OutputStructure.h
Go to the documentation of this file.
00001 
00019 #ifndef URDF2GRASPIT_OUTPUTSTRUCTURE_H
00020 #define URDF2GRASPIT_OUTPUTSTRUCTURE_H
00021 // Copyright Jennifer Buehler
00022 
00023 #include <string>
00024 #include <vector>
00025 
00026 namespace urdf2graspit
00027 {
00028 
00029 
00035 class OutputStructure
00036 {
00037 public:
00038     // \param meshSubdirName the name of the directory where the mesh files will be stored is more flexible
00039     // than the rest of the structure encoded in this class.
00040     OutputStructure(const std::string& _meshSubdirName = "iv",
00041                     const std::string& _texSubdirName = "iv/textures",
00042                     const std::string& _contactsFile = "contacts.xml",
00043                     const std::string& _eigengraspFile = "eigen.xml"):
00044         robotName("default_robot_name"),
00045         meshSubdirName(_meshSubdirName),
00046         texSubdirName(_texSubdirName),
00047         contactsFile(_contactsFile),
00048         eigengraspFile(_eigengraspFile) {}
00049 
00050     OutputStructure(const OutputStructure& o):
00051         robotName(o.robotName),
00052         meshSubdirName(o.meshSubdirName),
00053         texSubdirName(o.texSubdirName),
00054         contactsFile(o.contactsFile),
00055         eigengraspFile(o.eigengraspFile) {}
00056 
00057 
00058 
00059     // directory path relative to the root output directory
00060     void getRobotDirPath(std::vector<std::string>& structure) const;
00061 
00062     // directory path relative to the root output directory
00063     void getWorldDirPath(std::vector<std::string>& structure) const;
00064 
00065     // directory path relative to the root output directory
00066     void getEigenGraspDirPath(std::vector<std::string>& structure) const;
00067 
00068     // directory path relative to the root output directory
00069     void getContactsDirPath(std::vector<std::string>& structure) const;
00070 
00071     // directory path relative to the root output directory
00072     void getMeshDirPath(std::vector<std::string>& structure) const;
00073     void getTexDirPath(std::vector<std::string>& structure) const;
00074 
00075     // directory path relative to the root output directory
00076     std::string getRobotDirPath() const;
00077 
00078     // directory path relative to the root output directory
00079     std::string getRobotFilePath() const;
00080 
00081     // directory path relative to the root output directory
00082     std::string getWorldDirPath() const;
00083 
00084     // directory path relative to the root output directory
00085     std::string getWorldFilePath() const;
00086 
00087     // directory path relative to the root output directory
00088     std::string getWorldFileName() const;
00089 
00090     // directory path relative to the root output directory
00091     std::string getEigenGraspDirPath() const;
00092 
00098     std::string getEigenGraspFilePath(const std::string& useName) const;
00099 
00100     // directory path relative to the root output directory
00101     std::string getContactsDirPath() const;
00102 
00108     std::string getContactsFilePath(const std::string& useName) const;
00109 
00110     // directory path relative to the root output directory where meshes
00111     // are to be saved
00112     std::string getMeshDirPath() const;
00113 
00114     // directory path relative to the root output directory where textures
00115     // are to be saved
00116     std::string getTexDirPath() const;
00117 
00118     void setRobotName(const std::string& _robotName)
00119     {
00120         robotName = _robotName;
00121     }
00122 
00123     std::string getRobotName() const
00124     {
00125         return robotName;
00126     }
00127 
00128     // relative path to contact file as it should be referenced from the robot's XML file
00129     std::string getContactsFileRel() const;
00130 
00131     // relative path to eigengrasp file as it should be referenced from the robot's XML file
00132     std::string getEigenGraspFileRel() const;
00133 
00134     // relative path to mesh directory from the robot's root directory.
00135     std::string getMeshDirRel() const;
00136 
00137     // relative path to mesh directory from the robot's root directory.
00138     std::string getTexDirRel() const;
00139 
00140 private:
00141     // helper function to convert a path given in a vector to a string
00142     // in in the form of /path/to/directory.
00143     std::string toStringPath(const std::vector<std::string>& path) const;
00144 
00145     std::string robotName;
00146     std::string meshSubdirName;
00147     std::string texSubdirName;
00148     std::string contactsFile;
00149     std::string eigengraspFile;
00150 };
00151 
00152 
00153 }  // namespace urdf2graspit
00154 
00155 #endif  // URDF2GRASPIT_OUTPUTSTRUCTURE_H


urdf2graspit
Author(s): Jennifer Buehler
autogenerated on Wed May 8 2019 02:53:45