Blender  V2.59
DNA_mesh_types.h
Go to the documentation of this file.
00001 /*
00002  * $Id: DNA_mesh_types.h 36262 2011-04-21 08:55:10Z campbellbarton $ 
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 #ifndef DNA_MESH_TYPES_H
00030 #define DNA_MESH_TYPES_H
00031 
00036 #include "DNA_listBase.h"
00037 #include "DNA_ID.h"
00038 #include "DNA_customdata_types.h"
00039 
00040 struct DerivedMesh;
00041 struct Ipo;
00042 struct Key;
00043 struct Material;
00044 struct MVert;
00045 struct MEdge;
00046 struct MFace;
00047 struct MCol;
00048 struct MSticky;
00049 struct Mesh;
00050 struct OcInfo;
00051 struct Multires;
00052 struct PartialVisibility;
00053 struct EditMesh;
00054 struct AnimData;
00055 
00056 typedef struct Mesh {
00057         ID id;
00058         struct AnimData *adt;           /* animation data (must be immediately after id for utilities to use it) */
00059 
00060         struct BoundBox *bb;
00061         
00062         struct Ipo *ipo;                // XXX depreceated... old animation system
00063         struct Key *key;
00064         struct Material **mat;
00065 
00066         struct MFace *mface;    /* array of mesh object mode faces */
00067         struct MTFace *mtface;  /* store face UV's and texture here */
00068         struct TFace *tface;    /* depecrated, use mtface */
00069         struct MVert *mvert;    /* array of verts */
00070         struct MEdge *medge;    /* array of edges */
00071         struct MDeformVert *dvert;      /* deformgroup vertices */
00072         struct MCol *mcol;              /* array of colors, this must be the number of faces * 4 */
00073         struct MSticky *msticky;
00074         struct Mesh *texcomesh;
00075         struct MSelect *mselect;
00076         
00077         struct EditMesh *edit_mesh;     /* not saved in file! */
00078 
00079         struct CustomData vdata, edata, fdata;
00080 
00081         int totvert, totedge, totface, totselect;
00082         
00083         /* the last selected vertex/edge/face are used for the active face however
00084          * this means the active face must always be selected, this is to keep track
00085          * of the last selected face and is similar to the old active face flag where
00086          * the face does not need to be selected, -1 is inactive */
00087         int act_face; 
00088 
00089         /* texture space, copied as one block in editobject.c */
00090         float loc[3];
00091         float size[3];
00092         float rot[3];
00093 
00094         short texflag, drawflag;
00095         short smoothresh, flag;
00096 
00097         short subdiv, subdivr;
00098         char subsurftype;               /* only kept for backwards compat, not used anymore */
00099         char editflag;
00100 
00101         short totcol;
00102 
00103         struct Multires *mr;            /* deprecated multiresolution modeling data, only keep for loading old files */
00104         struct PartialVisibility *pv;
00105 } Mesh;
00106 
00107 /* deprecated by MTFace, only here for file reading */
00108 typedef struct TFace {
00109         void *tpage;    /* the faces image for the active UVLayer */
00110         float uv[4][2];
00111         unsigned int col[4];
00112         char flag, transp;
00113         short mode, tile, unwrap;
00114 } TFace;
00115 
00116 /* **************** MESH ********************* */
00117 
00118 /* texflag */
00119 #define AUTOSPACE       1
00120 
00121 /* me->editflag */
00122 #define ME_EDIT_MIRROR_X (1 << 0)
00123 #define ME_EDIT_MIRROR_Y (1 << 1) // unused so far
00124 #define ME_EDIT_MIRROR_Z (1 << 2) // unused so far
00125 
00126 #define ME_EDIT_PAINT_MASK (1 << 3)
00127 #define ME_EDIT_MIRROR_TOPO (1 << 4)
00128 
00129 
00130 /* me->flag */
00131 /* #define ME_ISDONE            1 */
00132 #define ME_DEPRECATED   2
00133 #define ME_TWOSIDED             4
00134 #define ME_UVEFFECT             8
00135 #define ME_VCOLEFFECT   16
00136 #define ME_AUTOSMOOTH   32
00137 #define ME_SMESH                64
00138 #define ME_SUBSURF              128
00139 #define ME_OPT_EDGES    256
00140 #define ME_DS_EXPAND    512
00141 
00142 /* me->drawflag, short */
00143 #define ME_DRAWEDGES    (1 << 0)
00144 #define ME_DRAWFACES    (1 << 1)
00145 #define ME_DRAWNORMALS  (1 << 2)
00146 #define ME_DRAW_VNORMALS (1 << 3)
00147 
00148 #define ME_ALLEDGES             (1 << 4)
00149 #define ME_HIDDENEDGES  (1 << 5)
00150 
00151 #define ME_DRAWCREASES  (1 << 6)
00152 #define ME_DRAWSEAMS    (1 << 7)
00153 #define ME_DRAWSHARP    (1 << 8)
00154 #define ME_DRAWBWEIGHTS (1 << 9)
00155 
00156 #define ME_DRAWEXTRA_EDGELEN  (1 << 10)
00157 #define ME_DRAWEXTRA_FACEAREA (1 << 11)
00158 #define ME_DRAWEXTRA_FACEANG  (1 << 12)
00159 
00160 /* old global flags:
00161 #define G_DRAWEDGES             (1 << 18)
00162 #define G_DRAWFACES             (1 <<  7)
00163 #define G_DRAWNORMALS   (1 <<  6)
00164 #define G_DRAW_VNORMALS (1 << 14)
00165 
00166 #define G_ALLEDGES              (1 << 11)
00167 #define G_HIDDENEDGES   (1 << 21)
00168 
00169 #define G_DRAWCREASES   (1 << 19)
00170 #define G_DRAWSEAMS     (1 << 20)
00171 #define G_DRAWSHARP     (1 << 28)
00172 #define G_DRAWBWEIGHTS  (1 << 31)
00173 
00174 #define G_DRAW_EDGELEN  (1 << 22) 
00175 #define G_DRAW_FACEAREA (1 << 23)
00176 #define G_DRAW_EDGEANG  (1 << 24)
00177 */
00178 
00179 
00180 
00181 /* Subsurf Type */
00182 #define ME_CC_SUBSURF           0
00183 #define ME_SIMPLE_SUBSURF       1
00184 
00185 #define MESH_MAX_VERTS 2000000000L
00186 
00187 #endif