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