Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00021 #ifndef MODELNODE_COLLADA_IMPL_H
00022 #define MODELNODE_COLLADA_IMPL_H
00023
00024 #include <string>
00025 #include <hrpCorba/ORBwrap.h>
00026 #include <hrpCorba/ModelLoader.hh>
00027 #include <hrpCollision/ColdetModel.h>
00028
00029 #include <boost/thread/thread.hpp>
00030
00031 #include "ShapeSetInfo_impl.h"
00032
00033 class ColladaReader;
00034
00036 class BodyInfoCollada_impl :
00037 public virtual ShapeSetInfo_impl,
00038 public virtual POA_OpenHRP::BodyInfo
00039 {
00040 public:
00041
00042 BodyInfoCollada_impl(PortableServer::POA_ptr poa);
00043 virtual ~BodyInfoCollada_impl();
00044
00045 virtual char* name();
00046 virtual char* url();
00047 virtual StringSequence* info();
00048 virtual LinkInfoSequence* links();
00049 virtual AllLinkShapeIndexSequence* linkShapeIndices();
00050 virtual ExtraJointInfoSequence* extraJoints();
00051
00052 void loadModelFile(const std::string& filename);
00053 void setLastUpdateTime(time_t time) { lastUpdate_ = time;};
00054 time_t getLastUpdateTime() { return lastUpdate_; }
00055 bool checkInlineFileUpdateTime();
00056
00057 bool getParam(std::string param);
00058 void setParam(std::string param, bool value);
00059 void setParam(std::string param, int value);
00060 void changetoBoundingBox(unsigned int* depth) ;
00061
00062 protected:
00063
00064 virtual const std::string& topUrl();
00065
00066 private:
00067
00068 time_t lastUpdate_;
00069 std::map<std::string, time_t> fileTimeMap;
00070 bool readImage_;
00071 OpenHRP::ModelLoader::AABBdataType AABBdataType_;
00072
00073 std::string name_;
00074 std::string url_;
00075 StringSequence info_;
00076 LinkInfoSequence links_;
00077 AllLinkShapeIndexSequence linkShapeIndices_;
00078 ExtraJointInfoSequence extraJoints_;
00079
00080 std::vector<ColdetModelPtr> linkColdetModels;
00081
00082 void setColdetModel(ColdetModelPtr& coldetModel, TransformedShapeIndexSequence shapeIndices, const Matrix44& Tparent, int& vertexIndex, int& triangleIndex);
00083 void setColdetModelTriangles(ColdetModelPtr& coldetModel, const TransformedShapeIndex& tsi, const Matrix44& Tparent, int& vertexIndex, int& triangleIndex);
00084
00085 static boost::mutex lock_;
00086
00087 friend class ColladaReader;
00088 };
00089
00090 #endif