DGtal 1.4.0
|
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>
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. | |
typedef TParametricCurve::Space::RealPoint | RealPoint |
Real point type. | |
typedef std::vector< Point > | DigitalCurve |
Digital curve type. | |
typedef std::vector< std::pair< long double, unsigned int > > | MetaData |
Public Member Functions | |
NaiveParametricCurveDigitizer3D () | |
~NaiveParametricCurveDigitizer3D ()=default | |
NaiveParametricCurveDigitizer3D (const NaiveParametricCurveDigitizer3D &other)=delete | |
NaiveParametricCurveDigitizer3D & | operator= (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. | |
MetaData | metaDataContainter |
A storage of final meta data (if requested) | |
bool | metaData |
A flag used to decided if meta data should be stored and returned to the user. | |
const TParametricCurve * | curve |
A pointer to the parameteric curve which is going to be digitized. | |
long double | step |
the time step value | |
long double | timeMin |
starting time (has to be lower than timeMax) | |
long double | timeMax |
the time when the digitization should stop (has to be bigger than timeMin) | |
bool | initOK |
A flag which is set to true if the initial paramters are correct. | |
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 |
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'
TParametricCurve | a model of C3DParametricCurve |
Definition at line 72 of file NaiveParametricCurveDigitizer3D.h.
|
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.
|
private |
A type representing a const iterator over Buffer.
Definition at line 176 of file NaiveParametricCurveDigitizer3D.h.
|
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.
typedef std::vector<Point> DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::DigitalCurve |
Digital curve type.
Definition at line 82 of file NaiveParametricCurveDigitizer3D.h.
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.
typedef TParametricCurve::Space::Point DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::Point |
Integer point type.
Definition at line 78 of file NaiveParametricCurveDigitizer3D.h.
typedef TParametricCurve::Space::RealPoint DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::RealPoint |
Real point type.
Definition at line 80 of file NaiveParametricCurveDigitizer3D.h.
DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::NaiveParametricCurveDigitizer3D | ( | ) |
Constructor
|
default |
Destructor.
|
delete |
Copy constructor.
other | the object to clone. Forbidden by default. |
void DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::attach | ( | ConstAlias< TParametricCurve > | p_curve | ) |
p_curve | - a paramtric curve realizing the model C3DParametricCurve |
|
private |
|
private |
Final clean up of a closed curve at the possibly overlapping part.
|
private |
Final clean up at the ends of the curve`
void DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::digitize | ( | std::back_insert_iterator< DigitalCurve > | inserter | ) |
inserter | writable iterator over a container which stores points of digitized curve |
void DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::digitize | ( | std::back_insert_iterator< DigitalCurve > | inserter, |
std::back_insert_iterator< MetaData > | meta_inserter ) |
inserter | writable iterator over a container which stores points of digitized curve |
meta_inserter | writable 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. |
|
private |
buffer | reference to the buffer to be flashed |
weights | removes a part of the data corresponding to the buffer points but keeps part of the data that may still be needed. |
void DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::init | ( | long double | tmin, |
long double | tmax, | ||
long double | timeStep ) |
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 |
|
private |
Checks is two points are 26-connected
x | an integer point |
y | an integer point |
bool DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::isValid | ( | ) | const |
Checks the validity/consistency of the object.
|
delete |
Assignment.
other | the object to copy. |
void DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::selfDisplay | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
unsigned int DGtal::NaiveParametricCurveDigitizer3D< TParametricCurve >::setKNext | ( | unsigned int | knext | ) |
knext | - the parameter used for scanning k points of the curve in order to fix possible connectivity issues. The default value is 5. |
|
private |
A method used to synchronized the final data with the buffer
bbegin | an iterator pointing at the beginning of the buffer |
bend | an iterator pointing at the end of the buffer |
weights | a reference to the meta information used to construct the final curve. |
|
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.
p | an integer point |
pc | a real point |
weights | meta data storage |
t | given time |
|
private |
A variable which stores the buffer size. It is equl to 3 times K_NEXT.
Definition at line 193 of file NaiveParametricCurveDigitizer3D.h.
|
protected |
A pointer to the parameteric curve which is going to be digitized.
Definition at line 209 of file NaiveParametricCurveDigitizer3D.h.
|
protected |
A storage of final integer points.
Definition at line 203 of file NaiveParametricCurveDigitizer3D.h.
|
protected |
A flag which is set to true if the initial paramters are correct.
Definition at line 217 of file NaiveParametricCurveDigitizer3D.h.
|
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.
|
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.
|
protected |
A storage of final meta data (if requested)
Definition at line 205 of file NaiveParametricCurveDigitizer3D.h.
|
protected |
the time step value
Definition at line 211 of file NaiveParametricCurveDigitizer3D.h.
|
protected |
the time when the digitization should stop (has to be bigger than timeMin)
Definition at line 215 of file NaiveParametricCurveDigitizer3D.h.
|
protected |
starting time (has to be lower than timeMax)
Definition at line 213 of file NaiveParametricCurveDigitizer3D.h.