Skip to content

Commit

Permalink
Move docstrings to header
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthijsBurgh committed Apr 4, 2023
1 parent a2d4d31 commit 2d3a650
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 38 deletions.
38 changes: 0 additions & 38 deletions src/models/shape_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ namespace ed
namespace models
{

/*
std::string split implementation by using delimiter as a character. Multiple delimeters are removed.
*/
/**
* @brief split Implementation by using delimiter as a character. Multiple delimeters are removed.
* @param strToSplit input string, which is splitted
Expand Down Expand Up @@ -400,17 +397,6 @@ geo::ShapePtr getHeightMapShape(const std::string& image_filename, const geo::Ve

// ----------------------------------------------------------------------------------------------------

/**
* @brief getHeightMapShape convert grayscale image in a heigtmap mesh
* @param image_filename full path of grayscale image
* @param pos position of the origin of the heigtmap
* @param blockheight height of the heightmap of max grayscale value
* @param resolution_x resolution in x direction in meters
* @param resolution_y resolution in y direction in meters
* @param inverted false: CV/ROS standard (black = height); true: SDF/GAZEBO (White = height)
* @param errorerrorstream
* @return final mesh; or empty mesh in case of error
*/
geo::ShapePtr getHeightMapShape(const std::string& image_filename, const geo::Vec3& pos, const double blockheight,
const double resolution_x, const double resolution_y, const bool inverted, std::stringstream& error)
{
Expand Down Expand Up @@ -462,14 +448,6 @@ geo::ShapePtr getHeightMapShape(const std::string& image_filename, tue::config::

// ----------------------------------------------------------------------------------------------------

/**
* @brief createPolygon create polygon mesh from points
* @param shape filled mesh
* @param points 2D points which define the mesh
* @param height height of the mesh
* @param error error stream
* @param create_bottom false: open bottom; true: closed bottom
*/
void createPolygon(geo::Shape& shape, const std::vector<geo::Vec2>& points, double height, std::stringstream& error, bool create_bottom)
{
TPPLPoly poly;
Expand Down Expand Up @@ -580,14 +558,6 @@ bool readVec3Group(tue::config::Reader& cfg, geo::Vec3& v, const std::string& ve

// ----------------------------------------------------------------------------------------------------

/**
* @brief readPose read pose into Pose3D. Both ED yaml and SDF. Also reads pos(position) of SDF.
* @param cfg reader
* @param pose filled Pose3D pose
* @param pos_req position RequiredOrOptional
* @param rot_req rotation RequiredOrOptional
* @return indicates succes
*/
bool readPose(tue::config::Reader& cfg, geo::Pose3D& pose, tue::config::RequiredOrOptional pos_req, tue::config::RequiredOrOptional rot_req)
{
double roll = 0, pitch = 0, yaw = 0;
Expand Down Expand Up @@ -648,14 +618,6 @@ bool readPose(tue::config::Reader& cfg, geo::Pose3D& pose, tue::config::Required

// ----------------------------------------------------------------------------------------------------

/**
* @brief loadShape load the shape of a model.
* @param model_path path of the model
* @param cfg reader
* @param shape_cache cache for complex models
* @param error errorstream
* @return final mesh; or empty mesh in case of error
*/
geo::ShapePtr loadShape(const std::string& model_path, tue::config::Reader cfg,
std::map<std::string, geo::ShapePtr>& shape_cache, std::stringstream& error)
{
Expand Down
41 changes: 41 additions & 0 deletions src/models/shape_loader_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,61 @@ enum ModelOrFile
FILE
};

/**
* @brief split Implementation by using delimiter as a character. Multiple delimeters are removed.
* @param strToSplit input string, which is splitted
* @param delimeter char on which the string is split
* @return vector of sub-strings
*/
std::vector<std::string> split(const std::string& strToSplit, char delimeter);

std::string parseURI(const std::string& uri, ModelOrFile& uri_type);

/**
* @brief loadShape load the shape of a model.
* @param model_path path of the model
* @param cfg reader
* @param shape_cache cache for complex models
* @param error errorstream
* @return final mesh; or empty mesh in case of error
*/
geo::ShapePtr loadShape(const std::string& model_path, tue::config::Reader cfg,
std::map<std::string, geo::ShapePtr>& shape_cache, std::stringstream& error);

/**
* @brief getHeightMapShape convert grayscale image in a heigtmap mesh
* @param image_filename full path of grayscale image
* @param pos position of the origin of the heigtmap
* @param blockheight height of the heightmap of max grayscale value
* @param resolution_x resolution in x direction in meters
* @param resolution_y resolution in y direction in meters
* @param inverted false: CV/ROS standard (black = height); true: SDF/GAZEBO (White = height)
* @param errorerrorstream
* @return final mesh; or empty mesh in case of error
*/
geo::ShapePtr getHeightMapShape(const std::string& image_filename, const geo::Vec3& pos, const double blockheight,
const double resolution_x, const double resolution_y, const bool inverted, std::stringstream& error);

/**
* @brief readPose read pose into Pose3D. Both ED yaml and SDF. Also reads pos(position) of SDF.
* @param cfg reader
* @param pose filled Pose3D pose
* @param pos_req position RequiredOrOptional
* @param rot_req rotation RequiredOrOptional
* @return indicates succes
*/
bool readPose(tue::config::Reader& cfg, geo::Pose3D& pose,
tue::config::RequiredOrOptional pos_req = tue::config::REQUIRED,
tue::config::RequiredOrOptional rot_req = tue::config::OPTIONAL);

/**
* @brief createPolygon create polygon mesh from points
* @param shape filled mesh
* @param points 2D points which define the mesh
* @param height height of the mesh
* @param error error stream
* @param create_bottom false: open bottom; true: closed bottom
*/
void createPolygon(geo::Shape& shape, const std::vector<geo::Vec2>& points, double height, std::stringstream& error, bool create_bottom = true);

} // end models namespace
Expand Down

0 comments on commit 2d3a650

Please sign in to comment.