Choreonoid  1.1
Public 型 | Public メソッド | フレンド | すべてのメンバ一覧
クラス cnoid::ColdetModel

#include <ColdetModel.h>

cnoid::ColdetModelに対する継承グラフ
cnoid::Referenced

Public 型

enum  PrimitiveType {
  SP_MESH, SP_BOX, SP_CYLINDER, SP_CONE,
  SP_SPHERE, SP_PLANE
}

Public メソッド

 ColdetModel ()
 constructor
 ColdetModel (const ColdetModel &org)
 copy constructor
virtual ~ColdetModel ()
 destructor
void setName (const std::string &name)
 set name of this model
const std::string & name () const
 get name of this model
void setNumVertices (int n)
 set the number of vertices
int getNumVertices () const
 get the number of vertices
void setNumTriangles (int n)
 set the number of triangles
int getNumTriangles () const
void setVertex (int index, float x, float y, float z)
 add a vertex
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
void setTriangle (int index, int v1, int v2, int v3)
 add a triangle
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
bool isValid () const
 check if build() is already called or not
void setPosition (const Matrix3 &R, const Vector3 &p)
 set position and orientation of this model
void setPosition (const double *R, const double *p)
 set position and orientation of this model
void setPrimitiveType (PrimitiveType ptype)
 set primitive type
PrimitiveType getPrimitiveType () const
 get primitive type
void setNumPrimitiveParams (unsigned int nparam)
 set the number of parameters of primitive
bool setPrimitiveParam (unsigned int index, float value)
 set a parameter of primitive
bool getPrimitiveParam (unsigned int index, float &value) const
 get a parameter of primitive
void setPrimitivePosition (const double *R, const double *p)
 set position and orientation of primitive
double computeDistanceWithRay (const double *point, const double *dir)
 compute distance between a point and this mesh along ray
bool checkCollisionWithPointCloud (const std::vector< Vector3 > &i_cloud, double i_radius)
 check collision between this triangle mesh and a point cloud
void getBoundingBoxData (const int depth, std::vector< Vector3 > &out_boxes)
int getAABBTreeDepth ()
int getAABBmaxNum ()
int numofBBtoDepth (int minNumofBB)
- Public メソッド inherited from cnoid::Referenced
 Referenced ()
virtual ~Referenced ()

フレンド

class ColdetModelPair

Additional Inherited Members

- Protected メソッド inherited from cnoid::Referenced
int refCounter ()

列挙型

列挙型の値:
SP_MESH 
SP_BOX 
SP_CYLINDER 
SP_CONE 
SP_SPHERE 
SP_PLANE 

コンストラクタとデストラクタ

ColdetModel::ColdetModel ( )

constructor

ColdetModel::ColdetModel ( const ColdetModel org)

copy constructor

Shape information stored in dataSet is shared with org

ColdetModel::~ColdetModel ( )
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_cloudpoints
i_radiusradius of spheres assigned to the points
戻り値
true if colliding, false otherwise
double ColdetModel::computeDistanceWithRay ( const double *  point,
const double *  dir 
)

compute distance between a point and this mesh along ray

引数
pointa point
dirdirection of ray
戻り値
distance if ray collides with this mesh, FLT_MAX otherwise
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

戻り値
the number of vertices
bool ColdetModel::getPrimitiveParam ( unsigned int  index,
float &  value 
) const

get a parameter of primitive

引数
indexindex of the parameter
valuevalue of the parameter
戻り値
true if the parameter is gotten successfully, false otherwise
ColdetModel::PrimitiveType ColdetModel::getPrimitiveType ( ) const

get primitive type

戻り値
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

引数
indexindex of the vertex
out_xx position of the vertex
out_yy position of the vertex
out_zz position of the vertex
bool cnoid::ColdetModel::isValid ( ) const
inline

check if build() is already called or not

戻り値
true if build() is already called, false otherwise
const std::string& cnoid::ColdetModel::name ( ) const
inline

get name of this model

戻り値
name name of this model
int ColdetModel::numofBBtoDepth ( int  minNumofBB)
void cnoid::ColdetModel::setName ( const std::string &  name)
inline

set name of this model

引数
namename of this model
void ColdetModel::setNumPrimitiveParams ( unsigned int  nparam)

set the number of parameters of primitive

引数
nparamthe number of parameters of primitive
void ColdetModel::setNumTriangles ( int  n)

set the number of triangles

引数
nthe number of triangles
void ColdetModel::setNumVertices ( int  n)

set the number of vertices

引数
nthe number of vertices
void ColdetModel::setPosition ( const Matrix3 R,
const Vector3 p 
)

set position and orientation of this model

引数
Rnew orientation
pnew position
void ColdetModel::setPosition ( const double *  R,
const double *  p 
)

set position and orientation of this model

引数
Rnew orientation (length = 9)
pnew position (length = 3)
bool ColdetModel::setPrimitiveParam ( unsigned int  index,
float  value 
)

set a parameter of primitive

引数
indexindex of the parameter
valuevalue of the parameter
戻り値
true if the parameter is set successfully, false otherwise
void ColdetModel::setPrimitivePosition ( const double *  R,
const double *  p 
)

set position and orientation of primitive

引数
Rorientation relative to link (length = 9)
pposition relative to link (length = 3)
void ColdetModel::setPrimitiveType ( PrimitiveType  ptype)

set primitive type

引数
ptypeprimitive type
void ColdetModel::setTriangle ( int  index,
int  v1,
int  v2,
int  v3 
)

add a triangle

引数
indexindex of the triangle
v1index of the first vertex
v2index of the second vertex
v3index of the third vertex
void ColdetModel::setVertex ( int  index,
float  x,
float  y,
float  z 
)

add a vertex

引数
indexindex of the vertex
xx position of the vertex
yy position of the vertex
zz position of the vertex

フレンドと関連する関数

friend class ColdetModelPair
friend

このクラスの説明は次のファイルから生成されました: