DGtal  1.3.beta
COBAGenericNaivePlaneComputer.h
1 
17 #pragma once
18 
33 #if defined(COBAGenericNaivePlaneComputer_RECURSES)
34 #error Recursive header files inclusion detected in COBAGenericNaivePlaneComputer.h
35 #else // defined(COBAGenericNaivePlaneComputer_RECURSES)
36 
37 #define COBAGenericNaivePlaneComputer_RECURSES
38 
39 #if !defined COBAGenericNaivePlaneComputer_h
40 
41 #define COBAGenericNaivePlaneComputer_h
42 
44 // Inclusions
45 #include <iostream>
46 #include <set>
47 #include "DGtal/base/Common.h"
48 #include "DGtal/kernel/CInteger.h"
49 #include "DGtal/kernel/CSpace.h"
50 #include "DGtal/kernel/SpaceND.h"
51 #include "DGtal/kernel/PointVector.h"
52 #include "DGtal/arithmetic/IntegerComputer.h"
53 #include "DGtal/geometry/surfaces/COBANaivePlaneComputer.h"
55 
56 namespace DGtal
57 {
58 
60  // template class COBAGenericNaivePlaneComputer
119  template < typename TSpace,
120  typename TInternalInteger >
122  {
123 
126  BOOST_STATIC_ASSERT(( TSpace::dimension == 3 ));
127 
128  // ----------------------- public types ------------------------------
129  public:
130  typedef TSpace Space;
131  typedef typename Space::Point Point;
132  typedef std::set< Point > PointSet;
133  typedef typename PointSet::size_type Size;
134  typedef typename PointSet::const_iterator ConstIterator;
135  typedef typename PointSet::iterator Iterator;
136  typedef TInternalInteger InternalInteger;
140 
141  // ----------------------- std public types ------------------------------
142  public:
143  typedef typename PointSet::const_iterator const_iterator;
144  typedef typename PointSet::const_pointer const_pointer;
145  typedef typename PointSet::const_reference const_reference;
146  typedef typename PointSet::value_type value_type;
147  typedef typename PointSet::difference_type difference_type;
148  typedef typename PointSet::size_type size_type;
149 
150  // ----------------------- internal types ------------------------------
151  private:
152  typedef std::vector<Dimension>::iterator AxisIterator;
153  typedef std::vector<Dimension>::const_iterator AxisConstIterator;
154  // ----------------------- Standard services ------------------------------
155  public:
156 
161 
167 
173 
180 
184  MyIntegerComputer & ic() const;
185 
189  Dimension active() const;
190 
195  void clear();
196 
214  void init( InternalInteger diameter,
217 
221  Size complexity() const;
222 
223  //-------------------- model of ForwardContainer -----------------------------
224  public:
225 
229  Size size() const;
230 
234  bool empty() const;
235 
239  ConstIterator begin() const;
240 
244  ConstIterator end() const;
245 
251  Size max_size() const;
252 
257  Size maxSize() const;
258 
259 
260  //-------------------- model of concepts::CPointPredicate -----------------------------
261  public:
262 
272  bool operator()( const Point & p ) const;
273 
274  //-------------------- model of CIncrementalPrimitiveComputer -----------------------------
275  public:
276 
286  bool extendAsIs( const Point & p );
287 
298  bool extend( const Point & p );
299 
310  bool isExtendable( const Point & p ) const;
311 
312  //-------------------- model of CAdditivePrimitiveComputer -----------------------------
313  public:
314 
328  template <typename TInputIterator>
329  bool extend( TInputIterator it, TInputIterator itE );
330 
345  template <typename TInputIterator>
346  bool isExtendable( TInputIterator it, TInputIterator itE ) const;
347 
348  //-------------------- Primitive services -----------------------------
349  public:
350 
361  Primitive primitive() const;
362 
363  //-------------------- Parameters services -----------------------------
364  public:
365 
372  template <typename Vector3D>
373  void getNormal( Vector3D & normal ) const;
374 
381  template <typename Vector3D>
382  void getUnitNormal( Vector3D & normal ) const;
383 
391  void getBounds( double & min, double & max ) const;
392 
399  const Point & minimalPoint() const;
400 
407  const Point & maximalPoint() const;
408 
409  // ----------------------- Interface --------------------------------------
410  public:
411 
416  void selfDisplay ( std::ostream & out ) const;
417 
422  bool isValid() const;
423 
424  // ------------------------- Private Datas --------------------------------
425  private:
426  std::vector<Dimension> myAxes;
428  mutable std::vector<Dimension> _axesToErase;
429  // ------------------------- Hidden services ------------------------------
430  protected:
431 
432 
433  // ------------------------- Internals ------------------------------------
434  private:
435  }; // end of class COBAGenericNaivePlaneComputer
436 
437 
444  template <typename TSpace, typename TInternalInteger>
445  std::ostream&
446  operator<< ( std::ostream & out, const COBAGenericNaivePlaneComputer<TSpace, TInternalInteger> & object );
447 
448 } // namespace DGtal
449 
450 
452 // Includes inline functions.
453 #include "DGtal/geometry/surfaces/COBAGenericNaivePlaneComputer.ih"
454 
455 // //
457 
458 #endif // !defined COBAGenericNaivePlaneComputer_h
459 
460 #undef COBAGenericNaivePlaneComputer_RECURSES
461 #endif // else defined(COBAGenericNaivePlaneComputer_RECURSES)
DGtal::COBAGenericNaivePlaneComputer::AxisIterator
std::vector< Dimension >::iterator AxisIterator
Definition: COBAGenericNaivePlaneComputer.h:152
DGtal::COBAGenericNaivePlaneComputer::extendAsIs
bool extendAsIs(const Point &p)
DGtal::COBAGenericNaivePlaneComputer::init
void init(InternalInteger diameter, InternalInteger widthNumerator=NumberTraits< InternalInteger >::ONE, InternalInteger widthDenominator=NumberTraits< InternalInteger >::ONE)
DGtal::COBAGenericNaivePlaneComputer::active
Dimension active() const
DGtal::COBAGenericNaivePlaneComputer::getBounds
void getBounds(double &min, double &max) const
DGtal::concepts::CSpace
Aim: Defines the concept describing a digital space, ie a cartesian product of integer lines.
Definition: CSpace.h:105
DGtal::COBAGenericNaivePlaneComputer::complexity
Size complexity() const
DGtal::concepts::CInteger
Aim: Concept checking for Integer Numbers. More precisely, this concept is a refinement of both CEucl...
Definition: CInteger.h:87
DGtal::COBAGenericNaivePlaneComputer::~COBAGenericNaivePlaneComputer
~COBAGenericNaivePlaneComputer()
max
int max(int a, int b)
Definition: testArithmeticalDSS.cpp:1108
DGtal::COBAGenericNaivePlaneComputer::Point
Space::Point Point
Definition: COBAGenericNaivePlaneComputer.h:131
DGtal::NumberTraits
Aim: The traits class for all models of Cinteger.
Definition: NumberTraits.h:562
DGtal::COBAGenericNaivePlaneComputer::myComputers
COBAComputer myComputers[3]
Definition: COBAGenericNaivePlaneComputer.h:427
DGtal::COBAGenericNaivePlaneComputer::minimalPoint
const Point & minimalPoint() const
DGtal::IntegerComputer
Aim: This class gathers several types and methods to make computation with integers.
Definition: IntegerComputer.h:82
DGtal::COBAGenericNaivePlaneComputer::getUnitNormal
void getUnitNormal(Vector3D &normal) const
DGtal::COBAGenericNaivePlaneComputer::_axesToErase
std::vector< Dimension > _axesToErase
Definition: COBAGenericNaivePlaneComputer.h:428
DGtal::Dimension
DGtal::uint32_t Dimension
Definition: Common.h:137
DGtal::COBAGenericNaivePlaneComputer::BOOST_STATIC_ASSERT
BOOST_STATIC_ASSERT((TSpace::dimension==3))
DGtal::COBAGenericNaivePlaneComputer
Aim: A class that recognizes pieces of digital planes of given axis width. When the width is 1,...
Definition: COBAGenericNaivePlaneComputer.h:121
DGtal::COBAGenericNaivePlaneComputer::Iterator
PointSet::iterator Iterator
Definition: COBAGenericNaivePlaneComputer.h:135
DGtal::COBAGenericNaivePlaneComputer::getNormal
void getNormal(Vector3D &normal) const
DGtal::COBAGenericNaivePlaneComputer::difference_type
PointSet::difference_type difference_type
Definition: COBAGenericNaivePlaneComputer.h:147
DGtal::COBAGenericNaivePlaneComputer::begin
ConstIterator begin() const
DGtal::COBAGenericNaivePlaneComputer::myAxes
std::vector< Dimension > myAxes
Definition: COBAGenericNaivePlaneComputer.h:426
DGtal::COBAGenericNaivePlaneComputer::end
ConstIterator end() const
DGtal::COBAGenericNaivePlaneComputer::extend
bool extend(const Point &p)
DGtal::operator<<
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
DGtal::COBAGenericNaivePlaneComputer::MyIntegerComputer
IntegerComputer< InternalInteger > MyIntegerComputer
Definition: COBAGenericNaivePlaneComputer.h:137
DGtal::COBAGenericNaivePlaneComputer::isValid
bool isValid() const
DGtal::COBAGenericNaivePlaneComputer::const_iterator
PointSet::const_iterator const_iterator
Definition: COBAGenericNaivePlaneComputer.h:143
DGtal::COBAGenericNaivePlaneComputer::empty
bool empty() const
DGtal::COBAGenericNaivePlaneComputer::AxisConstIterator
std::vector< Dimension >::const_iterator AxisConstIterator
Definition: COBAGenericNaivePlaneComputer.h:153
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::COBAGenericNaivePlaneComputer::Space
TSpace Space
Definition: COBAGenericNaivePlaneComputer.h:130
DGtal::COBAGenericNaivePlaneComputer::ConstIterator
PointSet::const_iterator ConstIterator
Definition: COBAGenericNaivePlaneComputer.h:134
DGtal::COBAGenericNaivePlaneComputer::isExtendable
bool isExtendable(const Point &p) const
DGtal::COBAGenericNaivePlaneComputer::ic
MyIntegerComputer & ic() const
DGtal::COBAGenericNaivePlaneComputer::clear
void clear()
DGtal::COBAGenericNaivePlaneComputer::maxSize
Size maxSize() const
DGtal::COBAGenericNaivePlaneComputer::PointSet
std::set< Point > PointSet
Definition: COBAGenericNaivePlaneComputer.h:132
DGtal::COBAGenericNaivePlaneComputer::COBAGenericNaivePlaneComputer
COBAGenericNaivePlaneComputer()
DGtal::ParallelStrip
Aim: A parallel strip in the space is the intersection of two parallel half-planes such that each hal...
Definition: ParallelStrip.h:90
DGtal::COBAGenericNaivePlaneComputer::InternalInteger
TInternalInteger InternalInteger
Definition: COBAGenericNaivePlaneComputer.h:136
DGtal::COBAGenericNaivePlaneComputer::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::COBAGenericNaivePlaneComputer::maximalPoint
const Point & maximalPoint() const
DGtal::PointVector< dim, Integer >
DGtal::COBAGenericNaivePlaneComputer::operator=
COBAGenericNaivePlaneComputer & operator=(const COBAGenericNaivePlaneComputer &other)
DGtal::COBAGenericNaivePlaneComputer::const_pointer
PointSet::const_pointer const_pointer
Definition: COBAGenericNaivePlaneComputer.h:144
DGtal::COBAGenericNaivePlaneComputer::COBAComputer
COBANaivePlaneComputer< Space, InternalInteger > COBAComputer
Definition: COBAGenericNaivePlaneComputer.h:138
DGtal::COBAGenericNaivePlaneComputer::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CSpace< TSpace >))
DGtal::COBANaivePlaneComputer< Space, InternalInteger >
DGtal::COBAGenericNaivePlaneComputer::size
Size size() const
DGtal::COBAGenericNaivePlaneComputer::value_type
PointSet::value_type value_type
Definition: COBAGenericNaivePlaneComputer.h:146
DGtal::COBAGenericNaivePlaneComputer::size_type
PointSet::size_type size_type
Definition: COBAGenericNaivePlaneComputer.h:148
DGtal::COBAGenericNaivePlaneComputer::primitive
Primitive primitive() const
DGtal::COBAGenericNaivePlaneComputer::Primitive
COBAComputer::Primitive Primitive
Definition: COBAGenericNaivePlaneComputer.h:139
DGtal::COBAGenericNaivePlaneComputer::const_reference
PointSet::const_reference const_reference
Definition: COBAGenericNaivePlaneComputer.h:145
DGtal::COBAGenericNaivePlaneComputer::operator()
bool operator()(const Point &p) const
DGtal::COBAGenericNaivePlaneComputer::max_size
Size max_size() const
DGtal::COBAGenericNaivePlaneComputer::Size
PointSet::size_type Size
Definition: COBAGenericNaivePlaneComputer.h:133