DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
GeometricalDSS.h
1 
17 #pragma once
18 
31 #if defined(GeometricalDSS_RECURSES)
32 #error Recursive header files inclusion detected in GeometricalDSS.h
33 #else // defined(GeometricalDSS_RECURSES)
34 
35 #define GeometricalDSS_RECURSES
36 
37 #if !defined GeometricalDSS_h
38 
39 #define GeometricalDSS_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 #include <boost/static_assert.hpp>
46 #include "DGtal/base/CowPtr.h"
47 #include "DGtal/base/ConceptUtils.h"
48 #include "DGtal/base/ReverseIterator.h"
49 #include "DGtal/geometry/curves/SegmentComputerUtils.h"
50 
51 #include "DGtal/geometry/tools/Preimage2D.h"
52 #include "DGtal/shapes/fromPoints/StraightLineFrom2Points.h"
53 
55 
56 namespace DGtal
57 {
58 
60  // template class GeometricalDSS
91  template <typename TConstIterator>
93  {
94 
95  public:
96 
97  //requiered types
98  typedef TConstIterator ConstIterator;
101 
102  //point type
104  typedef typename Pair::first_type Point;
105 
106  //Pair::first_type and Pair::second_type should be the same type;
108  < typename Pair::first_type, typename Pair::second_type >
109  ::value ) );
110 
111  //preimage
115 
116  // ----------------------- Standard services ------------------------------
117  public:
118 
122  GeometricalDSS();
123 
128  GeometricalDSS ( const Self& other );
129 
135  Self& operator= ( const Self& other );
136 
140  ~GeometricalDSS();
141 
147  bool operator==( const Self & other) const;
148 
154  bool operator!=( const Self & other) const;
155 
159  Self getSelf() const;
160 
164  Reverse getReverse() const;
165 
166 
167  // ----------------------- Interface --------------------------------------
168  public:
169 
174  bool isValid() const;
175 
179  ConstIterator begin() const;
180 
184  ConstIterator end() const;
185 
186  // ----------------------- accessors --------------------------------------
187 
191  Point getUf() const;
192 
196  Point getUl() const;
197 
201  Point getLf() const;
202 
206  Point getLl() const;
207 
211  bool isClockwiseOriented() const;
212 
219  void getParameters(double& alpha, double& beta, double& gamma) const;
220 
230  void projects(double& x, double& y,
231  const double& alpha, const double& beta, const double& gamma) const;
232 
233  // ----------------------- growth operations --------------------------------------
234 
239  void init(const ConstIterator& anIt);
240 
247  bool extendForward();
248 
255  bool isExtendableForward();
256 
266  bool isConcave();
267 
277  bool isConvex();
278 
285  bool extendBackward();
286 
293  bool isExtendableBackward();
294 
304  bool isOppositeEndConcave();
305 
315  bool isOppositeEndConvex();
316 
317  //------------------ display -------------------------------
322  void selfDisplay ( std::ostream & out ) const;
323 
328  //DrawableWithBoard2D* defaultStyle( std::string mode="" ) const;
329 
333  std::string className() const;
334 
335  // ------------------------- Protected Datas ------------------------------
336  private:
337  // ------------------------- Private Datas --------------------------------
338  private:
360  bool myFlagIsCW;
361 
362  // ------------------------- Hidden services ------------------------------
363  protected:
364 
365 
366  private:
367 
368 
369 
370  // ------------------------- Internals ------------------------------------
371  private:
372 
373  // ------------------------- Private Datas --------------------------------
374  private:
375 
376  }; // end of class GeometricalDSS
377 
378 
385  template <typename TConstIterator>
386  std::ostream&
387  operator<< ( std::ostream & out, const GeometricalDSS<TConstIterator> & object );
388 
389 } // namespace DGtal
390 
391 
393 // Includes inline functions.
394 #include "DGtal/geometry/curves/GeometricalDSS.ih"
395 
396 // //
398 
399 #endif // !defined GeometricalDSS_h
400 
401 #undef GeometricalDSS_RECURSES
402 #endif // else defined(GeometricalDSS_RECURSES)