DGtal  1.5.beta
DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger > Class Template Reference

Aim: A class that contains the COBA algorithm (Emilie Charrier, Lilian Buzer, DGCI2008) for recognizing pieces of digital planes of given axis width. When the width is 1, it corresponds to naive planes. The axis is specified at initialization of the object. More...

#include <DGtal/geometry/surfaces/COBANaivePlaneComputer.h>

Inheritance diagram for DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >:
[legend]

Data Structures

struct  State
 

Public Types

typedef TSpace Space
 
typedef Space::Point Point
 
typedef std::set< PointPointSet
 
typedef PointSet::size_type Size
 
typedef PointSet::const_iterator ConstIterator
 
typedef PointSet::iterator Iterator
 
typedef TInternalInteger InternalInteger
 
typedef IntegerComputer< InternalIntegerMyIntegerComputer
 
typedef ParallelStrip< Space, true, true > Primitive
 
typedef PointVector< 3, InternalIntegerIntegerVector3
 
typedef PointSet::const_iterator const_iterator
 
typedef PointSet::const_pointer const_pointer
 
typedef PointSet::const_reference const_reference
 
typedef PointSet::value_type value_type
 
typedef PointSet::difference_type difference_type
 
typedef PointSet::size_type size_type
 

Public Member Functions

 ~COBANaivePlaneComputer ()
 
 COBANaivePlaneComputer ()
 
 COBANaivePlaneComputer (const COBANaivePlaneComputer &other)
 
COBANaivePlaneComputeroperator= (const COBANaivePlaneComputer &other)
 
MyIntegerComputeric () const
 
void clear ()
 
void init (Dimension axis, InternalInteger diameter, InternalInteger widthNumerator=NumberTraits< InternalInteger >::ONE, InternalInteger widthDenominator=NumberTraits< InternalInteger >::ONE)
 
Size complexity () const
 
Size size () const
 
bool empty () const
 
ConstIterator begin () const
 
ConstIterator end () const
 
Size max_size () const
 
Size maxSize () const
 
bool operator() (const Point &p) const
 
bool extendAsIs (const Point &p)
 
bool extend (const Point &p)
 
bool isExtendable (const Point &p) const
 
template<typename TInputIterator >
bool extend (TInputIterator it, TInputIterator itE)
 
template<typename TInputIterator >
bool isExtendable (TInputIterator it, TInputIterator itE) const
 
Primitive primitive () const
 
template<typename Vector3D >
void getNormal (Vector3D &normal) const
 
const IntegerVector3exactNormal () const
 
template<typename Vector3D >
void getUnitNormal (Vector3D &normal) const
 
void getBounds (double &min, double &max) const
 
const PointminimalPoint () const
 
const PointmaximalPoint () const
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 

Private Types

typedef PointVector< 3, InternalIntegerInternalPoint3
 
typedef SpaceND< 2, InternalIntegerInternalSpace2
 
typedef InternalSpace2::Point InternalPoint2
 
typedef LatticePolytope2D< InternalSpace2ConvexPolygonZ2
 
typedef ConvexPolygonZ2::HalfSpace HalfSpace
 

Private Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CSpace< TSpace >))
 
 BOOST_CONCEPT_ASSERT ((concepts::CInteger< TInternalInteger >))
 
 BOOST_STATIC_ASSERT ((TSpace::dimension==3))
 
void computeCentroidAndNormal (State &state) const
 
void doubleCut (InternalPoint2 &grad, State &state) const
 
template<typename TInputIterator >
void computeMinMax (State &state, TInputIterator itB, TInputIterator itE) const
 
template<typename TInputIterator >
bool updateMinMax (State &state, TInputIterator itB, TInputIterator itE) const
 
bool checkPlaneWidth (const State &state) const
 
void computeGradient (InternalPoint2 &grad, const State &state) const
 

Private Attributes

Dimension myAxis
 
InternalInteger myG
 
InternalPoint2 myWidth
 
PointSet myPointSet
 
State myState
 
InternalInteger myCst1
 
InternalInteger myCst2
 
InternalInteger _v
 
State _state
 
InternalPoint2 _grad
 

Detailed Description

template<typename TSpace, typename TInternalInteger>
class DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >

Aim: A class that contains the COBA algorithm (Emilie Charrier, Lilian Buzer, DGCI2008) for recognizing pieces of digital planes of given axis width. When the width is 1, it corresponds to naive planes. The axis is specified at initialization of the object.

Description of template class 'COBANaivePlaneComputer'

As a (3D) geometric primitive, it obeys to a subset of the concept CSegmentComputer. It is copy constructible, assignable. It is iterable (inner type ConstIterator, begin(), end()). It has methods extend(), extend( InputIterator, InputIterator) and isExtendable(), isExtendable(InputIterator, InputIterator). The object stores all the distinct points p such that 'extend( p )' was successful. It is thus a model of boost::ForwardContainer (non mutable).

It is also a model of concepts::CPointPredicate (returns 'true' iff a point is within the current bounds).

Note on complexity: The complexity is highly dependent on the way points are added to the object. Let D be the diameter and n be the number of points already added. Assume small integers. Complexity of adding a point that do not change the normal of the plane is \( O(\log(n)) \). When it changes the normal, the number of cuts is upper bounded by some \( O(\log(D)) \), each cut costs \( O(n+m\log(D) ) \), where m is the number of sides of the convex polygon of constraints. However, when recognizing a piece of naive plane, the number of times K where the normal should be updated is rather limited to some \( O(\log(D)) \).

Note on execution times: The user should favor int64_t instead of BigInteger whenever possible (diameter smaller than 500). The speed-up is between 10 and 20 for these diameters. For greater diameters, it is necessary to use BigInteger (see below).

Template Parameters
TSpacespecifies the type of digital space in which lies input digital points. A model of CSpace.
TInternalIntegerspecifies the type of integer used in internal computations. The type should be able to hold integers of order (2*D^3)^2 if D is the diameter of the set of digital points. In practice, diameter is limited to 20 for int32_t, diameter is approximately 500 for int64_t, and whatever with BigInteger/GMP integers. For huge diameters, the slow-down is polylogarithmic with respect to the diameter.

Essentially a backport from ImaGene.

typedef SpaceND<3,int> Z3;
typedef COBANaivePlaneComputer< Z3, int64_t > NaivePlaneComputer;
plane.init( 2, 100, 1, 1 ); // axis is z, diameter is 100, width is 1/1 => naive
plane.extend( Point( 10, 0, 0 ) ); // return 'true'
plane.extend( Point( 0, 8, 0 ) ); // return 'true'
plane.extend( Point( 0, 0, 6 ) ); // return 'true'
plane.extend( Point( 5, 5, 5 ) ); // return 'false'
// There is no naive plane going through the 3 first points and the last one.
void init(Dimension axis, InternalInteger diameter, InternalInteger widthNumerator=NumberTraits< InternalInteger >::ONE, InternalInteger widthDenominator=NumberTraits< InternalInteger >::ONE)
COBANaivePlaneComputer< Z3, InternalInteger > NaivePlaneComputer
Space Z3
Definition: StdDefs.h:145

Model of boost::DefaultConstructible, boost::CopyConstructible, boost::Assignable, boost::ForwardContainer, concepts::CAdditivePrimitiveComputer, concepts::CPointPredicate.

Definition at line 129 of file COBANaivePlaneComputer.h.

Member Typedef Documentation

◆ const_iterator

template<typename TSpace , typename TInternalInteger >
typedef PointSet::const_iterator DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::const_iterator

Definition at line 151 of file COBANaivePlaneComputer.h.

◆ const_pointer

template<typename TSpace , typename TInternalInteger >
typedef PointSet::const_pointer DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::const_pointer

Definition at line 152 of file COBANaivePlaneComputer.h.

◆ const_reference

template<typename TSpace , typename TInternalInteger >
typedef PointSet::const_reference DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::const_reference

Definition at line 153 of file COBANaivePlaneComputer.h.

◆ ConstIterator

template<typename TSpace , typename TInternalInteger >
typedef PointSet::const_iterator DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::ConstIterator

Definition at line 142 of file COBANaivePlaneComputer.h.

◆ ConvexPolygonZ2

template<typename TSpace , typename TInternalInteger >
typedef LatticePolytope2D< InternalSpace2 > DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::ConvexPolygonZ2
private

Definition at line 163 of file COBANaivePlaneComputer.h.

◆ difference_type

template<typename TSpace , typename TInternalInteger >
typedef PointSet::difference_type DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::difference_type

Definition at line 155 of file COBANaivePlaneComputer.h.

◆ HalfSpace

template<typename TSpace , typename TInternalInteger >
typedef ConvexPolygonZ2::HalfSpace DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::HalfSpace
private

Definition at line 164 of file COBANaivePlaneComputer.h.

◆ IntegerVector3

template<typename TSpace , typename TInternalInteger >
typedef PointVector< 3, InternalInteger > DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::IntegerVector3

Definition at line 147 of file COBANaivePlaneComputer.h.

◆ InternalInteger

template<typename TSpace , typename TInternalInteger >
typedef TInternalInteger DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::InternalInteger

Definition at line 144 of file COBANaivePlaneComputer.h.

◆ InternalPoint2

template<typename TSpace , typename TInternalInteger >
typedef InternalSpace2::Point DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::InternalPoint2
private

Definition at line 162 of file COBANaivePlaneComputer.h.

◆ InternalPoint3

template<typename TSpace , typename TInternalInteger >
typedef PointVector< 3, InternalInteger > DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::InternalPoint3
private

Definition at line 160 of file COBANaivePlaneComputer.h.

◆ InternalSpace2

template<typename TSpace , typename TInternalInteger >
typedef SpaceND< 2, InternalInteger > DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::InternalSpace2
private

Definition at line 161 of file COBANaivePlaneComputer.h.

◆ Iterator

template<typename TSpace , typename TInternalInteger >
typedef PointSet::iterator DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::Iterator

Definition at line 143 of file COBANaivePlaneComputer.h.

◆ MyIntegerComputer

template<typename TSpace , typename TInternalInteger >
typedef IntegerComputer< InternalInteger > DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::MyIntegerComputer

Definition at line 145 of file COBANaivePlaneComputer.h.

◆ Point

template<typename TSpace , typename TInternalInteger >
typedef Space::Point DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::Point

Definition at line 139 of file COBANaivePlaneComputer.h.

◆ PointSet

template<typename TSpace , typename TInternalInteger >
typedef std::set< Point > DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::PointSet

Definition at line 140 of file COBANaivePlaneComputer.h.

◆ Primitive

template<typename TSpace , typename TInternalInteger >
typedef ParallelStrip<Space, true, true> DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::Primitive

Definition at line 146 of file COBANaivePlaneComputer.h.

◆ Size

template<typename TSpace , typename TInternalInteger >
typedef PointSet::size_type DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::Size

Definition at line 141 of file COBANaivePlaneComputer.h.

◆ size_type

template<typename TSpace , typename TInternalInteger >
typedef PointSet::size_type DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::size_type

Definition at line 156 of file COBANaivePlaneComputer.h.

◆ Space

template<typename TSpace , typename TInternalInteger >
typedef TSpace DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::Space

Definition at line 138 of file COBANaivePlaneComputer.h.

◆ value_type

template<typename TSpace , typename TInternalInteger >
typedef PointSet::value_type DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::value_type

Definition at line 154 of file COBANaivePlaneComputer.h.

Constructor & Destructor Documentation

◆ ~COBANaivePlaneComputer()

template<typename TSpace , typename TInternalInteger >
DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::~COBANaivePlaneComputer ( )

Destructor.

◆ COBANaivePlaneComputer() [1/2]

template<typename TSpace , typename TInternalInteger >
DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::COBANaivePlaneComputer ( )

Constructor. The object is not valid and should be initialized.

See also
init

◆ COBANaivePlaneComputer() [2/2]

template<typename TSpace , typename TInternalInteger >
DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::COBANaivePlaneComputer ( const COBANaivePlaneComputer< TSpace, TInternalInteger > &  other)

Copy constructor.

Parameters
otherthe object to clone.

Member Function Documentation

◆ begin()

template<typename TSpace , typename TInternalInteger >
ConstIterator DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::begin ( ) const
Returns
a const iterator pointing on the first point stored in the current naive plane.

Referenced by checkPlane(), checkPlaneGroupExtension(), and main().

◆ BOOST_CONCEPT_ASSERT() [1/2]

template<typename TSpace , typename TInternalInteger >
DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::BOOST_CONCEPT_ASSERT ( (concepts::CInteger< TInternalInteger >)  )
private

◆ BOOST_CONCEPT_ASSERT() [2/2]

template<typename TSpace , typename TInternalInteger >
DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::BOOST_CONCEPT_ASSERT ( (concepts::CSpace< TSpace >)  )
private

◆ BOOST_STATIC_ASSERT()

template<typename TSpace , typename TInternalInteger >
DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::BOOST_STATIC_ASSERT ( (TSpace::dimension==3)  )
private

◆ checkPlaneWidth()

template<typename TSpace , typename TInternalInteger >
bool DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::checkPlaneWidth ( const State state) const
private
Parameters
statethe state where the normal state.N, the scalars state.min and state.max are used in computations.
Returns
'true' if the current width along state.N (computed from the difference of state.max and state.min) is strictly inferior to the maximal specified width (in myWidth), 'false' otherwise.

◆ clear()

template<typename TSpace , typename TInternalInteger >
void DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::clear ( )

Clear the object, free memory. The plane keeps its main axis, diameter and width, but contains no point.

◆ complexity()

template<typename TSpace , typename TInternalInteger >
Size DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::complexity ( ) const
Returns
the number of vertices/edges of the convex integer polygon of solutions.

Referenced by checkGenericPlane(), and checkPlane().

◆ computeCentroidAndNormal()

template<typename TSpace , typename TInternalInteger >
void DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::computeCentroidAndNormal ( State state) const
private

Recompute centroid of polygon of solution and deduce the current normal vector. It is called after any modification of the convex polygon representing the set of solution.

Parameters
state(modified) the state where the fields state.cip are used in computation and where fields state.centroid and state.N are updated.

◆ computeGradient()

template<typename TSpace , typename TInternalInteger >
void DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::computeGradient ( InternalPoint2 grad,
const State state 
) const
private
Parameters
grad(updated) the value of a gradient used to cut the polygon of solutions.
statethe state where the iterators state.ptMin and state.ptMax are used in computations.

◆ computeMinMax()

template<typename TSpace , typename TInternalInteger >
template<typename TInputIterator >
void DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::computeMinMax ( State state,
TInputIterator  itB,
TInputIterator  itE 
) const
private

Computes the min and max values/arguments of the scalar product between the normal state.N and the points in the range [itB,itE). Overwrites state.min, state.max at the start.

Template Parameters
TInputIteratorany model of InputIterator.
Parameters
state(modified) the state where the normal N is used in computation and where fields state.min, state.max, state.ptMin, state.ptMax are updated.
itBan input iterator on the first point of the range.
itEan input iterator after the last point of the range.

◆ doubleCut()

template<typename TSpace , typename TInternalInteger >
void DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::doubleCut ( InternalPoint2 grad,
State state 
) const
private

Performs the double cut in parameter space according to the current gradient and width. The centroid and normals are no more valid (computeCentroidAndNormal should be called afterwards).

Parameters
grad(altered, but not modified) the gradient used to update the polygon of solutions state.cip.
state(modified) the state where the fields state.ptMin, state.ptMax, state.cip are used in computation and where field state.cip is updated.

◆ empty()

template<typename TSpace , typename TInternalInteger >
bool DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::empty ( ) const
Returns
'true' if and only if this object contains no point.

◆ end()

template<typename TSpace , typename TInternalInteger >
ConstIterator DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::end ( ) const
Returns
a const iterator pointing after the last point stored in the current naive plane.

Referenced by checkPlane(), checkPlaneGroupExtension(), and main().

◆ exactNormal()

template<typename TSpace , typename TInternalInteger >
const IntegerVector3& DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::exactNormal ( ) const
Returns
a reference to the current normal vector (exact form).

◆ extend() [1/2]

template<typename TSpace , typename TInternalInteger >
bool DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::extend ( const Point p)

Adds the point p and checks if we have still a digital plane of specified width. The plane parameters may be updated so as to include the new point.

Parameters
pany 3D point (in the specified diameter).
Returns
'true' if it is still a plane, 'false' otherwise (the object is then in its original state).

Referenced by checkGenericPlane(), checkPlane(), checkPlaneGroupExtension(), main(), testChordNaivePlaneComputer(), and testCOBANaivePlaneComputer().

◆ extend() [2/2]

template<typename TSpace , typename TInternalInteger >
template<typename TInputIterator >
bool DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::extend ( TInputIterator  it,
TInputIterator  itE 
)

Adds the range of points [it, itE) and checks if we have still a digital plane of specified width. The plane parameters may be updated so as to include all the new points. All points pointed by iterators should be in the diameter of this object.

Template Parameters
TInputIteratorany model of InputIterator on Point.
Parameters
itan iterator on the first element of the range of 3D points.
itEan iterator after the last element of the range of 3D points.
Returns
'true' if it is still a plane, 'false' otherwise (the object is then in its original state).

◆ extendAsIs()

template<typename TSpace , typename TInternalInteger >
bool DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::extendAsIs ( const Point p)

Adds the point p to this plane if it is within the current bounds. The plane parameters are not updated.

Parameters
pany 3D point (in the specified diameter).
Returns
'true' if p is in the plane, 'false' otherwise (the object is then in its original state).

◆ getBounds()

template<typename TSpace , typename TInternalInteger >
void DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::getBounds ( double &  min,
double &  max 
) const

If n is the unit normal to the current plane, then n.x >= min and n.x <= max are the two half-planes defining it.

Parameters
minthe lower bound (corresponding to the unit vector).
maxthe upper bound (corresponding to the unit vector).

◆ getNormal()

template<typename TSpace , typename TInternalInteger >
template<typename Vector3D >
void DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::getNormal ( Vector3D &  normal) const
Template Parameters
Vector3Dany type T such that T.operator[](int i) returns a reference to a double. i ranges in 0,1,2.
Parameters
[in,out]normalthe current normal vector

◆ getUnitNormal()

template<typename TSpace , typename TInternalInteger >
template<typename Vector3D >
void DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::getUnitNormal ( Vector3D &  normal) const
Template Parameters
Vector3Dany type T such that T.operator[](int i) returns a reference to a double. i ranges in 0,1,2.
Parameters
[in,out]normal(updates) the current unit normal vector

◆ ic()

template<typename TSpace , typename TInternalInteger >
MyIntegerComputer& DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::ic ( ) const
Returns
the object that performs integer calculation.

◆ init()

template<typename TSpace , typename TInternalInteger >
void DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::init ( Dimension  axis,
InternalInteger  diameter,
InternalInteger  widthNumerator = NumberTraitsInternalInteger >::ONE,
InternalInteger  widthDenominator = NumberTraitsInternalInteger >::ONE 
)

All these parameters cannot be changed during the process. After this call, the object is in a consistent state and can accept new points for recognition. Calls clear so that the object is ready to be extended.

Parameters
axisthe main axis (0,1,2) for x, y or z.
diameterthe diameter for the set of points (maximum distance between the given points)
widthNumeratorthe maximal axis-width (x,y,or z) for the plane is defined as the rational number widthNumerator / widthDenominator (default is 1/1, i.e. naive plane).
widthDenominatorthe maximal axis-width (x,y,or z) for the plane is defined as the rational number widthNumerator / widthDenominator (default is 1/1, i.e. naive plane).

Referenced by checkGenericPlane(), checkPlane(), checkPlaneGroupExtension(), main(), testChordNaivePlaneComputer(), and testCOBANaivePlaneComputer().

◆ isExtendable() [1/2]

template<typename TSpace , typename TInternalInteger >
bool DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::isExtendable ( const Point p) const

Checks if we have still a digital plane of specified width when adding point p. The object is left unchanged whatever the returned value. The invariant is 'this->isExtendable( p ) == true <=> this->extend( p ) == true'.

Parameters
pany 3D point (in the specified diameter).
Returns
'true' if this is still a plane, 'false' otherwise.

Referenced by checkPlane(), and checkPlaneGroupExtension().

◆ isExtendable() [2/2]

template<typename TSpace , typename TInternalInteger >
template<typename TInputIterator >
bool DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::isExtendable ( TInputIterator  it,
TInputIterator  itE 
) const

Checks if we have still a digital plane of specified width when adding the range of points [it, itE). The object is left unchanged whatever the returned value. All points pointed by iterators should be in the diameter of this object. The invariant is 'this->isExtendable( it, itE ) == true <=> this->extend( it, itE ) == true'.

Template Parameters
TInputIteratorany model of InputIterator on Point.
Parameters
itan iterator on the first element of the range of 3D points.
itEan iterator after the last element of the range of 3D points.
Returns
'true' if this is still a plane, 'false' otherwise.

◆ isValid()

template<typename TSpace , typename TInternalInteger >
bool DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::isValid ( ) const

Checks the validity/consistency of the object.

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

◆ max_size()

template<typename TSpace , typename TInternalInteger >
Size DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::max_size ( ) const

NB: std version.

Returns
the maximal allowed number of points in the current naive plane.
See also
maxSize

◆ maximalPoint()

template<typename TSpace , typename TInternalInteger >
const Point& DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::maximalPoint ( ) const
Precondition
! empty()
Returns
the current maximal point of the plane, i.e. the one with the highest scalar product with the current normal vector. Note that other points may also have a maximum value.

◆ maxSize()

template<typename TSpace , typename TInternalInteger >
Size DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::maxSize ( ) const

same as max_size

Returns
the maximal allowed number of points in the current naive plane.

◆ minimalPoint()

template<typename TSpace , typename TInternalInteger >
const Point& DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::minimalPoint ( ) const
Precondition
! empty()
Returns
the current minimal point of the plane, i.e. the one with the smallest scalar product with the current normal vector. Note that other points may also have a minimum value.

◆ operator()()

template<typename TSpace , typename TInternalInteger >
bool DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::operator() ( const Point p) const

Checks if the point p is in the current digital plane. Therefore, a COBANaivePlaneComputer is a model of concepts::CPointPredicate.

Parameters
pany 3D point.
Returns
'true' if it is in the current plane, false otherwise.

◆ operator=()

template<typename TSpace , typename TInternalInteger >
COBANaivePlaneComputer& DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::operator= ( const COBANaivePlaneComputer< TSpace, TInternalInteger > &  other)

Assignment.

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

◆ primitive()

template<typename TSpace , typename TInternalInteger >
Primitive DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::primitive ( ) const
Returns
the current primitive recognized by this computer, which is a ParallelStrip of axis width smaller than the one specified at instanciation.
Note
The returned primitive has the form \(\mu \le \vec{N} \cdot \vec{X} \le \mu + \epsilon\). It is guaranteed that its axis width is strictly less than the value widthNumerator / widthDenominator specified with method init.

◆ selfDisplay()

template<typename TSpace , typename TInternalInteger >
void DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::selfDisplay ( std::ostream &  out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.

◆ size()

template<typename TSpace , typename TInternalInteger >
Size DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::size ( ) const
Returns
the number of distinct points in the current naive plane.

Referenced by main().

◆ updateMinMax()

template<typename TSpace , typename TInternalInteger >
template<typename TInputIterator >
bool DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::updateMinMax ( State state,
TInputIterator  itB,
TInputIterator  itE 
) const
private

Updates the min and max values/arguments of the scalar product between the normal state.N and the points in the range [itB,itE). Do not overwrite state.min, state.max at the start.

Template Parameters
TInputIteratorany model of InputIterator.
Parameters
state(modified) the state where the normal N is used in computation and where fields state.min, state.max, state.ptMin, state.ptMax are updated.
itBan input iterator on the first point of the range.
itEan input iterator after the last point of the range.
Returns
'true' if any of the fields state.min, state.max, state.ptMin, state.ptMax have been updated, 'false' otherwise.

Field Documentation

◆ _grad

template<typename TSpace , typename TInternalInteger >
InternalPoint2 DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::_grad
mutableprivate

temporary variable to store the current gradient.

Definition at line 464 of file COBANaivePlaneComputer.h.

◆ _state

template<typename TSpace , typename TInternalInteger >
State DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::_state
mutableprivate

Temporary state used in computations.

Definition at line 463 of file COBANaivePlaneComputer.h.

◆ _v

template<typename TSpace , typename TInternalInteger >
InternalInteger DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::_v
mutableprivate

temporary variable used in computations.

Definition at line 462 of file COBANaivePlaneComputer.h.

◆ myAxis

template<typename TSpace , typename TInternalInteger >
Dimension DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::myAxis
private

the main axis used in all subsequent computations.

Definition at line 455 of file COBANaivePlaneComputer.h.

◆ myCst1

template<typename TSpace , typename TInternalInteger >
InternalInteger DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::myCst1
private

( (int) ceil( get_si( myG ) * myWidth ) + 1 ).

Definition at line 460 of file COBANaivePlaneComputer.h.

◆ myCst2

template<typename TSpace , typename TInternalInteger >
InternalInteger DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::myCst2
private

( (int) floor( get_si( myG ) * myWidth ) - 1 ).

Definition at line 461 of file COBANaivePlaneComputer.h.

◆ myG

template<typename TSpace , typename TInternalInteger >
InternalInteger DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::myG
private

the grid step used in all subsequent computations.

Definition at line 456 of file COBANaivePlaneComputer.h.

◆ myPointSet

template<typename TSpace , typename TInternalInteger >
PointSet DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::myPointSet
private

the set of points within the plane.

Definition at line 458 of file COBANaivePlaneComputer.h.

◆ myState

template<typename TSpace , typename TInternalInteger >
State DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::myState
private

the current state that defines the plane being recognized.

Definition at line 459 of file COBANaivePlaneComputer.h.

◆ myWidth

template<typename TSpace , typename TInternalInteger >
InternalPoint2 DGtal::COBANaivePlaneComputer< TSpace, TInternalInteger >::myWidth
private

the plane width as a positive rational number myWidth[0]/myWidth[1]

Definition at line 457 of file COBANaivePlaneComputer.h.


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