#include <polygon_mesh.h>
Public Types | |
using | ConstPtr = std::shared_ptr< const PolygonMesh > |
using | Ptr = std::shared_ptr< PolygonMesh > |
![]() | |
using | ConstPtr = std::shared_ptr< const Geometry > |
using | Ptr = std::shared_ptr< Geometry > |
Public Member Functions | |
Geometry::Ptr | clone () const override |
Create a copy of this shape. More... | |
int | getFaceCount () const |
Get face count. More... | |
const std::shared_ptr< const Eigen::VectorXi > & | getFaces () const |
Get Polygon mesh faces. More... | |
std::shared_ptr< const MeshMaterial > | getMaterial () const |
Get material data extracted from the mesh file. More... | |
const std::shared_ptr< const tesseract_common::VectorVector3d > & | getNormals () const |
Get the vertex normal vectors. More... | |
std::shared_ptr< const tesseract_common::Resource > | getResource () const |
Get the path to file used to generate the mesh. More... | |
const Eigen::Vector3d & | getScale () const |
Get the scale applied to file used to generate the mesh. More... | |
const std::shared_ptr< const std::vector< std::shared_ptr< MeshTexture > > > & | getTextures () const |
Get textures extracted from the mesh file. More... | |
const std::shared_ptr< const tesseract_common::VectorVector4d > & | getVertexColors () const |
Get the vertex colors. More... | |
int | getVertexCount () const |
Get vertex count. More... | |
const std::shared_ptr< const tesseract_common::VectorVector3d > & | getVertices () const |
Get Polygon mesh vertices. More... | |
bool | operator!= (const PolygonMesh &rhs) const |
bool | operator== (const PolygonMesh &rhs) const |
PolygonMesh ()=default | |
PolygonMesh (std::shared_ptr< const tesseract_common::VectorVector3d > vertices, std::shared_ptr< const Eigen::VectorXi > faces, int face_count, std::shared_ptr< const tesseract_common::Resource > resource=nullptr, const Eigen::Vector3d &scale=Eigen::Vector3d(1, 1, 1), std::shared_ptr< const tesseract_common::VectorVector3d > normals=nullptr, std::shared_ptr< const tesseract_common::VectorVector4d > vertex_colors=nullptr, std::shared_ptr< MeshMaterial > mesh_material=nullptr, std::shared_ptr< const std::vector< std::shared_ptr< MeshTexture >>> mesh_textures=nullptr, GeometryType type=GeometryType::POLYGON_MESH) | |
Polygon Mesh geometry. More... | |
PolygonMesh (std::shared_ptr< const tesseract_common::VectorVector3d > vertices, std::shared_ptr< const Eigen::VectorXi > faces, std::shared_ptr< const tesseract_common::Resource > resource=nullptr, const Eigen::Vector3d &scale=Eigen::Vector3d(1, 1, 1), std::shared_ptr< const tesseract_common::VectorVector3d > normals=nullptr, std::shared_ptr< const tesseract_common::VectorVector4d > vertex_colors=nullptr, std::shared_ptr< MeshMaterial > mesh_material=nullptr, std::shared_ptr< const std::vector< std::shared_ptr< MeshTexture >>> mesh_textures=nullptr, GeometryType type=GeometryType::POLYGON_MESH) | |
Polygon Mesh geometry. More... | |
~PolygonMesh () override=default | |
![]() | |
Geometry (const Geometry &)=default | |
Geometry (Geometry &&)=default | |
Geometry (GeometryType type=GeometryType::UNINITIALIZED) | |
GeometryType | getType () const |
Get the geometry type. More... | |
const boost::uuids::uuid & | getUUID () const |
Get the geometry UUID. More... | |
bool | operator!= (const Geometry &rhs) const |
Geometry & | operator= (const Geometry &)=default |
Geometry & | operator= (Geometry &&)=default |
bool | operator== (const Geometry &rhs) const |
void | setUUID (const boost::uuids::uuid &uuid) |
Set the geometry UUID. More... | |
virtual | ~Geometry ()=default |
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
Private Attributes | |
int | face_count_ { 0 } |
std::shared_ptr< const Eigen::VectorXi > | faces_ |
std::shared_ptr< MeshMaterial > | mesh_material_ |
std::shared_ptr< const std::vector< std::shared_ptr< MeshTexture > > > | mesh_textures_ |
std::shared_ptr< const tesseract_common::VectorVector3d > | normals_ |
std::shared_ptr< const tesseract_common::Resource > | resource_ |
Eigen::Vector3d | scale_ |
std::shared_ptr< const tesseract_common::VectorVector4d > | vertex_colors_ |
int | vertex_count_ { 0 } |
std::shared_ptr< const tesseract_common::VectorVector3d > | vertices_ |
Friends | |
class | boost::serialization::access |
struct | tesseract_common::Serialization |
Definition at line 51 of file polygon_mesh.h.
using tesseract_geometry::PolygonMesh::ConstPtr = std::shared_ptr<const PolygonMesh> |
Definition at line 59 of file polygon_mesh.h.
using tesseract_geometry::PolygonMesh::Ptr = std::shared_ptr<PolygonMesh> |
Definition at line 58 of file polygon_mesh.h.
tesseract_geometry::PolygonMesh::PolygonMesh | ( | std::shared_ptr< const tesseract_common::VectorVector3d > | vertices, |
std::shared_ptr< const Eigen::VectorXi > | faces, | ||
std::shared_ptr< const tesseract_common::Resource > | resource = nullptr , |
||
const Eigen::Vector3d & | scale = Eigen::Vector3d(1, 1, 1) , |
||
std::shared_ptr< const tesseract_common::VectorVector3d > | normals = nullptr , |
||
std::shared_ptr< const tesseract_common::VectorVector4d > | vertex_colors = nullptr , |
||
std::shared_ptr< MeshMaterial > | mesh_material = nullptr , |
||
std::shared_ptr< const std::vector< std::shared_ptr< MeshTexture >>> | mesh_textures = nullptr , |
||
GeometryType | type = GeometryType::POLYGON_MESH |
||
) |
Polygon Mesh geometry.
vertices | A vector of vertices associated with the mesh |
faces | A vector of face indices, where the first number indicates the number of vertices associated with the face, followed by the vertex index in parameter vertices. For example, a triangle has three vertices, so there should be four inputs, where the first should be 3, indicating there are three vertices that define this face, followed by three indices. |
resource | A resource locator for locating resource |
scale | Scale the mesh |
normals | A vector of normals for the vertices (optional) |
vertex_colors | A vector of colors (RGBA) for the vertices (optional) |
mesh_material | A MeshMaterial describing the color and material properties of the mesh (optional) |
mesh_textures | A vector of MeshTexture to apply to the mesh (optional) |
Definition at line 44 of file polygon_mesh.cpp.
tesseract_geometry::PolygonMesh::PolygonMesh | ( | std::shared_ptr< const tesseract_common::VectorVector3d > | vertices, |
std::shared_ptr< const Eigen::VectorXi > | faces, | ||
int | face_count, | ||
std::shared_ptr< const tesseract_common::Resource > | resource = nullptr , |
||
const Eigen::Vector3d & | scale = Eigen::Vector3d(1, 1, 1) , |
||
std::shared_ptr< const tesseract_common::VectorVector3d > | normals = nullptr , |
||
std::shared_ptr< const tesseract_common::VectorVector4d > | vertex_colors = nullptr , |
||
std::shared_ptr< MeshMaterial > | mesh_material = nullptr , |
||
std::shared_ptr< const std::vector< std::shared_ptr< MeshTexture >>> | mesh_textures = nullptr , |
||
GeometryType | type = GeometryType::POLYGON_MESH |
||
) |
Polygon Mesh geometry.
vertices | A vector of vertices associated with the mesh |
faces | A vector of face indices, where the first number indicates the number of vertices associated with the face, followed by the vertex index in parameter vertices. For example, a triangle has three vertices, so there should be four inputs, where the first should be 3, indicating there are three vertices that define this face, followed by three indices. |
face_count | Provide the number of faces. This is faster because it does not need to loop over the faces. |
resource | A resource locator for locating resource |
scale | Scale the mesh |
normals | A vector of normals for the vertices (optional) |
vertex_colors | A vector of colors (RGBA) for the vertices (optional) |
mesh_material | Describes the color and material properties of the mesh (optional) |
mesh_textures | A vector of MeshTexture to apply to the mesh (optional) |
|
default |
|
overridedefault |
|
overridevirtual |
Create a copy of this shape.
Implements tesseract_geometry::Geometry.
Reimplemented in tesseract_geometry::SDFMesh.
Definition at line 119 of file polygon_mesh.cpp.
int tesseract_geometry::PolygonMesh::getFaceCount | ( | ) | const |
const std::shared_ptr< const Eigen::VectorXi > & tesseract_geometry::PolygonMesh::getFaces | ( | ) | const |
Get Polygon mesh faces.
Definition at line 98 of file polygon_mesh.cpp.
MeshMaterial::ConstPtr tesseract_geometry::PolygonMesh::getMaterial | ( | ) | const |
Get material data extracted from the mesh file.
Mesh files contain material information. The mesh parser will extract the material information and store it in a MeshMaterial structure.
Definition at line 115 of file polygon_mesh.cpp.
const std::shared_ptr< const tesseract_common::VectorVector3d > & tesseract_geometry::PolygonMesh::getNormals | ( | ) | const |
Get the vertex normal vectors.
Optional, may be nullptr
Definition at line 108 of file polygon_mesh.cpp.
tesseract_common::Resource::ConstPtr tesseract_geometry::PolygonMesh::getResource | ( | ) | const |
Get the path to file used to generate the mesh.
Note: If empty, assume it was manually generated.
Definition at line 104 of file polygon_mesh.cpp.
const Eigen::Vector3d & tesseract_geometry::PolygonMesh::getScale | ( | ) | const |
Get the scale applied to file used to generate the mesh.
Definition at line 106 of file polygon_mesh.cpp.
const std::shared_ptr< const std::vector< MeshTexture::Ptr > > & tesseract_geometry::PolygonMesh::getTextures | ( | ) | const |
Get textures extracted from the mesh file.
Mesh files contain (or reference) image files that form textures on the surface of the mesh. UV coordinates specify how the image is applied to the mesh. The MeshTexture structure contains a resource to the image, and the UV coordinates. Currently only jpg and png image formats are supported.
Definition at line 117 of file polygon_mesh.cpp.
const std::shared_ptr< const tesseract_common::VectorVector4d > & tesseract_geometry::PolygonMesh::getVertexColors | ( | ) | const |
Get the vertex colors.
Optional, may be nullptr
Definition at line 110 of file polygon_mesh.cpp.
int tesseract_geometry::PolygonMesh::getVertexCount | ( | ) | const |
const std::shared_ptr< const tesseract_common::VectorVector3d > & tesseract_geometry::PolygonMesh::getVertices | ( | ) | const |
Get Polygon mesh vertices.
Definition at line 96 of file polygon_mesh.cpp.
bool tesseract_geometry::PolygonMesh::operator!= | ( | const PolygonMesh & | rhs | ) | const |
Definition at line 134 of file polygon_mesh.cpp.
bool tesseract_geometry::PolygonMesh::operator== | ( | const PolygonMesh & | rhs | ) | const |
Definition at line 124 of file polygon_mesh.cpp.
|
private |
Definition at line 137 of file polygon_mesh.cpp.
|
friend |
Definition at line 214 of file polygon_mesh.h.
|
friend |
Definition at line 215 of file polygon_mesh.h.
|
private |
Definition at line 206 of file polygon_mesh.h.
|
private |
Definition at line 203 of file polygon_mesh.h.
|
private |
Definition at line 211 of file polygon_mesh.h.
|
private |
Definition at line 212 of file polygon_mesh.h.
|
private |
Definition at line 209 of file polygon_mesh.h.
|
private |
Definition at line 207 of file polygon_mesh.h.
|
private |
Definition at line 208 of file polygon_mesh.h.
|
private |
Definition at line 210 of file polygon_mesh.h.
|
private |
Definition at line 205 of file polygon_mesh.h.
|
private |
Definition at line 202 of file polygon_mesh.h.