basegfx::B2DConnectedRanges< UserData > Class Template Reference

Calculate connected ranges from input ranges. More...

#include <b2dconnectedranges.hxx>

Collaboration diagram for basegfx::B2DConnectedRanges< UserData >:

Collaboration graph
[legend]

List of all members.

Public Types

typedef ::std::pair< B2DRange,
UserData > 
ComponentType
 Type of the basic entity (rect + user data).
typedef ::std::list
< ComponentType
ComponentListType
typedef ::std::list
< ConnectedComponents
ConnectedComponentsType

Public Member Functions

 B2DConnectedRanges ()
 Create the range calculator.
B2DRange getBounds () const
 Query total bounds of all added ranges.
void addRange (const B2DRange &rRange, const UserData &rUserData)
 Add an additional range.
template<typename UnaryFunctor>
UnaryFunctor forEachAggregate (UnaryFunctor aFunctor) const
 Apply a functor to each of the disjunct component aggregates.

Private Member Functions

 B2DConnectedRanges (const B2DConnectedRanges &)
B2DConnectedRangesoperator= (const B2DConnectedRanges &)

Private Attributes

ConnectedComponentsType maDisjunctAggregatesList
 Current list of disjunct sets of connected components.
B2DRange maTotalBounds
 Global bound rect over all added ranges.

Classes

struct  ConnectedComponents
 List of (intersecting) components, plus overall bounds. More...


Detailed Description

template<typename UserData>
class basegfx::B2DConnectedRanges< UserData >

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.

Template parameter:
UserData User data to be stored along with the range, to later identify which range went into which connected component. Must be assignable, default- and copy-constructible.

Definition at line 70 of file b2dconnectedranges.hxx.


Member Typedef Documentation

template<typename UserData>
typedef ::std::pair< B2DRange, UserData > basegfx::B2DConnectedRanges< UserData >::ComponentType

Type of the basic entity (rect + user data).

Definition at line 74 of file b2dconnectedranges.hxx.

template<typename UserData>
typedef ::std::list< ComponentType > basegfx::B2DConnectedRanges< UserData >::ComponentListType

Definition at line 75 of file b2dconnectedranges.hxx.

template<typename UserData>
typedef ::std::list< ConnectedComponents > basegfx::B2DConnectedRanges< UserData >::ConnectedComponentsType

Definition at line 84 of file b2dconnectedranges.hxx.


Constructor & Destructor Documentation

template<typename UserData>
basegfx::B2DConnectedRanges< UserData >::B2DConnectedRanges (  )  [inline]

Create the range calculator.

Definition at line 88 of file b2dconnectedranges.hxx.

template<typename UserData>
basegfx::B2DConnectedRanges< UserData >::B2DConnectedRanges ( const B2DConnectedRanges< UserData > &   )  [private]


Member Function Documentation

template<typename UserData>
B2DRange basegfx::B2DConnectedRanges< UserData >::getBounds (  )  const [inline]

Query total bounds of all added ranges.

Returns:
the union bound rect over all added ranges.

Definition at line 98 of file b2dconnectedranges.hxx.

References basegfx::B2DConnectedRanges< UserData >::maTotalBounds.

template<typename UserData>
void basegfx::B2DConnectedRanges< UserData >::addRange ( const B2DRange rRange,
const UserData &  rUserData 
) [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 111 of file b2dconnectedranges.hxx.

References basegfx::B2DRange::expand(), basegfx::B2DRange::isEmpty(), basegfx::B2DConnectedRanges< UserData >::ConnectedComponents::maComponentList, basegfx::B2DConnectedRanges< UserData >::maDisjunctAggregatesList, basegfx::B2DConnectedRanges< UserData >::ConnectedComponents::maTotalBounds, basegfx::B2DConnectedRanges< UserData >::maTotalBounds, and basegfx::B2DRange::overlaps().

template<typename UserData>
template<typename UnaryFunctor>
UnaryFunctor basegfx::B2DConnectedRanges< UserData >::forEachAggregate ( UnaryFunctor  aFunctor  )  const [inline]

Apply a functor to each of the disjunct component aggregates.

Parameters:
aFunctor Functor to apply. Must provide an operator( const ConnectedComponents& ).
Returns:
a copy of the functor, as applied to all aggregates.

Definition at line 238 of file b2dconnectedranges.hxx.

References basegfx::B2DConnectedRanges< UserData >::maDisjunctAggregatesList.

template<typename UserData>
B2DConnectedRanges& basegfx::B2DConnectedRanges< UserData >::operator= ( const B2DConnectedRanges< UserData > &   )  [private]


Member Data Documentation

template<typename UserData>
ConnectedComponentsType basegfx::B2DConnectedRanges< UserData >::maDisjunctAggregatesList [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 255 of file b2dconnectedranges.hxx.

Referenced by basegfx::B2DConnectedRanges< UserData >::addRange(), and basegfx::B2DConnectedRanges< UserData >::forEachAggregate().

template<typename UserData>
B2DRange basegfx::B2DConnectedRanges< UserData >::maTotalBounds [private]

Global bound rect over all added ranges.

Definition at line 259 of file b2dconnectedranges.hxx.

Referenced by basegfx::B2DConnectedRanges< UserData >::addRange(), and basegfx::B2DConnectedRanges< UserData >::getBounds().


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

Generated on Thu Apr 29 13:57:19 2010 for ooo-build Module basegfx (ooo/OOO320_m15) by  doxygen 1.5.6