ColdetBody.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  * General Robotix Inc.
9  */
14 #ifndef OPENHRP_COLLISION_DETECTOR_COLDET_BODY_H_INCLUDED
15 #define OPENHRP_COLLISION_DETECTOR_COLDET_BODY_H_INCLUDED
16 
17 #include <map>
18 #include <vector>
19 #include <string>
20 #include <hrpUtil/Referenced.h>
21 #include <hrpUtil/Eigen4d.h>
22 #include <hrpCorba/ModelLoader.hh>
24 
25 using namespace std;
26 using namespace boost;
27 using namespace hrp;
28 using namespace OpenHRP;
29 
30 
32 {
33 public:
34  ColdetBody(BodyInfo_ptr bodyInfo);
35 
39  ColdetBody(const ColdetBody& org);
40 
41  void setName(const char* name) { name_ = name; }
42  const char* name() { return name_.c_str(); }
43 
44  unsigned int numLinks() const {
45  return linkColdetModels.size();
46  }
48  return linkColdetModels[linkIndex];
49  }
50 
51  ColdetModelPtr linkColdetModel(const string& linkName){
52  map<string, ColdetModelPtr>::iterator p = linkNameToColdetModelMap.find(linkName);
53  return (p == linkNameToColdetModelMap.end()) ? ColdetModelPtr() : p->second;
54  }
55 
56  void setLinkPositions(const LinkPositionSequence& linkPositions);
57 
58  private:
59  void addLinkPrimitiveInfo(ColdetModelPtr& coldetModel,
60  const double *R, const double *p,
61  const ShapeInfo& shapeInfo);
62  void addLinkVerticesAndTriangles
63  (ColdetModelPtr& coldetModel, LinkInfo& linkInfo, ShapeInfoSequence_var& shapes);
64  void addLinkVerticesAndTriangles
65  (ColdetModelPtr& coldetModel, const TransformedShapeIndex& tsi, const Matrix44& Tparent, ShapeInfoSequence_var& shapes, int& vertexIndex, int& triangleIndex);
66 
67  vector<ColdetModelPtr> linkColdetModels;
68  map<string, ColdetModelPtr> linkNameToColdetModelMap;
69  string name_;
70 };
71 
72 typedef boost::intrusive_ptr<ColdetBody> ColdetBodyPtr;
73 
74 #endif
boost::intrusive_ptr< ColdetBody > ColdetBodyPtr
Definition: ColdetBody.h:72
Modifications controlling boost library behavior.
Definition: ColladaUtil.h:306
vector< ColdetModelPtr > linkColdetModels
Definition: ColdetBody.h:67
png_infop png_charpp name
Definition: png.h:2382
Eigen::Matrix4d Matrix44
Definition: Eigen4d.h:18
ColdetModelPtr linkColdetModel(const string &linkName)
Definition: ColdetBody.h:51
unsigned int numLinks() const
Definition: ColdetBody.h:44
void setName(const char *name)
Definition: ColdetBody.h:41
const char * name()
Definition: ColdetBody.h:42
org
boost::intrusive_ptr< ColdetModel > ColdetModelPtr
Definition: ColdetModel.h:268
ColdetModelPtr linkColdetModel(int linkIndex)
Definition: ColdetBody.h:47
map< string, ColdetModelPtr > linkNameToColdetModelMap
Definition: ColdetBody.h:68
string name_
Definition: ColdetBody.h:69


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Sat Apr 13 2019 02:14:20