5 #ifndef CNOID_AIST_COLLISION_DETECTOR_COLDET_MODEL_H
6 #define CNOID_AIST_COLLISION_DETECTOR_COLDET_MODEL_H
8 #include <cnoid/Referenced>
9 #include <cnoid/EigenTypes>
12 #include "exportdecl.h"
20 class ColdetModelInternalModel;
46 void cloneInternalModel();
52 void setName(
const std::string& name) { name_ = name; }
58 const std::string&
name()
const {
return name_; }
64 void setNumVertices(
int n);
70 int getNumVertices()
const;
76 void setNumTriangles(
int n);
78 int getNumTriangles()
const;
87 void setVertex(
int index,
float x,
float y,
float z);
92 void addVertex(
float x,
float y,
float z);
101 void getVertex(
int index,
float& out_x,
float& out_y,
float& out_z)
const;
110 void setTriangle(
int index,
int v1,
int v2,
int v3);
115 void addTriangle(
int v1,
int v2,
int v3);
117 void getTriangle(
int index,
int& out_v1,
int& out_v2,
int& out_v3)
const;
132 #ifdef CNOID_BACKWARD_COMPATIBILITY
147 void setPosition(
const double* R,
const double* p);
153 void setPrimitiveType(PrimitiveType ptype);
159 PrimitiveType getPrimitiveType()
const;
165 void setNumPrimitiveParams(
unsigned int nparam);
173 bool setPrimitiveParam(
unsigned int index,
float value);
181 bool getPrimitiveParam(
unsigned int index,
float &value)
const;
188 void setPrimitivePosition(
const double* R,
const double* p);
196 double computeDistanceWithRay(
const double *point,
const double *dir);
204 bool checkCollisionWithPointCloud(
const std::vector<Vector3> &i_cloud,
207 void getBoundingBoxData(
const int depth, std::vector<Vector3>& out_boxes);
209 int getAABBTreeDepth();
211 int numofBBtoDepth(
int minNumofBB);
217 IceMaths::Matrix4x4* transform;
218 IceMaths::Matrix4x4* pTransform;