Blender V2.61 - r43446

mesh_intern.h

Go to the documentation of this file.
00001 /*
00002  * ***** BEGIN GPL LICENSE BLOCK *****
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software Foundation,
00016  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  *
00018  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
00019  * All rights reserved.
00020  *
00021  * The Original Code is: all of this file.
00022  *
00023  * Contributor(s): none yet.
00024  *
00025  * ***** END GPL LICENSE BLOCK *****
00026  */
00027 
00033 /* Internal for editmesh_xxxx.c functions */
00034 
00035 #ifndef MESH_INTERN_H
00036 #define MESH_INTERN_H
00037 
00038 struct bContext;
00039 struct wmOperatorType;
00040 struct wmOperator;
00041 struct ViewContext;
00042 
00043 /* ******************** editface.c */
00044 
00045 int edgetag_context_check(Scene *scene, EditEdge *eed);
00046 void edgetag_context_set(Scene *scene, EditEdge *eed, int val);
00047 int edgetag_shortest_path(Scene *scene, EditMesh *em, EditEdge *source, EditEdge *target);
00048 
00049 /* ******************* editmesh.c */
00050 
00051 extern void free_editvert(EditMesh *em, EditVert *eve);
00052 extern void free_editedge(EditMesh *em, EditEdge *eed);
00053 extern void free_editface(EditMesh *em, EditFace *efa);
00054 
00055 extern void free_vertlist(EditMesh *em, ListBase *edve);
00056 extern void free_edgelist(EditMesh *em, ListBase *lb);
00057 extern void free_facelist(EditMesh *em, ListBase *lb);
00058 
00059 extern void remedge(EditMesh *em, EditEdge *eed);
00060 
00061 extern struct EditVert *addvertlist(EditMesh *em, float *vec, struct EditVert *example);
00062 extern struct EditEdge *addedgelist(EditMesh *em, struct EditVert *v1, struct EditVert *v2, struct EditEdge *example);
00063 extern struct EditFace *addfacelist(EditMesh *em, struct EditVert *v1, struct EditVert *v2, struct EditVert *v3, struct EditVert *v4, struct EditFace *example, struct EditFace *exampleEdges);
00064 extern struct EditEdge *findedgelist(EditMesh *em, struct EditVert *v1, struct EditVert *v2);
00065 
00066 void em_setup_viewcontext(struct bContext *C, struct ViewContext *vc);
00067 
00068 void MESH_OT_separate(struct wmOperatorType *ot);
00069 
00070 /* ******************* editmesh_add.c */
00071 void MESH_OT_primitive_plane_add(struct wmOperatorType *ot);
00072 void MESH_OT_primitive_cube_add(struct wmOperatorType *ot);
00073 void MESH_OT_primitive_circle_add(struct wmOperatorType *ot);
00074 void MESH_OT_primitive_cylinder_add(struct wmOperatorType *ot);
00075 void MESH_OT_primitive_cone_add(struct wmOperatorType *ot);
00076 void MESH_OT_primitive_grid_add(struct wmOperatorType *ot);
00077 void MESH_OT_primitive_monkey_add(struct wmOperatorType *ot);
00078 void MESH_OT_primitive_uv_sphere_add(struct wmOperatorType *ot);
00079 void MESH_OT_primitive_ico_sphere_add(struct wmOperatorType *ot);
00080 
00081 void MESH_OT_edge_face_add(struct wmOperatorType *ot);
00082 void MESH_OT_dupli_extrude_cursor(struct wmOperatorType *ot);
00083 void MESH_OT_duplicate(struct wmOperatorType *ot);
00084 
00085 void MESH_OT_fgon_make(struct wmOperatorType *ot);
00086 void MESH_OT_fgon_clear(struct wmOperatorType *ot);
00087 
00088 /* ******************* editmesh_lib.c */
00089 void EM_stats_update(EditMesh *em);
00090 
00091 extern void EM_fgon_flags(EditMesh *em);
00092 extern void EM_hide_reset(EditMesh *em);
00093 
00094 extern int faceselectedOR(EditFace *efa, int flag);
00095 extern int faceselectedAND(EditFace *efa, int flag);
00096 
00097 void EM_remove_selection(EditMesh *em, void *data, int type);
00098 void EM_clear_flag_all(EditMesh *em, int flag);
00099 void EM_set_flag_all(EditMesh *em, int flag);
00100 void EM_set_flag_all_selectmode(EditMesh *em, int flag);
00101 
00102 void EM_data_interp_from_verts(EditMesh *em, EditVert *v1, EditVert *v2, EditVert *eve, float fac);
00103 void EM_data_interp_from_faces(EditMesh *em, EditFace *efa1, EditFace *efa2, EditFace *efan, int i1, int i2, int i3, int i4);
00104 
00105 int EM_nvertices_selected(EditMesh *em);
00106 int EM_nedges_selected(EditMesh *em);
00107 int EM_nfaces_selected(EditMesh *em);
00108 
00109 float EM_face_perimeter(EditFace *efa);
00110 
00111 void EM_store_selection(EditMesh *em, void *data, int type);
00112 
00113 extern EditFace *exist_face(EditMesh *em, EditVert *v1, EditVert *v2, EditVert *v3, EditVert *v4);
00114 extern void flipface(EditMesh *em, EditFace *efa); // flips for normal direction
00115 extern int compareface(EditFace *vl1, EditFace *vl2);
00116 
00117 /* flag for selection bits, *nor will be filled with normal for extrusion constraint */
00118 /* return value defines if such normal was set */
00119 extern short extrudeflag_face_indiv(EditMesh *em, short flag, float *nor);
00120 extern short extrudeflag_verts_indiv(EditMesh *em, short flag, float *nor);
00121 extern short extrudeflag_edges_indiv(EditMesh *em, short flag, float *nor);
00122 extern short extrudeflag_vert(Object *obedit, EditMesh *em, short flag, float *nor, int all);
00123 extern short extrudeflag(Object *obedit, EditMesh *em, short flag, float *nor, int all);
00124 
00125 extern void adduplicateflag(EditMesh *em, int flag);
00126 extern void delfaceflag(EditMesh *em, int flag);
00127 
00128 extern void rotateflag(EditMesh *em, short flag, float *cent, float rotmat[][3]);
00129 extern void translateflag(EditMesh *em, short flag, float *vec);
00130 
00131 extern int convex(float *v1, float *v2, float *v3, float *v4);
00132 
00133 extern struct EditFace *EM_face_from_faces(EditMesh *em, struct EditFace *efa1,
00134                                            struct EditFace *efa2, int i1, int i2, int i3, int i4);
00135 
00136 extern int EM_view3d_poll(struct bContext *C);
00137 
00138 /* ******************* editmesh_loop.c */
00139 
00140 void MESH_OT_knife_cut(struct wmOperatorType *ot);
00141 
00142 /* ******************* editmesh_mods.c */
00143 void MESH_OT_loop_select(struct wmOperatorType *ot);
00144 void MESH_OT_select_all(struct wmOperatorType *ot);
00145 void MESH_OT_select_more(struct wmOperatorType *ot);
00146 void MESH_OT_select_less(struct wmOperatorType *ot);
00147 void MESH_OT_select_non_manifold(struct wmOperatorType *ot);
00148 void MESH_OT_select_linked(struct wmOperatorType *ot);
00149 void MESH_OT_select_linked_pick(struct wmOperatorType *ot);
00150 void MESH_OT_hide(struct wmOperatorType *ot);
00151 void MESH_OT_reveal(struct wmOperatorType *ot);
00152 void MESH_OT_select_by_number_vertices(struct wmOperatorType *ot);
00153 void MESH_OT_select_mirror(struct wmOperatorType *ot);
00154 void MESH_OT_normals_make_consistent(struct wmOperatorType *ot);
00155 void MESH_OT_faces_select_linked_flat(struct wmOperatorType *ot);
00156 void MESH_OT_edges_select_sharp(struct wmOperatorType *ot);
00157 void MESH_OT_select_shortest_path(struct wmOperatorType *ot);
00158 void MESH_OT_select_similar(struct wmOperatorType *ot);
00159 void MESH_OT_select_random(struct wmOperatorType *ot);
00160 void MESH_OT_loop_multi_select(struct wmOperatorType *ot);
00161 void MESH_OT_mark_seam(struct wmOperatorType *ot);
00162 void MESH_OT_mark_sharp(struct wmOperatorType *ot);
00163 void MESH_OT_vertices_smooth(struct wmOperatorType *ot);
00164 void MESH_OT_noise(struct wmOperatorType *ot);
00165 void MESH_OT_flip_normals(struct wmOperatorType *ot);
00166 void MESH_OT_solidify(struct wmOperatorType *ot);
00167 void MESH_OT_select_nth(struct wmOperatorType *ot);
00168 
00169 
00170 extern EditEdge *findnearestedge(struct ViewContext *vc, int *dist);
00171 void editmesh_select_by_material(EditMesh *em, int index);
00172 void EM_recalc_normal_direction(EditMesh *em, int inside, int select);  /* makes faces righthand turning */
00173 void EM_select_more(EditMesh *em);
00174 void selectconnected_mesh_all(EditMesh *em);
00175 void faceloop_select(EditMesh *em, EditEdge *startedge, int select);
00176 
00186 extern EditVert *findnearestvert(struct ViewContext *vc, int *dist, short sel, short strict);
00187 
00188 
00189 /* ******************* editmesh_tools.c */
00190 
00191 #define SUBDIV_SELECT_ORIG      0
00192 #define SUBDIV_SELECT_INNER     1
00193 #define SUBDIV_SELECT_INNER_SEL 2
00194 #define SUBDIV_SELECT_LOOPCUT 3
00195 
00196 /* edge subdivide corner cut types */
00197 #define SUBDIV_CORNER_PATH      0
00198 #define SUBDIV_CORNER_INNERVERT 1
00199 #define SUBDIV_CORNER_FAN       2
00200 
00201 extern EnumPropertyItem corner_type_items[];
00202 
00203 void join_triangles(EditMesh *em);
00204 int removedoublesflag(EditMesh *em, short flag, short automerge, float limit);      /* return amount */
00205 void esubdivideflag(Object *obedit, EditMesh *em, int flag, float smooth, float fractal, int beautify, int numcuts, int corner_pattern, int seltype);
00206 int EdgeSlide(EditMesh *em, struct wmOperator *op, short immediate, float imperc);
00207 
00208 void MESH_OT_merge(struct wmOperatorType *ot);
00209 void MESH_OT_subdivide(struct wmOperatorType *ot);
00210 void MESH_OT_remove_doubles(struct wmOperatorType *ot);
00211 void MESH_OT_vertices_randomize(struct wmOperatorType *ot);
00212 void MESH_OT_vertices_sort(struct wmOperatorType *ot);
00213 void MESH_OT_extrude(struct wmOperatorType *ot);
00214 void MESH_OT_spin(struct wmOperatorType *ot);
00215 void MESH_OT_screw(struct wmOperatorType *ot);
00216 
00217 void MESH_OT_fill(struct wmOperatorType *ot);
00218 void MESH_OT_beautify_fill(struct wmOperatorType *ot);
00219 void MESH_OT_quads_convert_to_tris(struct wmOperatorType *ot);
00220 void MESH_OT_tris_convert_to_quads(struct wmOperatorType *ot);
00221 void MESH_OT_edge_flip(struct wmOperatorType *ot);
00222 void MESH_OT_faces_shade_smooth(struct wmOperatorType *ot);
00223 void MESH_OT_faces_shade_flat(struct wmOperatorType *ot);
00224 void MESH_OT_split(struct wmOperatorType *ot);
00225 void MESH_OT_extrude_repeat(struct wmOperatorType *ot);
00226 void MESH_OT_edge_rotate(struct wmOperatorType *ot);
00227 void MESH_OT_select_vertex_path(struct wmOperatorType *ot);
00228 void MESH_OT_loop_to_region(struct wmOperatorType *ot);
00229 void MESH_OT_region_to_loop(struct wmOperatorType *ot);
00230 void MESH_OT_select_axis(struct wmOperatorType *ot);
00231 
00232 void MESH_OT_uvs_rotate(struct wmOperatorType *ot);
00233 void MESH_OT_uvs_mirror(struct wmOperatorType *ot);
00234 void MESH_OT_colors_rotate(struct wmOperatorType *ot);
00235 void MESH_OT_colors_mirror(struct wmOperatorType *ot);
00236 
00237 void MESH_OT_delete(struct wmOperatorType *ot);
00238 void MESH_OT_rip(struct wmOperatorType *ot);
00239 
00240 void MESH_OT_shape_propagate_to_all(struct wmOperatorType *ot);
00241 void MESH_OT_blend_from_shape(struct wmOperatorType *ot);
00242 void MESH_OT_sort_faces(struct wmOperatorType *ot);
00243 
00244 /* ******************* mesh_data.c */
00245 
00246 void MESH_OT_uv_texture_add(struct wmOperatorType *ot);
00247 void MESH_OT_uv_texture_remove(struct wmOperatorType *ot);
00248 void MESH_OT_vertex_color_add(struct wmOperatorType *ot);
00249 void MESH_OT_vertex_color_remove(struct wmOperatorType *ot);
00250 void MESH_OT_sticky_add(struct wmOperatorType *ot);
00251 void MESH_OT_sticky_remove(struct wmOperatorType *ot);
00252 void MESH_OT_drop_named_image(struct wmOperatorType *ot);
00253 
00254 void MESH_OT_edgering_select(struct wmOperatorType *ot);
00255 void MESH_OT_loopcut(struct wmOperatorType *ot);
00256 
00257 /* ******************* mesh_navmesh.c */
00258 void MESH_OT_navmesh_make(struct wmOperatorType *ot);
00259 void MESH_OT_navmesh_face_copy(struct wmOperatorType *ot);
00260 void MESH_OT_navmesh_face_add(struct wmOperatorType *ot);
00261 void MESH_OT_navmesh_reset(struct wmOperatorType *ot);
00262 void MESH_OT_navmesh_clear(struct wmOperatorType *ot);
00263 
00264 #endif // MESH_INTERN_H
00265