2009-11-29 00:53:23 +00:00
|
|
|
#ifndef _BKE_TESSMESH_H
|
|
|
|
#define _BKE_TESSMESH_H
|
|
|
|
|
2009-05-16 16:18:08 +00:00
|
|
|
#include "bmesh.h"
|
|
|
|
|
|
|
|
struct BMesh;
|
|
|
|
struct BMLoop;
|
|
|
|
struct BMFace;
|
2009-11-02 06:33:16 +00:00
|
|
|
struct Mesh;
|
|
|
|
struct DerivedMesh;
|
2009-05-16 16:18:08 +00:00
|
|
|
|
2009-05-26 04:17:47 +00:00
|
|
|
/*
|
|
|
|
ok: the EDBM module is for editmode bmesh stuff. in contrast, the
|
|
|
|
BMEdit module is for code shared with blenkernel that concerns
|
|
|
|
the BMEditMesh structure.
|
|
|
|
*/
|
|
|
|
|
2009-05-16 16:18:08 +00:00
|
|
|
/*this structure replaces EditMesh.
|
|
|
|
|
|
|
|
through this, you get access to both the edit bmesh,
|
|
|
|
it's tesselation, and various stuff that doesn't belong in the BMesh
|
|
|
|
struct itself.
|
|
|
|
|
|
|
|
the entire derivedmesh and modifier system works with this structure,
|
2009-07-17 10:54:00 +00:00
|
|
|
and not BMesh. Mesh->edit_bmesh stores a pointer to this structure.*/
|
2009-05-18 08:46:04 +00:00
|
|
|
typedef struct BMEditMesh {
|
2009-05-16 16:18:08 +00:00
|
|
|
struct BMesh *bm;
|
2009-06-18 07:11:55 +00:00
|
|
|
|
|
|
|
/*this is for undoing failed operations*/
|
|
|
|
struct BMEditMesh *emcopy;
|
2009-09-09 06:28:58 +00:00
|
|
|
int emcopyusers;
|
2009-05-16 16:18:08 +00:00
|
|
|
|
|
|
|
/*we store tesselations as triplets of three loops,
|
|
|
|
which each define a triangle.*/
|
|
|
|
struct BMLoop *(*looptris)[3];
|
|
|
|
int tottri;
|
|
|
|
|
|
|
|
/*derivedmesh stuff*/
|
|
|
|
struct DerivedMesh *derivedFinal, *derivedCage;
|
|
|
|
int lastDataMask;
|
|
|
|
|
|
|
|
/*retopo data pointer*/
|
|
|
|
struct RetopoPaintData *retopo_paint_data;
|
|
|
|
|
|
|
|
/*index tables, to map indices to elements via
|
|
|
|
EDBM_init_index_arrays and associated functions. don't
|
|
|
|
touch this or read it directly.*/
|
|
|
|
struct BMVert **vert_index;
|
|
|
|
struct BMEdge **edge_index;
|
|
|
|
struct BMFace **face_index;
|
|
|
|
|
|
|
|
/*selection mode*/
|
2011-05-09 04:06:48 +00:00
|
|
|
short selectmode;
|
|
|
|
short mat_nr;
|
2009-11-02 06:33:16 +00:00
|
|
|
|
|
|
|
/*Mesh structure this editmesh came from, if it came from one*/
|
|
|
|
struct Mesh *me;
|
|
|
|
struct Object *ob;
|
2010-03-11 05:30:01 +00:00
|
|
|
|
|
|
|
/*temp variables for x-mirror editing*/
|
|
|
|
int mirror_cdlayer;
|
|
|
|
int mirr_free_arrays;
|
2009-05-18 08:46:04 +00:00
|
|
|
} BMEditMesh;
|
|
|
|
|
2009-05-26 04:17:47 +00:00
|
|
|
void BMEdit_RecalcTesselation(BMEditMesh *tm);
|
|
|
|
BMEditMesh *BMEdit_Create(BMesh *bm);
|
|
|
|
BMEditMesh *BMEdit_Copy(BMEditMesh *tm);
|
|
|
|
void BMEdit_Free(BMEditMesh *em);
|
2009-08-30 21:30:07 +00:00
|
|
|
void BMEdit_UpdateLinkedCustomData(BMEditMesh *em);
|
2009-11-29 00:53:23 +00:00
|
|
|
|
2011-05-09 04:06:48 +00:00
|
|
|
#endif /* _BKE_TESSMESH_H */
|