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

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