Easy3D 2.6.1
Loading...
Searching...
No Matches
Property< T > Class Template Reference

Implementation of a generic property. More...

#include <easy3d/core/property.h>

Inheritance diagram for Property< T >:
Graph::EdgeProperty< easy3d::Graph::EdgeConnectivity > Graph::EdgeProperty< bool > Graph::VertexProperty< easy3d::Graph::VertexConnectivity > Graph::VertexProperty< bool > Graph::VertexProperty< easy3d::Vec > PolyMesh::CellProperty< easy3d::PolyMesh::CellConnectivity > PolyMesh::EdgeProperty< easy3d::PolyMesh::EdgeConnectivity > PolyMesh::HalfFaceProperty< easy3d::PolyMesh::HalfFaceConnectivity > PolyMesh::VertexProperty< easy3d::PolyMesh::VertexConnectivity > SurfaceMesh::EdgeProperty< double > SurfaceMesh::FaceProperty< easy3d::SurfaceMesh::FaceConnectivity > SurfaceMesh::FaceProperty< bool > SurfaceMesh::FaceProperty< easy3d::Vec > SurfaceMesh::FaceProperty< int > SurfaceMesh::FaceProperty< NormalCone > SurfaceMesh::FaceProperty< Points > SurfaceMesh::HalfedgeProperty< easy3d::SurfaceMesh::HalfedgeConnectivity > SurfaceMesh::VertexProperty< easy3d::SurfaceMesh::VertexConnectivity > SurfaceMesh::VertexProperty< easy3d::SurfaceMesh::Vertex > SurfaceMesh::VertexProperty< float > SurfaceMesh::VertexProperty< double > SurfaceMesh::VertexProperty< int > SurfaceMesh::VertexProperty< easy3d::SurfaceMesh::Halfedge > SurfaceMesh::VertexProperty< Quadric > Graph::EdgeProperty< T > Graph::ModelProperty< T > Graph::VertexProperty< T > PointCloud::ModelProperty< T > PointCloud::VertexProperty< T > PolyMesh::CellProperty< T > PolyMesh::EdgeProperty< T > PolyMesh::FaceProperty< T > PolyMesh::HalfFaceProperty< T > PolyMesh::ModelProperty< T > PolyMesh::VertexProperty< T > SurfaceMesh::EdgeProperty< T > SurfaceMesh::FaceProperty< T > SurfaceMesh::HalfedgeProperty< T > SurfaceMesh::ModelProperty< T > SurfaceMesh::VertexProperty< T >

Public Types

typedef PropertyArray< T >::reference reference
 The reference type of the property.
 
typedef PropertyArray< T >::const_reference const_reference
 The const reference type of the property.
 

Public Member Functions

 Property (PropertyArray< T > *p=nullptr)
 Constructor.
 
virtual ~Property ()=default
 Destructor.
 
void reset ()
 Resets the property.
 
 operator bool () const
 Checks if the property is valid.
 
virtual reference operator[] (size_t i)
 Accesses the i-th element.
 
virtual const_reference operator[] (size_t i) const
 Const access to the i-th element.
 
const T * data () const
 Gets a pointer to the array.
 
std::vector< T > & vector ()
 Gets a reference to the underlying vector.
 
const std::vector< T > & vector () const
 Const access to the underlying vector.
 
PropertyArray< T > & array ()
 Gets a reference to the property array.
 
const PropertyArray< T > & array () const
 Const access to the property array.
 
const std::string & name () const
 Returns the name of the property.
 
void set_name (const std::string &n)
 Sets the name of the property.
 

Friends

class PropertyContainer
 

Detailed Description

template<class T>
class easy3d::Property< T >

Implementation of a generic property.

Template Parameters
TThe type of the property.

Constructor & Destructor Documentation

◆ Property()

template<class T >
Property ( PropertyArray< T > *  p = nullptr)
inlineexplicit

Constructor.

Parameters
pA pointer to the property array.

Member Function Documentation

◆ array() [1/2]

template<class T >
PropertyArray< T > & array ( )
inline

Gets a reference to the property array.

Returns
A reference to the property array.

◆ array() [2/2]

template<class T >
const PropertyArray< T > & array ( ) const
inline

Const access to the property array.

Returns
A const reference to the property array.

◆ data()

template<class T >
const T * data ( ) const
inline

Gets a pointer to the array.

Returns
A pointer to the array.

◆ name()

template<class T >
const std::string & name ( ) const
inline

Returns the name of the property.

Returns
The name of the property.

◆ operator bool()

template<class T >
operator bool ( ) const
inline

Checks if the property is valid.

Returns
True if the property is valid, false otherwise.

◆ operator[]() [1/2]

template<class T >
virtual reference operator[] ( size_t  i)
inlinevirtual

Accesses the i-th element.

Parameters
iThe index of the element.
Returns
A reference to the i-th element.

Reimplemented in PolyMesh::ModelProperty< T >, SurfaceMesh::ModelProperty< T >, Graph::ModelProperty< T >, and PointCloud::ModelProperty< T >.

◆ operator[]() [2/2]

template<class T >
virtual const_reference operator[] ( size_t  i) const
inlinevirtual

Const access to the i-th element.

Parameters
iThe index of the element.
Returns
A const reference to the i-th element.

Reimplemented in PolyMesh::ModelProperty< T >, SurfaceMesh::ModelProperty< T >, Graph::ModelProperty< T >, and PointCloud::ModelProperty< T >.

◆ set_name()

template<class T >
void set_name ( const std::string &  n)
inline

Sets the name of the property.

Parameters
nThe new name of the property.

◆ vector() [1/2]

template<class T >
std::vector< T > & vector ( )
inline

Gets a reference to the underlying vector.

Returns
A reference to the underlying vector.

◆ vector() [2/2]

template<class T >
const std::vector< T > & vector ( ) const
inline

Const access to the underlying vector.

Returns
A const reference to the underlying vector.

The documentation for this class was generated from the following file: