This repository has been archived on 2023-10-09. You can view files and clone it, but cannot push or open issues or pull requests.
Files
blender-archive/source/blender/editors/curve/curve_intern.h

196 lines
7.0 KiB
C++
Raw Normal View History

/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
2010-02-12 13:34:04 +00:00
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* The Original Code is Copyright (C) 2008 Blender Foundation.
* All rights reserved.
*/
/** \file
* \ingroup edcurve
2011-02-27 20:29:51 +00:00
*/
#pragma once
/* internal exports only */
struct EditNurb;
2018-03-19 16:30:53 +01:00
struct GHash;
struct ListBase;
struct Object;
struct ViewContext;
struct wmOperatorType;
/* editfont.c */
enum {
DEL_NEXT_CHAR,
DEL_PREV_CHAR,
DEL_NEXT_WORD,
DEL_PREV_WORD,
DEL_SELECTION,
DEL_NEXT_SEL,
DEL_PREV_SEL
};
enum { CASE_LOWER, CASE_UPPER };
enum {
LINE_BEGIN,
LINE_END,
PREV_CHAR,
NEXT_CHAR,
PREV_WORD,
NEXT_WORD,
PREV_LINE,
NEXT_LINE,
PREV_PAGE,
NEXT_PAGE
};
typedef enum eVisible_Types {
HIDDEN = true,
VISIBLE = false,
} eVisible_Types;
typedef enum eEndPoint_Types {
FIRST = true,
LAST = false,
} eEndPoint_Types;
typedef enum eCurveElem_Types {
CURVE_VERTEX = 0,
CURVE_SEGMENT,
} eCurveElem_Types;
/* internal select utils */
bool select_beztriple(BezTriple *bezt, bool selstatus, uint8_t flag, eVisible_Types hidden);
bool select_bpoint(BPoint *bp, bool selstatus, uint8_t flag, bool hidden);
2009-04-12 22:43:07 +00:00
void FONT_OT_text_insert(struct wmOperatorType *ot);
void FONT_OT_line_break(struct wmOperatorType *ot);
void FONT_OT_case_toggle(struct wmOperatorType *ot);
void FONT_OT_case_set(struct wmOperatorType *ot);
void FONT_OT_style_toggle(struct wmOperatorType *ot);
void FONT_OT_style_set(struct wmOperatorType *ot);
void FONT_OT_select_all(struct wmOperatorType *ot);
2009-04-12 22:43:07 +00:00
void FONT_OT_text_copy(struct wmOperatorType *ot);
void FONT_OT_text_cut(struct wmOperatorType *ot);
void FONT_OT_text_paste(struct wmOperatorType *ot);
void FONT_OT_text_paste_from_file(struct wmOperatorType *ot);
void FONT_OT_move(struct wmOperatorType *ot);
void FONT_OT_move_select(struct wmOperatorType *ot);
void FONT_OT_delete(struct wmOperatorType *ot);
void FONT_OT_change_character(struct wmOperatorType *ot);
void FONT_OT_change_spacing(struct wmOperatorType *ot);
void FONT_OT_open(struct wmOperatorType *ot);
void FONT_OT_unlink(struct wmOperatorType *ot);
void FONT_OT_textbox_add(struct wmOperatorType *ot);
void FONT_OT_textbox_remove(struct wmOperatorType *ot);
/* editcurve.c */
void CURVE_OT_hide(struct wmOperatorType *ot);
void CURVE_OT_reveal(struct wmOperatorType *ot);
void CURVE_OT_separate(struct wmOperatorType *ot);
void CURVE_OT_split(struct wmOperatorType *ot);
void CURVE_OT_duplicate(struct wmOperatorType *ot);
void CURVE_OT_delete(struct wmOperatorType *ot);
void CURVE_OT_dissolve_verts(struct wmOperatorType *ot);
void CURVE_OT_spline_type_set(struct wmOperatorType *ot);
void CURVE_OT_radius_set(struct wmOperatorType *ot);
void CURVE_OT_spline_weight_set(struct wmOperatorType *ot);
void CURVE_OT_handle_type_set(struct wmOperatorType *ot);
void CURVE_OT_normals_make_consistent(struct wmOperatorType *ot);
void CURVE_OT_decimate(struct wmOperatorType *ot);
void CURVE_OT_shade_smooth(struct wmOperatorType *ot);
void CURVE_OT_shade_flat(struct wmOperatorType *ot);
void CURVE_OT_tilt_clear(struct wmOperatorType *ot);
void CURVE_OT_smooth(struct wmOperatorType *ot);
void CURVE_OT_smooth_weight(struct wmOperatorType *ot);
void CURVE_OT_smooth_radius(struct wmOperatorType *ot);
void CURVE_OT_smooth_tilt(struct wmOperatorType *ot);
void CURVE_OT_switch_direction(struct wmOperatorType *ot);
void CURVE_OT_subdivide(struct wmOperatorType *ot);
void CURVE_OT_make_segment(struct wmOperatorType *ot);
void CURVE_OT_spin(struct wmOperatorType *ot);
2009-04-12 22:43:07 +00:00
void CURVE_OT_vertex_add(struct wmOperatorType *ot);
void CURVE_OT_extrude(struct wmOperatorType *ot);
void CURVE_OT_cyclic_toggle(struct wmOperatorType *ot);
Move curve's boundbox and texspace calculation out of modifier stack There were several issues with how bounding box and texture space are calculated: - This was done at the same time as applying modifiers, meaning if several objects are sharing the same curve datablock, bounding box and texture space will be calculated multiple times. Further, allocating bounding box wasn't safe for threading. - Bounding box and texture space were evaluated after pre-tessellation modifiers are applied. This means Curve-level data is actually depends on object data, and it's really bad because different objects could have different modifiers and this leads to conflicts (curve's data depends on object evaluation order) and doesn't behave in a predictable way. This commit moves bounding box and texture space evaluation from modifier stack to own utility functions, just like it's was done for meshes. This makes curve objects update thread-safe, but gives some limitations as well. Namely, with such approach it's not so clear how to preserve the same behavior of texture space: before this change texture space and bounding box would match beveled curve as accurate as possible. Old behavior was nice for quick texturing -- in most cases you didn't need to modify texture space at all. But texture space was depending on render/preview settings which could easily lead to situations, when final result would be far different from preview one. Now we're using CV points coordinates and their radius to approximate the bounding box. This doesn't give the same exact texture space, but it helps a lot keeping texture space in a nice predictable way. We could make approximation smarter in the future, but fir now added operator to match texture space to fully tessellated curve called "Match Texture Space". Review link: https://codereview.appspot.com/15410043/ Brief description: http://wiki.blender.org/index.php/User:Nazg-gul/GSoC-2013/Results#Curve_Texture_Space
2013-10-20 14:41:33 +02:00
void CURVE_OT_match_texture_space(struct wmOperatorType *ot);
2018-03-19 16:30:53 +01:00
/* exported for editcurve_undo.c */
struct GHash *ED_curve_keyindex_hash_duplicate(struct GHash *keyindex);
void ED_curve_keyindex_update_nurb(struct EditNurb *editnurb, struct Nurb *nu, struct Nurb *newnu);
2018-03-19 16:30:53 +01:00
/* helper functions */
void ed_editnurb_translate_flag(struct ListBase *editnurb, uint8_t flag, const float vec[3]);
bool ed_editnurb_extrude_flag(struct EditNurb *editnurb, const uint8_t flag);
bool ed_editnurb_spin(float viewmat[4][4],
struct View3D *v3d,
struct Object *obedit,
const float axis[3],
const float cent[3]);
/* editcurve_select.c */
void CURVE_OT_de_select_first(struct wmOperatorType *ot);
void CURVE_OT_de_select_last(struct wmOperatorType *ot);
void CURVE_OT_select_all(struct wmOperatorType *ot);
void CURVE_OT_select_linked(struct wmOperatorType *ot);
void CURVE_OT_select_linked_pick(struct wmOperatorType *ot);
void CURVE_OT_select_row(struct wmOperatorType *ot);
void CURVE_OT_select_next(struct wmOperatorType *ot);
void CURVE_OT_select_previous(struct wmOperatorType *ot);
void CURVE_OT_select_more(struct wmOperatorType *ot);
void CURVE_OT_select_less(struct wmOperatorType *ot);
void CURVE_OT_select_random(struct wmOperatorType *ot);
void CURVE_OT_select_nth(struct wmOperatorType *ot);
void CURVE_OT_select_similar(struct wmOperatorType *ot);
void CURVE_OT_shortest_path_pick(struct wmOperatorType *ot);
/* editcurve_add.c */
void CURVE_OT_primitive_bezier_curve_add(struct wmOperatorType *ot);
void CURVE_OT_primitive_bezier_circle_add(struct wmOperatorType *ot);
void CURVE_OT_primitive_nurbs_curve_add(struct wmOperatorType *ot);
void CURVE_OT_primitive_nurbs_circle_add(struct wmOperatorType *ot);
void CURVE_OT_primitive_nurbs_path_add(struct wmOperatorType *ot);
void SURFACE_OT_primitive_nurbs_surface_curve_add(struct wmOperatorType *ot);
void SURFACE_OT_primitive_nurbs_surface_circle_add(struct wmOperatorType *ot);
void SURFACE_OT_primitive_nurbs_surface_surface_add(struct wmOperatorType *ot);
void SURFACE_OT_primitive_nurbs_surface_cylinder_add(struct wmOperatorType *ot);
void SURFACE_OT_primitive_nurbs_surface_sphere_add(struct wmOperatorType *ot);
void SURFACE_OT_primitive_nurbs_surface_torus_add(struct wmOperatorType *ot);
/* editcurve_query.c */
bool ED_curve_pick_vert(struct ViewContext *vc,
short sel,
struct Nurb **r_nurb,
struct BezTriple **r_bezt,
struct BPoint **r_bp,
short *r_handle,
struct Base **r_base);
void ED_curve_nurb_vert_selected_find(
Curve *cu, View3D *v3d, Nurb **r_nu, BezTriple **r_bezt, BPoint **r_bp);
/* editcurve_paint.c */
void CURVE_OT_draw(struct wmOperatorType *ot);