LibreOffice Module basegfx (master) 1
|
Calculate connected ranges from input ranges. More...
#include <b2dconnectedranges.hxx>
Classes | |
struct | ConnectedComponents |
List of (intersecting) components, plus overall bounds. More... | |
Public Types | |
typedef ::std::pair< B2DRange, UserData > | ComponentType |
Type of the basic entity (rect + user data) More... | |
typedef ::std::list< ComponentType > | ComponentListType |
typedef ::std::list< ConnectedComponents > | ConnectedComponentsType |
Public Member Functions | |
B2DConnectedRanges () | |
Create the range calculator. More... | |
void | addRange (const B2DRange &rRange, const UserData &rUserData) |
Add an additional range. More... | |
template<typename UnaryFunctor > | |
UnaryFunctor | forEachAggregate (UnaryFunctor aFunctor) const |
Apply a functor to each of the disjunct component aggregates. More... | |
Private Member Functions | |
B2DConnectedRanges (const B2DConnectedRanges &)=delete | |
B2DConnectedRanges & | operator= (const B2DConnectedRanges &)=delete |
Private Attributes | |
ConnectedComponentsType | maDisjunctAggregatesList |
Current list of disjunct sets of connected components. More... | |
B2DRange | maTotalBounds |
Global bound rect over all added ranges. More... | |
Calculate connected ranges from input ranges.
This template constructs a list of connected ranges from the given input ranges. That is, the output will contain a set of ranges, itself containing a number of input ranges, which will be mutually non-intersecting.
Example:
| ----—| | | || | — | || | | | ----—| -----— | | +------— | | | | –+ | | | | | | | | -----—
</code
Here, the outer rectangles represent the output ranges. Contained are the input rectangles that comprise these output ranges.
Definition at line 61 of file b2dconnectedranges.hxx.
typedef ::std::list< ComponentType > basegfx::B2DConnectedRanges< UserData >::ComponentListType |
Definition at line 66 of file b2dconnectedranges.hxx.
typedef ::std::pair< B2DRange, UserData > basegfx::B2DConnectedRanges< UserData >::ComponentType |
Type of the basic entity (rect + user data)
Definition at line 65 of file b2dconnectedranges.hxx.
typedef ::std::list< ConnectedComponents > basegfx::B2DConnectedRanges< UserData >::ConnectedComponentsType |
Definition at line 75 of file b2dconnectedranges.hxx.
|
inline |
Create the range calculator.
Definition at line 79 of file b2dconnectedranges.hxx.
|
privatedelete |
|
inline |
Add an additional range.
This method integrates a new range into the connected ranges lists. The method has a worst-case time complexity of O(n^2), with n denoting the number of already added ranges (typically, for well-behaved input, it is O(n) though).
Definition at line 92 of file b2dconnectedranges.hxx.
References basegfx::Range2D< TYPE, TRAITS >::expand(), basegfx::Range2D< TYPE, TRAITS >::isEmpty(), basegfx::B2DConnectedRanges< UserData >::ConnectedComponents::maComponentList, basegfx::B2DConnectedRanges< UserData >::maDisjunctAggregatesList, basegfx::B2DConnectedRanges< UserData >::ConnectedComponents::maTotalBounds, basegfx::B2DConnectedRanges< UserData >::maTotalBounds, and basegfx::Range2D< TYPE, TRAITS >::overlaps().
|
inline |
Apply a functor to each of the disjunct component aggregates.
aFunctor | Functor to apply. Must provide an operator( const ConnectedComponents& ). |
Definition at line 215 of file b2dconnectedranges.hxx.
References basegfx::B2DConnectedRanges< UserData >::maDisjunctAggregatesList.
|
privatedelete |
|
private |
Current list of disjunct sets of connected components.
Each entry corresponds to one of the top-level rectangles in the drawing above.
Definition at line 231 of file b2dconnectedranges.hxx.
Referenced by basegfx::B2DConnectedRanges< UserData >::addRange(), and basegfx::B2DConnectedRanges< UserData >::forEachAggregate().
|
private |
Global bound rect over all added ranges.
Definition at line 235 of file b2dconnectedranges.hxx.
Referenced by basegfx::B2DConnectedRanges< UserData >::addRange().