22#include <osl/diagnose.h>
98 const bool bNotOutsideEverything(
122 if( bNotOutsideEverything &&
125 typename ConnectedComponentsType::iterator aCurrAggregate;
126 typename ConnectedComponentsType::iterator aLastAggregate;
133 bool bSomeAggregatesChanged;
139 bSomeAggregatesChanged =
false;
144 aCurrAggregate != aLastAggregate; )
152 if( !aCurrAggregate->maTotalBounds.isEmpty() &&
153 aCurrAggregate->maTotalBounds.overlaps(
167 aCurrAggregate->maComponentList );
176 bSomeAggregatesChanged =
true;
184 while( bSomeAggregatesChanged );
197 "B2DConnectedRanges::addRange(): empty aggregate list" );
200 "B2DConnectedRanges::addRange(): empty ranges must be solitary");
215 template<
typename UnaryFunctor > UnaryFunctor
forEachAggregate( UnaryFunctor aFunctor )
const
Calculate connected ranges from input ranges.
UnaryFunctor forEachAggregate(UnaryFunctor aFunctor) const
Apply a functor to each of the disjunct component aggregates.
B2DConnectedRanges()
Create the range calculator.
void addRange(const B2DRange &rRange, const UserData &rUserData)
Add an additional range.
B2DConnectedRanges(const B2DConnectedRanges &)=delete
::std::pair< B2DRange, UserData > ComponentType
Type of the basic entity (rect + user data)
::std::list< ConnectedComponents > ConnectedComponentsType
ConnectedComponentsType maDisjunctAggregatesList
Current list of disjunct sets of connected components.
B2DRange maTotalBounds
Global bound rect over all added ranges.
B2DConnectedRanges & operator=(const B2DConnectedRanges &)=delete
::std::list< ComponentType > ComponentListType
A two-dimensional interval over doubles.
void expand(const Tuple2D< TYPE > &rTuple)
add point to the set, expanding as necessary
bool isEmpty() const
Check if the interval set is empty.
bool overlaps(const Range2D &rRange) const
yields true if rRange at least partly inside set
List of (intersecting) components, plus overall bounds.
ComponentListType maComponentList