3 #include <Core/Asset/AssetData.hpp>
4 #include <Core/Asset/MaterialData.hpp>
5 #include <Core/Containers/VectorArray.hpp>
6 #include <Core/Geometry/StandardAttribNames.hpp>
7 #include <Core/Geometry/TriangleMesh.hpp>
8 #include <Core/RaCore.hpp>
10 #include <Core/Utils/Attribs.hpp>
11 #include <Core/Utils/Index.hpp>
31 using ColorArray = Vector4Array;
34 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
50 GeometryData(
const std::string& name =
"",
const GeometryType& type = UNKNOWN );
60 inline void setName(
const std::string& name );
63 inline GeometryType getType()
const;
66 inline void setType(
const GeometryType& type );
69 inline Transform getFrame()
const;
72 inline void setFrame(
const Transform& frame );
92 inline bool isPointCloud()
const;
95 inline bool isLineMesh()
const;
98 inline bool isTriMesh()
const;
101 inline bool isQuadMesh()
const;
105 inline bool isPolyMesh()
const;
108 inline bool isTetraMesh()
const;
111 inline bool isHexMesh()
const;
114 inline bool hasEdges()
const;
117 inline bool hasFaces()
const;
120 inline bool hasPolyhedra()
const;
123 inline bool hasMaterial()
const;
126 inline void setPrimitiveCount(
int n );
129 inline int getPrimitiveCount()
const;
134 void displayInfo()
const;
147 int m_primitiveCount { -1 };
182 return (
m_type == POINT_CLOUD );
186 return (
m_type == LINE_MESH );
190 return (
m_type == TRI_MESH );
194 return (
m_type == QUAD_MESH );
198 return (
m_type == POLY_MESH );
202 return (
m_type == TETRA_MESH );
206 return (
m_type == HEX_MESH );
214 std::string layerSemanticName;
217 layerSemanticName = std::string( Geometry::TriangleIndexLayer::staticSemanticName );
220 layerSemanticName = std::string( Geometry::QuadIndexLayer::staticSemanticName );
223 layerSemanticName = std::string( Geometry::PolyIndexLayer::staticSemanticName );
int getPrimitiveCount() const
Return the number of primitives in the geometry data.
bool isLineMesh() const
Return true if the object is a Line Mesh.
int m_primitiveCount
Simple tracking of geometric primitive number.
bool isTetraMesh() const
Return true if the object is a Tetrahedron Mesh.
bool isTriMesh() const
Return true if the object is a Triangle Mesh.
bool hasFaces() const
Return true if the object has faces.
Transform m_frame
The transformation of the object.
GeometryType m_type
The type of geometry for the object.
bool isQuadMesh() const
Return true if the object is a Quadrangle Mesh.
bool isHexMesh() const
Return true if the object is a Hexahedron Mesh.
const MaterialData & getMaterial() const
Return the MaterialData associated to the objet.
void setMaterial(MaterialData *material)
Set the MaterialData for the object.
void setPrimitiveCount(int n)
Used to track easily the number of primitives in the geometry data.
void setType(const GeometryType &type)
Set the type of geometry.
GeometryType getType() const
Return the type of geometry.
Geometry::MultiIndexedGeometry & getGeometry()
Read/write access to the multiIndexedGeometry;.
std::shared_ptr< MaterialData > m_material
The MaterialData for the object.
bool hasPolyhedra() const
Return true if the object has polyhedra.
Core::Geometry::MultiIndexedGeometry m_geometry
Named attributes.
void setFrame(const Transform &frame)
Set the Transform of the object.
void setName(const std::string &name)
Return the name of the object.
Transform getFrame() const
Return the Transform of the object.
bool hasMaterial() const
Return true if the object has MaterialData.
bool isPointCloud() const
Return true if the object is a Point Cloud.
bool hasEdges() const
Return true if the object has lines.
represent material data loaded by a file loader. Material data must be identified by a unique name....
AbstractGeometry with per-vertex attributes and layers of indices. Each layer represents a different ...
bool containsLayer(const LayerKeyType &layerKey) const
Check if at least one layer with such properties exists.