UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
u3d_grid_cell.hpp
1 /* u3d_grid_cell.hpp */
2 /* $Id: u3d_grid_cell.hpp,v 1.10 2008/03/31 07:58:19 guser1 Exp $ */
3 
4 /***********************************************************************
5  * UNIVERS subpart
6  * (C)opyright GEOVERS LTD, 2004
7  * All rights reserved
8  ***********************************************************************/
9 
10 //#include <vector>
11 
12 #include <u3d_defines.hpp>
13 #include <u3d_box.hpp>
14 
15 #ifndef __u3d_grid_cell_hpp
16 #define __u3d_grid_cell_hpp
17 
18 //const int U3D_MAX_CELL_TRIANGLES = 20;
19 
21 struct U3dDivCell
22 {
23  int s_idBody1;
24  int s_idBody2;
25  int s_idBound;
26  unsigned char s_nTriangles;
28  std::vector<int> s_idTriangles;
29 };
30 
31 
33 struct U3dGridCell
34 {
35  unsigned m_ID;
36 
38  U3dBox m_Box;
39 
40  //U3dCellId m_cellId;
42  unsigned char m_numBodies;
43 
45  unsigned char m_Depth;
46 
49 
51  int m_surfaceId;
52 
55 
57  union content {
63  int c_idBody;
67 
70  } m_cellContent;
71 
72  U3dGridCell(unsigned cellId, unsigned char bodiesNum, unsigned char depth, U3dGridCell* parent, int surfId, int stPBodyId, int bodyId) :
73  m_ID(cellId),
74  m_numBodies(bodiesNum),
75  m_Depth(depth),
76  m_Parent(parent),
77  m_surfaceId(surfId),
78  m_startPointBodyId(stPBodyId)
79  { m_cellContent.c_idBody = bodyId; }
80 
81  ~U3dGridCell()
82  {
83  if (0==m_numBodies) {
84  for (unsigned char i=0; i<8; ++i)
85  delete m_cellContent.c_Childs[i];
86  }
87  if (m_numBodies>1) delete m_cellContent.c_b2;
88  }
89 };
90 
91 typedef safe_vector<U3dGridCell*> U3dGridCellsArray;
92 
93 //#define PtrType U3dGridCell*
94 //#define PtrAr U3dGridCellsArray
95 //#include <mix/PtrAr.H> // generates class dbContextAr
96 
97 #endif /* u3d_grid_cell.hpp */
98 
99 
100 
int s_idBody1
Definition: u3d_grid_cell.hpp:22
U3dBox m_Box
Definition: u3d_grid_cell.hpp:37
unsigned char s_nTriangles
Definition: u3d_grid_cell.hpp:25
Definition: u3d_grid_cell.hpp:20
unsigned char m_numBodies
Definition: u3d_grid_cell.hpp:41
U3dGridCell * c_Childs[8]
Definition: u3d_grid_cell.hpp:58
int s_idBound
Definition: u3d_grid_cell.hpp:24
Definition: u3d_box.hpp:24
int c_idBody
Definition: u3d_grid_cell.hpp:62
int m_surfaceId
Definition: u3d_grid_cell.hpp:50
unsigned char m_Depth
Definition: u3d_grid_cell.hpp:44
U3dGridCell * m_Parent
Definition: u3d_grid_cell.hpp:47
int s_idBody2
Definition: u3d_grid_cell.hpp:23
U3dDivCell * c_b2
Definition: u3d_grid_cell.hpp:65
std::vector< int > s_idTriangles
Definition: u3d_grid_cell.hpp:27
int m_startPointBodyId
Definition: u3d_grid_cell.hpp:53
Definition: u3d_grid_cell.hpp:32
Definition: u3d_defines.hpp:188