2012-02-12 14:40:08 +00:00
|
|
|
/*
|
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
*
|
|
|
|
* 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,
|
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
* Contributor(s): Joseph Eagar.
|
|
|
|
*
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __BKE_TESSMESH_H__
|
|
|
|
#define __BKE_TESSMESH_H__
|
2009-11-29 00:53:23 +00:00
|
|
|
|
2012-04-25 03:44:01 +00:00
|
|
|
#include "BKE_customdata.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
|
|
|
|
2012-03-03 20:19:11 +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-26 04:17:47 +00:00
|
|
|
|
2012-03-03 20:19:11 +00:00
|
|
|
/* this structure replaces EditMesh.
|
|
|
|
*
|
|
|
|
* through this, you get access to both the edit bmesh,
|
|
|
|
* it's tessellation, and various stuff that doesn't belong in the BMesh
|
|
|
|
* struct itself.
|
|
|
|
*
|
|
|
|
* the entire derivedmesh and modifier system works with this structure,
|
|
|
|
* 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
|
|
|
|
2012-03-03 20:19:11 +00:00
|
|
|
/* we store tessellations as triplets of three loops,
|
|
|
|
* which each define a triangle.*/
|
2009-05-16 16:18:08 +00:00
|
|
|
struct BMLoop *(*looptris)[3];
|
|
|
|
int tottri;
|
|
|
|
|
|
|
|
/*derivedmesh stuff*/
|
|
|
|
struct DerivedMesh *derivedFinal, *derivedCage;
|
2012-04-25 03:44:01 +00:00
|
|
|
CustomDataMask lastDataMask;
|
2013-04-13 20:20:21 +00:00
|
|
|
unsigned char (*derivedVertColor)[4];
|
|
|
|
int derivedVertColorLen;
|
2009-05-16 16:18:08 +00:00
|
|
|
|
2012-02-19 01:51:36 +00:00
|
|
|
/* index tables, to map indices to elements via
|
2012-03-27 04:46:52 +00:00
|
|
|
* EDBM_index_arrays_init and associated functions. don't
|
2012-02-19 01:51:36 +00:00
|
|
|
* touch this or read it directly.*/
|
2009-05-16 16:18:08 +00:00
|
|
|
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
|
|
|
|
2012-09-10 03:42:29 +00:00
|
|
|
/* Object this editmesh came from (if it came from one) */
|
2009-11-02 06:33:16 +00:00
|
|
|
struct Object *ob;
|
2010-03-11 05:30:01 +00:00
|
|
|
|
2012-09-10 03:42:29 +00:00
|
|
|
/* Unused for now, we could bring it back and assign in the same way 'ob' is */
|
|
|
|
// struct Mesh *me;
|
|
|
|
|
2010-03-11 05:30:01 +00:00
|
|
|
/*temp variables for x-mirror editing*/
|
2011-10-28 06:23:12 +00:00
|
|
|
int mirror_cdlayer; /* -1 is invalid */
|
2009-05-18 08:46:04 +00:00
|
|
|
} BMEditMesh;
|
|
|
|
|
2012-12-12 05:27:52 +00:00
|
|
|
void BMEdit_RecalcTessellation(BMEditMesh *em);
|
2013-01-14 16:42:43 +00:00
|
|
|
BMEditMesh *BMEdit_Create(BMesh *bm, const bool do_tessellate);
|
2012-12-12 05:27:52 +00:00
|
|
|
BMEditMesh *BMEdit_Copy(BMEditMesh *em);
|
2012-03-02 12:09:49 +00:00
|
|
|
BMEditMesh *BMEdit_FromObject(struct Object *ob);
|
2009-05-26 04:17:47 +00:00
|
|
|
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
|
|
|
|
2012-02-12 14:40:08 +00:00
|
|
|
#endif /* __BKE_TESSMESH_H__ */
|