MeshConvertRecursionParams.h
Go to the documentation of this file.
00001 
00032 #ifndef URDF2INVENTOR_MESHCONVERTRECURSIONPARAMS
00033 #define URDF2INVENTOR_MESHCONVERTRECURSIONPARAMS
00034 
00035 #include <urdf_traverser/RecursionParams.h>
00036 #include <ros/ros.h>
00037 #include <set>
00038 #include <string>
00039 #include <map>
00040 
00041 namespace urdf2inventor
00042 {
00043 
00047 template<class MeshFormat>
00048 class MeshConvertRecursionParams: public urdf_traverser::FactorRecursionParams
00049 {
00050 public:
00051     typedef MeshConvertRecursionParams<MeshFormat> Self;
00052     typedef typename baselib_binding::shared_ptr<Self>::type Ptr;
00053     explicit MeshConvertRecursionParams(double _scale_factor, const std::string _material,
00054                                         const std::string& _extension,
00055                                         const urdf_traverser::EigenTransform& _addVisualTransform):
00056         FactorRecursionParams(_scale_factor),
00057         material(_material),
00058         extension(_extension),
00059         addVisualTransform(_addVisualTransform) {}
00060     MeshConvertRecursionParams(const MeshConvertRecursionParams& o):
00061         FactorRecursionParams(o),
00062         material(o.material),
00063         extension(o.extension),
00064         resultMeshes(o.resultMeshes),
00065         addVisualTransform(o.addVisualTransform),
00066         textureFiles(o.textureFiles) {}
00067     virtual ~MeshConvertRecursionParams() {}
00068 
00069     // If the material cannot be converted, use this material name instead
00070     std::string material;
00071 
00072     // When the meshes are written to file, this is the extension they
00073     // will have.
00074     std::string extension;
00075 
00081     virtual urdf_traverser::EigenTransform getVisualTransform() const
00082     {
00083       return addVisualTransform;
00084     }
00085 
00086     // the resulting meshes (files in output MeshFormat), indexed by their name.
00087     // The name (map key) may also be a relative path, with the last element
00088     // being the link name (without file type extension). This will then mean
00089     // the mesh should be stored in this directory, relative to the output directory.
00090     // Note: If the resulting meshes reference texture files, they must reference
00091     // *absolute* file paths (which can be converted in a post-processing step)
00092     std::map<std::string, MeshFormat> resultMeshes;
00093 
00094     // if the \e resultMeshes have textures, this is a list of textures
00095     // (absolute file paths) referenced from the meshes.
00096     // Key is the same as in \e resultMeshes.
00097     std::map<std::string, std::set<std::string> > textureFiles;
00098 
00099 private:
00100     explicit MeshConvertRecursionParams() {}
00101 
00102 protected:
00111     urdf_traverser::EigenTransform addVisualTransform;
00112 };
00113 
00114 }  // namespace
00115 
00116 #endif   // URDF2INVENTOR_MESHCONVERTRECURSIONPARAMS


urdf2inventor
Author(s): Jennifer Buehler
autogenerated on Fri Mar 1 2019 03:38:11