DGtal  1.1.0
CDigitalSetArchetype.h
1 
17 #pragma once
18 
19 #ifndef _MSC_VER
20 #pragma GCC diagnostic ignored "-Wunused-parameter"
21 #endif
22 
23 
36 #if defined(CDigitalSetArchetype_RECURSES)
37 #error Recursive header files inclusion detected in CDigitalSetArchetype.h
38 #else // defined(CDigitalSetArchetype_RECURSES)
39 
40 #define CDigitalSetArchetype_RECURSES
41 
42 #if !defined CDigitalSetArchetype_h
43 
44 #define CDigitalSetArchetype_h
45 
47 // Inclusions
48 #include <iostream>
49 #include <set>
50 #include <string>
51 #include "DGtal/base/Common.h"
52 #include "DGtal/base/CountedPtr.h"
53 #include "DGtal/kernel/sets/CDigitalSet.h"
55 
56 namespace DGtal
57 {
58  namespace concepts
59  {
61  // template class CDigitalSetArchetype
71  template <typename TDomain>
73  {
74  public:
75  typedef TDomain Domain;
76  typedef typename Domain::Point Point;
77  typedef typename Domain::Size Size;
78  //typedef boost::bidirectional_iterator_archetype<Point> Iterator;
81 
82  // ----------------------- Standard services ------------------------------
83  public:
84 
89 
96  CDigitalSetArchetype( const Domain & d ) {}
97 
103 
110  { return *this; }
111 
115  const Domain & domain() const { return DummyObject<Domain>::get(); }
116 
121 
122  // ----------------------- Standard Set services --------------------------
123  public:
124 
128  Size size() const { return 0; }
129 
133  bool empty() const { return true; }
134 
141  void insert( const Point & p ) {}
142 
151  template <typename PointInputIterator>
152  void insert( PointInputIterator first, PointInputIterator last ) {}
153 
163  void insertNew( const Point & p ) {}
164 
175  template <typename PointInputIterator>
176  void insertNew( PointInputIterator first, PointInputIterator last ) {}
177 
184  Size erase( const Point & p ) { return 0; }
185 
192  void erase( Iterator it ) {}
193 
201  void erase( Iterator first, Iterator last ) {}
202 
207  void clear() {}
208 
212  ConstIterator find( const Point & p ) const
213  { return DummyObject<ConstIterator>::get(); }
214 
219  Iterator find( const Point & p )
220  { return DummyObject<Iterator>::get(); }
221 
226  { return DummyObject<ConstIterator>::get(); }
227 
232  { return DummyObject<ConstIterator>::get(); }
233 
238  { return DummyObject<Iterator>::get(); }
239 
244  { return DummyObject<Iterator>::get(); }
245 
251  ( const CDigitalSetArchetype<Domain> & aSet )
252  { return *this; }
253 
254  // ----------------------- Model of concepts::CPointPredicate -----------------------------
255  public:
256 
261  bool operator()( const Point & p ) const
262  { return p == p; }
263 
264  // ----------------------- Other Set services -----------------------------
265  public:
266 
272  template< typename TOutputIterator >
273  void computeComplement(TOutputIterator& ito) const {}
274 
282  {}
283 
292  void computeBoundingBox( Point & lower, Point & upper ) const {}
293 
294 
295  // ----------------------- Interface --------------------------------------
296  public:
297 
302  void selfDisplay ( std::ostream & out ) const {}
303 
308  bool isValid() const { return true; }
309 
310 
311  }; // end of class CDigitalSetArchetype
312  }
313 } // namespace DGtal
314 
315 
316 // //
318 
319 #endif // !defined CDigitalSetArchetype_h
320 
321 #undef CDigitalSetArchetype_RECURSES
322 #endif // else defined(CDigitalSetArchetype_RECURSES)
323 
324 
DGtal::concepts::CDigitalSetArchetype::Point
Domain::Point Point
Definition: CDigitalSetArchetype.h:76
DGtal::DummyObject
Definition: ConceptUtils.h:87
DGtal::concepts::CDigitalSetArchetype::ConstIterator
Iterator ConstIterator
Definition: CDigitalSetArchetype.h:80
DGtal::concepts::CDigitalSetArchetype::erase
void erase(Iterator first, Iterator last)
Definition: CDigitalSetArchetype.h:201
DGtal::concepts::CDigitalSetArchetype::assignFromComplement
void assignFromComplement(const CDigitalSetArchetype< Domain > &other_set)
Definition: CDigitalSetArchetype.h:281
DGtal::concepts::CDigitalSetArchetype::operator()
bool operator()(const Point &p) const
Definition: CDigitalSetArchetype.h:261
lower
Vector lower(const Vector &z, unsigned int k)
Definition: viewDualSurface.cpp:190
DGtal::concepts::CDigitalSetArchetype::Iterator
CSinglePassIteratorArchetype< Point > Iterator
Definition: CDigitalSetArchetype.h:79
DGtal::concepts::CDigitalSetArchetype::computeBoundingBox
void computeBoundingBox(Point &lower, Point &upper) const
Definition: CDigitalSetArchetype.h:292
DGtal::concepts::CDigitalSetArchetype::Domain
TDomain Domain
Definition: CDigitalSetArchetype.h:75
DGtal::concepts::CDigitalSetArchetype::domain
const Domain & domain() const
Definition: CDigitalSetArchetype.h:115
DGtal::concepts::CDigitalSetArchetype::size
Size size() const
Definition: CDigitalSetArchetype.h:128
DGtal::concepts::CDigitalSetArchetype::end
Iterator end()
Definition: CDigitalSetArchetype.h:243
DGtal::concepts::CDigitalSetArchetype::operator=
CDigitalSetArchetype & operator=(const CDigitalSetArchetype &other)
Definition: CDigitalSetArchetype.h:109
DGtal::concepts::CDigitalSetArchetype::insertNew
void insertNew(PointInputIterator first, PointInputIterator last)
Definition: CDigitalSetArchetype.h:176
DGtal::concepts::CDigitalSetArchetype::selfDisplay
void selfDisplay(std::ostream &out) const
Definition: CDigitalSetArchetype.h:302
DGtal::concepts::CDigitalSetArchetype::erase
void erase(Iterator it)
Definition: CDigitalSetArchetype.h:192
DGtal::concepts::CDigitalSetArchetype::Size
Domain::Size Size
Definition: CDigitalSetArchetype.h:77
DGtal::HyperRectDomain< Space >::Size
Space::Size Size
Definition: HyperRectDomain.h:117
DGtal::concepts::CDigitalSetArchetype::find
ConstIterator find(const Point &p) const
Definition: CDigitalSetArchetype.h:212
DGtal::concepts::CDigitalSetArchetype::CDigitalSetArchetype
CDigitalSetArchetype(const Domain &d)
Definition: CDigitalSetArchetype.h:96
DGtal::concepts::CDigitalSetArchetype::empty
bool empty() const
Definition: CDigitalSetArchetype.h:133
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition: ClosedIntegerHalfPlane.h:49
DGtal::concepts::CDigitalSetArchetype::insert
void insert(const Point &p)
Definition: CDigitalSetArchetype.h:141
DGtal::concepts::CDigitalSetArchetype::insertNew
void insertNew(const Point &p)
Definition: CDigitalSetArchetype.h:163
DGtal::concepts::CDigitalSetArchetype::domainPointer
CowPtr< Domain > domainPointer() const
Definition: CDigitalSetArchetype.h:120
DGtal::concepts::CDigitalSetArchetype::clear
void clear()
Definition: CDigitalSetArchetype.h:207
DGtal::concepts::CDigitalSetArchetype::computeComplement
void computeComplement(TOutputIterator &ito) const
Definition: CDigitalSetArchetype.h:273
DGtal::concepts::CDigitalSetArchetype::erase
Size erase(const Point &p)
Definition: CDigitalSetArchetype.h:184
upper
Vector upper(const Vector &z, unsigned int k)
Definition: viewDualSurface.cpp:197
DGtal::PointVector< dim, Integer >
DGtal::concepts::CDigitalSetArchetype
Aim: The archetype of a container class for storing sets of digital points within some given domain.
Definition: CDigitalSetArchetype.h:73
DGtal::concepts::CDigitalSetArchetype::begin
ConstIterator begin() const
Definition: CDigitalSetArchetype.h:225
DGtal::concepts::CDigitalSetArchetype::begin
Iterator begin()
Definition: CDigitalSetArchetype.h:237
DGtal::concepts::CDigitalSetArchetype::CDigitalSetArchetype
CDigitalSetArchetype(const CDigitalSetArchetype &other)
Definition: CDigitalSetArchetype.h:102
DGtal::concepts::CDigitalSetArchetype::insert
void insert(PointInputIterator first, PointInputIterator last)
Definition: CDigitalSetArchetype.h:152
DGtal::concepts::CDigitalSetArchetype::isValid
bool isValid() const
Definition: CDigitalSetArchetype.h:308
DGtal::concepts::CDigitalSetArchetype::find
Iterator find(const Point &p)
Definition: CDigitalSetArchetype.h:219
DGtal::concepts::CDigitalSetArchetype::~CDigitalSetArchetype
~CDigitalSetArchetype()
Definition: CDigitalSetArchetype.h:88
DGtal::CSinglePassIteratorArchetype
An archetype of SingePassIterator.
Definition: BasicArchetypes.h:61
DGtal::concepts::CDigitalSetArchetype::end
ConstIterator end() const
Definition: CDigitalSetArchetype.h:231
DGtal::CowPtr< Domain >