DGtal  1.5.beta
DGtal::concepts::CDigitalSetArchetype< TDomain > Class Template Reference

Aim: The archetype of a container class for storing sets of digital points within some given domain. More...

#include <DGtal/kernel/sets/CDigitalSetArchetype.h>

Public Types

typedef TDomain Domain
 
typedef Domain::Point Point
 
typedef Domain::Size Size
 
typedef CSinglePassIteratorArchetype< PointIterator
 
typedef Iterator ConstIterator
 

Public Member Functions

 ~CDigitalSetArchetype ()
 
 CDigitalSetArchetype (const Domain &d)
 
 CDigitalSetArchetype (const CDigitalSetArchetype &other)
 
CDigitalSetArchetypeoperator= (const CDigitalSetArchetype &other)
 
const Domaindomain () const
 
CowPtr< DomaindomainPointer () const
 
Size size () const
 
bool empty () const
 
void insert (const Point &p)
 
template<typename PointInputIterator >
void insert (PointInputIterator first, PointInputIterator last)
 
void insertNew (const Point &p)
 
template<typename PointInputIterator >
void insertNew (PointInputIterator first, PointInputIterator last)
 
Size erase (const Point &p)
 
void erase (Iterator it)
 
void erase (Iterator first, Iterator last)
 
void clear ()
 
ConstIterator find (const Point &p) const
 
Iterator find (const Point &p)
 
ConstIterator begin () const
 
ConstIterator end () const
 
Iterator begin ()
 
Iterator end ()
 
CDigitalSetArchetype< Domain > & operator+= (const CDigitalSetArchetype< Domain > &aSet)
 
bool operator() (const Point &p) const
 
template<typename TOutputIterator >
void computeComplement (TOutputIterator &ito) const
 
void assignFromComplement (const CDigitalSetArchetype< Domain > &other_set)
 
void computeBoundingBox (Point &lower, Point &upper) const
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 

Detailed Description

template<typename TDomain>
class DGtal::concepts::CDigitalSetArchetype< TDomain >

Aim: The archetype of a container class for storing sets of digital points within some given domain.

Description of template class 'CDigitalSetArchetype'

Archetype of CDigitalSet.

Definition at line 72 of file CDigitalSetArchetype.h.

Member Typedef Documentation

◆ ConstIterator

template<typename TDomain >
typedef Iterator DGtal::concepts::CDigitalSetArchetype< TDomain >::ConstIterator

Definition at line 80 of file CDigitalSetArchetype.h.

◆ Domain

template<typename TDomain >
typedef TDomain DGtal::concepts::CDigitalSetArchetype< TDomain >::Domain

Definition at line 75 of file CDigitalSetArchetype.h.

◆ Iterator

template<typename TDomain >
typedef CSinglePassIteratorArchetype<Point> DGtal::concepts::CDigitalSetArchetype< TDomain >::Iterator

Definition at line 79 of file CDigitalSetArchetype.h.

◆ Point

template<typename TDomain >
typedef Domain::Point DGtal::concepts::CDigitalSetArchetype< TDomain >::Point

Definition at line 76 of file CDigitalSetArchetype.h.

◆ Size

template<typename TDomain >
typedef Domain::Size DGtal::concepts::CDigitalSetArchetype< TDomain >::Size

Definition at line 77 of file CDigitalSetArchetype.h.

Constructor & Destructor Documentation

◆ ~CDigitalSetArchetype()

template<typename TDomain >
DGtal::concepts::CDigitalSetArchetype< TDomain >::~CDigitalSetArchetype ( )
inline

Destructor.

Definition at line 88 of file CDigitalSetArchetype.h.

88 {}

◆ CDigitalSetArchetype() [1/2]

template<typename TDomain >
DGtal::concepts::CDigitalSetArchetype< TDomain >::CDigitalSetArchetype ( const Domain d)
inline

Constructor. Creates the empty set in the domain [d].

Parameters
dany domain.

Definition at line 96 of file CDigitalSetArchetype.h.

96 {}

◆ CDigitalSetArchetype() [2/2]

template<typename TDomain >
DGtal::concepts::CDigitalSetArchetype< TDomain >::CDigitalSetArchetype ( const CDigitalSetArchetype< TDomain > &  other)
inline

Copy constructor.

Parameters
otherthe object to clone.

Definition at line 102 of file CDigitalSetArchetype.h.

102 {}

Member Function Documentation

◆ assignFromComplement()

template<typename TDomain >
void DGtal::concepts::CDigitalSetArchetype< TDomain >::assignFromComplement ( const CDigitalSetArchetype< Domain > &  other_set)
inline

Builds the complement in the domain of the set [other_set] in this.

Parameters
other_setdefines the set whose complement is assigned to 'this'.

Definition at line 281 of file CDigitalSetArchetype.h.

282  {}

◆ begin() [1/2]

template<typename TDomain >
Iterator DGtal::concepts::CDigitalSetArchetype< TDomain >::begin ( )
inline
Returns
an iterator on the first element in this set.

Definition at line 237 of file CDigitalSetArchetype.h.

238  { return DummyObject<Iterator>::get(); }

◆ begin() [2/2]

template<typename TDomain >
ConstIterator DGtal::concepts::CDigitalSetArchetype< TDomain >::begin ( ) const
inline
Returns
a const iterator on the first element in this set.

Definition at line 225 of file CDigitalSetArchetype.h.

226  { return DummyObject<ConstIterator>::get(); }

◆ clear()

template<typename TDomain >
void DGtal::concepts::CDigitalSetArchetype< TDomain >::clear ( )
inline

Clears the set.

Postcondition
this set is empty.

Definition at line 207 of file CDigitalSetArchetype.h.

207 {}

◆ computeBoundingBox()

template<typename TDomain >
void DGtal::concepts::CDigitalSetArchetype< TDomain >::computeBoundingBox ( Point lower,
Point upper 
) const
inline

Computes the bounding box of this set.

Parameters
lowerthe first point of the bounding box (lowest in all directions).
upperthe last point of the bounding box (highest in all directions).

Definition at line 292 of file CDigitalSetArchetype.h.

292 {}

◆ computeComplement()

template<typename TDomain >
template<typename TOutputIterator >
void DGtal::concepts::CDigitalSetArchetype< TDomain >::computeComplement ( TOutputIterator &  ito) const
inline

Computes the complement in the domain of this set

Parameters
itoan output iterator
Template Parameters
TOutputIteratora model of output iterator

Definition at line 273 of file CDigitalSetArchetype.h.

273 {}

◆ domain()

template<typename TDomain >
const Domain& DGtal::concepts::CDigitalSetArchetype< TDomain >::domain ( ) const
inline
Returns
the embedding domain.

Definition at line 115 of file CDigitalSetArchetype.h.

115 { return DummyObject<Domain>::get(); }

◆ domainPointer()

template<typename TDomain >
CowPtr<Domain> DGtal::concepts::CDigitalSetArchetype< TDomain >::domainPointer ( ) const
inline
Returns
the embedding domain.

Definition at line 120 of file CDigitalSetArchetype.h.

120 { return DummyObject< CowPtr<Domain> >::get(); }

◆ empty()

template<typename TDomain >
bool DGtal::concepts::CDigitalSetArchetype< TDomain >::empty ( ) const
inline
Returns
'true' iff the set is empty (no element).

Definition at line 133 of file CDigitalSetArchetype.h.

133 { return true; }

◆ end() [1/2]

template<typename TDomain >
Iterator DGtal::concepts::CDigitalSetArchetype< TDomain >::end ( )
inline
Returns
a iterator on the element after the last in this set.

Definition at line 243 of file CDigitalSetArchetype.h.

244  { return DummyObject<Iterator>::get(); }

◆ end() [2/2]

template<typename TDomain >
ConstIterator DGtal::concepts::CDigitalSetArchetype< TDomain >::end ( ) const
inline
Returns
a const iterator on the element after the last in this set.

Definition at line 231 of file CDigitalSetArchetype.h.

232  { return DummyObject<ConstIterator>::get(); }

◆ erase() [1/3]

template<typename TDomain >
Size DGtal::concepts::CDigitalSetArchetype< TDomain >::erase ( const Point p)
inline

Removes point [p] from the set.

Parameters
pthe point to remove.
Returns
the number of removed elements (0 or 1).

Definition at line 184 of file CDigitalSetArchetype.h.

184 { return 0; }

◆ erase() [2/3]

template<typename TDomain >
void DGtal::concepts::CDigitalSetArchetype< TDomain >::erase ( Iterator  first,
Iterator  last 
)
inline

Removes the collection of points specified by the two iterators from this set.

Parameters
firstthe start point in this set.
lastthe last point in this set.

Definition at line 201 of file CDigitalSetArchetype.h.

201 {}

◆ erase() [3/3]

template<typename TDomain >
void DGtal::concepts::CDigitalSetArchetype< TDomain >::erase ( Iterator  it)
inline

Removes the point pointed by [it] from the set.

Parameters
itan iterator on this set. Note: generally faster than giving just the point.

Definition at line 192 of file CDigitalSetArchetype.h.

192 {}

◆ find() [1/2]

template<typename TDomain >
Iterator DGtal::concepts::CDigitalSetArchetype< TDomain >::find ( const Point p)
inline
Parameters
pany digital point.
Returns
an iterator pointing on [p] if found, otherwise end().

Definition at line 219 of file CDigitalSetArchetype.h.

220  { return DummyObject<Iterator>::get(); }

◆ find() [2/2]

template<typename TDomain >
ConstIterator DGtal::concepts::CDigitalSetArchetype< TDomain >::find ( const Point p) const
inline
Parameters
pany digital point.

Definition at line 212 of file CDigitalSetArchetype.h.

213  { return DummyObject<ConstIterator>::get(); }

◆ insert() [1/2]

template<typename TDomain >
void DGtal::concepts::CDigitalSetArchetype< TDomain >::insert ( const Point p)
inline

Adds point [p] to this set.

Parameters
pany digital point.
Precondition
p should belong to the associated domain.

Definition at line 141 of file CDigitalSetArchetype.h.

141 {}

◆ insert() [2/2]

template<typename TDomain >
template<typename PointInputIterator >
void DGtal::concepts::CDigitalSetArchetype< TDomain >::insert ( PointInputIterator  first,
PointInputIterator  last 
)
inline

Adds the collection of points specified by the two iterators to this set.

Parameters
firstthe start point in the collection of Point.
lastthe last point in the collection of Point.
Precondition
all points should belong to the associated domain.

Definition at line 152 of file CDigitalSetArchetype.h.

152 {}

◆ insertNew() [1/2]

template<typename TDomain >
void DGtal::concepts::CDigitalSetArchetype< TDomain >::insertNew ( const Point p)
inline

Adds point [p] to this set if the point is not already in the set.

Parameters
pany digital point.
Precondition
p should belong to the associated domain.
p should not belong to this.

Definition at line 163 of file CDigitalSetArchetype.h.

163 {}

◆ insertNew() [2/2]

template<typename TDomain >
template<typename PointInputIterator >
void DGtal::concepts::CDigitalSetArchetype< TDomain >::insertNew ( PointInputIterator  first,
PointInputIterator  last 
)
inline

Adds the collection of points specified by the two iterators to this set.

Parameters
firstthe start point in the collection of Point.
lastthe last point in the collection of Point.
Precondition
all points should belong to the associated domain.
each point should not belong to this.

Definition at line 176 of file CDigitalSetArchetype.h.

176 {}

◆ isValid()

template<typename TDomain >
bool DGtal::concepts::CDigitalSetArchetype< TDomain >::isValid ( ) const
inline

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.

Definition at line 308 of file CDigitalSetArchetype.h.

308 { return true; }

◆ operator()()

template<typename TDomain >
bool DGtal::concepts::CDigitalSetArchetype< TDomain >::operator() ( const Point p) const
inline
Parameters
pany point.
Returns
'true' if and only if p belongs to this set.

Definition at line 261 of file CDigitalSetArchetype.h.

262  { return p == p; }

◆ operator+=()

template<typename TDomain >
CDigitalSetArchetype<Domain>& DGtal::concepts::CDigitalSetArchetype< TDomain >::operator+= ( const CDigitalSetArchetype< Domain > &  aSet)
inline

set union to left.

Parameters
aSetany other set.

Definition at line 250 of file CDigitalSetArchetype.h.

252  { return *this; }

◆ operator=()

template<typename TDomain >
CDigitalSetArchetype& DGtal::concepts::CDigitalSetArchetype< TDomain >::operator= ( const CDigitalSetArchetype< TDomain > &  other)
inline

Assignment.

Parameters
otherthe object to copy.
Returns
a reference on 'this'.

Definition at line 109 of file CDigitalSetArchetype.h.

110  { return *this; }

◆ selfDisplay()

template<typename TDomain >
void DGtal::concepts::CDigitalSetArchetype< TDomain >::selfDisplay ( std::ostream &  out) const
inline

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.

Definition at line 302 of file CDigitalSetArchetype.h.

302 {}

◆ size()

template<typename TDomain >
Size DGtal::concepts::CDigitalSetArchetype< TDomain >::size ( ) const
inline
Returns
the number of elements in the set.

Definition at line 128 of file CDigitalSetArchetype.h.

128 { return 0; }

The documentation for this class was generated from the following file: