Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00015 #ifndef OPENHRP_MODEL_LOADER_BODYINFO_IMPL_H_INCLUDED
00016 #define OPENHRP_MODEL_LOADER_BODYINFO_IMPL_H_INCLUDED
00017
00018 #include <string>
00019 #include <hrpCorba/ORBwrap.h>
00020 #include <hrpCorba/ModelLoader.hh>
00021 #include <hrpModel/ModelNodeSet.h>
00022 #include <hrpCollision/ColdetModel.h>
00023
00024 #include "ShapeSetInfo_impl.h"
00025
00026 using namespace OpenHRP;
00027 using namespace hrp;
00028
00029 class BodyInfo_impl :
00030 public virtual POA_OpenHRP::BodyInfo,
00031 public virtual ShapeSetInfo_impl
00032 {
00033 public:
00034
00035 BodyInfo_impl(PortableServer::POA_ptr poa);
00036 virtual ~BodyInfo_impl();
00037
00038 virtual char* name();
00039 virtual char* url();
00040 virtual StringSequence* info();
00041 virtual LinkInfoSequence* links();
00042 virtual AllLinkShapeIndexSequence* linkShapeIndices();
00043 virtual ExtraJointInfoSequence* extraJoints();
00044
00045 void loadModelFile(const std::string& filename);
00046
00047 void setLastUpdateTime(time_t time) { lastUpdate_ = time;};
00048 time_t getLastUpdateTime() { return lastUpdate_; }
00049 bool checkInlineFileUpdateTime() { return checkFileUpdateTime(); }
00050
00051 bool getParam(std::string param);
00052 void setParam(std::string param, bool value);
00053 void setParam(std::string param, int value);
00054 void changetoBoundingBox(unsigned int* depth) ;
00055 void changetoOriginData();
00056
00057 protected:
00058
00059 virtual const std::string& topUrl();
00060
00061 private:
00062
00063 time_t lastUpdate_;
00064 bool readImage_;
00065 OpenHRP::ModelLoader::AABBdataType AABBdataType_;
00066
00067 std::string name_;
00068 std::string url_;
00069 StringSequence info_;
00070 LinkInfoSequence links_;
00071 AllLinkShapeIndexSequence linkShapeIndices_;
00072 AllLinkShapeIndexSequence originlinkShapeIndices_;
00073 ExtraJointInfoSequence extraJoints_;
00074
00075 std::vector<ColdetModelPtr> linkColdetModels;
00076
00077 int readJointNodeSet(JointNodeSetPtr jointNodeSet, int& currentIndex, int motherIndex);
00078 void setJointParameters(int linkInfoIndex, VrmlProtoInstancePtr jointNode );
00079 void setSegmentParameters(int linkInfoIndex, JointNodeSetPtr jointNodeSet);
00080 void setSensors(int linkInfoIndex, JointNodeSetPtr jointNodeSet);
00081 void setHwcs(int linkInfoIndex, JointNodeSetPtr jointNodeSet);
00082 void setLights(int linkInfoIndex, JointNodeSetPtr jointNodeSet);
00083 void readSensorNode(int linkInfoIndex, SensorInfo& sensorInfo, VrmlProtoInstancePtr sensorNode);
00084 void readHwcNode(int linkInfoIndex, HwcInfo& hwcInfo, VrmlProtoInstancePtr hwcNode);
00085 void readLightNode(int linkInfoIndex, LightInfo& LightInfo,
00086 std::pair<Matrix44, VrmlNodePtr> &transformedLight);
00087 };
00088
00089 #endif