DGtal 1.4.0
Loading...
Searching...
No Matches
DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity > Class Template Reference

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

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

Public Types

typedef TInteger Integer
 Type of integer, devoted to remainders (and intercepts)
 
typedef std::pair< Integer, IntegerQuotient
 Type which represent quotient of two integers first/second.
 
typedef TIterator ConstIterator
 Type of iterator, at least readable and forward.
 
typedef Naive3DDSSComputer< ConstIterator, TInteger, connectivity > Self
 Self type.
 
typedef Naive3DDSSComputer< ReverseIterator< ConstIterator >, TInteger, connectivity > Reverse
 Reverse type.
 
typedef IteratorCirculatorTraits< ConstIterator >::Value Point3d
 Type of 3d digital point.
 
typedef IteratorCirculatorTraits< ConstIterator >::Value Vector3d
 Type of 3d digital vector.
 
typedef Point3d::Coordinate Coordinate
 Type of 3d digital point coordinate.
 
typedef DGtal::PointVector< 2, CoordinatePoint2d
 Type of 2d digital point.
 
typedef std::array< Quotient, 3 > PointR3d
 Type of 3d rational point.
 
typedef functors::Projector< SpaceND< 2, Coordinate > > Projector2d
 Adapter for iterators.
 
typedef ConstIteratorAdapter< ConstIterator, Projector2d, Point2dIteratorAdapter
 Iterator over adapter.
 
typedef DGtal::ArithmeticalDSSComputer< IteratorAdapter, TInteger, connectivity > ArithmeticalDSSComputer2d
 2D arithmetical DSS recognition algorithm
 

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
 Projector for XY-plane.
 
Projector2d myProjXZ
 Projector for XZ-plane.
 
Projector2d myProjYZ
 Projector for YZ-plane.
 
ArithmeticalDSSComputer2d myXYalgo
 2d-arithmeticalDSS recognition algorithms for XY-plane.
 
ArithmeticalDSSComputer2d myXZalgo
 2d-arithmeticalDSS recognition algorithms for XZ-plane.
 
ArithmeticalDSSComputer2d myYZalgo
 2d-arithmeticalDSS recognition algorithms for YZ-plane.
 
bool blockXY
 
bool blockXZ
 
bool blockYZ
 
ConstIterator myBegin
 begin and end iterators
 
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/exampleNaive3DDSSComputer.cpp.

Definition at line 97 of file Naive3DDSSComputer.h.

Member Typedef Documentation

◆ ArithmeticalDSSComputer2d

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.

◆ ConstIterator

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.

◆ Coordinate

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.

◆ Integer

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.

◆ IteratorAdapter

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.

◆ Point2d

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.

◆ Point3d

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.

◆ PointR3d

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.

◆ Projector2d

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.

◆ Quotient

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.

◆ Reverse

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.

◆ Self

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.

◆ Vector3d

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

◆ Naive3DDSSComputer() [1/3]

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

Default constructor. not valid

◆ Naive3DDSSComputer() [2/3]

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

◆ Naive3DDSSComputer() [3/3]

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.

◆ ~Naive3DDSSComputer()

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

◆ arithmeticalDSS2d()

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.

◆ arithmeticalDSS2dXY()

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.

◆ arithmeticalDSS2dXZ()

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.

◆ arithmeticalDSS2dYZ()

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.

◆ begin()

template<typename TIterator , typename TInteger , int connectivity = 8>
ConstIterator DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::begin ( ) const
Returns
begin iterator of the 3d DSS range.

◆ BOOST_CONCEPT_ASSERT()

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

◆ className()

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.

◆ end()

template<typename TIterator , typename TInteger , int connectivity = 8>
ConstIterator DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::end ( ) const
Returns
end iterator of the 3d DSS range.

◆ extendFront() [1/2]

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.

◆ extendFront() [2/2]

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.

◆ getParameters()

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.

◆ getReverse()

template<typename TIterator , typename TInteger , int connectivity = 8>
Reverse DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::getReverse ( ) const
Returns
a default-constructed instance of Reverse.

◆ getSelf()

template<typename TIterator , typename TInteger , int connectivity = 8>
Self DGtal::Naive3DDSSComputer< TIterator, TInteger, connectivity >::getSelf ( ) const
Returns
a default-constructed instance of Self.

◆ init()

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.

Referenced by main().

◆ isExtendableFront()

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

◆ isInDSS() [1/2]

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

◆ isInDSS() [2/2]

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

◆ isValid()

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.

◆ operator!=()

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

◆ operator=()

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

◆ operator==()

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

◆ selfDisplay()

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.

◆ validArithmeticalDSS2d()

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

◆ blockXY

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.

◆ blockXZ

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

Definition at line 349 of file Naive3DDSSComputer.h.

◆ blockYZ

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

Definition at line 349 of file Naive3DDSSComputer.h.

◆ myBegin

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.

◆ myEnd

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

Definition at line 352 of file Naive3DDSSComputer.h.

◆ myProjXY

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.

◆ myProjXZ

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.

◆ myProjYZ

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.

◆ myXYalgo

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.

◆ myXZalgo

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.

◆ myYZalgo

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: