DGtal  1.0.0
Data Structures | Public Types | Public Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes
DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve > Class Template Reference

Aim: Digitization of 3D parametric curves. This method produces, for good parameters step and k_next, a 26-connected digital curves obtained from a digitization process of 3D parametric curves. More...

#include <DGtal/geometry/curves/parametric/NaiveParametricCurveDigitizer3D.h>

Collaboration diagram for DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >:
[legend]

Data Structures

struct  KConstIter
 A structure used for making iterations over digital curve with respect to K_NEXT. More...
 
struct  KIter
 A structure used for making iterations over digital curve with respect to K_NEXT. More...
 

Public Types

typedef TParametricCurve::Space::Point Point
 Integer point type. More...
 
typedef TParametricCurve::Space::RealPoint RealPoint
 Real point type. More...
 
typedef std::vector< PointDigitalCurve
 Digital curve type. More...
 
typedef std::vector< std::pair< long double, unsigned int > > MetaData
 

Public Member Functions

 NaiveParametricCurveDigitizer3D ()
 
 ~NaiveParametricCurveDigitizer3D ()=default
 
 NaiveParametricCurveDigitizer3D (const NaiveParametricCurveDigitizer3D &other)=delete
 
NaiveParametricCurveDigitizer3Doperator= (const NaiveParametricCurveDigitizer3D &other)=delete
 
void attach (ConstAlias< TParametricCurve > p_curve)
 
void init (long double tmin, long double tmax, long double timeStep)
 
unsigned int setKNext (unsigned int knext)
 
void digitize (std::back_insert_iterator< DigitalCurve > inserter)
 
void digitize (std::back_insert_iterator< DigitalCurve > inserter, std::back_insert_iterator< MetaData > meta_inserter)
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 

Protected Attributes

DigitalCurve digitalCurve
 A storage of final integer points. More...
 
MetaData metaDataContainter
 A storage of final meta data (if requested) More...
 
bool metaData
 A flag used to decided if meta data should be stored and returned to the user. More...
 
const TParametricCurve * curve
 A pointer to the parameteric curve which is going to be digitized. More...
 
long double step
 the time step value More...
 
long double timeMin
 starting time (has to be lower than timeMax) More...
 
long double timeMax
 the time when the digitization should stop (has to be bigger than timeMin) More...
 
bool initOK
 A flag which is set to true if the initial paramters are correct. More...
 

Private Types

typedef DigitalCurve Buffer
 
typedef Buffer::const_iterator ConstIterator
 
typedef std::map< Point, std::pair< long double, unsigned int > > DataInfo
 

Private Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::C3DParametricCurve< TParametricCurve >))
 
bool is26Connected (const Point &x, const Point &y)
 
void syncData (ConstIterator bbegin, ConstIterator bend, DataInfo &weights)
 
void flashBuffers (Buffer &buffer, DataInfo &weights)
 
void updateMetaData (const Point &p, const RealPoint &pc, DataInfo &weights, long double t)
 
void cleanCurve ()
 
void cleanClosedPart ()
 

Private Attributes

unsigned int K_NEXT
 
unsigned int BUFFER_SIZE
 

Detailed Description

template<typename TParametricCurve>
class DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >

Aim: Digitization of 3D parametric curves. This method produces, for good parameters step and k_next, a 26-connected digital curves obtained from a digitization process of 3D parametric curves.

Description of class 'NaiveParametricCurveDigitizer3D'

Template Parameters
TParametricCurvea model of C3DParametricCurve
Todo:
The method cannot detect an optimal digitization time step, therefore, for curves of high curvature, the method can be very very slow due to the need of setting a tiny digitization step. Such a limitation is planned to be mitigated by splitting a curve into regions of different digitization step.

Definition at line 72 of file NaiveParametricCurveDigitizer3D.h.

Member Typedef Documentation

◆ Buffer

template<typename TParametricCurve>
typedef DigitalCurve DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::Buffer
private

Buffer type. A buffer is used during digitzation to store part of the output. The size of the bufffer is three times K_NEXT.

Definition at line 171 of file NaiveParametricCurveDigitizer3D.h.

◆ ConstIterator

template<typename TParametricCurve>
typedef Buffer::const_iterator DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::ConstIterator
private

A type representing a const iterator over Buffer.

Definition at line 176 of file NaiveParametricCurveDigitizer3D.h.

◆ DataInfo

template<typename TParametricCurve>
typedef std::map< Point, std::pair < long double, unsigned int > > DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::DataInfo
private

Type which defines storage of meta data related to an integer point. The final meta data required by the user are computed from the data stored in DataInfo.

Definition at line 182 of file NaiveParametricCurveDigitizer3D.h.

◆ DigitalCurve

template<typename TParametricCurve>
typedef std::vector<Point> DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::DigitalCurve

Digital curve type.

Definition at line 82 of file NaiveParametricCurveDigitizer3D.h.

◆ MetaData

template<typename TParametricCurve>
typedef std::vector< std::pair < long double, unsigned int > > DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::MetaData

MetaData type. The first field stores the time value at which the continuous curve is at the closest position to the corresponding integer point. This time value is evaluated with respect to the parameter timeStep (see documentation of the method NaiveParametricCurveDigitizer3D::init). The second information stores the number of times a given integer point was hit during the digitization.

Definition at line 89 of file NaiveParametricCurveDigitizer3D.h.

◆ Point

template<typename TParametricCurve>
typedef TParametricCurve::Space::Point DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::Point

Integer point type.

Definition at line 78 of file NaiveParametricCurveDigitizer3D.h.

◆ RealPoint

template<typename TParametricCurve>
typedef TParametricCurve::Space::RealPoint DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::RealPoint

Real point type.

Definition at line 80 of file NaiveParametricCurveDigitizer3D.h.

Constructor & Destructor Documentation

◆ NaiveParametricCurveDigitizer3D() [1/2]

template<typename TParametricCurve>
DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::NaiveParametricCurveDigitizer3D ( )

Constructor

◆ ~NaiveParametricCurveDigitizer3D()

template<typename TParametricCurve>
DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::~NaiveParametricCurveDigitizer3D ( )
default

Destructor.

◆ NaiveParametricCurveDigitizer3D() [2/2]

template<typename TParametricCurve>
DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::NaiveParametricCurveDigitizer3D ( const NaiveParametricCurveDigitizer3D< TParametricCurve > &  other)
delete

Copy constructor.

Parameters
otherthe object to clone. Forbidden by default.

Member Function Documentation

◆ attach()

template<typename TParametricCurve>
void DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::attach ( ConstAlias< TParametricCurve >  p_curve)
Parameters
p_curve- a paramtric curve realizing the model C3DParametricCurve

◆ BOOST_CONCEPT_ASSERT()

template<typename TParametricCurve>
DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::BOOST_CONCEPT_ASSERT ( (concepts::C3DParametricCurve< TParametricCurve >)  )
private

◆ cleanClosedPart()

template<typename TParametricCurve>
void DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::cleanClosedPart ( )
private

Final clean up of a closed curve at the possibly overlapping part.

◆ cleanCurve()

template<typename TParametricCurve>
void DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::cleanCurve ( )
private

Final clean up at the ends of the curve`

◆ digitize() [1/2]

template<typename TParametricCurve>
void DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::digitize ( std::back_insert_iterator< DigitalCurve inserter)
Parameters
inserterwritable iterator over a container which stores points of digitized curve

◆ digitize() [2/2]

template<typename TParametricCurve>
void DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::digitize ( std::back_insert_iterator< DigitalCurve inserter,
std::back_insert_iterator< MetaData meta_inserter 
)
Parameters
inserterwritable iterator over a container which stores points of digitized curve
meta_inserterwritable iterator over a container which stores meta information (t at which curve is closest to the integer point (wwith respect to timeStep), hit values) used during digitization.

◆ flashBuffers()

template<typename TParametricCurve>
void DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::flashBuffers ( Buffer buffer,
DataInfo weights 
)
private
Parameters
bufferreference to the buffer to be flashed
weightsremoves a part of the data corresponding to the buffer points but keeps part of the data that may still be needed.

◆ init()

template<typename TParametricCurve>
void DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::init ( long double  tmin,
long double  tmax,
long double  timeStep 
)
Parameters
tmin- starting time (has to be lower than tmax)
tmax- the time when the digitization should stop (has to be bigger than tmin)
timeStep- the digitization step

◆ is26Connected()

template<typename TParametricCurve>
bool DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::is26Connected ( const Point x,
const Point y 
)
private

Checks is two points are 26-connected

Parameters
xan integer point
yan integer point
Returns
true if x and y are 26-connected and false otherwise

◆ isValid()

template<typename TParametricCurve>
bool DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::isValid ( ) const

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.

◆ operator=()

template<typename TParametricCurve>
NaiveParametricCurveDigitizer3D& DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::operator= ( const NaiveParametricCurveDigitizer3D< TParametricCurve > &  other)
delete

Assignment.

Parameters
otherthe object to copy.
Returns
a reference on 'this'. Forbidden by default.

◆ selfDisplay()

template<typename TParametricCurve>
void DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::selfDisplay ( std::ostream &  out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.

◆ setKNext()

template<typename TParametricCurve>
unsigned int DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::setKNext ( unsigned int  knext)
Parameters
knext- the parameter used for scanning k points of the curve in order to fix possible connectivity issues. The default value is 5.
Returns
previous value of K_NEXT

◆ syncData()

template<typename TParametricCurve>
void DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::syncData ( ConstIterator  bbegin,
ConstIterator  bend,
DataInfo weights 
)
private

A method used to synchronized the final data with the buffer

Parameters
bbeginan iterator pointing at the beginning of the buffer
bendan iterator pointing at the end of the buffer
weightsa reference to the meta information used to construct the final curve.

◆ updateMetaData()

template<typename TParametricCurve>
void DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::updateMetaData ( const Point p,
const RealPoint pc,
DataInfo weights,
long double  t 
)
private

Checks if a closer point of the continuous curve to the integer point has been found and if so then the meta information are being updated.

Parameters
pan integer point
pca real point
weightsmeta data storage
tgiven time

Field Documentation

◆ BUFFER_SIZE

template<typename TParametricCurve>
unsigned int DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::BUFFER_SIZE
private

A variable which stores the buffer size. It is equl to 3 times K_NEXT.

Definition at line 193 of file NaiveParametricCurveDigitizer3D.h.

◆ curve

template<typename TParametricCurve>
const TParametricCurve* DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::curve
protected

A pointer to the parameteric curve which is going to be digitized.

Definition at line 209 of file NaiveParametricCurveDigitizer3D.h.

◆ digitalCurve

template<typename TParametricCurve>
DigitalCurve DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::digitalCurve
protected

A storage of final integer points.

Definition at line 203 of file NaiveParametricCurveDigitizer3D.h.

◆ initOK

template<typename TParametricCurve>
bool DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::initOK
protected

A flag which is set to true if the initial paramters are correct.

Definition at line 217 of file NaiveParametricCurveDigitizer3D.h.

◆ K_NEXT

template<typename TParametricCurve>
unsigned int DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::K_NEXT
private

This value is used during the local digitzation step. In general, we search for K_NEXT points and check if they are 26-connected. Also, the internal buffer size is defined as three times K_NEXT. The default value is 5.

Definition at line 188 of file NaiveParametricCurveDigitizer3D.h.

◆ metaData

template<typename TParametricCurve>
bool DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::metaData
protected

A flag used to decided if meta data should be stored and returned to the user.

Definition at line 207 of file NaiveParametricCurveDigitizer3D.h.

◆ metaDataContainter

template<typename TParametricCurve>
MetaData DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::metaDataContainter
protected

A storage of final meta data (if requested)

Definition at line 205 of file NaiveParametricCurveDigitizer3D.h.

◆ step

template<typename TParametricCurve>
long double DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::step
protected

the time step value

Definition at line 211 of file NaiveParametricCurveDigitizer3D.h.

◆ timeMax

template<typename TParametricCurve>
long double DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::timeMax
protected

the time when the digitization should stop (has to be bigger than timeMin)

Definition at line 215 of file NaiveParametricCurveDigitizer3D.h.

◆ timeMin

template<typename TParametricCurve>
long double DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::timeMin
protected

starting time (has to be lower than timeMax)

Definition at line 213 of file NaiveParametricCurveDigitizer3D.h.


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