Choreonoid  1.1
ColdetModelSharedDataSet.h
[詳解]
1 
5 #ifndef CNOID_COLDET_MODEL_SHARED_DATA_SET_H_INCLUDED
6 #define CNOID_COLDET_MODEL_SHARED_DATA_SET_H_INCLUDED
7 
8 #include "ColdetModel.h"
9 #include "Opcode/Opcode.h"
10 #include <vector>
11 
12 using namespace std;
13 using namespace cnoid;
14 
15 namespace cnoid {
16 
18  {
19  public:
21 
22  bool build();
23 
24  // need two instances ?
25  Opcode::Model model;
26  Opcode::MeshInterface iMesh;
27 
28  vector<IceMaths::Point> vertices;
29  vector<IceMaths::IndexedTriangle> triangles;
30 
32  std::vector<float> pParams;
33 
34  inline int getAABBTreeDepth() {
35  return AABBTreeMaxDepth;
36  };
37  inline int getNumofBB(int depth){
38  return numBBMap.at(depth);
39  };
40  inline int getmaxNumofBB(){
41  if(AABBTreeMaxDepth>0){
42  return numBBMap.at(AABBTreeMaxDepth-1);
43  } else {
44  return 0;
45  }
46  };
47 
48  private:
49  int refCounter;
50  int AABBTreeMaxDepth;
51  std::vector<int> numBBMap;
52  std::vector<int> numLeafMap;
53  int computeDepth(const Opcode::AABBCollisionNode* node, int currentDepth, int max );
54 
55  friend class ColdetModel;
56  };
57 }
58 
59 #endif
int getAABBTreeDepth()
Definition: ColdetModelSharedDataSet.h:34
int getmaxNumofBB()
Definition: ColdetModelSharedDataSet.h:40
PrimitiveType
Definition: ColdetModel.h:25
Opcode::Model model
Definition: ColdetModelSharedDataSet.h:25
STL namespace.
vector< IceMaths::IndexedTriangle > triangles
Definition: ColdetModelSharedDataSet.h:29
Definition: ColdetModel.h:22
ColdetModel::PrimitiveType pType
Definition: ColdetModelSharedDataSet.h:31
Definition: EasyScanner.h:16
vector< IceMaths::Point > vertices
Definition: ColdetModelSharedDataSet.h:28
Definition: ColdetModelSharedDataSet.h:17
Opcode::MeshInterface iMesh
Definition: ColdetModelSharedDataSet.h:26
std::vector< float > pParams
Definition: ColdetModelSharedDataSet.h:32
int getNumofBB(int depth)
Definition: ColdetModelSharedDataSet.h:37