DGtal 2.2.0
Loading...
Searching...
No Matches
DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::IndexedPropertyMap< TData > Struct Template Reference

#include <DGtal/topology/IndexedDigitalSurface.h>

Inheritance diagram for DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::IndexedPropertyMap< TData >:
[legend]

Public Types

typedef Index Argument
typedef TData Data
typedef std::vector< Data > Storage

Public Member Functions

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

Private Attributes

const Self * mySurface
 The associated indexed digital surface.
OwningOrAliasingPtr< Storage > myData
 An owned or aliased pointer to the vector of data.

Detailed Description

template<typename TDigitalSurfaceContainer>
template<typename TData>
struct DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::IndexedPropertyMap< TData >

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

Member Typedef Documentation

◆ Argument

template<typename TDigitalSurfaceContainer>
template<typename TData>
typedef Index DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::IndexedPropertyMap< TData >::Argument

Definition at line 150 of file IndexedDigitalSurface.h.

◆ Data

template<typename TDigitalSurfaceContainer>
template<typename TData>
typedef TData DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::IndexedPropertyMap< TData >::Data

Definition at line 151 of file IndexedDigitalSurface.h.

◆ Storage

template<typename TDigitalSurfaceContainer>
template<typename TData>
typedef std::vector<Data> DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::IndexedPropertyMap< TData >::Storage

Definition at line 152 of file IndexedDigitalSurface.h.

Constructor & Destructor Documentation

◆ IndexedPropertyMap() [1/3]

◆ IndexedPropertyMap() [2/3]

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

Creates an empty vertex property map

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

Definition at line 161 of file IndexedDigitalSurface.h.

162 : mySurface( &aSurface ),
163 myData( Storage( s, def_data ) )
164 {}
Aim: Represents a digital surface with the topology of its dual surface. Its aim is to mimic the stan...

◆ IndexedPropertyMap() [3/3]

template<typename TDigitalSurfaceContainer>
template<typename TData>
DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::IndexedPropertyMap< TData >::IndexedPropertyMap ( const Self & aSurface,
Storage & aStorage )
inline

Creates the IndexedPropertyMap that points to one that exists already.

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

Definition at line 173 of file IndexedDigitalSurface.h.

175 : mySurface( &aSurface ),
176 myData( &aStorage, false )
177 {}

Member Function Documentation

◆ isValid()

template<typename TDigitalSurfaceContainer>
template<typename TData>
bool DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::IndexedPropertyMap< TData >::isValid ( ) const
inline
Returns
if the object was properly initialized.

Definition at line 214 of file IndexedDigitalSurface.h.

214{ return mySurface != 0; }

◆ operator()()

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

This object is a function : Argument -> Data

Parameters
vany index
Returns
the associated data

Definition at line 189 of file IndexedDigitalSurface.h.

◆ operator[]() [1/2]

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

mutable array access.

Parameters
vany index
Returns
the associated data

Definition at line 207 of file IndexedDigitalSurface.h.

208 {
210 return (*myData)[ v ];
211 }

◆ operator[]() [2/2]

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

Non-mutable array access.

Parameters
vany index
Returns
the associated data

Definition at line 198 of file IndexedDigitalSurface.h.

199 {
201 return (*myData)[ v ];
202 }

◆ size()

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

Definition at line 217 of file IndexedDigitalSurface.h.

217{ return myData->size(); }

◆ storage() [1/2]

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

Definition at line 220 of file IndexedDigitalSurface.h.

220{ return *myData; }

◆ storage() [2/2]

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

Definition at line 223 of file IndexedDigitalSurface.h.

223{ return *myData; }

◆ surface()

template<typename TDigitalSurfaceContainer>
template<typename TData>
const Self & DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::IndexedPropertyMap< TData >::surface ( ) const
inline
Returns
the associated indexed digital surface.

Definition at line 180 of file IndexedDigitalSurface.h.

181 {
182 ASSERT( isValid() );
183 return *mySurface;
184 }

Field Documentation

◆ myData

template<typename TDigitalSurfaceContainer>
template<typename TData>
OwningOrAliasingPtr<Storage> DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::IndexedPropertyMap< TData >::myData
private

An owned or aliased pointer to the vector of data.

Definition at line 229 of file IndexedDigitalSurface.h.

◆ mySurface

template<typename TDigitalSurfaceContainer>
template<typename TData>
const Self* DGtal::IndexedDigitalSurface< TDigitalSurfaceContainer >::IndexedPropertyMap< TData >::mySurface
private

The associated indexed digital surface.

Definition at line 227 of file IndexedDigitalSurface.h.


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