|
Choreonoid
1.8
|
#include <ColdetModel.h>
Public Types | |
| enum | PrimitiveType { SP_MESH, SP_BOX, SP_CYLINDER, SP_CONE, SP_SPHERE, SP_PLANE } |
Public Member Functions | |
| ColdetModel () | |
| constructor More... | |
| ColdetModel (const ColdetModel &org) | |
| copy constructor More... | |
| virtual | ~ColdetModel () |
| destructor More... | |
| virtual ColdetModel * | clone () const |
| void | cloneInternalModel () |
| void | setName (const std::string &name) |
| set name of this model More... | |
| const std::string & | name () const |
| get name of this model More... | |
| void | setNumVertices (int n) |
| set the number of vertices More... | |
| int | getNumVertices () const |
| get the number of vertices More... | |
| void | setNumTriangles (int n) |
| set the number of triangles More... | |
| int | getNumTriangles () const |
| void | setVertex (int index, float x, float y, float z) |
| add a vertex More... | |
| void | addVertex (float x, float y, float z) |
| void | getVertex (int index, float &out_x, float &out_y, float &out_z) const |
| get a vertex More... | |
| void | setTriangle (int index, int v1, int v2, int v3) |
| add a triangle More... | |
| void | addTriangle (int v1, int v2, int v3) |
| void | getTriangle (int index, int &out_v1, int &out_v2, int &out_v3) const |
| void | build () |
| build tree of bounding boxes to accelerate collision check More... | |
| bool | isValid () const |
| check if build() is already called or not More... | |
| void | setPosition (const Isometry3 &T) |
| void | setPosition (const double *R, const double *p) |
| set position and orientation of this model More... | |
| void | setPrimitiveType (PrimitiveType ptype) |
| set primitive type More... | |
| PrimitiveType | getPrimitiveType () const |
| get primitive type More... | |
| void | setNumPrimitiveParams (unsigned int nparam) |
| set the number of parameters of primitive More... | |
| bool | setPrimitiveParam (unsigned int index, float value) |
| set a parameter of primitive More... | |
| bool | getPrimitiveParam (unsigned int index, float &value) const |
| get a parameter of primitive More... | |
| void | setPrimitivePosition (const double *R, const double *p) |
| set position and orientation of primitive More... | |
| double | computeDistanceWithRay (const double *point, const double *dir) |
| compute distance between a point and this mesh along ray More... | |
| bool | checkCollisionWithPointCloud (const std::vector< Vector3 > &i_cloud, double i_radius) |
| check collision between this triangle mesh and a point cloud More... | |
| void | getBoundingBoxData (const int depth, std::vector< Vector3 > &out_boxes) |
| int | getAABBTreeDepth () |
| int | getAABBmaxNum () |
| int | numofBBtoDepth (int minNumofBB) |
Public Member Functions inherited from cnoid::Referenced | |
| virtual | ~Referenced () |
Friends | |
| class | ColdetModelPair |
Additional Inherited Members | |
Protected Member Functions inherited from cnoid::Referenced | |
| Referenced () | |
| Referenced (const Referenced &) | |
| int | refCount () const |
| ColdetModel::ColdetModel | ( | ) |
constructor
| ColdetModel::ColdetModel | ( | const ColdetModel & | org | ) |
copy constructor
Shape information stored in dataSet is shared with org
|
virtual |
destructor
| void ColdetModel::addTriangle | ( | int | v1, |
| int | v2, | ||
| int | v3 | ||
| ) |
add a triangle to the end of the vector
| void ColdetModel::addVertex | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) |
add a vertex to the end of the vector
| void ColdetModel::build | ( | ) |
build tree of bounding boxes to accelerate collision check
This method must be called before doing collision check
| bool ColdetModel::checkCollisionWithPointCloud | ( | const std::vector< Vector3 > & | i_cloud, |
| double | i_radius | ||
| ) |
check collision between this triangle mesh and a point cloud
| i_cloud | points |
| i_radius | radius of spheres assigned to the points |
|
virtual |
| void ColdetModel::cloneInternalModel | ( | ) |
| double ColdetModel::computeDistanceWithRay | ( | const double * | point, |
| const double * | dir | ||
| ) |
compute distance between a point and this mesh along ray
| point | a point |
| dir | direction of ray |
| int ColdetModel::getAABBmaxNum | ( | ) |
| int ColdetModel::getAABBTreeDepth | ( | ) |
| void ColdetModel::getBoundingBoxData | ( | const int | depth, |
| std::vector< Vector3 > & | out_boxes | ||
| ) |
| int ColdetModel::getNumTriangles | ( | ) | const |
| int ColdetModel::getNumVertices | ( | ) | const |
get the number of vertices
| bool ColdetModel::getPrimitiveParam | ( | unsigned int | index, |
| float & | value | ||
| ) | const |
get a parameter of primitive
| index | index of the parameter |
| value | value of the parameter |
| ColdetModel::PrimitiveType ColdetModel::getPrimitiveType | ( | ) | const |
get primitive type
| void ColdetModel::getTriangle | ( | int | index, |
| int & | out_v1, | ||
| int & | out_v2, | ||
| int & | out_v3 | ||
| ) | const |
| void ColdetModel::getVertex | ( | int | index, |
| float & | out_x, | ||
| float & | out_y, | ||
| float & | out_z | ||
| ) | const |
get a vertex
| index | index of the vertex |
| out_x | x position of the vertex |
| out_y | y position of the vertex |
| out_z | z position of the vertex |
|
inline |
|
inline |
get name of this model
| int ColdetModel::numofBBtoDepth | ( | int | minNumofBB | ) |
|
inline |
set name of this model
| name | name of this model |
| void ColdetModel::setNumPrimitiveParams | ( | unsigned int | nparam | ) |
set the number of parameters of primitive
| nparam | the number of parameters of primitive |
| void ColdetModel::setNumTriangles | ( | int | n | ) |
set the number of triangles
| n | the number of triangles |
| void ColdetModel::setNumVertices | ( | int | n | ) |
set the number of vertices
| n | the number of vertices |
| void ColdetModel::setPosition | ( | const double * | R, |
| const double * | p | ||
| ) |
set position and orientation of this model
| R | new orientation (row-major, length = 9) |
| p | new position (length = 3) |
| void ColdetModel::setPosition | ( | const Isometry3 & | T | ) |
| bool ColdetModel::setPrimitiveParam | ( | unsigned int | index, |
| float | value | ||
| ) |
set a parameter of primitive
| index | index of the parameter |
| value | value of the parameter |
| void ColdetModel::setPrimitivePosition | ( | const double * | R, |
| const double * | p | ||
| ) |
set position and orientation of primitive
| R | orientation relative to link (length = 9) |
| p | position relative to link (length = 3) |
| void ColdetModel::setPrimitiveType | ( | PrimitiveType | ptype | ) |
set primitive type
| ptype | primitive type |
| void ColdetModel::setTriangle | ( | int | index, |
| int | v1, | ||
| int | v2, | ||
| int | v3 | ||
| ) |
add a triangle
| index | index of the triangle |
| v1 | index of the first vertex |
| v2 | index of the second vertex |
| v3 | index of the third vertex |
| void ColdetModel::setVertex | ( | int | index, |
| float | x, | ||
| float | y, | ||
| float | z | ||
| ) |
add a vertex
| index | index of the vertex |
| x | x position of the vertex |
| y | y position of the vertex |
| z | z position of the vertex |
|
friend |
1.8.17