DGtal  0.9.2
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 "DGtal/base/Common.h"
47 #include "DGtal/kernel/NumberTraits.h"
49 
50 namespace DGtal
51 {
52 
54  // template class StarShaped2D
72  template <typename TSpace>
74  {
75 
76  public:
77  typedef TSpace Space;
78  typedef typename Space::Point Point;
79  typedef typename Space::RealPoint RealPoint;
80 
85  {}
86 
90  ~StarShaped2D();
91 
92  // ------------------------- Implemented services -------------------------
93  public:
97  virtual RealPoint interiorPoint() const
98  {
99  return center();
100  }
101 
102  // ------------------------- Abstract services ----------------------------
103  public:
104 
109  virtual RealPoint getLowerBound() const = 0;
110 
115  virtual RealPoint getUpperBound() const = 0;
116 
117 
121  virtual RealPoint center() const = 0;
122 
129  virtual double parameter( const RealPoint & p ) const = 0;
130 
137  virtual RealPoint x( const double t ) const = 0;
138 
145  virtual RealPoint xp( const double t ) const = 0;
146 
152  virtual RealPoint xpp( const double t ) const = 0;
153 
154 
155  // ------------------------- star-shaped services -------------------------
156  public:
157 
165  Orientation orientation( const RealPoint &p) const;
166 
167 
174  RealPoint tangent( double t ) const;
175 
182  RealPoint normal( double t ) const;
183 
191  double curvature( double t ) const;
192 
199  double arclength( double t1, double t2, unsigned int nb ) const;
200 
201 
202  // ----------------------- Interface --------------------------------------
203  public:
204 
209  void selfDisplay ( std::ostream & out ) const;
210 
215  bool isValid() const;
216 
217  // ------------------------- Protected Datas ------------------------------
218  private:
219  // ------------------------- Private Datas --------------------------------
220  private:
221 
222  // ------------------------- Hidden services ------------------------------
223  protected:
224 
229  //StarShaped2D();
230 
231  private:
232 
238  //StarShaped2D ( const StarShaped2D & other );
239 
246  StarShaped2D & operator= ( const StarShaped2D & other );
247 
248  // ------------------------- Internals ------------------------------------
249  private:
250 
251  }; // end of class StarShaped2D
252 
253 
260  template <typename T>
261  std::ostream&
262  operator<< ( std::ostream & out, const StarShaped2D<T> & object );
263 
264 } // namespace DGtal
265 
266 
268 // Includes inline functions.
269 #include "DGtal/shapes/parametric/StarShaped2D.ih"
270 
271 // //
273 
274 #endif // !defined StarShaped2D_h
275 
276 #undef StarShaped2D_RECURSES
277 #endif // else defined(StarShaped2D_RECURSES)
virtual RealPoint center() const =0
Orientation orientation(const RealPoint &p) const
virtual RealPoint x(const double t) const =0
bool isValid() const
virtual RealPoint getUpperBound() const =0
virtual RealPoint xp(const double t) const =0
PointVector< dim, double > RealPoint
Definition: SpaceND.h:117
double curvature(double t) const
Orientation
Definition: Common.h:118
Space::RealPoint RealPoint
Definition: StarShaped2D.h:79
virtual RealPoint xpp(const double t) const =0
RealPoint tangent(double t) const
Space::Point Point
Definition: StarShaped2D.h:78
virtual RealPoint interiorPoint() const
Definition: StarShaped2D.h:97
virtual RealPoint getLowerBound() const =0
DGtal is the top-level namespace which contains all DGtal functions and types.
StarShaped2D & operator=(const StarShaped2D &other)
RealPoint normal(double t) const
void selfDisplay(std::ostream &out) const
virtual double parameter(const RealPoint &p) const =0
double arclength(double t1, double t2, unsigned int nb) const