OutputStructure.cpp
Go to the documentation of this file.
00001 
00019 #include <urdf2graspit/OutputStructure.h>
00020 #include <urdf_traverser/Helpers.h>
00021 
00022 #include <string>
00023 #include <vector>
00024 
00025 void urdf2graspit::OutputStructure::getRobotDirPath(std::vector<std::string>& structure) const
00026 {
00027     structure.push_back("models");
00028     structure.push_back("robots");
00029     structure.push_back(robotName);
00030 }
00031 
00032 
00033 std::string urdf2graspit::OutputStructure::getRobotFilePath() const
00034 {
00035     return getRobotDirPath() + robotName + ".xml";
00036 }
00037 
00038 
00039 void urdf2graspit::OutputStructure::getWorldDirPath(std::vector<std::string>& structure) const
00040 {
00041     structure.push_back("worlds");
00042 }
00043 
00044 
00045 std::string urdf2graspit::OutputStructure::getWorldFileName() const
00046 {
00047     return robotName + "_world.xml";
00048 }
00049 
00050 std::string urdf2graspit::OutputStructure::getWorldFilePath() const
00051 {
00052     return getWorldDirPath() + getWorldFileName();
00053 }
00054 
00055 
00056 void urdf2graspit::OutputStructure::getEigenGraspDirPath(std::vector<std::string>& structure) const
00057 {
00058     getRobotDirPath(structure);
00059     structure.push_back("eigen");
00060 }
00061 
00062 std::string urdf2graspit::OutputStructure::getEigenGraspFilePath(const std::string& useName) const
00063 {
00064     return getEigenGraspDirPath() + (useName.empty()? eigengraspFile : useName);
00065 }
00066 
00067 std::string urdf2graspit::OutputStructure::getEigenGraspFileRel() const
00068 {
00069     return "eigen/" + eigengraspFile;
00070 }
00071 
00072 void urdf2graspit::OutputStructure::getContactsDirPath(std::vector<std::string>& structure) const
00073 {
00074     getRobotDirPath(structure);
00075     structure.push_back("virtual");
00076 }
00077 
00078 std::string urdf2graspit::OutputStructure::getContactsFileRel() const
00079 {
00080     return "virtual/" + contactsFile;
00081 }
00082 
00083 std::string urdf2graspit::OutputStructure::getContactsFilePath(const std::string& useName) const
00084 {
00085     return getContactsDirPath() + (useName.empty()? contactsFile : useName);
00086 }
00087 
00088 
00089 // ---------------
00090 
00091 std::string urdf2graspit::OutputStructure::getMeshDirRel() const
00092 {
00093     std::string dir = meshSubdirName;
00094     urdf_traverser::helpers::enforceDirectory(dir, false);
00095     return dir;
00096 }
00097 
00098 std::string urdf2graspit::OutputStructure::getTexDirRel() const
00099 {
00100     std::string dir = texSubdirName;
00101     urdf_traverser::helpers::enforceDirectory(dir, false);
00102     return dir;
00103 }
00104 
00105 
00106 
00107 void urdf2graspit::OutputStructure::getMeshDirPath(std::vector<std::string>& structure) const
00108 {
00109     getRobotDirPath(structure);
00110     structure.push_back(meshSubdirName);
00111 }
00112 
00113 void urdf2graspit::OutputStructure::getTexDirPath(std::vector<std::string>& structure) const
00114 {
00115     getRobotDirPath(structure);
00116     structure.push_back(texSubdirName);
00117 }
00118 
00119 
00120 std::string urdf2graspit::OutputStructure::getMeshDirPath() const
00121 {
00122     return getRobotDirPath() + getMeshDirRel();
00123 }
00124 
00125 std::string urdf2graspit::OutputStructure::getTexDirPath() const
00126 {
00127     return getRobotDirPath() + getTexDirRel();
00128 }
00129 
00130 
00131 
00132 std::string urdf2graspit::OutputStructure::toStringPath(const std::vector<std::string>& path) const
00133 {
00134     std::string ret;
00135     for (std::vector<std::string>::const_iterator it = path.begin(); it != path.end(); ++it)
00136     {
00137         ret += *it +  "/";
00138     }
00139     return ret;
00140 }
00141 
00142 std::string urdf2graspit::OutputStructure::getRobotDirPath() const
00143 {
00144     std::vector<std::string> robDir;
00145     getRobotDirPath(robDir);
00146     return toStringPath(robDir);
00147 }
00148 
00149 
00150 
00151 std::string urdf2graspit::OutputStructure::getEigenGraspDirPath() const
00152 {
00153     std::vector<std::string> eDir;
00154     getEigenGraspDirPath(eDir);
00155     return toStringPath(eDir);
00156 }
00157 
00158 
00159 std::string urdf2graspit::OutputStructure::getContactsDirPath() const
00160 {
00161     std::vector<std::string> cDir;
00162     getContactsDirPath(cDir);
00163     return toStringPath(cDir);
00164 }
00165 
00166 std::string urdf2graspit::OutputStructure::getWorldDirPath() const
00167 {
00168     std::vector<std::string> wDir;
00169     getWorldDirPath(wDir);
00170     return toStringPath(wDir);
00171 }


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