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

#include <DGtal/shapes/PolygonalSurface.h>

Collaboration diagram for DGtal::PolygonalSurface< 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::PolygonalSurface< TPoint >::IndexedPropertyMap< TData >

This structure is used to define efficient maps between vertices and any data specified by type TData. The polygonal 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 129 of file PolygonalSurface.h.

Member Typedef Documentation

◆ Argument

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

Definition at line 130 of file PolygonalSurface.h.

◆ Data

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

Definition at line 131 of file PolygonalSurface.h.

◆ Storage

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

Definition at line 132 of file PolygonalSurface.h.

Constructor & Destructor Documentation

◆ IndexedPropertyMap() [1/3]

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

Default constructor. The object is invalid.

Definition at line 135 of file PolygonalSurface.h.

135 : 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::PolygonalSurface< TPoint >::IndexedPropertyMap< TData >::IndexedPropertyMap ( const Self aSurface,
Size  s,
Data  def_data = Data() 
)
inline

Creates an empty vertex property map

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

Definition at line 141 of file PolygonalSurface.h.

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

◆ IndexedPropertyMap() [3/3]

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

Creates the IndexedPropertyMap that points to one that exists already.

Parameters
aSurfacethe corresponding polygonal 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 polygonal surface.

Definition at line 153 of file PolygonalSurface.h.

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

Member Function Documentation

◆ isValid()

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

◆ operator()()

template<typename TPoint>
template<typename TData >
const Data& DGtal::PolygonalSurface< 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 169 of file PolygonalSurface.h.

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

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

◆ operator[]() [1/2]

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

Non-mutable array access.

Parameters
vany index
Returns
the associated data

Definition at line 178 of file PolygonalSurface.h.

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

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

◆ operator[]() [2/2]

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

mutable array access.

Parameters
vany index
Returns
the associated data

Definition at line 187 of file PolygonalSurface.h.

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

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

◆ size()

template<typename TPoint>
template<typename TData >
Size DGtal::PolygonalSurface< TPoint >::IndexedPropertyMap< TData >::size ( ) const
inline
Returns
the size of the indexed map (i.e., size of associated vector).

Definition at line 197 of file PolygonalSurface.h.

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

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

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

◆ storage() [1/2]

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

Definition at line 200 of file PolygonalSurface.h.

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

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

◆ storage() [2/2]

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

Definition at line 203 of file PolygonalSurface.h.

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

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

◆ surface()

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

Definition at line 160 of file PolygonalSurface.h.

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

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

Field Documentation

◆ myData

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

◆ mySurface

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

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