DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Protected Attributes
DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity > Class Template Reference

#include <ArithmeticalDSS3d.h>

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

Public Types

typedef TInteger Integer
typedef TIterator ConstIterator
typedef ArithmeticalDSS3d
< ConstIterator, TInteger,
connectivity > 
Self
typedef ArithmeticalDSS3d
< ReverseIterator
< ConstIterator >, TInteger,
connectivity > 
Reverse
typedef
IteratorCirculatorTraits
< ConstIterator >::Value 
Point3d
typedef
IteratorCirculatorTraits
< ConstIterator >::Value 
Vector3d
typedef Point3d::Coordinate Coordinate
typedef DGtal::PointVector
< 2, Coordinate
Point2d
typedef DGtal::PointVector
< 2, Coordinate
Vector2d
typedef DGtal::PointVector
< 2, double > 
PointD2d
typedef DGtal::PointVector
< 3, double > 
PointD3d
typedef DGtal::PointVector
< 3, double > 
VectorD3d
typedef Projector< SpaceND
< 2, Coordinate > > 
Projector2d
typedef ConstIteratorAdapter
< ConstIterator, Projector2d,
Point2d
IteratorAdapter
typedef DGtal::ArithmeticalDSS
< IteratorAdapter, TInteger,
connectivity > 
ArithmeticalDSS2d

Public Member Functions

 BOOST_CONCEPT_ASSERT ((CInteger< TInteger >))
 ArithmeticalDSS3d ()
 ArithmeticalDSS3d (const ConstIterator &it)
void init (const ConstIterator &it)
 ArithmeticalDSS3d (const ArithmeticalDSS3d &other)
ArithmeticalDSS3doperator= (const ArithmeticalDSS3d &other)
Self getSelf () const
Reverse getReverse () const
bool operator== (const ArithmeticalDSS3d &other) const
bool operator!= (const ArithmeticalDSS3d &other) const
 ~ArithmeticalDSS3d ()
bool extendForward ()
bool isExtendableForward ()
void getParameters (Vector3d &direction, PointD3d &intercept, PointD3d &thickness) const
bool isValid () const
ConstIterator begin () const
ConstIterator end () const
std::string className () const
void selfDisplay (std::ostream &out)

Protected Attributes

Projector2d myProjXY
Projector2d myProjXZ
Projector2d myProjYZ
ArithmeticalDSS2d myXYalgo
ArithmeticalDSS2d myXZalgo
ArithmeticalDSS2d myYZalgo
ConstIterator myBegin
ConstIterator myEnd

Detailed Description

template<typename TIterator, typename TInteger, int connectivity>
class DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >

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

Description of class 'ArithmeticalDSS3d'

Definition at line 74 of file ArithmeticalDSS3d.h.


Member Typedef Documentation

template<typename TIterator, typename TInteger, int connectivity>
typedef DGtal::ArithmeticalDSS<IteratorAdapter,TInteger,connectivity> DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::ArithmeticalDSS2d

Definition at line 111 of file ArithmeticalDSS3d.h.

template<typename TIterator, typename TInteger, int connectivity>
typedef TIterator DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::ConstIterator

Definition at line 87 of file ArithmeticalDSS3d.h.

template<typename TIterator, typename TInteger, int connectivity>
typedef Point3d::Coordinate DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::Coordinate

Definition at line 95 of file ArithmeticalDSS3d.h.

template<typename TIterator, typename TInteger, int connectivity>
typedef TInteger DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::Integer

Definition at line 83 of file ArithmeticalDSS3d.h.

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

Definition at line 107 of file ArithmeticalDSS3d.h.

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

Definition at line 97 of file ArithmeticalDSS3d.h.

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

Definition at line 93 of file ArithmeticalDSS3d.h.

template<typename TIterator, typename TInteger, int connectivity>
typedef DGtal::PointVector<2,double> DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::PointD2d

Definition at line 100 of file ArithmeticalDSS3d.h.

template<typename TIterator, typename TInteger, int connectivity>
typedef DGtal::PointVector<3,double> DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::PointD3d

Definition at line 101 of file ArithmeticalDSS3d.h.

template<typename TIterator, typename TInteger, int connectivity>
typedef Projector<SpaceND<2,Coordinate> > DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::Projector2d

Definition at line 105 of file ArithmeticalDSS3d.h.

template<typename TIterator, typename TInteger, int connectivity>
typedef ArithmeticalDSS3d<ReverseIterator<ConstIterator>,TInteger,connectivity> DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::Reverse

Definition at line 89 of file ArithmeticalDSS3d.h.

template<typename TIterator, typename TInteger, int connectivity>
typedef ArithmeticalDSS3d<ConstIterator,TInteger,connectivity> DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::Self

Definition at line 88 of file ArithmeticalDSS3d.h.

template<typename TIterator, typename TInteger, int connectivity>
typedef DGtal::PointVector<2,Coordinate> DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::Vector2d

Definition at line 98 of file ArithmeticalDSS3d.h.

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

Definition at line 94 of file ArithmeticalDSS3d.h.

template<typename TIterator, typename TInteger, int connectivity>
typedef DGtal::PointVector<3,double> DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::VectorD3d

Definition at line 102 of file ArithmeticalDSS3d.h.


Constructor & Destructor Documentation

template<typename TIterator , typename TInteger , int connectivity>
DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::ArithmeticalDSS3d ( )
inline

Default constructor. not valid

Definition at line 52 of file ArithmeticalDSS3d.ih.

{
//projections
std::vector<DGtal::Dimension> v1,v2,v3;
v1.push_back(0);
v1.push_back(1);
v2.push_back(0);
v2.push_back(2);
v3.push_back(1);
v3.push_back(2);
myProjXY.init(v1.begin(),v1.end());
myProjXZ.init(v2.begin(),v2.end());
myProjYZ.init(v3.begin(),v3.end());
}
template<typename TIterator , typename TInteger , int connectivity>
DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::ArithmeticalDSS3d ( const ConstIterator it)
inline

Constructor with initialisation

Parameters:
itan iterator
See also:
init

Constructor with initialisation

Definition at line 75 of file ArithmeticalDSS3d.ih.

{
//projections
std::vector<DGtal::Dimension> v1,v2,v3;
v1.push_back(0);
v1.push_back(1);
v2.push_back(0);
v2.push_back(2);
v3.push_back(1);
v3.push_back(2);
myProjXY.init(v1.begin(),v1.end());
myProjXZ.init(v2.begin(),v2.end());
myProjYZ.init(v3.begin(),v3.end());
init(it);
}
template<typename TIterator , typename TInteger , int connectivity>
DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::ArithmeticalDSS3d ( const ArithmeticalDSS3d< TIterator, TInteger, connectivity > &  other)
inline

Copy constructor.

Parameters:
otherthe object to clone.

Copy constructor.

Parameters:
otherthe object to clone. Forbidden by default.

Definition at line 127 of file ArithmeticalDSS3d.ih.

:
myBegin(other.myBegin), myEnd(other.myEnd) {}
template<typename TIterator, typename TInteger, int connectivity>
DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::~ArithmeticalDSS3d ( )
inline

Destructor.

Definition at line 184 of file ArithmeticalDSS3d.h.

{};

Member Function Documentation

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

Definition at line 275 of file ArithmeticalDSS3d.ih.

Referenced by DGtal::Display3DFactory::drawAsBoundingBox(), and DGtal::Display3DFactory::drawAsPoints().

{
return myBegin;
}
template<typename TIterator, typename TInteger, int connectivity>
DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::BOOST_CONCEPT_ASSERT ( (CInteger< TInteger >)  )
template<typename TIterator , typename TInteger , int connectivity>
std::string DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::className ( ) const
inline
Returns:
the style name used for drawing this object.

Definition at line 408 of file ArithmeticalDSS3d.ih.

Referenced by DGtal::Display3DFactory::draw().

{
return "ArithmeticalDSS3d";
}
template<typename TIterator , typename TInteger , int connectivity>
TIterator DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::end ( ) const
inline
Returns:
end iterator of the 3d DSS range.

Definition at line 282 of file ArithmeticalDSS3d.ih.

Referenced by DGtal::Display3DFactory::drawAsBoundingBox(), and DGtal::Display3DFactory::drawAsPoints().

{
return myEnd;
}
template<typename TIterator , typename TInteger , int connectivity>
bool DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::extendForward ( )
inline

Tests whether the current DSS can be extended at the front. Computes the parameters of the extended DSS if yes. with the adding point if true.

Returns:
'true' if yes, 'false' otherwise.

Tests whether the union between a point (adding to the front of the DSS with respect to the scan orientaion) and a DSS is a DSS. Computes the parameters of the new DSS with the adding point if true.

Parameters:
itan iterator on a sequence of points
Returns:
'true' if the union is a DSS, 'false' otherwise.

Definition at line 230 of file ArithmeticalDSS3d.ih.

References DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::extendForward().

Referenced by DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::extendForward().

{
bool XYflag = myXYalgo.extendForward();
bool XZflag = myXZalgo.extendForward();
bool YZflag = myYZalgo.extendForward();
ASSERT( (XYflag)&&(XZflag)&&(YZflag) );
myEnd++;
return true;
} else return false;
}
template<typename TIterator , typename TInteger , int connectivity>
void DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::getParameters ( Vector3d direction,
PointD3d intercept,
PointD3d thickness 
) const
inline

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

Parameters:
direction
intercept
thickness

Definition at line 318 of file ArithmeticalDSS3d.ih.

Referenced by DGtal::Display3DFactory::drawAsBoundingBox().

{
//let us take the pair of projection planes for which
//the common coordinate of the main vector cannot be 0
if (myXYalgo.getB() != 0) { //XY-plane, XZ-plane
direction = Point3d(a1*a2,a2*b1,a1*c1);
double y = (double) -NumberTraits<TInteger>::castToInt64_t(mu1) / a1;
double z = (double) -NumberTraits<TInteger>::castToInt64_t(mu2) / a2;
intercept = PointD3d(0,y,z);
Integer omega1 = myXYalgo.getOmega()-1;
Integer omega2 = myXZalgo.getOmega()-1;
double ty = (double) -NumberTraits<TInteger>::castToInt64_t(omega1) / a1;
double tz = (double) -NumberTraits<TInteger>::castToInt64_t(omega2) / a2;
thickness = PointD3d(0,ty,tz);
} else {
if (myXYalgo.getA() != 0) {//XY-plane, YZ-plane
direction = Point3d(b1*a1,b1*b2,b2*c2);
double x = (double) NumberTraits<TInteger>::castToInt64_t(mu1) / b1;
double z = (double) -NumberTraits<TInteger>::castToInt64_t(mu2) / b2;
intercept = PointD3d(x,0,z);
Integer omega1 = myXYalgo.getOmega()-1;
Integer omega2 = myYZalgo.getOmega()-1;
double tx = (double) NumberTraits<TInteger>::castToInt64_t(omega1) / b1;
double tz = (double) -NumberTraits<TInteger>::castToInt64_t(omega2) / b2;
thickness = PointD3d(tx,0,tz);
} else {
if (myYZalgo.getA() != 0) {//YZ-plane, XZ-plane
direction = Point3d(c2*a2,c1*b2,c1*c2);
double y = (double) NumberTraits<TInteger>::castToInt64_t(mu1) / c2;
double x = (double) NumberTraits<TInteger>::castToInt64_t(mu2) / c1;
intercept = PointD3d(x,y,0);
Integer omega1 = myYZalgo.getOmega()-1;
Integer omega2 = myXZalgo.getOmega()-1;
double ty = (double) NumberTraits<TInteger>::castToInt64_t(omega1) / c2;
double tx = (double) NumberTraits<TInteger>::castToInt64_t(omega2) / c1;
thickness = PointD3d(tx,ty,0);
} else {//degenerated case
direction = Point3d(0,0,0);
intercept = PointD3d(0,0,0);
thickness = PointD3d(0,0,0);
}
}
}
}
template<typename TIterator , typename TInteger , int connectivity>
DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::Reverse DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::getReverse ( ) const
inline
Returns:
a default-constructed instance of Reverse.

Definition at line 170 of file ArithmeticalDSS3d.ih.

{
return Reverse();
}
template<typename TIterator , typename TInteger , int connectivity>
DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::Self DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::getSelf ( ) const
inline
Returns:
a default-constructed instance of Self.

Definition at line 162 of file ArithmeticalDSS3d.ih.

{
return Self();
}
template<typename TIterator , typename TInteger , int connectivity>
void DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::init ( const ConstIterator it)
inline

Initialisation.

Parameters:
itan iterator

Initialisation.

Parameters:
itan iterator on a sequence of points

Definition at line 99 of file ArithmeticalDSS3d.ih.

{
//begin and end iterators
myBegin = it;
myEnd = it;
myEnd++;
//adapters and projections
myXYalgo.init(XYit);
myXZalgo.init(XZit);
myYZalgo.init(YZit);
}
template<typename TIterator , typename TInteger , int connectivity>
bool DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::isExtendableForward ( )
inline

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

Returns:
'true' if yes, 'false' otherwise

Definition at line 253 of file ArithmeticalDSS3d.ih.

References DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::isExtendableForward().

Referenced by DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::isExtendableForward().

{
//projection on xy-plane
bool XYflag = myXYalgo.isExtendableForward();
//projection on xz-plane
bool XZflag = myXZalgo.isExtendableForward();
//projection on yz-plane
bool YZflag = myYZalgo.isExtendableForward();
if ( (XYflag)&&(XZflag)&&(YZflag) )
return true;
else return false;
}
template<typename TIterator , typename TInteger , int connectivity>
bool DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::isValid ( ) const
inline

Checks the validity/consistency of the object.

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

Definition at line 298 of file ArithmeticalDSS3d.ih.

{
return ( (myXYalgo.isValid())&&
}
template<typename TIterator , typename TInteger , int connectivity>
bool DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::operator!= ( const ArithmeticalDSS3d< TIterator, TInteger, connectivity > &  other) const
inline

Difference operator.

Parameters:
otherthe object to compare with.
Returns:
'false' if equal 'true' otherwise

Definition at line 208 of file ArithmeticalDSS3d.ih.

{
return (!(*this == other));
}
template<typename TIterator , typename TInteger , int connectivity>
DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity > & DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::operator= ( const ArithmeticalDSS3d< TIterator, TInteger, connectivity > &  other)
inline
template<typename TIterator , typename TInteger , int connectivity>
bool DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::operator== ( const ArithmeticalDSS3d< TIterator, TInteger, connectivity > &  other) const
inline

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

Equality operator.

Parameters:
otherthe object to compare with.
Returns:
'true' either if the points perfectly match or if the first points match to the last ones (same DSS scanned in the conversed way) and 'false' otherwise

Definition at line 189 of file ArithmeticalDSS3d.ih.

References DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::myBegin, DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::myEnd, DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::myXYalgo, DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::myXZalgo, and DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::myYZalgo.

{
return ( ( myXYalgo == other.myXYalgo ) &&
( myXZalgo == other.myXZalgo ) &&
( myYZalgo == other.myYZalgo ) &&
(*myBegin == *other.myBegin) &&
(*myEnd == *other.myEnd) );
}
template<typename TIterator , typename TInteger , int connectivity>
void DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::selfDisplay ( std::ostream &  out)
inline

Writes/Displays the object on an output stream.

Parameters:
outthe output stream where the object is written.

Definition at line 423 of file ArithmeticalDSS3d.ih.

{
out << "[ArithmeticalDSS3d]" << endl;
out << "[XYprojection]" << endl;
out << myXYalgo << endl;
out << "[XZprojection]" << endl;
out << myXZalgo << endl;
out << "[YZprojection]" << endl;
out << myYZalgo << endl;
out << "[End ArithmeticalDSS3d]" << endl;
}

Field Documentation

template<typename TIterator, typename TInteger, int connectivity>
ConstIterator DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::myBegin
protected
template<typename TIterator, typename TInteger, int connectivity>
ConstIterator DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::myEnd
protected
template<typename TIterator, typename TInteger, int connectivity>
Projector2d DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::myProjXY
protected
template<typename TIterator, typename TInteger, int connectivity>
Projector2d DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::myProjXZ
protected
template<typename TIterator, typename TInteger, int connectivity>
Projector2d DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::myProjYZ
protected
template<typename TIterator, typename TInteger, int connectivity>
ArithmeticalDSS2d DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::myXYalgo
protected
template<typename TIterator, typename TInteger, int connectivity>
ArithmeticalDSS2d DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::myXZalgo
protected
template<typename TIterator, typename TInteger, int connectivity>
ArithmeticalDSS2d DGtal::ArithmeticalDSS3d< TIterator, TInteger, connectivity >::myYZalgo
protected

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