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< 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 Graph::ModelProperty< T >, PointCloud::ModelProperty< T >, PolyMesh::ModelProperty< T >, and SurfaceMesh::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 Graph::ModelProperty< T >, PointCloud::ModelProperty< T >, PolyMesh::ModelProperty< T >, and SurfaceMesh::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: