DGtal  1.0.0
Public Types | Public Member Functions | Private Attributes
DGtal::TriangulatedSurface< TPoint >::IndexedPropertyMap< TData > Struct Template Reference

#include <DGtal/shapes/TriangulatedSurface.h>

Collaboration diagram for DGtal::TriangulatedSurface< TPoint >::IndexedPropertyMap< TData >:
[legend]

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 127 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 128 of file TriangulatedSurface.h.

◆ Data

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

Definition at line 129 of file TriangulatedSurface.h.

◆ Storage

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

Definition at line 130 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 133 of file TriangulatedSurface.h.

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

◆ 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 139 of file TriangulatedSurface.h.

140  : mySurface( &aSurface ),
141  myData( Storage( s, def_data ) )
142  {}
OwningOrAliasingPtr< Storage > myData
An owned or aliased pointer to the vector of data.
const Self * mySurface
The associated polygonal surface.

◆ 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 151 of file TriangulatedSurface.h.

153  : mySurface( &aSurface ),
154  myData( &aStorage, false )
155  {}
OwningOrAliasingPtr< Storage > myData
An owned or aliased pointer to the vector of data.
const Self * mySurface
The associated polygonal surface.

Member Function Documentation

◆ isValid()

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

◆ 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 167 of file TriangulatedSurface.h.

168  {
169  ASSERT( isValid() && v < myData->size() );
170  return (*myData)[ v ];
171  }
OwningOrAliasingPtr< Storage > myData
An owned or aliased pointer to the vector of data.

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 >
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 176 of file TriangulatedSurface.h.

177  {
178  ASSERT( isValid() && v < myData->size() );
179  return (*myData)[ v ];
180  }
OwningOrAliasingPtr< Storage > myData
An owned or aliased pointer to the vector of data.

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 >
Data& DGtal::TriangulatedSurface< TPoint >::IndexedPropertyMap< TData >::operator[] ( Argument  v)
inline

mutable array access.

Parameters
vany index
Returns
the associated data

Definition at line 185 of file TriangulatedSurface.h.

186  {
187  ASSERT( isValid() && v < myData->size() );
188  return (*myData)[ v ];
189  }
OwningOrAliasingPtr< Storage > myData
An owned or aliased pointer to the vector of data.

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
Returns
the size of the indexed map (i.e., size of associated vector).

Definition at line 195 of file TriangulatedSurface.h.

195 { return myData->size(); }
OwningOrAliasingPtr< Storage > myData
An owned or aliased pointer to the vector of data.

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

Referenced by DGtal::TriangulatedSurface< TPoint >::IndexedPropertyMap< TData >::operator()(), and DGtal::TriangulatedSurface< TPoint >::IndexedPropertyMap< TData >::operator[]().

◆ 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 198 of file TriangulatedSurface.h.

198 { return *myData; }
OwningOrAliasingPtr< Storage > myData
An owned or aliased pointer to the vector of data.

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 201 of file TriangulatedSurface.h.

201 { return *myData; }
OwningOrAliasingPtr< Storage > myData
An owned or aliased pointer to the vector of data.

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 158 of file TriangulatedSurface.h.

159  {
160  ASSERT( isValid() );
161  return *mySurface;
162  }
const Self * mySurface
The associated polygonal surface.

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

Field Documentation

◆ myData

template<typename TPoint>
template<typename TData >
OwningOrAliasingPtr<Storage> DGtal::TriangulatedSurface< TPoint >::IndexedPropertyMap< TData >::myData
private

◆ 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: