DGtal  0.9.4beta
Public Types | Public Member Functions | Protected Attributes | Private Member Functions
DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity > Class Template Reference

#include <DGtal/geometry/curves/Naive3DDSSComputer.h>

Collaboration diagram for DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >:
[legend]

Public Types

typedef TInteger Integer
 
typedef std::pair< Integer, IntegerQuotient
 
typedef TIterator ConstIterator
 
typedef Naive3DDSSComputer< ConstIterator, TInteger, connectivity > Self
 
typedef Naive3DDSSComputer< ReverseIterator< ConstIterator >, TInteger, connectivity > Reverse
 
typedef IteratorCirculatorTraits< ConstIterator >::Value Point3d
 
typedef IteratorCirculatorTraits< ConstIterator >::Value Vector3d
 
typedef Point3d::Coordinate Coordinate
 
typedef DGtal::PointVector< 2, CoordinatePoint2d
 
typedef std::array< Quotient, 3 > PointR3d
 
typedef functors::Projector< SpaceND< 2, Coordinate > > Projector2d
 
typedef ConstIteratorAdapter< ConstIterator, Projector2d, Point2dIteratorAdapter
 
typedef DGtal::ArithmeticalDSSComputer< IteratorAdapter, TInteger, connectivity > ArithmeticalDSSComputer2d
 

Public Member Functions

 Naive3DDSSComputer ()
 
 Naive3DDSSComputer (const ConstIterator &it)
 
void init (const ConstIterator &it)
 
 Naive3DDSSComputer (const Naive3DDSSComputer &other)
 
Naive3DDSSComputeroperator= (const Naive3DDSSComputer &other)
 
Self getSelf () const
 
Reverse getReverse () const
 
bool isInDSS (const Point3d &aPoint) const
 
bool isInDSS (const ConstIterator &it) const
 
bool operator== (const Naive3DDSSComputer &other) const
 
bool operator!= (const Naive3DDSSComputer &other) const
 
 ~Naive3DDSSComputer ()
 
bool extendFront ()
 
bool isExtendableFront ()
 
void getParameters (Vector3d &direction, PointR3d &intercept, PointR3d &thickness) const
 
bool isValid () const
 
ConstIterator begin () const
 
ConstIterator end () const
 
const ArithmeticalDSSComputer2darithmeticalDSS2dXY () const
 
const ArithmeticalDSSComputer2darithmeticalDSS2dXZ () const
 
const ArithmeticalDSSComputer2darithmeticalDSS2dYZ () const
 
const ArithmeticalDSSComputer2darithmeticalDSS2d (Dimension i) const
 
bool validArithmeticalDSS2d (Dimension i) const
 
std::string className () const
 
void selfDisplay (std::ostream &out)
 

Protected Attributes

Projector2d myProjXY
 
Projector2d myProjXZ
 
Projector2d myProjYZ
 
ArithmeticalDSSComputer2d myXYalgo
 
ArithmeticalDSSComputer2d myXZalgo
 
ArithmeticalDSSComputer2d myYZalgo
 
bool blockXY
 
bool blockXZ
 
bool blockYZ
 
ConstIterator myBegin
 
ConstIterator myEnd
 

Private Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CInteger< TInteger >))
 
bool extendFront (ArithmeticalDSSComputer2d &DSS2D, bool &blocked)
 

Detailed Description

template<typename TIterator, typename TInteger, int connectivity = 8>
class DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >

Aim: Dynamic recognition of a 3d-digital straight segment (DSS)

Description of class 'Naive3DDSSComputer' model of CForwardSegmentComputer

Aim: This class is a wrapper around ArithmeticalDSSComputer that is devoted to the dynamic recognition of digital straight segments in 2D (DSS), along any sequence of digital points.

Naive3DDSSComputer projects 3d curve onto three orthogonal planes. Then each projection is segmented while using ArithmeticalDSSComputer, as long as at least two such segmentations along projected curves are valid. By valid we understand, there is no—at least—two 3d points which have same projection onto one of the orthogonal 2d planes.

Template Parameters
TIteratortype of iterator on 3d digital points, readable and forward.
TIntegertype of integers used for the computation of remainders, which is a model of CInteger.
connectivityof the projected DSS (simply 4-connected) curve or 8 for naive (simply 8-connected) curve (default). Corresponds to adjacency of 2d projections (see above). Notice that choosing 8-adjacency for each 2d projection onto orthogonal planes means that 3d curve is 26-connected. While 4-adjacency means that 3d curve is 6-connected.

This class is a model of CForwardSegmentComputer. It is also default constructible, copy constructible, assignable and equality comparable.

See also
exampleNaive3DDSSComputer.cpp
Examples:
geometry/curves/estimation/exampleLMST3D.cpp, and geometry/curves/exampleNaive3DDSSComputer.cpp.

Definition at line 97 of file Naive3DDSSComputer.h.

Member Typedef Documentation

template<typename TIterator, typename TInteger, int connectivity = 8>
typedef DGtal::ArithmeticalDSSComputer< IteratorAdapter, TInteger, connectivity > DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::ArithmeticalDSSComputer2d

2D arithmetical DSS recognition algorithm

Definition at line 127 of file Naive3DDSSComputer.h.

template<typename TIterator, typename TInteger, int connectivity = 8>
typedef TIterator DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::ConstIterator

Type of iterator, at least readable and forward.

Definition at line 107 of file Naive3DDSSComputer.h.

template<typename TIterator, typename TInteger, int connectivity = 8>
typedef Point3d::Coordinate DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::Coordinate

Type of 3d digital point coordinate.

Definition at line 117 of file Naive3DDSSComputer.h.

template<typename TIterator, typename TInteger, int connectivity = 8>
typedef TInteger DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::Integer

Type of integer, devoted to remainders (and intercepts)

Definition at line 103 of file Naive3DDSSComputer.h.

template<typename TIterator, typename TInteger, int connectivity = 8>
typedef ConstIteratorAdapter< ConstIterator, Projector2d, Point2d > DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::IteratorAdapter

Iterator over adapter.

Definition at line 125 of file Naive3DDSSComputer.h.

template<typename TIterator, typename TInteger, int connectivity = 8>
typedef DGtal::PointVector< 2, Coordinate > DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::Point2d

Type of 2d digital point.

Definition at line 119 of file Naive3DDSSComputer.h.

template<typename TIterator, typename TInteger, int connectivity = 8>
typedef IteratorCirculatorTraits< ConstIterator >::Value DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::Point3d

Type of 3d digital point.

Definition at line 113 of file Naive3DDSSComputer.h.

template<typename TIterator, typename TInteger, int connectivity = 8>
typedef std::array< Quotient, 3 > DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::PointR3d

Type of 3d rational point.

Definition at line 121 of file Naive3DDSSComputer.h.

template<typename TIterator, typename TInteger, int connectivity = 8>
typedef functors::Projector< SpaceND< 2, Coordinate > > DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::Projector2d

Adapter for iterators.

Definition at line 123 of file Naive3DDSSComputer.h.

template<typename TIterator, typename TInteger, int connectivity = 8>
typedef std::pair<Integer, Integer> DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::Quotient

Type which represent quotient of two integers first/second.

Definition at line 105 of file Naive3DDSSComputer.h.

template<typename TIterator, typename TInteger, int connectivity = 8>
typedef Naive3DDSSComputer< ReverseIterator< ConstIterator >,TInteger, connectivity > DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::Reverse

Reverse type.

Definition at line 111 of file Naive3DDSSComputer.h.

template<typename TIterator, typename TInteger, int connectivity = 8>
typedef Naive3DDSSComputer< ConstIterator, TInteger, connectivity > DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::Self

Self type.

Definition at line 109 of file Naive3DDSSComputer.h.

template<typename TIterator, typename TInteger, int connectivity = 8>
typedef IteratorCirculatorTraits< ConstIterator >::Value DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::Vector3d

Type of 3d digital vector.

Definition at line 115 of file Naive3DDSSComputer.h.

Constructor & Destructor Documentation

template<typename TIterator, typename TInteger, int connectivity = 8>
DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::Naive3DDSSComputer ( )

Default constructor. not valid

template<typename TIterator, typename TInteger, int connectivity = 8>
DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::Naive3DDSSComputer ( const ConstIterator it)

Constructor with initialisation

Parameters
itan iterator
See also
init
template<typename TIterator, typename TInteger, int connectivity = 8>
DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::Naive3DDSSComputer ( const Naive3DDSSComputer< TIterator, TInteger, connectivity > &  other)

Copy constructor.

Parameters
otherthe object to clone.
template<typename TIterator, typename TInteger, int connectivity = 8>
DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::~Naive3DDSSComputer ( )
inline

Destructor.

Definition at line 211 of file Naive3DDSSComputer.h.

211 {}

Member Function Documentation

template<typename TIterator, typename TInteger, int connectivity = 8>
const ArithmeticalDSSComputer2d& DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::arithmeticalDSS2d ( Dimension  i) const
Parameters
ithe axis orthogonal to the plane i = 0 -> YZ-plane i = 1 -> XZ-plane i = 2 -> XY-plane
Returns
a const-reference on the arithmetical DSS recognition algorithm along the plane orthogonal to the i-th axis.
template<typename TIterator, typename TInteger, int connectivity = 8>
const ArithmeticalDSSComputer2d& DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::arithmeticalDSS2dXY ( ) const
Returns
a const-reference on the arithmetical DSS recognition algorithm along the XY plane.
template<typename TIterator, typename TInteger, int connectivity = 8>
const ArithmeticalDSSComputer2d& DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::arithmeticalDSS2dXZ ( ) const
Returns
a const-reference on the arithmetical DSS recognition algorithm along the XZ plane.
template<typename TIterator, typename TInteger, int connectivity = 8>
const ArithmeticalDSSComputer2d& DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::arithmeticalDSS2dYZ ( ) const
Returns
a const-reference on the arithmetical DSS recognition algorithm along the YZ plane.
template<typename TIterator, typename TInteger, int connectivity = 8>
ConstIterator DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::begin ( ) const
Returns
begin iterator of the 3d DSS range.
template<typename TIterator, typename TInteger, int connectivity = 8>
DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::BOOST_CONCEPT_ASSERT ( (concepts::CInteger< TInteger >)  )
private
template<typename TIterator, typename TInteger, int connectivity = 8>
std::string DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::className ( ) const
Returns
the style name used for drawing this object.
template<typename TIterator, typename TInteger, int connectivity = 8>
ConstIterator DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::end ( ) const
Returns
end iterator of the 3d DSS range.
template<typename TIterator, typename TInteger, int connectivity = 8>
bool DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::extendFront ( )

Tests whether the current DSS can be extended at the front. Computes the parameters of the extended DSS if yes and adds the point to the current DSS in this case.

Returns
'true' if yes, 'false' otherwise.
template<typename TIterator, typename TInteger, int connectivity = 8>
bool DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::extendFront ( ArithmeticalDSSComputer2d DSS2D,
bool &  blocked 
)
private

Tests whether the current 2d-DSS can be extended at the front. Computes the parameters of the extended 2d-DSS if yes and adds the point to the current 2d-DSS in this case. Used internally to simplify extendFront().

Parameters
DSS2Dreference to 2d-DSSComputer
blockedreference to status of DSS2D updated if DSS2D cannot be extended at the front.
Returns
'true' if yes, 'false' otherwise.
template<typename TIterator, typename TInteger, int connectivity = 8>
void DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::getParameters ( Vector3d direction,
PointR3d intercept,
PointR3d thickness 
) const

Computes the parameters (direction, intercept, thickness) of the DSS

Parameters
directiondirection vector calculated from 2D valid DSS.
interceptintercept calculated from mu-parameters of 2D valid DSS.
thicknessthickness calculated from omega-parameters of 2D valid DSS.
template<typename TIterator, typename TInteger, int connectivity = 8>
Reverse DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::getReverse ( ) const
Returns
a default-constructed instance of Reverse.
template<typename TIterator, typename TInteger, int connectivity = 8>
Self DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::getSelf ( ) const
Returns
a default-constructed instance of Self.
template<typename TIterator, typename TInteger, int connectivity = 8>
void DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::init ( const ConstIterator it)

Initialisation.

Parameters
itan iterator
Examples:
geometry/curves/exampleNaive3DDSSComputer.cpp.
template<typename TIterator, typename TInteger, int connectivity = 8>
bool DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::isExtendableFront ( )

Tests whether the 3d DSS can be extended at the front.

Returns
'true' if yes, 'false' otherwise
template<typename TIterator, typename TInteger, int connectivity = 8>
bool DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::isInDSS ( const Point3d aPoint) const

Checks whether a point belongs to the DSS or not

Parameters
aPointthe point to be checked
Returns
'true' if yes, 'false' otherwise
template<typename TIterator, typename TInteger, int connectivity = 8>
bool DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::isInDSS ( const ConstIterator it) const

Checks whether a point belongs to the DSS or not

Parameters
itan iterator on the point to be checked
Returns
'true' if yes, 'false' otherwise
template<typename TIterator, typename TInteger, int connectivity = 8>
bool DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::isValid ( ) const

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.
template<typename TIterator, typename TInteger, int connectivity = 8>
bool DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::operator!= ( const Naive3DDSSComputer< TIterator, TInteger, connectivity > &  other) const

Difference operator.

Parameters
otherthe object to compare with.
Returns
'false' if equal 'true' otherwise
template<typename TIterator, typename TInteger, int connectivity = 8>
Naive3DDSSComputer& DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::operator= ( const Naive3DDSSComputer< TIterator, TInteger, connectivity > &  other)

Assignment.

Parameters
otherthe object to copy.
Returns
a reference on 'this'.
template<typename TIterator, typename TInteger, int connectivity = 8>
bool DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::operator== ( const Naive3DDSSComputer< TIterator, TInteger, connectivity > &  other) const

Equality operator.

Parameters
otherthe object to compare with.
Returns
'true' either if the leaning points perfectly match or if the first leaning points match to the last ones (same DSS scanned in the reverse way) and 'false' otherwise
template<typename TIterator, typename TInteger, int connectivity = 8>
void DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::selfDisplay ( std::ostream &  out)

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.
template<typename TIterator, typename TInteger, int connectivity = 8>
bool DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::validArithmeticalDSS2d ( Dimension  i) const
Parameters
ithe axis orthogonal to the plane i = 0 -> YZ-plane i = 1 -> XZ-plane i = 2 -> XY-plane
Returns
true if given 2D DSS along orthogonal axis is valid

Field Documentation

template<typename TIterator, typename TInteger, int connectivity = 8>
bool DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::blockXY
protected

Used internally to store information which 2d-arithemticalDSS should not be any more extended. This happened when two successive 3D points have same projections onto respective 2d plane.

Definition at line 349 of file Naive3DDSSComputer.h.

template<typename TIterator, typename TInteger, int connectivity = 8>
bool DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::blockXZ
protected

Definition at line 349 of file Naive3DDSSComputer.h.

template<typename TIterator, typename TInteger, int connectivity = 8>
bool DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::blockYZ
protected

Definition at line 349 of file Naive3DDSSComputer.h.

template<typename TIterator, typename TInteger, int connectivity = 8>
ConstIterator DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::myBegin
protected

begin and end iterators

Definition at line 352 of file Naive3DDSSComputer.h.

template<typename TIterator, typename TInteger, int connectivity = 8>
ConstIterator DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::myEnd
protected

Definition at line 352 of file Naive3DDSSComputer.h.

template<typename TIterator, typename TInteger, int connectivity = 8>
Projector2d DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::myProjXY
protected

Projector for XY-plane.

Definition at line 331 of file Naive3DDSSComputer.h.

template<typename TIterator, typename TInteger, int connectivity = 8>
Projector2d DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::myProjXZ
protected

Projector for XZ-plane.

Definition at line 333 of file Naive3DDSSComputer.h.

template<typename TIterator, typename TInteger, int connectivity = 8>
Projector2d DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::myProjYZ
protected

Projector for YZ-plane.

Definition at line 335 of file Naive3DDSSComputer.h.

template<typename TIterator, typename TInteger, int connectivity = 8>
ArithmeticalDSSComputer2d DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::myXYalgo
protected

2d-arithmeticalDSS recognition algorithms for XY-plane.

Definition at line 338 of file Naive3DDSSComputer.h.

template<typename TIterator, typename TInteger, int connectivity = 8>
ArithmeticalDSSComputer2d DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::myXZalgo
protected

2d-arithmeticalDSS recognition algorithms for XZ-plane.

Definition at line 340 of file Naive3DDSSComputer.h.

template<typename TIterator, typename TInteger, int connectivity = 8>
ArithmeticalDSSComputer2d DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::myYZalgo
protected

2d-arithmeticalDSS recognition algorithms for YZ-plane.

Definition at line 342 of file Naive3DDSSComputer.h.


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