BodyInfoCollada_impl.h
Go to the documentation of this file.
00001 // -*- coding: utf-8 -*-
00002 // Copyright (C) 2011 University of Tokyo, General Robotix Inc.
00003 //
00004 // Licensed under the Apache License, Version 2.0 (the "License");
00005 // you may not use this file except in compliance with the License.
00006 // You may obtain a copy of the License at
00007 //     http://www.apache.org/licenses/LICENSE-2.0
00008 // 
00009 // Unless required by applicable law or agreed to in writing, software
00010 // distributed under the License is distributed on an "AS IS" BASIS,
00011 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00012 // See the License for the specific language governing permissions and
00013 // limitations under the License.
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


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Thu Apr 11 2019 03:30:15