DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes
DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger > Class Template Reference

#include <COBAGenericNaivePlane.h>

Collaboration diagram for DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >:
Collaboration graph
[legend]

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
< InternalInteger
MyIntegerComputer
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

 ~COBAGenericNaivePlane ()
 COBAGenericNaivePlane ()
 COBAGenericNaivePlane (const COBAGenericNaivePlane &other)
COBAGenericNaivePlaneoperator= (const COBAGenericNaivePlane &other)
MyIntegerComputeric () const
Dimension active () const
void clear ()
void init (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
template<typename Vector3D >
void getNormal (Vector3D &normal) 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 COBANaivePlane< Space,
InternalInteger
COBAComputer
typedef std::vector< Dimension >
::iterator 
AxisIterator
typedef std::vector< Dimension >
::const_iterator 
AxisConstIterator

Private Member Functions

 BOOST_CONCEPT_ASSERT ((CSpace< TSpace >))
 BOOST_CONCEPT_ASSERT ((CInteger< TInternalInteger >))
 BOOST_STATIC_ASSERT ((TSpace::dimension==3))

Private Attributes

std::vector< DimensionmyAxes
COBAComputer myComputers [3]
std::vector< Dimension_axesToErase

Detailed Description

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

Aim: A class that recognizes pieces of digital planes of given axis width. When the width is 1, it corresponds to naive planes. Contrary to COBANaivePlane, the axis is not specified at initialization of the object. This class uses three instances of COBANaivePlane, one per axis.

Description of template class 'COBAGenericNaivePlane'

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()). You may clear() it. 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 CPointPredicate (returns 'true' iff a point is within the current bounds).

Note on complexity: See COBANaivePlane. Although it uses three instances of COBANaivePlane, the recognition is not three times slower. Indeed, recognition stops quickly on bad axes.

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 the diameter.

Essentially a backport from ImaGene.

typedef SpaceND<3,int> Z3;
typedef COBAGenericNaivePlane< Z3, int64_t > NaivePlane;
NaivePlane plane;
plane.init( 100, 1, 1 ); // 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.

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

Definition at line 121 of file COBAGenericNaivePlane.h.


Member Typedef Documentation

template<typename TSpace, typename TInternalInteger>
typedef std::vector<Dimension>::const_iterator DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::AxisConstIterator
private

Definition at line 152 of file COBAGenericNaivePlane.h.

template<typename TSpace, typename TInternalInteger>
typedef std::vector<Dimension>::iterator DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::AxisIterator
private

Definition at line 151 of file COBAGenericNaivePlane.h.

template<typename TSpace, typename TInternalInteger>
typedef COBANaivePlane< Space, InternalInteger > DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::COBAComputer
private

Definition at line 150 of file COBAGenericNaivePlane.h.

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

Definition at line 141 of file COBAGenericNaivePlane.h.

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

Definition at line 142 of file COBAGenericNaivePlane.h.

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

Definition at line 143 of file COBAGenericNaivePlane.h.

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

Definition at line 134 of file COBAGenericNaivePlane.h.

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

Definition at line 145 of file COBAGenericNaivePlane.h.

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

Definition at line 136 of file COBAGenericNaivePlane.h.

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

Definition at line 135 of file COBAGenericNaivePlane.h.

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

Definition at line 137 of file COBAGenericNaivePlane.h.

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

Definition at line 131 of file COBAGenericNaivePlane.h.

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

Definition at line 132 of file COBAGenericNaivePlane.h.

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

Definition at line 133 of file COBAGenericNaivePlane.h.

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

Definition at line 146 of file COBAGenericNaivePlane.h.

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

Definition at line 130 of file COBAGenericNaivePlane.h.

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

Definition at line 144 of file COBAGenericNaivePlane.h.


Constructor & Destructor Documentation

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

Destructor.

Definition at line 45 of file COBAGenericNaivePlane.ih.

{ // Nothing to do.
}
template<typename TSpace , typename TInternalInteger >
DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::COBAGenericNaivePlane ( )
inline

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

See also:
init

Definition at line 52 of file COBAGenericNaivePlane.ih.

{ // Object is invalid
_axesToErase.reserve( 3 );
}
template<typename TSpace , typename TInternalInteger >
DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::COBAGenericNaivePlane ( const COBAGenericNaivePlane< TSpace, TInternalInteger > &  other)
inline

Copy constructor.

Parameters:
otherthe object to clone.

Definition at line 60 of file COBAGenericNaivePlane.ih.

References DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::_axesToErase, DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::myAxes, and DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::myComputers.

: myAxes( other.myAxes )
{
for ( AxisConstIterator it = myAxes.begin(), itE = myAxes.end();
it != itE; ++it )
myComputers[ *it ] = other.myComputers[ *it ];
_axesToErase.reserve( 3 );
}

Member Function Documentation

template<typename TSpace , typename TInternalInteger >
DGtal::Dimension DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::active ( ) const
inline
Returns:
an active axis (or the active axis when there is only one).

Definition at line 89 of file COBAGenericNaivePlane.ih.

{
ASSERT( myAxes.size() > 0 );
return myAxes[ 0 ];
}
template<typename TSpace, typename TInternalInteger>
ConstIterator DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::begin ( ) const
Returns:
a const iterator pointing on the first point stored in the current naive plane.
template<typename TSpace, typename TInternalInteger>
DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::BOOST_CONCEPT_ASSERT ( (CSpace< TSpace >)  )
private
template<typename TSpace, typename TInternalInteger>
DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::BOOST_CONCEPT_ASSERT ( (CInteger< TInternalInteger >)  )
private
template<typename TSpace, typename TInternalInteger>
DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::BOOST_STATIC_ASSERT ( (TSpace::dimension==3)  )
private
template<typename TSpace , typename TInternalInteger >
void DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::clear ( )
inline

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

Definition at line 108 of file COBAGenericNaivePlane.ih.

References DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::clear().

Referenced by DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::clear().

{
myAxes.clear();
for ( unsigned int i = 0; i < 3; ++i )
{
myAxes.push_back( i );
}
}
template<typename TSpace , typename TInternalInteger >
DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::Size DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::complexity ( ) const
inline
Returns:
the number of vertices/edges of the convex integer polygon of solutions.

Definition at line 171 of file COBAGenericNaivePlane.ih.

References DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::complexity().

Referenced by DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::complexity().

{
return myComputers[ active() ].complexity();
}
template<typename TSpace , typename TInternalInteger >
bool DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::empty ( ) const
inline
Returns:
'true' if and only if this object contains no point.

Definition at line 144 of file COBAGenericNaivePlane.ih.

References DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::empty().

Referenced by DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::empty().

{
return myComputers[ active() ].empty();
}
template<typename TSpace, typename TInternalInteger>
ConstIterator DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::end ( ) const
Returns:
a const iterator pointing after the last point stored in the current naive plane.
template<typename TSpace , typename TInternalInteger >
bool DGtal::COBAGenericNaivePlane< 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).

Definition at line 221 of file COBAGenericNaivePlane.ih.

{
ASSERT( isValid() );
unsigned int nbok = 0;
_axesToErase.clear();
for ( AxisConstIterator axIt = myAxes.begin(), axItE = myAxes.end();
axIt != axItE; ++axIt )
{
bool ok = myComputers[ *axIt ].extend( p );
if ( ! ok ) _axesToErase.push_back( *axIt );
else ++nbok;
}
if ( nbok != 0 ) // at least one is ok.
{ // if one is ok, we must remove ko ones from the list of active
// axes.
AxisIterator axIt = myAxes.begin();
for ( unsigned int i = 0; i < _axesToErase.size(); ++i )
{
while ( *axIt != _axesToErase[ i ] ) ++axIt;
axIt = myAxes.erase( axIt );
}
return true;
}
return false;
}
template<typename TSpace , typename TInternalInteger >
template<typename TInputIterator >
bool DGtal::COBAGenericNaivePlane< 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).

Definition at line 266 of file COBAGenericNaivePlane.ih.

{
BOOST_CONCEPT_ASSERT(( boost::InputIterator<TInputIterator> ));
ASSERT( isValid() );
unsigned int nbok = 0;
_axesToErase.clear();
for ( AxisConstIterator axIt = myAxes.begin(), axItE = myAxes.end();
axIt != axItE; ++axIt )
{
bool ok = myComputers[ *axIt ].extend( it, itE );
if ( ! ok ) _axesToErase.push_back( *axIt );
else ++nbok;
}
if ( nbok != 0 ) // at least one is ok.
{ // if one is ok, we must remove ko ones from the list of active
// axes.
AxisIterator axIt = myAxes.begin();
for ( unsigned int i = 0; i < _axesToErase.size(); ++i )
{
while ( *axIt != _axesToErase[ i ] ) ++axIt;
axIt = myAxes.erase( axIt );
}
return true;
}
return false;
}
template<typename TSpace , typename TInternalInteger >
bool DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::extendAsIs ( const Point p)
inline

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).

Definition at line 190 of file COBAGenericNaivePlane.ih.

{
ASSERT( isValid() );
unsigned int nbok = 0;
for ( AxisConstIterator it = myAxes.begin(), itE = myAxes.end();
it != itE; ++it )
{
nbok += myComputers[ *it ].operator()( p ) ? 1 : 0;
}
if ( nbok != 0 ) // at least one is ok.
{
for ( AxisIterator it = myAxes.begin(); it != myAxes.end(); )
// cannot put end() in variable, since end() moves when
// modifiying a vector.
{
bool ok = myComputers[ *it ].extendAsIs( p );
if ( ! ok )
it = myAxes.erase( *it );
else
++it;
}
ASSERT( ! myAxes.empty() );
return true;
}
return false;
}
template<typename TSpace , typename TInternalInteger >
void DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::getBounds ( double &  min,
double &  max 
) const
inline

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).

Definition at line 339 of file COBAGenericNaivePlane.ih.

References DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::getBounds().

Referenced by DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::getBounds().

{
myComputers[ active() ].getBounds( min, max );
}
template<typename TSpace , typename TInternalInteger >
template<typename Vector3D >
void DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::getNormal ( Vector3D &  normal) const
inline
Template Parameters:
Vector3Dany type T such that T.operator[](int i) returns a reference to a double. i ranges in 0,1,2.
Parameters:
(updates)the current normal vector

Definition at line 319 of file COBAGenericNaivePlane.ih.

References DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::getNormal().

Referenced by DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::getNormal().

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

Definition at line 330 of file COBAGenericNaivePlane.ih.

References DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::getUnitNormal().

Referenced by DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::getUnitNormal().

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

Definition at line 99 of file COBAGenericNaivePlane.ih.

References DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::ic().

Referenced by DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::ic().

{
return myComputers[ active() ].ic();
}
template<typename TSpace , typename TInternalInteger >
void DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::init ( InternalInteger  diameter,
InternalInteger  widthNumerator = NumberTraitsInternalInteger >::ONE,
InternalInteger  widthDenominator = NumberTraitsInternalInteger >::ONE 
)
inline

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:
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).

Definition at line 122 of file COBAGenericNaivePlane.ih.

{
clear();
for ( unsigned int i = 0; i < 3; ++i )
myComputers[ i ].init( i, diameter, widthNumerator, widthDenominator );
}
template<typename TSpace , typename TInternalInteger >
bool DGtal::COBAGenericNaivePlane< 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.

Definition at line 250 of file COBAGenericNaivePlane.ih.

{
ASSERT( isValid() );
unsigned int nbok = 0;
for ( AxisConstIterator it = myAxes.begin(), itE = myAxes.end();
it != itE; ++it )
{
nbok += myComputers[ *it ].isExtendable( p ) ? 1 : 0;
}
return nbok != 0;
}
template<typename TSpace , typename TInternalInteger >
template<typename TInputIterator >
bool DGtal::COBAGenericNaivePlane< 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.

Definition at line 298 of file COBAGenericNaivePlane.ih.

{
BOOST_CONCEPT_ASSERT(( boost::InputIterator<TInputIterator> ));
ASSERT( isValid() );
unsigned int nbok = 0;
for ( AxisConstIterator axIt = myAxes.begin(), axItE = myAxes.end();
axIt != axItE; ++axIt )
{
nbok += myComputers[ *axIt ].isExtendable( it, itE ) ? 1 : 0;
}
return nbok != 0;
}
template<typename TSpace , typename TInternalInteger >
bool DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::isValid ( ) const
inline

Checks the validity/consistency of the object.

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

Definition at line 392 of file COBAGenericNaivePlane.ih.

References DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::isValid().

Referenced by DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::isValid().

{
return myComputers[ active() ].isValid();
}
template<typename TSpace , typename TInternalInteger >
DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::Size DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::max_size ( ) const
inline

NB: std version.

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

Definition at line 153 of file COBAGenericNaivePlane.ih.

References DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::max_size().

Referenced by DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::max_size().

{
return myComputers[ active() ].max_size();
}
template<typename TSpace , typename TInternalInteger >
const DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::Point & DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::maximalPoint ( ) const
inline
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.

Definition at line 357 of file COBAGenericNaivePlane.ih.

References DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::maximalPoint().

Referenced by DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::maximalPoint().

{
}
template<typename TSpace , typename TInternalInteger >
DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::Size DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::maxSize ( ) const
inline

same as max_size

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

Definition at line 162 of file COBAGenericNaivePlane.ih.

{
return max_size();
}
template<typename TSpace , typename TInternalInteger >
const DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::Point & DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::minimalPoint ( ) const
inline
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.

Definition at line 348 of file COBAGenericNaivePlane.ih.

References DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::minimalPoint().

Referenced by DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::minimalPoint().

{
}
template<typename TSpace , typename TInternalInteger >
bool DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::operator() ( const Point p) const
inline

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

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

Definition at line 180 of file COBAGenericNaivePlane.ih.

{
return myComputers[ active() ].operator()( p );
}
template<typename TSpace , typename TInternalInteger >
DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger > & DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::operator= ( const COBAGenericNaivePlane< TSpace, TInternalInteger > &  other)
inline

Assignment.

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

Definition at line 73 of file COBAGenericNaivePlane.ih.

References DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::myAxes, and DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::myComputers.

{
if ( this != &other )
{
myAxes = other.myAxes;
for ( AxisConstIterator it = myAxes.begin(), itE = myAxes.end();
it != itE; ++it )
myComputers[ *it ] = other.myComputers[ *it ];
}
return *this;
}
template<typename TSpace , typename TInternalInteger >
void DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::selfDisplay ( std::ostream &  out) const
inline

Writes/Displays the object on an output stream.

Parameters:
outthe output stream where the object is written.

Definition at line 374 of file COBAGenericNaivePlane.ih.

{
double min, max;
double N[ 3 ];
out << "[COBAGenericNaivePlane";
for ( AxisConstIterator axIt = myAxes.begin(), axItE = myAxes.end();
axIt != axItE; ++axIt )
out << " " << myComputers[ *axIt ];
out << " ]";
}
template<typename TSpace , typename TInternalInteger >
DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::Size DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::size ( ) const
inline
Returns:
the number of distinct points in the current naive plane.

Definition at line 135 of file COBAGenericNaivePlane.ih.

References DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::size().

Referenced by DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::size().

{
return myComputers[ active() ].size();
}

Field Documentation

template<typename TSpace, typename TInternalInteger>
std::vector<Dimension> DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::_axesToErase
mutableprivate

Useful when erasing axes.

Definition at line 412 of file COBAGenericNaivePlane.h.

Referenced by DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::COBAGenericNaivePlane().

template<typename TSpace, typename TInternalInteger>
std::vector<Dimension> DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::myAxes
private

The list of active plane axes. Starts with {0,1,2}. At least one.

Definition at line 410 of file COBAGenericNaivePlane.h.

Referenced by DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::COBAGenericNaivePlane(), and DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::operator=().

template<typename TSpace, typename TInternalInteger>
COBAComputer DGtal::COBAGenericNaivePlane< TSpace, TInternalInteger >::myComputers[3]
private

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