DGtal 1.3.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes
DGtal::PolygonalSurface< TPoint >::IndexedPropertyMap< TData > Struct Template Reference

#include <DGtal/shapes/PolygonalSurface.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::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 130 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 131 of file PolygonalSurface.h.

◆ Data

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

Definition at line 132 of file PolygonalSurface.h.

◆ Storage

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

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

136: 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 142 of file PolygonalSurface.h.

143 : mySurface( &aSurface ),
144 myData( Storage( s, def_data ) )
145 {}

◆ 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 154 of file PolygonalSurface.h.

156 : mySurface( &aSurface ),
157 myData( &aStorage, false )
158 {}

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 170 of file PolygonalSurface.h.

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

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

mutable array access.

Parameters
vany index
Returns
the associated data

Definition at line 188 of file PolygonalSurface.h.

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

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 >
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 179 of file PolygonalSurface.h.

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

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

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

201{ return *myData; }

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 204 of file PolygonalSurface.h.

204{ return *myData; }

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 161 of file PolygonalSurface.h.

162 {
163 ASSERT( isValid() );
164 return *mySurface;
165 }

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: