DGtal  1.1.0
DigitalSetBySTLVector.h
1 
17 #pragma once
18 
35 #if defined(DigitalSetBySTLVector_RECURSES)
36 #error Recursive header files inclusion detected in DigitalSetBySTLVector.h
37 #else // defined(DigitalSetBySTLVector_RECURSES)
38 
39 #define DigitalSetBySTLVector_RECURSES
40 
41 #if !defined DigitalSetBySTLVector_h
42 
43 #define DigitalSetBySTLVector_h
44 
46 // Inclusions
47 #include <iostream>
48 #include <vector>
49 #include <string>
50 #include "DGtal/base/Common.h"
51 #include "DGtal/base/CowPtr.h"
52 #include "DGtal/base/Clone.h"
53 #include "DGtal/base/Alias.h"
54 #include "DGtal/base/ConstAlias.h"
56 
57 namespace DGtal
58 {
59 
61  // template class DigitalSetBySTLVector
79  template <typename TDomain>
81  {
82  public:
83  typedef TDomain Domain;
85  typedef typename Domain::Space Space;
86  typedef typename Domain::Point Point;
87  typedef typename Domain::Size Size;
88  typedef typename std::vector<Point>::const_iterator Iterator;
89  typedef typename std::vector<Point>::const_iterator ConstIterator;
90  typedef typename std::vector<Point>::iterator MutableIterator;
91 
92  // ----------------------- Standard services ------------------------------
93  public:
94 
99 
107 
113 
120 
124  const Domain & domain() const;
125 
130 
131  // ----------------------- Standard Set services --------------------------
132  public:
133 
137  Size size() const;
138 
142  bool empty() const;
143 
150  void insert( const Point & p );
151 
160  template <typename PointInputIterator>
161  void insert( PointInputIterator first, PointInputIterator last );
162 
173  void insertNew( const Point & p );
174 
189  template <typename PointInputIterator>
190  void insertNew( PointInputIterator first, PointInputIterator last );
191 
198  Size erase( const Point & p );
199 
207  void erase( Iterator it );
208 
216  void erase( Iterator first, Iterator last );
217 
222  void clear();
223 
228  ConstIterator find( const Point & p ) const;
229 
234  Iterator find( const Point & p );
235 
240 
245 
250 
255 
261  ( const DigitalSetBySTLVector<Domain> & aSet );
262 
263  // ----------------------- Model of concepts::CPointPredicate -----------------------------
264  public:
265 
270  bool operator()( const Point & p ) const;
271 
272  // ----------------------- Other Set services -----------------------------
273  public:
274 
280  template< typename TOutputIterator >
281  void computeComplement(TOutputIterator& ito) const;
282 
290 
300 
301  // ----------------------- Interface --------------------------------------
302  public:
303 
308  void selfDisplay ( std::ostream & out ) const;
309 
314  bool isValid() const;
315 
316  // ------------------------- Protected Datas ------------------------------
317  protected:
318 
324 
328  std::vector<Point> myVector;
329 
330  // ------------------------- Private Datas --------------------------------
331  private:
332 
333 
334 
335  // --------------- CDrawableWithBoard2D realization --------------------
336  public:
337 
341  std::string className() const;
342 
343  public:
344 
345 
346  // ------------------------- Hidden services ------------------------------
347  protected:
348 
354 
355  // ------------------------- Internals ------------------------------------
356  private:
357 
358  }; // end of class DigitalSetBySTLVector
359 
360 
367  template <typename Domain>
368  std::ostream&
369  operator<< ( std::ostream & out,
370  const DigitalSetBySTLVector<Domain> & object );
371 
372 } // namespace DGtal
373 
374 
376 // Includes inline functions.
377 #include "DGtal/kernel/sets/DigitalSetBySTLVector.ih"
378 
379 // //
381 
382 #endif // !defined DigitalSetBySTLVector_h
383 
384 #undef DigitalSetBySTLVector_RECURSES
385 #endif // else defined(DigitalSetBySTLVector_RECURSES)
DGtal::Clone
Aim: This class encapsulates its parameter class to indicate that the given parameter is required to ...
Definition: Clone.h:267
DGtal::DigitalSetBySTLVector::insertNew
void insertNew(const Point &p)
DGtal::HyperRectDomain< Space >::Space
Space Space
Definition: HyperRectDomain.h:110
DGtal::DigitalSetBySTLVector::DigitalSetBySTLVector
DigitalSetBySTLVector()
lower
Vector lower(const Vector &z, unsigned int k)
Definition: viewDualSurface.cpp:190
DGtal::DigitalSetBySTLVector::ConstIterator
std::vector< Point >::const_iterator ConstIterator
Definition: DigitalSetBySTLVector.h:89
DGtal::DigitalSetBySTLVector::Self
DigitalSetBySTLVector< Domain > Self
Definition: DigitalSetBySTLVector.h:84
DGtal::DigitalSetBySTLVector::insert
void insert(const Point &p)
DGtal::DigitalSetBySTLVector::computeBoundingBox
void computeBoundingBox(Point &lower, Point &upper) const
DGtal::DigitalSetBySTLVector::MutableIterator
std::vector< Point >::iterator MutableIterator
Definition: DigitalSetBySTLVector.h:90
DGtal::DigitalSetBySTLVector::className
std::string className() const
DGtal::DigitalSetBySTLVector::empty
bool empty() const
DGtal::DigitalSetBySTLVector::insertNew
void insertNew(PointInputIterator first, PointInputIterator last)
DGtal::DigitalSetBySTLVector::DigitalSetBySTLVector
DigitalSetBySTLVector(Clone< Domain > d)
DGtal::DigitalSetBySTLVector::end
ConstIterator end() const
DGtal::DigitalSetBySTLVector::myDomain
CowPtr< Domain > myDomain
Definition: DigitalSetBySTLVector.h:323
DGtal::HyperRectDomain< Space >::Size
Space::Size Size
Definition: HyperRectDomain.h:117
DGtal::DigitalSetBySTLVector::end
Iterator end()
DGtal::DigitalSetBySTLVector::computeComplement
void computeComplement(TOutputIterator &ito) const
DGtal::DigitalSetBySTLVector::size
Size size() const
DGtal::DigitalSetBySTLVector::Size
Domain::Size Size
Definition: DigitalSetBySTLVector.h:87
DGtal::DigitalSetBySTLVector::domainPointer
CowPtr< Domain > domainPointer() const
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition: ClosedIntegerHalfPlane.h:49
DGtal::DigitalSetBySTLVector::Point
Domain::Point Point
Definition: DigitalSetBySTLVector.h:86
DGtal::DigitalSetBySTLVector::~DigitalSetBySTLVector
~DigitalSetBySTLVector()
DGtal::DigitalSetBySTLVector::myVector
std::vector< Point > myVector
Definition: DigitalSetBySTLVector.h:328
DGtal::DigitalSetBySTLVector::clear
void clear()
DGtal::DigitalSetBySTLVector::DigitalSetBySTLVector
DigitalSetBySTLVector(const DigitalSetBySTLVector &other)
DGtal::DigitalSetBySTLVector::erase
void erase(Iterator it)
DGtal::operator<<
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
DGtal::DigitalSetBySTLVector::operator()
bool operator()(const Point &p) const
DGtal::DigitalSetBySTLVector::find
ConstIterator find(const Point &p) const
DGtal::DigitalSetBySTLVector::isValid
bool isValid() const
DGtal::DigitalSetBySTLVector::begin
Iterator begin()
upper
Vector upper(const Vector &z, unsigned int k)
Definition: viewDualSurface.cpp:197
DGtal::DigitalSetBySTLVector::operator=
DigitalSetBySTLVector & operator=(const DigitalSetBySTLVector &other)
DGtal::PointVector
Aim: Implements basic operations that will be used in Point and Vector classes.
Definition: PointVector.h:593
DGtal::DigitalSetBySTLVector::begin
ConstIterator begin() const
DGtal::DigitalSetBySTLVector::Space
Domain::Space Space
Definition: DigitalSetBySTLVector.h:85
DGtal::DigitalSetBySTLVector::insert
void insert(PointInputIterator first, PointInputIterator last)
DGtal::DigitalSetBySTLVector::Iterator
std::vector< Point >::const_iterator Iterator
Definition: DigitalSetBySTLVector.h:88
DGtal::DigitalSetBySTLVector::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::DigitalSetBySTLVector::erase
void erase(Iterator first, Iterator last)
DGtal::DigitalSetBySTLVector::assignFromComplement
void assignFromComplement(const DigitalSetBySTLVector< Domain > &other_set)
DGtal::DigitalSetBySTLVector::domain
const Domain & domain() const
DGtal::DigitalSetBySTLVector::Domain
TDomain Domain
Definition: DigitalSetBySTLVector.h:83
DGtal::DigitalSetBySTLVector::find
Iterator find(const Point &p)
DGtal::DigitalSetBySTLVector::erase
Size erase(const Point &p)
DGtal::DigitalSetBySTLVector
Aim: Realizes the concept CDigitalSet by using the STL container std::vector.
Definition: DigitalSetBySTLVector.h:81
DGtal::CowPtr< Domain >