DGtal  0.9.4.1
StarShaped2D.h
1 
17 #pragma once
18 
33 #if defined(StarShaped2D_RECURSES)
34 #error Recursive header files inclusion detected in StarShaped2D.h
35 #else // defined(StarShaped2D_RECURSES)
36 
37 #define StarShaped2D_RECURSES
38 
39 #if !defined StarShaped2D_h
40 
41 #define StarShaped2D_h
42 
44 // Inclusions
45 #include <iostream>
46 #include <vector>
47 #include "DGtal/base/Common.h"
48 #include "DGtal/kernel/NumberTraits.h"
50 
51 namespace DGtal
52 {
53 
55  // template class StarShaped2D
73  template <typename TSpace>
75  {
76 
77  public:
78  typedef TSpace Space;
79  typedef typename Space::Point Point;
80  typedef typename Space::RealPoint RealPoint;
81 
86  {}
87 
91  ~StarShaped2D();
92 
93  // ------------------------- Implemented services -------------------------
94  public:
98  virtual RealPoint interiorPoint() const
99  {
100  return center();
101  }
102 
103  // ------------------------- Abstract services ----------------------------
104  public:
105 
110  virtual RealPoint getLowerBound() const = 0;
111 
116  virtual RealPoint getUpperBound() const = 0;
117 
118 
122  virtual RealPoint center() const = 0;
123 
130  virtual double parameter( const RealPoint & p ) const = 0;
131 
138  virtual RealPoint x( const double t ) const = 0;
139 
146  virtual RealPoint xp( const double t ) const = 0;
147 
153  virtual RealPoint xpp( const double t ) const = 0;
154 
155 
156  // ------------------------- star-shaped services -------------------------
157  public:
158 
166  Orientation orientation( const RealPoint &p) const;
167 
174  RealPoint tangent( double t ) const;
175 
182  RealPoint normal( double t ) const;
183 
191  double curvature( double t ) const;
192 
200  double arclength( double t1, double t2, unsigned int nb ) const;
201 
211  RealPoint findIntersection( const RealPoint& inner, const RealPoint& outer, const double epsilon ) const;
212 
223  RealPoint closestPointWithWitnesses( const RealPoint& p, const RealPoint& left, const RealPoint& right, const int step) const;
224 
225  // ----------------------- Interface --------------------------------------
226  public:
227 
232  void selfDisplay ( std::ostream & out ) const;
233 
238  bool isValid() const;
239 
240  // ------------------------- Protected Datas ------------------------------
241  private:
242  // ------------------------- Private Datas --------------------------------
243  private:
244 
245  // ------------------------- Hidden services ------------------------------
246  protected:
247 
252  //StarShaped2D();
253 
254  private:
255 
261  //StarShaped2D ( const StarShaped2D & other );
262 
269  StarShaped2D & operator= ( const StarShaped2D & other );
270 
271  // ------------------------- Internals ------------------------------------
272  private:
273 
274  }; // end of class StarShaped2D
275 
276 
283  template <typename T>
284  std::ostream&
285  operator<< ( std::ostream & out, const StarShaped2D<T> & object );
286 
287 } // namespace DGtal
288 
289 
291 // Includes inline functions.
292 #include "DGtal/shapes/parametric/StarShaped2D.ih"
293 
294 // //
296 
297 #endif // !defined StarShaped2D_h
298 
299 #undef StarShaped2D_RECURSES
300 #endif // else defined(StarShaped2D_RECURSES)
virtual RealPoint xp(const double t) const =0
virtual RealPoint xpp(const double t) const =0
RealPoint findIntersection(const RealPoint &inner, const RealPoint &outer, const double epsilon) const
virtual double parameter(const RealPoint &p) const =0
PointVector< dim, double > RealPoint
Definition: SpaceND.h:117
Orientation
Definition: Common.h:125
virtual RealPoint getUpperBound() const =0
virtual RealPoint interiorPoint() const
Definition: StarShaped2D.h:98
double curvature(double t) const
Orientation orientation(const RealPoint &p) const
Space::RealPoint RealPoint
Definition: StarShaped2D.h:80
void selfDisplay(std::ostream &out) const
RealPoint tangent(double t) const
bool isValid() const
Space::Point Point
Definition: StarShaped2D.h:79
virtual RealPoint x(const double t) const =0
virtual RealPoint getLowerBound() const =0
RealPoint normal(double t) const
DGtal is the top-level namespace which contains all DGtal functions and types.
StarShaped2D & operator=(const StarShaped2D &other)
virtual RealPoint center() const =0
RealPoint closestPointWithWitnesses(const RealPoint &p, const RealPoint &left, const RealPoint &right, const int step) const
double arclength(double t1, double t2, unsigned int nb) const