Welcome to mirror list, hosted at ThFree Co, Russian Federation.

BKE_tessmesh.h « blenkernel « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 67afb86fde18e59c496954e28824d5a10bc3525b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#ifndef _BKE_TESSMESH_H
#define _BKE_TESSMESH_H

#include "bmesh.h"

struct BMesh;
struct BMLoop;
struct BMFace;
struct Mesh;
struct DerivedMesh;

/*
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.
*/

/*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,
  and not BMesh.  Mesh->edit_bmesh stores a pointer to this structure.*/
typedef struct BMEditMesh {
	struct BMesh *bm;

	/*this is for undoing failed operations*/
	struct BMEditMesh *emcopy;
	int emcopyusers;
	
	/*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*/
	short selectmode;
	short mat_nr;

	/*Mesh structure this editmesh came from, if it came from one*/
	struct Mesh *me;
	struct Object *ob;

	/*temp variables for x-mirror editing*/
	int mirror_cdlayer; /* -1 is invalid */
	int mirr_free_arrays;
} BMEditMesh;

/* undo triggers editmesh tessface update, this is odd but works OK.
 * BMESH_TODO, look into having the update elsewhere. */
#define BMESH_EM_UNDO_RECALC_TESSFACE_WORKAROUND

void BMEdit_RecalcTesselation(BMEditMesh *tm);
BMEditMesh *BMEdit_Create(BMesh *bm, int do_tesselate);
BMEditMesh *BMEdit_Copy(BMEditMesh *tm);
void BMEdit_Free(BMEditMesh *em);
void BMEdit_UpdateLinkedCustomData(BMEditMesh *em);

#endif /* _BKE_TESSMESH_H */