ColdetModelSharedDataSet.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008, AIST, the University of Tokyo and General Robotix Inc.
3  * All rights reserved. This program is made available under the terms of the
4  * Eclipse Public License v1.0 which accompanies this distribution, and is
5  * available at http://www.eclipse.org/legal/epl-v10.html
6  * Contributors:
7  * National Institute of Advanced Industrial Science and Technology (AIST)
8  */
13 #ifndef OPENHRP_COLDET_MODEL_SHARED_DATA_SET_H_INCLUDED
14 #define OPENHRP_COLDET_MODEL_SHARED_DATA_SET_H_INCLUDED
15 
16 
17 #include "ColdetModel.h"
18 #include "Opcode/Opcode.h"
19 #include <vector>
20 
21 using namespace std;
22 using namespace hrp;
23 
24 namespace hrp {
25  struct triangle3 {
26  int triangles[3];
27  };
28 
30  {
31  public:
33  int triangles[3];
35  triangles[0] = triangles[1] = triangles[2] = -1;
36  }
37  void addNeighbor(int neighbor){
38  for(int i=0; i < 3; ++i){
39  if(triangles[i] < 0){
40  triangles[i] = neighbor;
41  break;
42  }
43  }
44  }
45  void deleteNeighbor(int neighbor){
46  for(int i=0; i<3; i++){
47  if(triangles[i]==neighbor){
48  for(int j=i+1; j<3; j++){
49  triangles[j-1] = triangles[j];
50  }
51  triangles[2] = -1;
52  }
53  break;
54  }
55  }
56  int operator[](int index) const { return triangles[index]; }
57  };
58 
59  typedef std::vector<NeighborTriangleSet> NeighborTriangleSetArray;
60 
62 
63  bool build();
64 
65  // need two instances ?
67 
69 
70  vector<IceMaths::Point> vertices;
71  vector<IceMaths::IndexedTriangle> triangles;
72 
74  std::vector<float> pParams;
75 
76  NeighborTriangleSetArray neighbor;
77 
79  return AABBTreeMaxDepth;
80  };
81  int getNumofBB(int depth){
82  return numBBMap.at(depth);
83  };
85  if(AABBTreeMaxDepth>0)
86  return numBBMap.at(AABBTreeMaxDepth-1);
87  else
88  return 0;
89  };
90 
91  private:
92  int refCounter;
94  std::vector<int> numBBMap;
95  std::vector<int> numLeafMap;
96  int computeDepth(const Opcode::AABBCollisionNode* node, int currentDepth, int max );
97 
98  friend class ColdetModel;
99  };
100 }
101 
102 #endif
png_uint_32 i
Definition: png.h:2735
std::vector< NeighborTriangleSet > NeighborTriangleSetArray
vector< IceMaths::IndexedTriangle > triangles
vector< IceMaths::Point > vertices
ColdetModel::PrimitiveType pType
static int max(int a, int b)


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Thu Sep 8 2022 02:24:02