DGtal  1.1.0
ChordGenericNaivePlaneComputer.h
1 
17 #pragma once
18 
31 #if defined(ChordGenericNaivePlaneComputer_RECURSES)
32 #error Recursive header files inclusion detected in ChordGenericNaivePlaneComputer.h
33 #else // defined(ChordGenericNaivePlaneComputer_RECURSES)
34 
35 #define ChordGenericNaivePlaneComputer_RECURSES
36 
37 #if !defined ChordGenericNaivePlaneComputer_h
38 
39 #define ChordGenericNaivePlaneComputer_h
40 
42 // Inclusions
43 #include <iostream>
44 #include <set>
45 #include "DGtal/base/Common.h"
46 #include "DGtal/kernel/CInteger.h"
47 #include "DGtal/kernel/CSpace.h"
48 #include "DGtal/kernel/SpaceND.h"
49 #include "DGtal/kernel/PointVector.h"
50 #include "DGtal/arithmetic/IntegerComputer.h"
51 #include "DGtal/geometry/surfaces/ChordNaivePlaneComputer.h"
53 
54 namespace DGtal
55 {
56 
58  // template class ChordGenericNaivePlaneComputer
115  template < typename TSpace,
116  typename TInputPoint,
117  typename TInternalScalar >
119  {
122  BOOST_STATIC_ASSERT(( TSpace::dimension == 3 ));
123  BOOST_STATIC_ASSERT(( TInputPoint::dimension == 3 ));
124 
125  // ----------------------- public types ------------------------------
126  public:
127  typedef TSpace Space;
128  typedef TInputPoint InputPoint;
129  typedef TInternalScalar InternalScalar;
131  typedef typename InputVector::Component Component;
132  typedef typename InputPoint::Coordinate Coordinate;
134  typedef typename Space::Point Point;
137 
138  typedef std::set< InputPoint > InputPointSet;
139  typedef typename InputPointSet::size_type Size;
140  typedef typename InputPointSet::const_iterator ConstIterator;
141  typedef typename InputPointSet::iterator Iterator;
142 
143  // ----------------------- std public types ------------------------------
144  public:
145  typedef typename InputPointSet::const_iterator const_iterator;
146  typedef typename InputPointSet::const_pointer const_pointer;
147  typedef typename InputPointSet::const_reference const_reference;
148  typedef typename InputPointSet::value_type value_type;
149  typedef typename InputPointSet::difference_type difference_type;
150  typedef typename InputPointSet::size_type size_type;
151 
152  // ----------------------- internal types ------------------------------
153  private:
154  typedef std::vector<Dimension>::iterator AxisIterator;
155  typedef std::vector<Dimension>::const_iterator AxisConstIterator;
156  // ----------------------- Standard services ------------------------------
157  public:
158 
163 
169 
175 
182 
186  Dimension active() const;
187 
192  void clear();
193 
210 
211  //-------------------- model of ForwardContainer -----------------------------
212  public:
213 
217  Size size() const;
218 
222  bool empty() const;
223 
228 
233 
239  Size max_size() const;
240 
245  Size maxSize() const;
246 
247 
248  //-------------------- model of concepts::CPointPredicate -----------------------------
249  public:
250 
260  bool operator()( const Point & p ) const;
261 
262  //-------------------- model of CIncrementalPrimitiveComputer -----------------------------
263  public:
264 
274  bool extendAsIs( const InputPoint & p );
275 
286  bool extend( const InputPoint & p );
287 
298  bool isExtendable( const InputPoint & p ) const;
299 
300  //-------------------- model of CAdditivePrimitiveComputer -----------------------------
301  public:
302 
316  template <typename TInputIterator>
317  bool extend( TInputIterator it, TInputIterator itE );
318 
333  template <typename TInputIterator>
334  bool isExtendable( TInputIterator it, TInputIterator itE ) const;
335 
336  //-------------------- Primitive services -----------------------------
337  public:
338 
350 
351  //-------------------- Parameters services -----------------------------
352  public:
353 
360  template <typename Vector3D>
361  void getNormal( Vector3D & normal ) const;
362 
369  template <typename Vector3D>
370  void getUnitNormal( Vector3D & normal ) const;
371 
379  void getBounds( double & min, double & max ) const;
380 
387  const InputPoint & minimalPoint() const;
388 
395  const InputPoint & maximalPoint() const;
396 
397  // ----------------------- Interface --------------------------------------
398  public:
399 
404  void selfDisplay ( std::ostream & out ) const;
405 
410  bool isValid() const;
411 
412  // ------------------------- Private Datas --------------------------------
413  private:
414  std::vector<Dimension> myAxes;
416  mutable std::vector<Dimension> _axesToErase;
417  // ------------------------- Hidden services ------------------------------
418  protected:
419 
420 
421  // ------------------------- Internals ------------------------------------
422  private:
423  }; // end of class ChordGenericNaivePlaneComputer
424 
425 
432  template <typename TSpace, typename TInputPoint, typename TInternalScalar>
433  std::ostream&
434  operator<< ( std::ostream & out,
436 
437 } // namespace DGtal
438 
439 
441 // Includes inline functions.
442 #include "DGtal/geometry/surfaces/ChordGenericNaivePlaneComputer.ih"
443 
444 // //
446 
447 #endif // !defined ChordGenericNaivePlaneComputer_h
448 
449 #undef ChordGenericNaivePlaneComputer_RECURSES
450 #endif // else defined(ChordGenericNaivePlaneComputer_RECURSES)
DGtal::ChordNaivePlaneComputer< Space, InputPoint, InternalScalar >
DGtal::ChordGenericNaivePlaneComputer::getBounds
void getBounds(double &min, double &max) const
DGtal::ChordGenericNaivePlaneComputer::ChordGenericNaivePlaneComputer
ChordGenericNaivePlaneComputer(const ChordGenericNaivePlaneComputer &other)
DGtal::ChordGenericNaivePlaneComputer::init
void init(InternalScalar widthNumerator=NumberTraits< InternalScalar >::ONE, InternalScalar widthDenominator=NumberTraits< InternalScalar >::ONE)
DGtal::ChordGenericNaivePlaneComputer::Iterator
InputPointSet::iterator Iterator
Definition: ChordGenericNaivePlaneComputer.h:141
DGtal::concepts::CSpace
Aim: Defines the concept describing a digital space, ie a cartesian product of integer lines.
Definition: CSpace.h:106
DGtal::ChordGenericNaivePlaneComputer::const_reference
InputPointSet::const_reference const_reference
Definition: ChordGenericNaivePlaneComputer.h:147
max
int max(int a, int b)
Definition: testArithmeticalDSS.cpp:1108
DGtal::NumberTraits
Aim: The traits class for all models of Cinteger.
Definition: NumberTraits.h:533
DGtal::ChordGenericNaivePlaneComputer::InputPoint
TInputPoint InputPoint
Definition: ChordGenericNaivePlaneComputer.h:128
DGtal::ChordGenericNaivePlaneComputer::const_iterator
InputPointSet::const_iterator const_iterator
Definition: ChordGenericNaivePlaneComputer.h:145
DGtal::ChordGenericNaivePlaneComputer::BOOST_STATIC_ASSERT
BOOST_STATIC_ASSERT((TSpace::dimension==3))
DGtal::ChordGenericNaivePlaneComputer::primitive
Primitive primitive() const
DGtal::ChordGenericNaivePlaneComputer::isExtendable
bool isExtendable(const InputPoint &p) const
DGtal::ChordGenericNaivePlaneComputer::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CSignedNumber< TInternalScalar >))
DGtal::ChordGenericNaivePlaneComputer::~ChordGenericNaivePlaneComputer
~ChordGenericNaivePlaneComputer()
DGtal::ChordGenericNaivePlaneComputer::Coordinate
InputPoint::Coordinate Coordinate
Definition: ChordGenericNaivePlaneComputer.h:132
DGtal::ChordGenericNaivePlaneComputer::Size
InputPointSet::size_type Size
Definition: ChordGenericNaivePlaneComputer.h:139
DGtal::Dimension
DGtal::uint32_t Dimension
Definition: Common.h:133
DGtal::ChordGenericNaivePlaneComputer::end
ConstIterator end() const
DGtal::ChordGenericNaivePlaneComputer::value_type
InputPointSet::value_type value_type
Definition: ChordGenericNaivePlaneComputer.h:148
DGtal::ChordGenericNaivePlaneComputer::begin
ConstIterator begin() const
DGtal::ChordGenericNaivePlaneComputer::Primitive
ChordComputer::Primitive Primitive
Definition: ChordGenericNaivePlaneComputer.h:136
DGtal::ChordGenericNaivePlaneComputer::ChordGenericNaivePlaneComputer
ChordGenericNaivePlaneComputer()
DGtal::ChordGenericNaivePlaneComputer::empty
bool empty() const
DGtal::ChordGenericNaivePlaneComputer::InternalScalar
TInternalScalar InternalScalar
Definition: ChordGenericNaivePlaneComputer.h:129
DGtal::concepts::CSignedNumber
Aim: Concept checking for Signed Numbers. Models of this concept should be listed in NumberTraits cla...
Definition: CSignedNumber.h:98
DGtal::ChordGenericNaivePlaneComputer::ConstIterator
InputPointSet::const_iterator ConstIterator
Definition: ChordGenericNaivePlaneComputer.h:140
DGtal::ChordGenericNaivePlaneComputer::InputPointSet
std::set< InputPoint > InputPointSet
Definition: ChordGenericNaivePlaneComputer.h:138
DGtal::ChordGenericNaivePlaneComputer::myAxes
std::vector< Dimension > myAxes
Definition: ChordGenericNaivePlaneComputer.h:414
DGtal::ChordGenericNaivePlaneComputer::minimalPoint
const InputPoint & minimalPoint() const
DGtal::ChordGenericNaivePlaneComputer::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CSpace< TSpace >))
DGtal::ChordGenericNaivePlaneComputer::BOOST_STATIC_ASSERT
BOOST_STATIC_ASSERT((TInputPoint::dimension==3))
DGtal::ChordGenericNaivePlaneComputer::size
Size size() const
DGtal::ChordGenericNaivePlaneComputer::ChordComputer
ChordNaivePlaneComputer< Space, InputPoint, InternalScalar > ChordComputer
Definition: ChordGenericNaivePlaneComputer.h:135
DGtal::ChordGenericNaivePlaneComputer::difference_type
InputPointSet::difference_type difference_type
Definition: ChordGenericNaivePlaneComputer.h:149
DGtal::ChordGenericNaivePlaneComputer::active
Dimension active() const
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition: ClosedIntegerHalfPlane.h:49
DGtal::ChordGenericNaivePlaneComputer::InputVector
InputPoint InputVector
Definition: ChordGenericNaivePlaneComputer.h:130
DGtal::ChordGenericNaivePlaneComputer::operator()
bool operator()(const Point &p) const
DGtal::ChordGenericNaivePlaneComputer::getNormal
void getNormal(Vector3D &normal) const
DGtal::ChordGenericNaivePlaneComputer::max_size
Size max_size() const
DGtal::ChordGenericNaivePlaneComputer::extend
bool extend(const InputPoint &p)
DGtal::operator<<
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
DGtal::ChordGenericNaivePlaneComputer
Aim: A class that recognizes pieces of digital planes of given axis width. When the width is 1,...
Definition: ChordGenericNaivePlaneComputer.h:119
DGtal::ChordGenericNaivePlaneComputer::Space
TSpace Space
Definition: ChordGenericNaivePlaneComputer.h:127
DGtal::ParallelStrip
Aim: A parallel strip in the space is the intersection of two parallel half-planes such that each hal...
Definition: ParallelStrip.h:91
DGtal::ChordGenericNaivePlaneComputer::getUnitNormal
void getUnitNormal(Vector3D &normal) const
DGtal::ChordGenericNaivePlaneComputer::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::ChordGenericNaivePlaneComputer::operator=
ChordGenericNaivePlaneComputer & operator=(const ChordGenericNaivePlaneComputer &other)
DGtal::ChordGenericNaivePlaneComputer::maxSize
Size maxSize() const
DGtal::ChordGenericNaivePlaneComputer::isExtendable
bool isExtendable(TInputIterator it, TInputIterator itE) const
DGtal::ChordGenericNaivePlaneComputer::AxisConstIterator
std::vector< Dimension >::const_iterator AxisConstIterator
Definition: ChordGenericNaivePlaneComputer.h:155
DGtal::ChordGenericNaivePlaneComputer::extend
bool extend(TInputIterator it, TInputIterator itE)
DGtal::ChordGenericNaivePlaneComputer::InternalVector
InternalScalar InternalVector[3]
Definition: ChordGenericNaivePlaneComputer.h:133
DGtal::PointVector< dim, Integer >
DGtal::ChordGenericNaivePlaneComputer::AxisIterator
std::vector< Dimension >::iterator AxisIterator
Definition: ChordGenericNaivePlaneComputer.h:154
DGtal::ChordGenericNaivePlaneComputer::clear
void clear()
DGtal::ChordGenericNaivePlaneComputer::_axesToErase
std::vector< Dimension > _axesToErase
Definition: ChordGenericNaivePlaneComputer.h:416
DGtal::ChordGenericNaivePlaneComputer::extendAsIs
bool extendAsIs(const InputPoint &p)
DGtal::ChordGenericNaivePlaneComputer::myComputers
ChordComputer myComputers[3]
Definition: ChordGenericNaivePlaneComputer.h:415
DGtal::ChordGenericNaivePlaneComputer::const_pointer
InputPointSet::const_pointer const_pointer
Definition: ChordGenericNaivePlaneComputer.h:146
DGtal::ChordGenericNaivePlaneComputer::Component
InputVector::Component Component
Definition: ChordGenericNaivePlaneComputer.h:131
DGtal::ChordGenericNaivePlaneComputer::Point
Space::Point Point
Definition: ChordGenericNaivePlaneComputer.h:134
DGtal::ChordGenericNaivePlaneComputer::maximalPoint
const InputPoint & maximalPoint() const
DGtal::ChordGenericNaivePlaneComputer::size_type
InputPointSet::size_type size_type
Definition: ChordGenericNaivePlaneComputer.h:150
DGtal::ChordGenericNaivePlaneComputer::isValid
bool isValid() const