Skip to content
Snippets Groups Projects
Commit ee2d86a9 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

[C++] Add GeometryModel::addGeometryObject(const Geometry&)

parent 019bb1a5
No related branches found
No related tags found
No related merge requests found
...@@ -70,6 +70,15 @@ namespace se3 ...@@ -70,6 +70,15 @@ namespace se3
~GeometryModel() {}; ~GeometryModel() {};
/**
* @brief Add a geometry object to a GeometryModel
*
* @param[in] object Object
*
* @return The index of the new added GeometryObject in geometryObjects
*/
inline GeomIndex addGeometryObject(const GeometryObject& object);
/** /**
* @brief Add a geometry object to a GeometryModel * @brief Add a geometry object to a GeometryModel
* *
......
...@@ -32,6 +32,14 @@ ...@@ -32,6 +32,14 @@
namespace se3 namespace se3
{ {
inline GeomIndex GeometryModel::addGeometryObject(const GeometryObject& object)
{
Index idx = (Index) (ngeoms ++);
geometryObjects.push_back(object);
addInnerObject(object.parentJoint, idx);
return idx;
}
inline GeomIndex GeometryModel::addGeometryObject(const Model& model, inline GeomIndex GeometryModel::addGeometryObject(const Model& model,
const FrameIndex parent, const FrameIndex parent,
const boost::shared_ptr<fcl::CollisionGeometry> & co, const boost::shared_ptr<fcl::CollisionGeometry> & co,
...@@ -39,14 +47,11 @@ namespace se3 ...@@ -39,14 +47,11 @@ namespace se3
const std::string & geom_name, const std::string & geom_name,
const std::string & mesh_path) throw(std::invalid_argument) const std::string & mesh_path) throw(std::invalid_argument)
{ {
Index idx = (Index) (ngeoms ++);
assert (model.frames[parent].type == se3::BODY); assert (model.frames[parent].type == se3::BODY);
JointIndex parentJoint = model.frames[parent].parent; JointIndex parentJoint = model.frames[parent].parent;
geometryObjects.push_back(GeometryObject( geom_name, parent, parentJoint, co, GeometryObject object( geom_name, parent, parentJoint, co,
placement, mesh_path)); placement, mesh_path);
addInnerObject(parentJoint, idx); return addGeometryObject (object);
return idx;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment