Go to the documentation of this file.
27 #include <boost/serialization/access.hpp>
28 #include <boost/serialization/base_object.hpp>
29 #include <boost/serialization/nvp.hpp>
30 #include <boost/serialization/vector.hpp>
31 #include <boost/serialization/shared_ptr.hpp>
42 std::vector<std::shared_ptr<tesseract_geometry::PolygonMesh>>
convert(std::vector<std::shared_ptr<T>>& meshes)
44 std::vector<std::shared_ptr<tesseract_geometry::PolygonMesh>> polygon_meshes;
45 polygon_meshes.reserve(meshes.size());
46 for (
const auto& mesh : meshes)
47 polygon_meshes.push_back(mesh);
49 return polygon_meshes;
58 throw std::runtime_error(
"Meshes must contain more than one mesh");
61 for (
const auto& mesh :
meshes_)
63 assert(tesseract_common::pointersEqual<const tesseract_common::Resource>(
meshes_[0]->
getResource(),
64 mesh->getResource()));
80 return meshes_.front()->getResource();
87 std::vector<std::shared_ptr<PolygonMesh>> meshes;
89 for (
const auto& mesh :
meshes_)
90 meshes.emplace_back(std::dynamic_pointer_cast<PolygonMesh>(mesh->clone()));
92 return std::make_shared<CompoundMesh>(meshes);
102 for (std::size_t i = 0; i <
meshes_.size(); ++i)
109 template <
class Archive>
112 ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(
Geometry);
113 ar& BOOST_SERIALIZATION_NVP(
meshes_);
bool operator!=(const CompoundMesh &rhs) const
const std::vector< std::shared_ptr< PolygonMesh > > & getMeshes() const
Get the meshes.
std::shared_ptr< Geometry > Ptr
Tesseract SDF Mesh Geometry.
bool operator==(const CompoundMesh &rhs) const
std::vector< std::shared_ptr< PolygonMesh > > meshes_
bool almostEqualRelativeAndAbs(const Eigen::Ref< const Eigen::VectorXd > &v1, const Eigen::Ref< const Eigen::VectorXd > &v2, const Eigen::Ref< const Eigen::VectorXd > &max_diff, const Eigen::Ref< const Eigen::VectorXd > &max_rel_diff)
#define TESSERACT_SERIALIZE_ARCHIVES_INSTANTIATE(Type)
#define TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
bool operator==(const Geometry &rhs) const
void serialize(Archive &ar, const unsigned int version)
std::shared_ptr< const tesseract_common::Resource > getResource() const
Get the path to file used to generate the meshs.
Geometry::Ptr clone() const override final
Create a copy of this shape.
#define TESSERACT_COMMON_IGNORE_WARNINGS_POP
const Eigen::Vector3d & getScale() const
Get the scale applied to file used to generate the meshs.
Tesseract Compound Mesh Geometry.
Tesseract Convex Mesh Geometry.
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP std::vector< std::shared_ptr< tesseract_geometry::PolygonMesh > > convert(std::vector< std::shared_ptr< T >> &meshes)
This is store meshes that are associated with as single resource.