DGtal  0.9.2
ParallelStrip.h
1 
17 #pragma once
18 
31 #if defined(ParallelStrip_RECURSES)
32 #error Recursive header files inclusion detected in ParallelStrip.h
33 #else // defined(ParallelStrip_RECURSES)
34 
35 #define ParallelStrip_RECURSES
36 
37 #if !defined ParallelStrip_h
38 
39 #define ParallelStrip_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 #include "DGtal/kernel/CSpace.h"
47 
48 namespace DGtal
49 {
50 
52  // template class ParallelStrip
89  template <typename TSpace, bool muIncluded = true, bool muPlusNuIncluded = true>
91  {
93 
94  // ----------------------- public types ------------------------------
95  public:
96  typedef TSpace Space;
98  typedef typename Space::Point Point;
99  typedef typename Space::RealPoint RealPoint;
100  typedef typename Space::Vector Vector;
101  typedef typename Space::RealVector RealVector;
104  typedef Component Scalar;
105 
106 
107  // ----------------------- Standard services ------------------------------
108  public:
109 
113  ~ParallelStrip();
114 
118  ParallelStrip();
119 
129  ParallelStrip ( Scalar mu, const RealVector & N, Scalar nu );
130 
135  ParallelStrip ( const ParallelStrip & other );
136 
142  ParallelStrip & operator= ( const ParallelStrip & other );
143 
144  //-------------------- strip / plane services -----------------------------
145  public:
146 
150  const RealVector & normal() const;
151 
155  Scalar mu() const;
156 
162  Scalar nu() const;
163 
169  Scalar width() const;
170 
175  Scalar axisWidth() const;
176 
181  Dimension mainAxis() const;
182 
187  Scalar diagonalWidth() const;
188 
194  Dimension mainDiagonal() const;
195 
204  void getBounds( Scalar & mu, Scalar & mu_plus_nu ) const;
205 
206  //-------------------- model of concepts::CPointPredicate -----------------------------
207  public:
208 
217  bool operator()( const Point & p ) const;
218 
226  bool operator()( const RealPoint & p ) const;
227 
228  // ----------------------- Interface --------------------------------------
229  public:
230 
235  void selfDisplay ( std::ostream & out ) const;
236 
241  bool isValid() const;
242 
243  // ------------------------- Protected Datas ------------------------------
244  protected:
246  Scalar myMu;
248  RealVector myN;
250  Scalar myNu;
251 
252  // ------------------------- Private Datas --------------------------------
253  private:
254 
255  // ------------------------- Hidden services ------------------------------
256  protected:
257 
258  // ------------------------- Internals ------------------------------------
259  private:
260 
261  }; // end of class ParallelStrip
262 
263 
270  template <typename TSpace, bool muIncluded, bool muPlusNuIncluded>
271  std::ostream&
272  operator<< ( std::ostream & out,
274 
275 } // namespace DGtal
276 
277 
279 // Includes inline functions.
280 #include "DGtal/geometry/surfaces/ParallelStrip.ih"
281 
282 // //
284 
285 #endif // !defined ParallelStrip_h
286 
287 #undef ParallelStrip_RECURSES
288 #endif // else defined(ParallelStrip_RECURSES)
Dimension mainAxis() const
Component Coordinate
Type for Point elements.
Definition: PointVector.h:158
Scalar diagonalWidth() const
DGtal::uint32_t Dimension
Definition: Common.h:113
Space::Point Point
Definition: ParallelStrip.h:98
Aim: A parallel strip in the space is the intersection of two parallel half-planes such that each hal...
Definition: ParallelStrip.h:90
Space::RealVector RealVector
Scalar mu() const
Space::RealPoint RealPoint
Definition: ParallelStrip.h:99
Dimension mainDiagonal() const
const RealVector & normal() const
bool isValid() const
RealPoint::Coordinate Coordinate
Scalar myNu
The width of the strip.
RealVector::Component Component
void selfDisplay(std::ostream &out) const
Scalar width() const
bool operator()(const Point &p) const
Aim: Defines the concept describing a digital space, ie a cartesian product of integer lines...
Definition: CSpace.h:105
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
Space::Vector Vector
ParallelStrip< Space, muIncluded, muPlusNuIncluded > Self
Definition: ParallelStrip.h:97
Scalar myMu
The minimal scalar value of the strip.
DGtal is the top-level namespace which contains all DGtal functions and types.
Scalar nu() const
BOOST_CONCEPT_ASSERT((concepts::CSpace< TSpace >))
RealVector myN
The unit normal vector N to the strip.
Scalar axisWidth() const
ParallelStrip & operator=(const ParallelStrip &other)
void getBounds(Scalar &mu, Scalar &mu_plus_nu) const
TEuclideanRing Component
Type for Vector elements.
Definition: PointVector.h:155