31 #if defined(ArithmeticalDSL_RECURSES)
32 #error Recursive header files inclusion detected in ArithmeticalDSL.h
33 #else // defined(ArithmeticalDSL_RECURSES)
35 #define ArithmeticalDSL_RECURSES
37 #if !defined ArithmeticalDSL_h
39 #define ArithmeticalDSL_h
45 #include "DGtal/base/Common.h"
46 #include "DGtal/base/Exceptions.h"
47 #include "DGtal/base/ReverseIterator.h"
48 #include "DGtal/kernel/CInteger.h"
49 #include "DGtal/kernel/CSignedNumber.h"
50 #include "DGtal/kernel/SpaceND.h"
51 #include "DGtal/kernel/PointVector.h"
52 #include "DGtal/arithmetic/IntegerComputer.h"
54 #include "DGtal/geometry/curves/ArithmeticalDSLKernel.h"
62 template <
typename TCoordinate,
64 unsigned short adjacency>
65 class ArithmeticalDSS;
103 template <
typename TCoordinate,
104 typename TInteger = TCoordinate,
105 unsigned short adjacency = 8>
149 typedef std::pair<Vector,Vector>
Steps;
158 typedef std::pair<unsigned char, unsigned char>
Octant;
178 :
public boost::iterator_facade<ConstIterator,
180 boost::random_access_traversal_tag,
671 template <
typename TCoordinate,
typename TInteger,
unsigned short adjacency>
707 template <
typename TCoordinate,
typename TInteger = TCoordinate>
775 template <
typename TCoordinate,
typename TInteger = TCoordinate>
830 template <
typename TInput,
typename TOutput >
842 static TOutput
cast(
const TInput& aInput)
844 return static_cast<TOutput
>(aInput);
847 #ifdef WITH_BIGINTEGER
849 template <
typename TOutput>
859 (aInput >=
static_cast<DGtal::BigInteger>(std::numeric_limits<TOutput>::min())) );
860 return static_cast<TOutput
>(aInput.get_si());
881 #include "DGtal/geometry/curves/ArithmeticalDSL.ih"
886 #endif // !defined ArithmeticalDSL_h
888 #undef ArithmeticalDSL_RECURSES
889 #endif // else defined(ArithmeticalDSL_RECURSES)
Super::Coordinate Coordinate
NaiveDSL(const Coordinate &aA, const Coordinate &aB, const Integer &aMu)
mpz_class BigInteger
Multi-precision integer with GMP implementation.
ConstIterator(const ConstIterator &aOther)
Aim: This class is an alias of ArithmeticalDSS for standard DSL. It represents a standard digital str...
bool operator()(const Point &aPoint) const
MyDigitalSurface::ConstIterator ConstIterator
Point const dereference() const
bool checkShiftAndSteps() const
Integer myQuantityToAdd
Quantity to add to the current remainder.
Integer orthogonalPosition(const Point &aPoint) const
bool before(const Point &aP1, const Point &aP2) const
bool operator==(const ArithmeticalDSL &aOther) const
Aim: Concept checking for Integer Numbers. More precisely, this concept is a refinement of both CEucl...
static DGtal::BigInteger cast(const DGtal::BigInteger &aInput)
ConstIterator end(const Point &aPoint) const
BOOST_CONCEPT_ASSERT((concepts::CInteger< TInput >))
const ArithmeticalDSL * myDSLPtr
Constant aliasing pointer to the DSL visited by the iterator.
BOOST_CONCEPT_ASSERT((concepts::CSignedNumber< TInput >))
ConstIterator begin(const Point &aPoint) const
std::pair< Vector, Vector > Steps
BOOST_CONCEPT_ASSERT((concepts::CInteger< TOutput >))
ArithmeticalDSL< TCoordinate, TInteger, 4 > Super
BOOST_CONCEPT_ASSERT((concepts::CSignedNumber< TOutput >))
StandardDSL & operator=(const StandardDSL &aOther)
Super::Coordinate Coordinate
BOOST_CONCEPT_ASSERT((concepts::CInteger< Integer >))
This class adapts any bidirectional iterator so that operator++ calls operator-- and vice versa.
ArithmeticalDSL(const Coordinate &aA, const Coordinate &aB, const Integer &aMu)
NaiveDSL(const NaiveDSL &aOther)
Aim: This class is an alias of ArithmeticalDSS for naive DSL. It represents a naive digital straight ...
Aim: Concept checking for Signed Numbers. Models of this concept should be listed in NumberTraits cla...
void selfDisplay(std::ostream &out) const
Integer remainder(const Point &aPoint) const
ArithmeticalDSLKernel< Coordinate, adjacency >::Space Space
static TOutput cast(const TInput &aInput)
StandardDSL(const StandardDSL &aOther)
Aim: This class aims at representing an iterator that provides a way to scan the points of a DSL....
Integer myQuantityToRemove
Quantity to remove to the current remainder.
Integer remainder() const
std::pair< unsigned char, unsigned char > Octant
ConstIterator(const ArithmeticalDSL *aDSL, const Point &aPoint)
bool operator!=(const ArithmeticalDSL &aOther) const
bool isLowerLeaningPoint(const Point &aPoint) const
ArithmeticalDSL(const ArithmeticalDSL &aOther)
ConstIterator & operator=(const ConstIterator &aOther)
static TOutput cast(const DGtal::BigInteger &aInput)
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: This class represents a naive (resp. standard) digital straight segment (DSS),...
BOOST_CONCEPT_ASSERT((concepts::CSignedNumber< TOutput >))
Position distance_to(const ConstIterator &aOther) const
bool isInDSL(const Point &aPoint) const
ArithmeticalDSL & operator=(const ArithmeticalDSL &aOther)
Integer myCurrentRemainder
Remainder of the current point.
friend class boost::iterator_core_access
ConstReverseIterator rend(const Point &aPoint) const
Aim: Define a simple functor that can cast a signed integer (possibly a DGtal::BigInteger) into anoth...
Position position(const Point &aPoint) const
Position patternLength() const
NaiveDSL & operator=(const NaiveDSL &aOther)
bool equalsTo(const ArithmeticalDSL &aOther) const
BOOST_CONCEPT_ASSERT((concepts::CInteger< Coordinate >))
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
StandardDSL(const Coordinate &aA, const Coordinate &aB, const Integer &aMu)
Aim: This class represents a naive (resp. standard) digital straight line (DSL), ie....
static Coordinate toCoordinate(const Integer &aI)
bool beforeOrEqual(const Point &aP1, const Point &aP2) const
static Integer remainder(const Coordinate &aA, const Coordinate &aB, const Point &aPoint)
Point myCurrentPoint
The current point.
ArithmeticalDSL< TCoordinate, TInteger, 8 > Super
void advance(const Position &aShift)
static const unsigned short foregroundAdjacency
bool isUpperLeaningPoint(const Point &aPoint) const
ArithmeticalDSL negate() const
DGtal::ReverseIterator< ConstIterator > ConstReverseIterator
bool sameOctant(const ArithmeticalDSL &aOther, typename Octant::first_type *theOctant) const
ArithmeticalDSL(const Coordinate &aA, const Coordinate &aB, const Integer &aLowerIntercept, const Integer &aUpperIntercept, const Steps &aSteps, const Vector &aShift)
bool equal(const ConstIterator &aOther) const
ConstReverseIterator rbegin(const Point &aPoint) const
BOOST_CONCEPT_ASSERT((concepts::CInteger< TOutput >))
Point getPoint(const Position &aPosition) const