convex_mesh.cpp
Go to the documentation of this file.
1 
27 #include <boost/serialization/access.hpp>
28 #include <boost/serialization/base_object.hpp>
29 #include <boost/serialization/nvp.hpp>
31 
35 
36 namespace tesseract_geometry
37 {
38 ConvexMesh::ConvexMesh(std::shared_ptr<const tesseract_common::VectorVector3d> vertices,
39  std::shared_ptr<const Eigen::VectorXi> faces,
41  const Eigen::Vector3d& scale,
42  std::shared_ptr<const tesseract_common::VectorVector3d> normals,
43  std::shared_ptr<const tesseract_common::VectorVector4d> vertex_colors,
44  MeshMaterial::Ptr mesh_material,
45  std::shared_ptr<const std::vector<MeshTexture::Ptr>> mesh_textures)
46  : PolygonMesh(std::move(vertices),
47  std::move(faces),
48  std::move(resource),
49  scale,
50  std::move(normals),
51  std::move(vertex_colors),
52  std::move(mesh_material),
53  std::move(mesh_textures),
55 {
56 }
57 
58 ConvexMesh::ConvexMesh(std::shared_ptr<const tesseract_common::VectorVector3d> vertices,
59  std::shared_ptr<const Eigen::VectorXi> faces,
60  int face_count,
62  const Eigen::Vector3d& scale,
63  std::shared_ptr<const tesseract_common::VectorVector3d> normals,
64  std::shared_ptr<const tesseract_common::VectorVector4d> vertex_colors,
65  MeshMaterial::Ptr mesh_material,
66  std::shared_ptr<const std::vector<MeshTexture::Ptr>> mesh_textures)
67  : PolygonMesh(std::move(vertices),
68  std::move(faces),
69  face_count,
70  std::move(resource),
71  scale,
72  std::move(normals),
73  std::move(vertex_colors),
74  std::move(mesh_material),
75  std::move(mesh_textures),
77 {
78 }
79 
81 
83 
85 {
86  return std::make_shared<ConvexMesh>(getVertices(), getFaces(), getFaceCount(), getResource(), getScale());
87 }
88 
89 bool ConvexMesh::operator==(const ConvexMesh& rhs) const
90 {
91  bool equal = true;
92  equal &= PolygonMesh::operator==(rhs);
93  equal &= creation_method_ == rhs.creation_method_;
94  return equal;
95 }
96 bool ConvexMesh::operator!=(const ConvexMesh& rhs) const { return !operator==(rhs); }
97 
98 template <class Archive>
99 void ConvexMesh::serialize(Archive& ar, const unsigned int /*version*/)
100 {
101  ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(PolygonMesh);
102  ar& BOOST_SERIALIZATION_NVP(creation_method_);
103 }
104 } // namespace tesseract_geometry
105 
108 BOOST_CLASS_EXPORT_IMPLEMENT(tesseract_geometry::ConvexMesh)
tesseract_geometry::ConvexMesh::creation_method_
CreationMethod creation_method_
Definition: convex_mesh.h:136
tesseract_geometry::ConvexMesh
Definition: convex_mesh.h:45
tesseract_geometry::ConvexMesh::ConvexMesh
ConvexMesh()=default
tesseract_geometry::Geometry::Ptr
std::shared_ptr< Geometry > Ptr
Definition: geometry.h:72
tesseract_geometry::GeometryType
GeometryType
Definition: geometry.h:48
resource_locator.h
TESSERACT_SERIALIZE_ARCHIVES_INSTANTIATE
#define TESSERACT_SERIALIZE_ARCHIVES_INSTANTIATE(Type)
tesseract_common::Resource::ConstPtr
std::shared_ptr< const Resource > ConstPtr
tesseract_geometry::ConvexMesh::setCreationMethod
void setCreationMethod(CreationMethod method)
Set the method used to create the convex mesh.
Definition: convex_mesh.cpp:82
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#define TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
tesseract_geometry::PolygonMesh::getFaces
const std::shared_ptr< const Eigen::VectorXi > & getFaces() const
Get Polygon mesh faces.
Definition: polygon_mesh.cpp:98
tesseract_geometry::ConvexMesh::CreationMethod
CreationMethod
Definition: convex_mesh.h:55
tesseract_geometry::MeshMaterial::Ptr
std::shared_ptr< MeshMaterial > Ptr
Definition: mesh_material.h:67
tesseract_geometry::ConvexMesh::operator==
bool operator==(const ConvexMesh &rhs) const
Definition: convex_mesh.cpp:89
mesh_material.h
Tesseract Mesh Material read from a mesh file.
tesseract_geometry::ConvexMesh::serialize
void serialize(Archive &ar, const unsigned int version)
Definition: convex_mesh.cpp:99
serialization.h
tesseract_geometry::ConvexMesh::getCreationMethod
CreationMethod getCreationMethod() const
Get how the convex hull was created.
Definition: convex_mesh.cpp:80
tesseract_geometry::PolygonMesh::getFaceCount
int getFaceCount() const
Get face count.
Definition: polygon_mesh.cpp:102
tesseract_geometry::PolygonMesh::operator==
bool operator==(const PolygonMesh &rhs) const
Definition: polygon_mesh.cpp:124
tesseract_geometry::PolygonMesh::getScale
const Eigen::Vector3d & getScale() const
Get the scale applied to file used to generate the mesh.
Definition: polygon_mesh.cpp:106
tesseract_geometry::ConvexMesh::operator!=
bool operator!=(const ConvexMesh &rhs) const
Definition: convex_mesh.cpp:96
tesseract_geometry::PolygonMesh
Definition: polygon_mesh.h:51
TESSERACT_COMMON_IGNORE_WARNINGS_POP
#define TESSERACT_COMMON_IGNORE_WARNINGS_POP
tesseract_geometry::ConvexMesh::clone
Geometry::Ptr clone() const override
Create a copy of this shape.
Definition: convex_mesh.cpp:84
tesseract_geometry
Definition: fwd.h:31
tesseract_geometry::GeometryType::CONVEX_MESH
@ CONVEX_MESH
macros.h
convex_mesh.h
Tesseract Convex Mesh Geometry.
tesseract_geometry::PolygonMesh::getVertices
const std::shared_ptr< const tesseract_common::VectorVector3d > & getVertices() const
Get Polygon mesh vertices.
Definition: polygon_mesh.cpp:96
tesseract_geometry::PolygonMesh::getResource
std::shared_ptr< const tesseract_common::Resource > getResource() const
Get the path to file used to generate the mesh.
Definition: polygon_mesh.cpp:104


tesseract_geometry
Author(s): Levi Armstrong
autogenerated on Sun May 18 2025 03:01:46