Geogram Version 1.9.7
A programming library of geometric algorithms
Loading...
Searching...
No Matches
GEO::Attribute< vecng< DIM, double > > Class Template Reference

An attribute class that can access a vector attribute as a scalar attribute with vec2,vec3 or vec4 element types. More...

#include <geogram/basic/vector_attribute.h>

Public Types

typedef vecng< DIM, double > vec_type
 

Public Member Functions

 Attribute (AttributesManager &manager, const std::string &name)
 
void bind (AttributesManager &manager, const std::string &name)
 
void unbind ()
 
bool bind_if_is_defined (AttributesManager &manager, const std::string &name)
 
bool is_bound () const
 
index_t size () const
 
index_t dimension () const
 
index_t nb_elements () const
 
AttributesManagermanager ()
 
void destroy ()
 Destroys this attribute in the AttributesManager.
 
bool bind_if_is_compatible (AttributesManager &manager, const std::string &name)
 Binds this Attribute to an AttributesManager if it already exists in the AttributesManager and types are compatible.
 
void copy (const Attribute< vec_type > &rhs)
 Copies all the values from another attribute.
 
void fill (const vec_type &val)
 Sets all the elements in this attribute to a specified value.
 
vec_typeoperator[] (index_t i)
 
const vec_typeoperator[] (index_t i) const
 

Static Public Member Functions

static bool is_defined (AttributesManager &manager, const std::string &name)
 

Static Public Attributes

static constexpr index_t vec_dim = DIM
 

Detailed Description

template<index_t DIM>
class GEO::Attribute< vecng< DIM, double > >

An attribute class that can access a vector attribute as a scalar attribute with vec2,vec3 or vec4 element types.

Definition at line 54 of file vector_attribute.h.

Member Typedef Documentation

◆ vec_type

template<index_t DIM>
typedef vecng<DIM,double> GEO::Attribute< vecng< DIM, double > >::vec_type

Definition at line 56 of file vector_attribute.h.

Constructor & Destructor Documentation

◆ Attribute() [1/2]

template<index_t DIM>
GEO::Attribute< vecng< DIM, double > >::Attribute ( )
inline

Definition at line 59 of file vector_attribute.h.

◆ ~Attribute()

template<index_t DIM>
GEO::Attribute< vecng< DIM, double > >::~Attribute ( )
inline

Definition at line 64 of file vector_attribute.h.

◆ Attribute() [2/2]

template<index_t DIM>
GEO::Attribute< vecng< DIM, double > >::Attribute ( AttributesManager manager,
const std::string &  name 
)
inline

Definition at line 70 of file vector_attribute.h.

Member Function Documentation

◆ bind()

template<index_t DIM>
void GEO::Attribute< vecng< DIM, double > >::bind ( AttributesManager manager,
const std::string &  name 
)
inline

Definition at line 92 of file vector_attribute.h.

◆ bind_if_is_compatible()

template<index_t DIM>
bool GEO::Attribute< vecng< DIM, double > >::bind_if_is_compatible ( AttributesManager manager,
const std::string &  name 
)
inline

Binds this Attribute to an AttributesManager if it already exists in the AttributesManager and types are compatible.

Parameters
[in]managera reference to the AttributesManager
[in]namename of the attribute
Precondition
!is_bound()
Returns
true if this Attribute was successfully bound

Definition at line 169 of file vector_attribute.h.

◆ bind_if_is_defined()

template<index_t DIM>
bool GEO::Attribute< vecng< DIM, double > >::bind_if_is_defined ( AttributesManager manager,
const std::string &  name 
)
inline

Definition at line 116 of file vector_attribute.h.

◆ copy()

template<index_t DIM>
void GEO::Attribute< vecng< DIM, double > >::copy ( const Attribute< vec_type > &  rhs)
inline

Copies all the values from another attribute.

Parameters
[in]rhsthe attribute to be copied.

rhs needs to have the same size and dimension as this Attribute.

Definition at line 194 of file vector_attribute.h.

◆ destroy()

template<index_t DIM>
void GEO::Attribute< vecng< DIM, double > >::destroy ( )
inline

Destroys this attribute in the AttributesManager.

On exit, the attribute is no-longer accessible in the AttributesManager, its name is available again, and this attribute is in the unbound state.

Definition at line 153 of file vector_attribute.h.

◆ dimension()

template<index_t DIM>
index_t GEO::Attribute< vecng< DIM, double > >::dimension ( ) const
inline

Definition at line 135 of file vector_attribute.h.

◆ fill()

template<index_t DIM>
void GEO::Attribute< vecng< DIM, double > >::fill ( const vec_type val)
inline

Sets all the elements in this attribute to a specified value.

Parameters
[in]valthe value

Definition at line 208 of file vector_attribute.h.

◆ is_bound()

template<index_t DIM>
bool GEO::Attribute< vecng< DIM, double > >::is_bound ( ) const
inline

Definition at line 127 of file vector_attribute.h.

◆ is_defined()

template<index_t DIM>
static bool GEO::Attribute< vecng< DIM, double > >::is_defined ( AttributesManager manager,
const std::string &  name 
)
inlinestatic

Definition at line 76 of file vector_attribute.h.

◆ manager()

template<index_t DIM>
AttributesManager * GEO::Attribute< vecng< DIM, double > >::manager ( )
inline

Definition at line 143 of file vector_attribute.h.

◆ nb_elements()

template<index_t DIM>
index_t GEO::Attribute< vecng< DIM, double > >::nb_elements ( ) const
inline

Definition at line 139 of file vector_attribute.h.

◆ operator[]() [1/2]

template<index_t DIM>
vec_type & GEO::Attribute< vecng< DIM, double > >::operator[] ( index_t  i)
inline

Definition at line 219 of file vector_attribute.h.

◆ operator[]() [2/2]

template<index_t DIM>
const vec_type & GEO::Attribute< vecng< DIM, double > >::operator[] ( index_t  i) const
inline

Definition at line 224 of file vector_attribute.h.

◆ size()

template<index_t DIM>
index_t GEO::Attribute< vecng< DIM, double > >::size ( ) const
inline

Definition at line 131 of file vector_attribute.h.

◆ unbind()

template<index_t DIM>
void GEO::Attribute< vecng< DIM, double > >::unbind ( )
inline

Definition at line 104 of file vector_attribute.h.

Member Data Documentation

◆ vec_dim

template<index_t DIM>
constexpr index_t GEO::Attribute< vecng< DIM, double > >::vec_dim = DIM
staticconstexpr

Definition at line 57 of file vector_attribute.h.


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