DGtal  0.9.2
AccFlower2D.h
1 
17 #pragma once
18 
33 #if defined(AccFlower2D_RECURSES)
34 #error Recursive header files inclusion detected in AccFlower2D.h
35 #else // defined(AccFlower2D_RECURSES)
36 
37 #define AccFlower2D_RECURSES
38 
39 #if !defined AccFlower2D_h
40 
41 #define AccFlower2D_h
42 
44 // Inclusions
45 #include <iostream>
46 #include "DGtal/base/Common.h"
47 #include "DGtal/shapes/parametric/StarShaped2D.h"
48 #include <cmath>
50 
51 namespace DGtal
52 {
53 
55  // template class AccFlower2D
63  template <typename TSpace>
64  class AccFlower2D: public StarShaped2D<TSpace>
65  {
66  // ----------------------- Standard services ------------------------------
67  public:
68 
69  typedef TSpace Space;
70  typedef typename Space::Point Point;
71  typedef typename Space::RealPoint RealPoint2D;
72  typedef typename Space::RealVector RealVector2D;
73 
77  ~AccFlower2D();
78 
88  AccFlower2D( const double x0, const double y0,
89  const double r,
90  const double smallr,
91  const unsigned int k,
92  const double phi);
93 
102  AccFlower2D(const RealPoint2D &aPoint,
103  const double r,
104  const double smallr,
105  const unsigned int k,
106  const double phi);
107 
116  AccFlower2D(const Point &aPoint,
117  const double r,
118  const double smallr,
119  const unsigned int k,
120  const double phi);
121 
122 
123  // ------------- Implementation of 'StarShaped' services ------------------
124  public:
125 
130  RealPoint2D getLowerBound() const
131  {
132  return RealPoint2D(myCenter[0] - myRadius - myVarRadius,
133  myCenter[1] - myRadius - myVarRadius);
134  }
135 
140  RealPoint2D getUpperBound() const
141  {
143  myCenter[1] + myRadius + myVarRadius);
144  }
145 
149  RealPoint2D center() const
150  {
151  return myCenter;
152  }
153 
160  double parameter( const RealPoint2D & p ) const;
161 
162 
169  RealPoint2D x( const double t ) const;
170 
177  RealVector2D xp( const double t ) const;
178 
184  RealVector2D xpp( const double t ) const;
185 
186 
187  // ------------------------- data ----------------------------
188  private:
189 
193  RealPoint2D myCenter;
194 
198  double myRadius;
199 
203  double myVarRadius;
204 
208  unsigned int myK;
209 
213  double myKp;
214 
218  double myPhi;
219 
220  // ----------------------- Interface --------------------------------------
221  public:
222 
227  void selfDisplay ( std::ostream & out ) const;
228 
233  bool isValid() const;
234 
235 
236  // ------------------------- Hidden services ------------------------------
237  protected:
238 
243  AccFlower2D();
244 
245  private:
246 
252  // AccFlower2D ( const AccFlower2D & other );
253 
260  AccFlower2D & operator= ( const AccFlower2D & other );
261 
262  // ------------------------- Internals ------------------------------------
263  private:
264 
265  }; // end of class AccFlower2D
266 
267 
274  template <typename T>
275  std::ostream&
276  operator<< ( std::ostream & out, const AccFlower2D<T> & object );
277 
278 } // namespace DGtal
279 
280 
282 // Includes inline functions.
283 #include "DGtal/shapes/parametric/AccFlower2D.ih"
284 
285 // //
287 
288 #endif // !defined AccFlower2D_h
289 
290 #undef AccFlower2D_RECURSES
291 #endif // else defined(AccFlower2D_RECURSES)
unsigned int myK
Definition: AccFlower2D.h:208
Space::RealPoint RealPoint2D
Definition: AccFlower2D.h:71
AccFlower2D & operator=(const AccFlower2D &other)
PointVector< dim, double > RealPoint
Definition: SpaceND.h:117
RealPoint2D x(const double t) const
RealPoint2D myCenter
Definition: AccFlower2D.h:193
RealPoint2D getLowerBound() const
Definition: AccFlower2D.h:130
RealPoint2D getUpperBound() const
Definition: AccFlower2D.h:140
RealVector2D xpp(const double t) const
bool isValid() const
Aim: Model of the concept StarShaped represents any accelerated flower in the plane.
Definition: AccFlower2D.h:64
Space::RealVector RealVector2D
Definition: AccFlower2D.h:72
void selfDisplay(std::ostream &out) const
DGtal is the top-level namespace which contains all DGtal functions and types.
double parameter(const RealPoint2D &p) const
RealVector2D xp(const double t) const
RealPoint2D center() const
Definition: AccFlower2D.h:149
Space::Point Point
Definition: AccFlower2D.h:70