5 #ifndef __pinocchio_multibody_pool_geometry_hpp__
6 #define __pinocchio_multibody_pool_geometry_hpp__
8 #include "pinocchio/multibody/geometry.hpp"
9 #include "pinocchio/multibody/pool/model.hpp"
13 template<
typename _Scalar,
int _Options,
template<
typename,
int>
class JointCollectionTpl>
17 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
20 typedef _Scalar Scalar;
28 typedef typename Base::ModelVector ModelVector;
29 typedef typename Base::DataVector DataVector;
33 typedef std::vector<GeometryModel, Eigen::aligned_allocator<GeometryModel>> GeometryModelVector;
34 typedef std::vector<GeometryData, Eigen::aligned_allocator<GeometryData>> GeometryDataVector;
45 const size_t pool_size = (
size_t)omp_get_max_threads())
46 :
Base(model, pool_size)
50 for (
size_t k = 0; k < pool_size; ++k)
70 const size_t pool_size = other.
size();
73 for (
size_t k = 0; k < pool_size; ++k)
83 PINOCCHIO_CHECK_INPUT_ARGUMENT(
85 "Index greater than the size of the geometry_models vector.");
92 PINOCCHIO_CHECK_INPUT_ARGUMENT(
94 "Index greater than the size of the geometry_models vector.");
101 PINOCCHIO_CHECK_INPUT_ARGUMENT(
103 "Index greater than the size of the geometry_datas vector.");
110 PINOCCHIO_CHECK_INPUT_ARGUMENT(
112 "Index greater than the size of the geometry_datas vector.");
145 void sync(
const GeometryModel & geometry_model,
const std::vector<GeomIndex> & geometry_indexes)
147 for (GeomIndex i : geometry_indexes)
148 PINOCCHIO_CHECK_INPUT_ARGUMENT(
149 i < geometry_model.
ngeoms,
150 "One of the given geometry index is greater than geometry_model.ngeoms.");
154 for (GeomIndex i : geometry_indexes)
155 geometry_model_pool.geometryObjects[i] = geometry_model.
geometryObjects[i].clone();
168 geometry_data.oMg = geometry_data_to_copy.oMg;
189 const size_t current_size = (size_t)
size();
192 if (current_size < new_size)
194 for (
size_t k = current_size; k < new_size; ++k)
const GeometryDataVector & getGeometryDatas() const
Returns the vector of Geometry Data.
size_t size() const
Returns the size of the pool.
GeometryModelVector m_geometry_models
Vector of Geometry Model associated to the pool.
const GeometryModelVector & getGeometryModels() const
Returns the vector of Geometry Model.
GeometryModel & getGeometryModel(const size_t index)
Returns the geometry_model at given index.
GeometryData & getGeometryData(const size_t index)
Returns the geometry_data at given index.
virtual void update(const GeometryData &geometry_data_to_copy)
Update the geometry datas with the new value.
const GeometryData & getGeometryData(const size_t index) const
Returns the geometry_data at given index.
const GeometryModel & getGeometryModel(const size_t index) const
Returns the geometry_model at given index.
GeometryModelVector & getGeometryModels()
Returns the vector of Geometry Model.
void sync(const GeometryModel &geometry_model, const std::vector< GeomIndex > &geometry_indexes)
Synchronize the internal geometry models with the input geometry for all given geometry indexes by cl...
GeometryPoolTpl(const Model &model, const GeometryModel &geometry_model, const size_t pool_size=(size_t) omp_get_max_threads())
Default constructor from a model and a pool size.
virtual void doResize(const size_t new_size)
 
GeometryDataVector & getGeometryDatas()
Returns the vector of Geometry Data.
GeometryPoolTpl(const GeometryPoolTpl &other)
Copy constructor from an other GeometryPoolTpl.
GeometryDataVector m_geometry_datas
Vector of Geometry Data associated to the pool.
virtual ~GeometryPoolTpl()
 
size_t size() const
Returns the size of the pool.
void update(const Data &data)
Update all the datas with the input data value.
Main pinocchio namespace.
std::vector< fcl::CollisionRequest > collisionRequests
Defines what information should be computed by collision test. There is one request per pair of geome...
PairIndex collisionPairIndex
Index of the collision pair.
std::vector< bool > activeCollisionPairs
Vector of collision pairs.
std::vector< fcl::DistanceRequest > distanceRequests
Defines what information should be computed by distance computation. There is one request per pair of...
GeometryObjectVector geometryObjects
Vector of GeometryObjects used for collision computations.
Index ngeoms
The number of GeometryObjects.
GeometryModel clone() const
Create a deep copy of *this.