DGtal  1.3.beta
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 final: public StarShaped2D<TSpace>
65  {
66  // ----------------------- Standard services ------------------------------
67  public:
68 
69  typedef TSpace Space;
70  typedef typename Space::RealPoint RealPoint;
71  typedef typename Space::RealVector RealVector;
72 
77  AccFlower2D() = delete;
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 RealPoint& aPoint,
103  const double r,
104  const double smallr,
105  const unsigned int k,
106  const double phi );
107 
112  AccFlower2D( const AccFlower2D& other );
113 
120  AccFlower2D& operator= ( const AccFlower2D& other ) = delete;
121 
125  ~AccFlower2D() = default;
126 
127  // ------------- Implementation of 'StarShaped' services ------------------
128  public:
129 
135  {
136  return myCenter - (myRadius + myVarRadius);
137  }
138 
144  {
145  return myCenter + (myRadius + myVarRadius);
146  }
147 
152  {
153  return myCenter;
154  }
155 
160  inline
161  void moveTo( const RealPoint& newCenter )
162  {
163  myCenter = newCenter;
164  }
165 
172  double parameter( const RealPoint & p ) const;
173 
174 
181  RealPoint x( const double t ) const;
182 
189  RealVector xp( const double t ) const;
190 
196  RealVector xpp( const double t ) const;
197 
198 
199  // ------------------------- data ----------------------------
200  private:
201 
206 
210  double myRadius;
211 
215  double myVarRadius;
216 
220  unsigned int myK;
221 
225  double myKp;
226 
230  double myPhi;
231 
232  // ----------------------- Interface --------------------------------------
233  public:
234 
239  void selfDisplay ( std::ostream & out ) const;
240 
245  bool isValid() const;
246 
247  }; // end of class AccFlower2D
248 
249 
256  template <typename T>
257  std::ostream&
258  operator<< ( std::ostream & out, const AccFlower2D<T> & object );
259 
260 } // namespace DGtal
261 
262 
264 // Includes inline functions.
265 #include "DGtal/shapes/parametric/AccFlower2D.ih"
266 
267 // //
269 
270 #endif // !defined AccFlower2D_h
271 
272 #undef AccFlower2D_RECURSES
273 #endif // else defined(AccFlower2D_RECURSES)
DGtal::AccFlower2D::parameter
double parameter(const RealPoint &p) const
DGtal::AccFlower2D::AccFlower2D
AccFlower2D()=delete
DGtal::AccFlower2D
Aim: Model of the concept StarShaped represents any accelerated flower in the plane.
Definition: AccFlower2D.h:64
DGtal::AccFlower2D::myK
unsigned int myK
Definition: AccFlower2D.h:220
aPoint
const Point aPoint(3, 4)
DGtal::AccFlower2D::RealPoint
Space::RealPoint RealPoint
Definition: AccFlower2D.h:70
DGtal::AccFlower2D::xpp
RealVector xpp(const double t) const
DGtal::StarShaped2D
Definition: StarShaped2D.h:74
DGtal::AccFlower2D::Space
TSpace Space
Definition: AccFlower2D.h:69
DGtal::AccFlower2D::myVarRadius
double myVarRadius
Definition: AccFlower2D.h:215
DGtal::AccFlower2D::x
RealPoint x(const double t) const
DGtal::operator<<
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
DGtal::AccFlower2D::myPhi
double myPhi
Definition: AccFlower2D.h:230
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::AccFlower2D::isValid
bool isValid() const
DGtal::AccFlower2D::xp
RealVector xp(const double t) const
DGtal::AccFlower2D::myKp
double myKp
Definition: AccFlower2D.h:225
DGtal::AccFlower2D::myCenter
RealPoint myCenter
Definition: AccFlower2D.h:205
DGtal::AccFlower2D::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::AccFlower2D::getUpperBound
RealPoint getUpperBound() const
Definition: AccFlower2D.h:143
DGtal::AccFlower2D::~AccFlower2D
~AccFlower2D()=default
DGtal::AccFlower2D::center
RealPoint center() const
Definition: AccFlower2D.h:151
DGtal::AccFlower2D::moveTo
void moveTo(const RealPoint &newCenter)
Definition: AccFlower2D.h:161
DGtal::SpaceND::RealPoint
PointVector< dim, double > RealPoint
Definition: SpaceND.h:117
DGtal::AccFlower2D::RealVector
Space::RealVector RealVector
Definition: AccFlower2D.h:71
DGtal::PointVector
Aim: Implements basic operations that will be used in Point and Vector classes.
Definition: PointVector.h:165
DGtal::AccFlower2D::myRadius
double myRadius
Definition: AccFlower2D.h:210
DGtal::AccFlower2D::getLowerBound
RealPoint getLowerBound() const
Definition: AccFlower2D.h:134
DGtal::AccFlower2D::operator=
AccFlower2D & operator=(const AccFlower2D &other)=delete