DGtal  1.5.beta
DGtal::TriangulatedSurface< TPoint >::IndexedPropertyMap< TData > Struct Template Reference

#include <DGtal/shapes/TriangulatedSurface.h>

Public Types

typedef Index Argument
 
typedef TData Data
 
typedef std::vector< DataStorage
 

Public Member Functions

 IndexedPropertyMap ()
 Default constructor. The object is invalid. More...
 
 IndexedPropertyMap (const Self &aSurface, Size s, Data def_data=Data())
 
 IndexedPropertyMap (const Self &aSurface, Storage &aStorage)
 
const Selfsurface () const
 
const Dataoperator() (Argument v) const
 
const Dataoperator[] (Argument v) const
 
Dataoperator[] (Argument v)
 
bool isValid () const
 
Size size () const
 
Storagestorage ()
 
const Storagestorage () const
 

Private Attributes

const SelfmySurface
 The associated polygonal surface. More...
 
OwningOrAliasingPtr< StoragemyData
 An owned or aliased pointer to the vector of data. More...
 

Detailed Description

template<typename TPoint>
template<typename TData>
struct DGtal::TriangulatedSurface< TPoint >::IndexedPropertyMap< TData >

This structure is used to define efficient maps between vertices and any data specified by type TData. The triangulated surface provides a default vertex map for vertex positions.

Template Parameters
TDatathe value type for the map.
See also
positions
makeVertexMap
Note
This property map uses a vector structure as storage.

Definition at line 128 of file TriangulatedSurface.h.

Member Typedef Documentation

◆ Argument

template<typename TPoint >
template<typename TData >
typedef Index DGtal::TriangulatedSurface< TPoint >::IndexedPropertyMap< TData >::Argument

Definition at line 129 of file TriangulatedSurface.h.

◆ Data

template<typename TPoint >
template<typename TData >
typedef TData DGtal::TriangulatedSurface< TPoint >::IndexedPropertyMap< TData >::Data

Definition at line 130 of file TriangulatedSurface.h.

◆ Storage

template<typename TPoint >
template<typename TData >
typedef std::vector<Data> DGtal::TriangulatedSurface< TPoint >::IndexedPropertyMap< TData >::Storage

Definition at line 131 of file TriangulatedSurface.h.

Constructor & Destructor Documentation

◆ IndexedPropertyMap() [1/3]

template<typename TPoint >
template<typename TData >
DGtal::TriangulatedSurface< TPoint >::IndexedPropertyMap< TData >::IndexedPropertyMap ( )
inline

Default constructor. The object is invalid.

Definition at line 134 of file TriangulatedSurface.h.

134 : mySurface( 0 ), myData( 0 ) {}
const Self * mySurface
The associated polygonal surface.
OwningOrAliasingPtr< Storage > myData
An owned or aliased pointer to the vector of data.

◆ IndexedPropertyMap() [2/3]

template<typename TPoint >
template<typename TData >
DGtal::TriangulatedSurface< TPoint >::IndexedPropertyMap< TData >::IndexedPropertyMap ( const Self aSurface,
Size  s,
Data  def_data = Data() 
)
inline

Creates an empty vertex property map

Parameters
aSurfacethe corresponding triangulated surface.
sone more than the maximal allowed index (i.e. nb of elements).
def_datathe default value at initialization.

Definition at line 140 of file TriangulatedSurface.h.

141  : mySurface( &aSurface ),
142  myData( Storage( s, def_data ) )
143  {}

◆ IndexedPropertyMap() [3/3]

template<typename TPoint >
template<typename TData >
DGtal::TriangulatedSurface< TPoint >::IndexedPropertyMap< TData >::IndexedPropertyMap ( const Self aSurface,
Storage aStorage 
)
inline

Creates the IndexedPropertyMap that points to one that exists already.

Parameters
aSurfacethe corresponding triangulated surface.
aStoragethe map to reference in this property map.
Note
This method is used to give to a user the map vertex -> position that is stored within the triangulated surface.

Definition at line 152 of file TriangulatedSurface.h.

154  : mySurface( &aSurface ),
155  myData( &aStorage, false )
156  {}

Member Function Documentation

◆ isValid()

◆ operator()()

template<typename TPoint >
template<typename TData >
const Data& DGtal::TriangulatedSurface< TPoint >::IndexedPropertyMap< TData >::operator() ( Argument  v) const
inline

This object is a function : Argument -> Data

Parameters
vany index
Returns
the associated data

Definition at line 168 of file TriangulatedSurface.h.

169  {
170  ASSERT( isValid() && v < myData->size() );
171  return (*myData)[ v ];
172  }

References DGtal::TriangulatedSurface< TPoint >::IndexedPropertyMap< TData >::isValid(), DGtal::TriangulatedSurface< TPoint >::IndexedPropertyMap< TData >::myData, and DGtal::TriangulatedSurface< TPoint >::IndexedPropertyMap< TData >::size().

◆ operator[]() [1/2]

template<typename TPoint >
template<typename TData >
Data& DGtal::TriangulatedSurface< TPoint >::IndexedPropertyMap< TData >::operator[] ( Argument  v)
inline

mutable array access.

Parameters
vany index
Returns
the associated data

Definition at line 186 of file TriangulatedSurface.h.

187  {
188  ASSERT( isValid() && v < myData->size() );
189  return (*myData)[ v ];
190  }

References DGtal::TriangulatedSurface< TPoint >::IndexedPropertyMap< TData >::isValid(), DGtal::TriangulatedSurface< TPoint >::IndexedPropertyMap< TData >::myData, and DGtal::TriangulatedSurface< TPoint >::IndexedPropertyMap< TData >::size().

◆ operator[]() [2/2]

template<typename TPoint >
template<typename TData >
const Data& DGtal::TriangulatedSurface< TPoint >::IndexedPropertyMap< TData >::operator[] ( Argument  v) const
inline

Non-mutable array access.

Parameters
vany index
Returns
the associated data

Definition at line 177 of file TriangulatedSurface.h.

178  {
179  ASSERT( isValid() && v < myData->size() );
180  return (*myData)[ v ];
181  }

References DGtal::TriangulatedSurface< TPoint >::IndexedPropertyMap< TData >::isValid(), DGtal::TriangulatedSurface< TPoint >::IndexedPropertyMap< TData >::myData, and DGtal::TriangulatedSurface< TPoint >::IndexedPropertyMap< TData >::size().

◆ size()

template<typename TPoint >
template<typename TData >
Size DGtal::TriangulatedSurface< TPoint >::IndexedPropertyMap< TData >::size ( ) const
inline

◆ storage() [1/2]

template<typename TPoint >
template<typename TData >
Storage& DGtal::TriangulatedSurface< TPoint >::IndexedPropertyMap< TData >::storage ( )
inline
Returns
a reference to the storage class (a vector of Data).

Definition at line 199 of file TriangulatedSurface.h.

199 { return *myData; }

References DGtal::TriangulatedSurface< TPoint >::IndexedPropertyMap< TData >::myData.

◆ storage() [2/2]

template<typename TPoint >
template<typename TData >
const Storage& DGtal::TriangulatedSurface< TPoint >::IndexedPropertyMap< TData >::storage ( ) const
inline
Returns
a const reference to the storage class (a vector of Data).

Definition at line 202 of file TriangulatedSurface.h.

202 { return *myData; }

References DGtal::TriangulatedSurface< TPoint >::IndexedPropertyMap< TData >::myData.

◆ surface()

template<typename TPoint >
template<typename TData >
const Self& DGtal::TriangulatedSurface< TPoint >::IndexedPropertyMap< TData >::surface ( ) const
inline
Returns
the associated triangulated surface.

Definition at line 159 of file TriangulatedSurface.h.

160  {
161  ASSERT( isValid() );
162  return *mySurface;
163  }

References DGtal::TriangulatedSurface< TPoint >::IndexedPropertyMap< TData >::isValid(), and DGtal::TriangulatedSurface< TPoint >::IndexedPropertyMap< TData >::mySurface.

Field Documentation

◆ myData

◆ mySurface

template<typename TPoint >
template<typename TData >
const Self* DGtal::TriangulatedSurface< TPoint >::IndexedPropertyMap< TData >::mySurface
private

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