DGtal  1.3.beta
CDigitalSet.h
1 
17 #pragma once
18 
35 #if defined(CDigitalSet_RECURSES)
36 #error Recursive header files inclusion detected in CDigitalSet.h
37 #else // defined(CDigitalSet_RECURSES)
38 
39 #define CDigitalSet_RECURSES
40 
41 #if !defined CDigitalSet_h
42 
43 #define CDigitalSet_h
44 
46 // Inclusions
47 #include <iostream>
48 #include "boost/concept_check.hpp"
49 #include "DGtal/base/Common.h"
50 #include "DGtal/base/CowPtr.h"
51 #include "DGtal/kernel/CPointPredicate.h"
52 #include "DGtal/kernel/domains/CDomain.h"
54 
55 namespace DGtal
56 {
57  namespace concepts
58  {
60  // class CDigitalSet
62  // class CDigitalSet
137  template <typename T>
138  struct CDigitalSet :
141  {
142  // ----------------------- Concept checks ------------------------------
143  public:
144  // 1. define first provided types (i.e. inner types), like
145  typedef typename T::Domain Domain;
146  typedef typename T::Point Point;
147  typedef typename T::Size Size;
148  typedef typename T::Iterator Iterator;
149  typedef typename T::ConstIterator ConstIterator;
150 
154 
155  // 2. then check the presence of data members, operators and methods with
157  {
160  }
165  {
166  ConceptUtils::sameType( myDomain, myX.domain() );
167  ConceptUtils::sameType( myDomainPtr, myX.domainPointer() );
168  ConceptUtils::sameType( mySize, myX.size() );
169  ConceptUtils::sameType( myBool, myX.empty() );
170 
174  }
175 
180  {
181  myX.insert( myPoint );
182  // template <typename PointInputIterator>
183  // BOOST_CONCEPT_REQUIRES
184  // ( ((boost::InputIterator<PointInputIterator>)),
185  // (void) )
186  // myX.insert( PointInputIterator, PointInputIterator );
187  myX.insertNew( myPoint );
189  myX.erase( myIterator );
190  myX.erase( myIterator, myIterator );
191  myX.clear();
192  ConceptUtils::sameType( myX, myX.operator+=( myX ) );
193  myX.computeComplement( myOutputIt );
194  myX.assignFromComplement( myX );
195  myX.computeBoundingBox( myPoint, myPoint );
199  }
200 
201  // ------------------------- Private Datas --------------------------------
202  private:
203  T myX; // only if T is default constructible.
207  bool myBool;
212  // ------------------------- Internals ------------------------------------
213  private:
214 
215  }; // end of concept CDigitalSet
216  }
217 } // namespace DGtal
218 
219 // //
221 
222 #endif // !defined CDigitalSet_h
223 
224 #undef CDigitalSet_RECURSES
225 #endif // else defined(CDigitalSet_RECURSES)
ConstIterator
MyDigitalSurface::ConstIterator ConstIterator
Definition: greedy-plane-segmentation-ex2.cpp:93
DGtal::concepts::CDigitalSet::mySize
Size mySize
Definition: CDigitalSet.h:206
DGtal::concepts::CDigitalSet::Size
T::Size Size
Definition: CDigitalSet.h:147
boost_concepts::SinglePassIteratorConcept
Go to http://www.boost.org/doc/libs/1_52_0/libs/iterator/doc/SinglePassIterator.html.
Definition: BoostConcepts.dox:44
DGtal::concepts::CDigitalSet::myX
T myX
Definition: CDigitalSet.h:203
DGtal::concepts::CDigitalSet::myDomain
Domain myDomain
Definition: CDigitalSet.h:204
DGtal::concepts::CDigitalSet::myPoint
Point myPoint
Definition: CDigitalSet.h:208
Size
HalfEdgeDataStructure::Size Size
Definition: testHalfEdgeDataStructure.cpp:50
DGtal::concepts::CDigitalSet::myConstIterator
ConstIterator myConstIterator
Definition: CDigitalSet.h:210
DGtal::concepts::CDigitalSet::myDomainPtr
CowPtr< Domain > myDomainPtr
Definition: CDigitalSet.h:205
DGtal::concepts::CDomain
Aim: This concept represents a digital domain, i.e. a non mutable subset of points of the given digit...
Definition: CDomain.h:129
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Domain
HyperRectDomain< Space > Domain
Definition: testSimpleRandomAccessRangeFromPoint.cpp:44
DGtal::concepts::CDigitalSet::checkNonConstConstraints
void checkNonConstConstraints()
Definition: CDigitalSet.h:179
DGtal::concepts::CDigitalSet::Point
T::Point Point
Definition: CDigitalSet.h:146
DGtal::concepts::CDigitalSet::BOOST_CONCEPT_USAGE
BOOST_CONCEPT_USAGE(CDigitalSet)
Definition: CDigitalSet.h:156
boost::CopyConstructible
Go to http://www.sgi.com/tech/stl/CopyConstructible.html.
Definition: Boost.dox:34
DGtal::concepts::CDigitalSet::Domain
T::Domain Domain
Definition: CDigitalSet.h:145
DGtal::concepts::CDigitalSet::myOutputIt
Point * myOutputIt
Definition: CDigitalSet.h:211
DGtal::concepts::CDigitalSet::ConstIterator
T::ConstIterator ConstIterator
Definition: CDigitalSet.h:149
DGtal::concepts::ConceptUtils::sameType
void sameType(const T &, const T &)
Definition: ConceptUtils.h:117
DGtal::concepts::CDigitalSet::Iterator
T::Iterator Iterator
Definition: CDigitalSet.h:148
DGtal::concepts::CPointPredicate
Aim: Defines a predicate on a point.
Definition: CPointPredicate.h:80
boost_concepts::ReadableIteratorConcept
Go to http://www.boost.org/doc/libs/1_52_0/libs/iterator/doc/ReadableIterator.html.
Definition: BoostConcepts.dox:29
DGtal::concepts::CDigitalSet
Aim: Represents a set of points within the given domain. This set of points is modifiable by the user...
Definition: CDigitalSet.h:138
DGtal::concepts::CDigitalSet::myIterator
Iterator myIterator
Definition: CDigitalSet.h:209
Point
MyPointD Point
Definition: testClone2.cpp:383
DGtal::concepts::CDigitalSet::checkConstConstraints
void checkConstConstraints() const
Definition: CDigitalSet.h:164
DGtal::concepts::CDigitalSet::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CDomain< Domain >))
DGtal::concepts::CDigitalSet::myBool
bool myBool
Definition: CDigitalSet.h:207
DGtal::CowPtr< Domain >