Tesseract
Motion Planning Environment
|
#include <polygon_mesh.h>
Public Types | |
using | Ptr = std::shared_ptr< PolygonMesh > |
using | ConstPtr = std::shared_ptr< const PolygonMesh > |
Public Types inherited from tesseract_geometry::Geometry | |
using | Ptr = std::shared_ptr< Geometry > |
using | ConstPtr = std::shared_ptr< const Geometry > |
Public Member Functions | |
PolygonMesh (std::shared_ptr< const tesseract_common::VectorVector3d > vertices, std::shared_ptr< const Eigen::VectorXi > faces, tesseract_common::Resource::ConstPtr 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, MeshMaterial::Ptr mesh_material=nullptr, std::shared_ptr< const std::vector< MeshTexture::Ptr > > mesh_textures=nullptr, GeometryType type=GeometryType::CONVEX_MESH) | |
Polygon Mesh geometry. More... | |
PolygonMesh (std::shared_ptr< const tesseract_common::VectorVector3d > vertices, std::shared_ptr< const Eigen::VectorXi > faces, int face_count, tesseract_common::Resource::ConstPtr 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, MeshMaterial::Ptr mesh_material=nullptr, std::shared_ptr< const std::vector< MeshTexture::Ptr > > mesh_textures=nullptr, GeometryType type=GeometryType::CONVEX_MESH) | |
Polygon Mesh geometry. More... | |
PolygonMesh ()=default | |
~PolygonMesh () override=default | |
const std::shared_ptr< const tesseract_common::VectorVector3d > & | getVertices () const |
Get Polygon mesh vertices. More... | |
const std::shared_ptr< const Eigen::VectorXi > & | getFaces () const |
Get Polygon mesh faces. More... | |
int | getVertexCount () const |
Get vertex count. More... | |
int | getFaceCount () const |
Get face count. More... | |
tesseract_common::Resource::ConstPtr | 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 tesseract_common::VectorVector3d > & | getNormals () const |
Get the vertex normal vectors. More... | |
const std::shared_ptr< const tesseract_common::VectorVector4d > & | getVertexColors () const |
Get the vertex colors. More... | |
MeshMaterial::ConstPtr | getMaterial () const |
Get material data extracted from the mesh file. More... | |
const std::shared_ptr< const std::vector< MeshTexture::Ptr > > & | getTextures () const |
Get textures extracted from the mesh file. More... | |
Geometry::Ptr | clone () const override |
Create a copy of this shape. More... | |
bool | operator== (const PolygonMesh &rhs) const |
bool | operator!= (const PolygonMesh &rhs) const |
Public Member Functions inherited from tesseract_geometry::Geometry | |
Geometry (GeometryType type=GeometryType::UNINITIALIZED) | |
virtual | ~Geometry ()=default |
Geometry (const Geometry &)=default | |
Geometry & | operator= (const Geometry &)=default |
Geometry (Geometry &&)=default | |
Geometry & | operator= (Geometry &&)=default |
virtual Geometry::Ptr | clone () const =0 |
Create a copy of this shape. More... | |
GeometryType | getType () const |
bool | operator== (const Geometry &rhs) const |
bool | operator!= (const Geometry &rhs) const |
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
Private Attributes | |
std::shared_ptr< const tesseract_common::VectorVector3d > | vertices_ |
std::shared_ptr< const Eigen::VectorXi > | faces_ |
int | vertex_count_ { 0 } |
int | face_count_ { 0 } |
tesseract_common::Resource::ConstPtr | resource_ |
Eigen::Vector3d | scale_ |
std::shared_ptr< const tesseract_common::VectorVector3d > | normals_ |
std::shared_ptr< const tesseract_common::VectorVector4d > | vertex_colors_ |
MeshMaterial::Ptr | mesh_material_ |
std::shared_ptr< const std::vector< MeshTexture::Ptr > > | mesh_textures_ |
Friends | |
class | boost::serialization::access |
using tesseract_geometry::PolygonMesh::ConstPtr = std::shared_ptr<const PolygonMesh> |
using tesseract_geometry::PolygonMesh::Ptr = std::shared_ptr<PolygonMesh> |
|
inline |
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) |
|
inline |
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 |
|
inlineoverridevirtual |
Create a copy of this shape.
Implements tesseract_geometry::Geometry.
Reimplemented in tesseract_geometry::SDFMesh.
|
inline |
Get face count.
|
inline |
Get Polygon mesh faces.
|
inline |
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.
|
inline |
Get the vertex normal vectors.
Optional, may be nullptr
|
inline |
Get the path to file used to generate the mesh.
Note: If empty, assume it was manually generated.
|
inline |
Get the scale applied to file used to generate the mesh.
|
inline |
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.
|
inline |
Get the vertex colors.
Optional, may be nullptr
|
inline |
Get vertex count.
|
inline |
Get Polygon mesh vertices.
bool tesseract_geometry::PolygonMesh::operator!= | ( | const PolygonMesh & | rhs | ) | const |
bool tesseract_geometry::PolygonMesh::operator== | ( | const PolygonMesh & | rhs | ) | const |
|
private |
|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |