DGtal  1.3.beta
InGeneralizedDiskOfGivenRadius.h
1 
17 #pragma once
18 
31 #if defined(InGeneralizedDiskOfGivenRadius_RECURSES)
32 #error Recursive header files inclusion detected in InGeneralizedDiskOfGivenRadius.h
33 #else // defined(InGeneralizedDiskOfGivenRadius_RECURSES)
34 
35 #define InGeneralizedDiskOfGivenRadius_RECURSES
36 
37 #if !defined InGeneralizedDiskOfGivenRadius_h
38 
39 #define InGeneralizedDiskOfGivenRadius_h
40 
42 // Inclusions
43 #include <iostream>
44 #include <array>
45 #include "DGtal/base/Common.h"
46 
47 #include "DGtal/geometry/tools/determinant/C2x2DetComputer.h"
48 #include "DGtal/geometry/tools/determinant/Simple2x2DetComputer.h"
50 
51 namespace DGtal
52 {
53 
55  // template class InGeneralizedDiskOfGivenRadius
125  template <typename TPoint, typename TDetComputer>
127  {
128  // ----------------------- Inner types ------------------------------------
129  public:
133  typedef TPoint Point;
134 
138  typedef std::array<Point,2> PointArray;
142  typedef typename PointArray::size_type SizeArray;
146  static const SizeArray size = 2;
147 
151  typedef TDetComputer DetComputer;
156  typedef typename DetComputer::ArgumentInteger Integer;
160  typedef typename DetComputer::ResultInteger Value;
167 
168  // ----------------------- Standard services ------------------------------
169  public:
170 
187  InGeneralizedDiskOfGivenRadius(bool isPositive = true,
188  const Integer& aNum2 = NumberTraits<Integer>::ONE,
189  const Integer& aDen2 = NumberTraits<Integer>::ZERO);
190 
196 
203 
204  // ----------------------- Interface --------------------------------------
205  public:
213  void init( const Point& aP, const Point& aQ );
214 
220  void init(const PointArray& aA);
221 
243  Value operator()( const Point& aR ) const;
244 
249  void selfDisplay ( std::ostream & out ) const;
250 
259  bool lengthIsValid(const Integer& aL2) const;
260 
268  bool isValid() const;
269 
270  // ----------------------- Internals --------------------------------------
271  public:
275  void finalizeComputation() const;
276 
277  // ------------------------- Private Datas --------------------------------
278  private:
303 
307  mutable Point myP;
311  mutable Point myQ;
315  mutable Point myR;
327  mutable Integer myPQ0;
331  mutable Integer myPQ1;
335  mutable Integer myPQnorm;
339  mutable Integer myQR0;
343  mutable Integer myQR1;
347  mutable Integer myQRnorm;
351  mutable Integer myRP0;
355  mutable Integer myRP1;
359  mutable Integer myRPnorm;
363  mutable Integer myArea;
369 
370  }; // end of class InGeneralizedDiskOfGivenRadius
371 
372 
379  template <typename TPoint, typename TDetComputer>
380  std::ostream&
381  operator<< ( std::ostream & out, const InGeneralizedDiskOfGivenRadius<TPoint, TDetComputer> & object );
382 
383 
384 } // namespace DGtal
385 
386 
388 // Includes inline functions.
389 #include "DGtal/geometry/tools/determinant/InGeneralizedDiskOfGivenRadius.ih"
390 
391 // //
393 
394 #endif // !defined InGeneralizedDiskOfGivenRadius_h
395 
396 #undef InGeneralizedDiskOfGivenRadius_RECURSES
397 #endif // else defined(InGeneralizedDiskOfGivenRadius_RECURSES)
DGtal::InGeneralizedDiskOfGivenRadius::myQR1
Integer myQR1
Definition: InGeneralizedDiskOfGivenRadius.h:343
DGtal::Simple2x2DetComputer< Integer >
DGtal::InGeneralizedDiskOfGivenRadius::myIsPositive
bool myIsPositive
Definition: InGeneralizedDiskOfGivenRadius.h:295
DGtal::InGeneralizedDiskOfGivenRadius::myPQ0
Integer myPQ0
Definition: InGeneralizedDiskOfGivenRadius.h:327
DGtal::InGeneralizedDiskOfGivenRadius::myComputedDen2
Integer myComputedDen2
Definition: InGeneralizedDiskOfGivenRadius.h:323
DGtal::InGeneralizedDiskOfGivenRadius::myArea
Integer myArea
Definition: InGeneralizedDiskOfGivenRadius.h:363
DGtal::InGeneralizedDiskOfGivenRadius::SizeArray
PointArray::size_type SizeArray
Definition: InGeneralizedDiskOfGivenRadius.h:142
DGtal::NumberTraits
Aim: The traits class for all models of Cinteger.
Definition: NumberTraits.h:562
DGtal::InGeneralizedDiskOfGivenRadius::lengthIsValid
bool lengthIsValid(const Integer &aL2) const
DGtal::InGeneralizedDiskOfGivenRadius::myQR0
Integer myQR0
Definition: InGeneralizedDiskOfGivenRadius.h:339
DGtal::InGeneralizedDiskOfGivenRadius::DetComputer
TDetComputer DetComputer
Definition: InGeneralizedDiskOfGivenRadius.h:151
DGtal::InGeneralizedDiskOfGivenRadius::myDen2
Integer myDen2
Definition: InGeneralizedDiskOfGivenRadius.h:286
DGtal::InGeneralizedDiskOfGivenRadius::Integer
DetComputer::ArgumentInteger Integer
Definition: InGeneralizedDiskOfGivenRadius.h:156
DGtal::InGeneralizedDiskOfGivenRadius::myAreaFunctor
AreaFunctor myAreaFunctor
Definition: InGeneralizedDiskOfGivenRadius.h:368
DGtal::InGeneralizedDiskOfGivenRadius::Point
TPoint Point
Definition: InGeneralizedDiskOfGivenRadius.h:133
DGtal::InGeneralizedDiskOfGivenRadius::operator()
Value operator()(const Point &aR) const
DGtal::operator<<
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
DGtal::InGeneralizedDiskOfGivenRadius
Aim: This class implements an orientation functor that provides a way to determine the position of ...
Definition: InGeneralizedDiskOfGivenRadius.h:126
DGtal::InGeneralizedDiskOfGivenRadius::init
void init(const Point &aP, const Point &aQ)
DGtal::InGeneralizedDiskOfGivenRadius::myQRnorm
Integer myQRnorm
Definition: InGeneralizedDiskOfGivenRadius.h:347
DGtal::InGeneralizedDiskOfGivenRadius::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((C2x2DetComputer< DetComputer >))
DGtal::InGeneralizedDiskOfGivenRadius::myPQ1
Integer myPQ1
Definition: InGeneralizedDiskOfGivenRadius.h:331
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::InGeneralizedDiskOfGivenRadius::finalizeComputation
void finalizeComputation() const
DGtal::InGeneralizedDiskOfGivenRadius::InGeneralizedDiskOfGivenRadius
InGeneralizedDiskOfGivenRadius(bool isPositive=true, const Integer &aNum2=NumberTraits< Integer >::ONE, const Integer &aDen2=NumberTraits< Integer >::ZERO)
DGtal::InGeneralizedDiskOfGivenRadius::PointArray
std::array< Point, 2 > PointArray
Definition: InGeneralizedDiskOfGivenRadius.h:138
DGtal::InGeneralizedDiskOfGivenRadius::myComputedNum2
Integer myComputedNum2
Definition: InGeneralizedDiskOfGivenRadius.h:319
DGtal::InGeneralizedDiskOfGivenRadius::operator=
InGeneralizedDiskOfGivenRadius & operator=(const InGeneralizedDiskOfGivenRadius &other)
DGtal::InGeneralizedDiskOfGivenRadius::Value
DetComputer::ResultInteger Value
Definition: InGeneralizedDiskOfGivenRadius.h:160
DGtal::InGeneralizedDiskOfGivenRadius::myQ
Point myQ
Definition: InGeneralizedDiskOfGivenRadius.h:311
DGtal::InGeneralizedDiskOfGivenRadius::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::InGeneralizedDiskOfGivenRadius::myRPnorm
Integer myRPnorm
Definition: InGeneralizedDiskOfGivenRadius.h:359
DGtal::C2x2DetComputer
Aim: This concept gathers all models that are able to compute the (sign of the) determinant of a 2x2 ...
Definition: C2x2DetComputer.h:107
DGtal::InGeneralizedDiskOfGivenRadius::AreaFunctor
Simple2x2DetComputer< Integer > AreaFunctor
Definition: InGeneralizedDiskOfGivenRadius.h:166
DGtal::InGeneralizedDiskOfGivenRadius::myRP1
Integer myRP1
Definition: InGeneralizedDiskOfGivenRadius.h:355
DGtal::InGeneralizedDiskOfGivenRadius::isValid
bool isValid() const
DGtal::InGeneralizedDiskOfGivenRadius::myNum2
Integer myNum2
Definition: InGeneralizedDiskOfGivenRadius.h:282
DGtal::InGeneralizedDiskOfGivenRadius::myRP0
Integer myRP0
Definition: InGeneralizedDiskOfGivenRadius.h:351
DGtal::InGeneralizedDiskOfGivenRadius::myR
Point myR
Definition: InGeneralizedDiskOfGivenRadius.h:315
DGtal::InGeneralizedDiskOfGivenRadius::myP
Point myP
Definition: InGeneralizedDiskOfGivenRadius.h:307
DGtal::InGeneralizedDiskOfGivenRadius::myDetComputer
DetComputer myDetComputer
Definition: InGeneralizedDiskOfGivenRadius.h:302
DGtal::InGeneralizedDiskOfGivenRadius::myPQnorm
Integer myPQnorm
Definition: InGeneralizedDiskOfGivenRadius.h:335