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.1 2008/05/13 12:19:18 sad Exp $ */
3 
4 /***********************************************************************
5  * UNIVERS subpart
6  * (C)opyright GEOVERS LTD, 2004
7  * All rights reserved
8  ***********************************************************************/
9 
10 //#include <vector>
11 
12 #include <mth/u3d_box.hpp>
13 
14 #ifndef __u3d_grid_cell_hpp
15 #define __u3d_grid_cell_hpp
16 
17 //const int U3D_MAX_CELL_TRIANGLES = 20;
18 
20 struct U3dDivCell
21 {
22  int s_idBody1;
23  int s_idBody2;
24  int s_idBound;
25  unsigned char s_nTriangles;
27  std::vector<int> s_idTriangles;
28 };
29 
30 
33 {
34  unsigned m_ID;
35 
38 
39  //U3dCellId m_cellId;
41  unsigned char m_numBodies;
42 
44  unsigned char m_Depth;
45 
48 
51 
54 
56  union content {
62  int c_idBody;
66 
69  } m_cellContent;
70 
71  U3dGridCell(unsigned cellId, unsigned char bodiesNum, unsigned char depth, U3dGridCell* parent, int surfId, int stPBodyId, int bodyId) :
72  m_ID(cellId),
73  m_numBodies(bodiesNum),
74  m_Depth(depth),
75  m_Parent(parent),
76  m_surfaceId(surfId),
77  m_startPointBodyId(stPBodyId)
78  { m_cellContent.c_idBody = bodyId; }
79 
80  ~U3dGridCell()
81  {
82  if (0==m_numBodies) {
83  for (unsigned char i=0; i<8; ++i)
84  delete m_cellContent.c_Childs[i];
85  }
86  if (m_numBodies>1) delete m_cellContent.c_b2;
87  }
88 };
89 
90 typedef std::vector<U3dGridCell*> U3dGridCellsArray;
91 
92 #endif /* u3d_grid_cell.hpp */
93 
94 
95 
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
Definition: u3d_grid_cell.hpp:56
int m_startPointBodyId
Definition: u3d_grid_cell.hpp:53
Definition: u3d_grid_cell.hpp:32