DGtal  1.5.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)
37 #define COBAGenericNaivePlaneComputer_RECURSES
38 
39 #if !defined COBAGenericNaivePlaneComputer_h
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 
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 
240 
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 
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)
Aim: A class that recognizes pieces of digital planes of given axis width. When the width is 1,...
BOOST_CONCEPT_ASSERT((concepts::CSpace< TSpace >))
void getUnitNormal(Vector3D &normal) const
IntegerComputer< InternalInteger > MyIntegerComputer
BOOST_STATIC_ASSERT((TSpace::dimension==3))
void selfDisplay(std::ostream &out) const
std::vector< Dimension >::const_iterator AxisConstIterator
void getNormal(Vector3D &normal) const
MyIntegerComputer & ic() const
void getBounds(double &min, double &max) const
std::vector< Dimension >::iterator AxisIterator
const Point & minimalPoint() const
BOOST_CONCEPT_ASSERT((concepts::CInteger< TInternalInteger >))
bool operator()(const Point &p) const
bool isExtendable(TInputIterator it, TInputIterator itE) const
bool isExtendable(const Point &p) const
void init(InternalInteger diameter, InternalInteger widthNumerator=NumberTraits< InternalInteger >::ONE, InternalInteger widthDenominator=NumberTraits< InternalInteger >::ONE)
COBAGenericNaivePlaneComputer(const COBAGenericNaivePlaneComputer &other)
COBANaivePlaneComputer< Space, InternalInteger > COBAComputer
COBAGenericNaivePlaneComputer & operator=(const COBAGenericNaivePlaneComputer &other)
const Point & maximalPoint() const
bool extend(TInputIterator it, TInputIterator itE)
Aim: This class gathers several types and methods to make computation with integers.
Aim: A parallel strip in the space is the intersection of two parallel half-planes such that each hal...
Definition: ParallelStrip.h:91
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
DGtal::uint32_t Dimension
Definition: Common.h:136
Aim: The traits class for all models of Cinteger.
Definition: NumberTraits.h:564
Aim: Concept checking for Integer Numbers. More precisely, this concept is a refinement of both CEucl...
Definition: CInteger.h:88
Aim: Defines the concept describing a digital space, ie a cartesian product of integer lines.
Definition: CSpace.h:106
int max(int a, int b)