Gnash
0.8.10
|
#include <snappingrange.h>
Classes | |
class | AddTo |
class | ContainsPoint |
class | ContainsRange |
struct | ExpandToIfSnap |
Merge two ranges based on snaptest. More... | |
class | GrowBy |
class | IntersectsRange |
class | Scale |
Public Types | |
typedef std::vector< RangeType > | RangeList |
typedef RangeList::size_type | size_type |
Public Member Functions | |
SnappingRanges2d () | |
template<typename U > | |
SnappingRanges2d (const SnappingRanges2d< U > &from) | |
Templated copy constructor, for casting between range types. | |
void | setSnapFactor (const float factor) |
float | getSnapFactor () const |
void | setSingleMode (const bool mode) |
if mode==true, then the snapping ranges will act like a normal Range2d | |
bool | getSingleMode () const |
void | setRangeCountLimit (const size_type limit) |
size_type | getRangeCountLimit () const |
void | inheritConfig (const SnappingRanges2d< T > &from) |
void | add (const RangeType &range) |
Add a Range to the set, merging when possible and appropriate. | |
void | add (const SnappingRanges2d< T > &other) |
combines two snapping ranges | |
void | growBy (const T amount) |
Grows all ranges by the specified amount. | |
void | scale (const float factor) |
Scale all ranges by the specified factor. | |
void | setNull () |
Resets to NULL range. | |
void | setWorld () |
Resets to one range with world flags. | |
bool | isWorld () const |
Returns true, when the ranges equal world range. | |
bool | isNull () const |
Returns true, when there is no range. | |
size_type | size () const |
Returns the number of ranges in the list. | |
const RangeType & | getRange (size_type index) const |
Returns the range at the specified index. | |
RangeType | getFullArea () const |
bool | intersects (const RangeType &r) const |
Returns true if any of the ranges intersect the given range. | |
bool | contains (T x, T y) const |
Returns true if any of the ranges contains the point. | |
bool | contains (const RangeType &r) const |
Returns true if any of the ranges contains the range. | |
bool | contains (const SnappingRanges2d< T > &o) const |
Returns true if all ranges in the given SnappingRanges2d are contained in at least one of the ranges composing this one. | |
void | intersect (const SnappingRanges2d< T > &o) |
void | intersect (const RangeType &r) |
void | combineRanges () const |
template<class V > | |
bool | visit (V &visitor) const |
Visit the current Ranges set. | |
template<class V > | |
void | visitAll (V &visitor) const |
Visit the current Ranges set. | |
Static Public Member Functions | |
typedef geometry::Range2d< T > | RangeType |
Friends | |
template<typename U > | |
std::ostream & | operator<< (std::ostream &os, const SnappingRanges2d< U > &r) |
typedef std::vector<RangeType> gnash::geometry::SnappingRanges2d::RangeList |
typedef geometry::Range2d<T> gnash::geometry::SnappingRanges2d::RangeType [static] |
typedef RangeList::size_type gnash::geometry::SnappingRanges2d::size_type |
gnash::geometry::SnappingRanges2d::SnappingRanges2d | ( | ) | [inline] |
gnash::geometry::SnappingRanges2d::SnappingRanges2d | ( | const SnappingRanges2d< U > & | from | ) | [inline] |
Templated copy constructor, for casting between range types.
void gnash::geometry::SnappingRanges2d::add | ( | const RangeType & | range | ) | [inline] |
Add a Range to the set, merging when possible and appropriate.
Referenced by gnash::Bitmap::add_invalidated_bounds(), gnash::Button::add_invalidated_bounds(), gnash::DisplayList::add_invalidated_bounds(), gnash::DisplayObject::add_invalidated_bounds(), gnash::DisplayObject::extend_invalidated_bounds(), gnash::qwidget::paintEvent(), gnash::MovieClip::add_invalidated_bounds(), gnash::geometry::SnappingRanges2d< T >::SnappingRanges2d(), gnash::geometry::SnappingRanges2d::AddTo::operator()(), gnash::geometry::SnappingRanges2d< T >::intersect(), gnash::TextField::add_invalidated_bounds(), and gnash::Video::add_invalidated_bounds().
void gnash::geometry::SnappingRanges2d::add | ( | const SnappingRanges2d< T > & | other | ) | [inline] |
combines two snapping ranges
void gnash::geometry::SnappingRanges2d::combineRanges | ( | ) | const [inline] |
Combines known ranges. Previously merged ranges may have come close to other ranges. Algorithm could be optimized.
bool gnash::geometry::SnappingRanges2d::contains | ( | T | x, |
T | y | ||
) | const [inline] |
Returns true if any of the ranges contains the point.
Referenced by gnash::geometry::SnappingRanges2d< T >::contains().
bool gnash::geometry::SnappingRanges2d::contains | ( | const RangeType & | r | ) | const [inline] |
Returns true if any of the ranges contains the range.
Note that a NULL range is not contained in any range and a WORLD range is onluy contained in another WORLD range.
bool gnash::geometry::SnappingRanges2d::contains | ( | const SnappingRanges2d< T > & | o | ) | const [inline] |
Returns true if all ranges in the given SnappingRanges2d are contained in at least one of the ranges composing this one.
Note that a NULL range is not contained in any range and a WORLD range is onluy contained in another WORLD range.
TODO: use a visitor !
RangeType gnash::geometry::SnappingRanges2d::getFullArea | ( | ) | const [inline] |
Return a range that surrounds *all* added ranges. This is used mainly for compatibilty issues.
Referenced by gnash::Gui::setInvalidatedRegions(), and gnash::geometry::SnappingRanges2d< T >::combineRanges().
Returns the range at the specified index.
Referenced by gnash::AOS4AggGlue::setInvalidatedRegions(), gnash::AOS4CairoGlue::setInvalidatedRegions(), gnash::gui::FBAggGlue::setInvalidatedRegions(), gnash::gui::FBOvgGlue::setInvalidatedRegions(), gnash::FltkGui::setInvalidatedRegions(), gnash::GtkGui::setInvalidatedRegions(), gnash::HaikuAggGlue::setInvalidatedRegions(), gnash::KdeAggGlue::setInvalidatedRegions(), gnash::Qt4Gui::setInvalidatedRegions(), gnash::Renderer_cairo::begin_display(), gnash::SdlAggGlue::setInvalidatedRegions(), gnash::geometry::SnappingRanges2d< T >::contains(), and gnash::geometry::SnappingRanges2d< T >::intersect().
size_type gnash::geometry::SnappingRanges2d::getRangeCountLimit | ( | ) | const [inline] |
bool gnash::geometry::SnappingRanges2d::getSingleMode | ( | ) | const [inline] |
float gnash::geometry::SnappingRanges2d::getSnapFactor | ( | ) | const [inline] |
void gnash::geometry::SnappingRanges2d::growBy | ( | const T | amount | ) | [inline] |
Grows all ranges by the specified amount.
void gnash::geometry::SnappingRanges2d::inheritConfig | ( | const SnappingRanges2d< T > & | from | ) | [inline] |
Copy the snapping settings from another ranges list, without copying the ranges itself
Referenced by gnash::DisplayList::add_invalidated_bounds().
void gnash::geometry::SnappingRanges2d::intersect | ( | const SnappingRanges2d< T > & | o | ) | [inline] |
Intersect this ranges list with the given ranges list, updating the current ranges list. Note this is currently a relatively expensive operation for complex lists.
Referenced by gnash::DisplayList::add_invalidated_bounds().
void gnash::geometry::SnappingRanges2d::intersect | ( | const RangeType & | r | ) | [inline] |
Intersects this ranges list with the given single range, updating the current ranges list.
bool gnash::geometry::SnappingRanges2d::intersects | ( | const RangeType & | r | ) | const [inline] |
Returns true if any of the ranges intersect the given range.
Note that a NULL range doesn't intersect anything and a WORLD range intersects everything except a NULL Range.
bool gnash::geometry::SnappingRanges2d::isNull | ( | ) | const [inline] |
Returns true, when there is no range.
Referenced by gnash::DisplayObject::DisplayObject(), gnash::geometry::SnappingRanges2d< T >::growBy(), gnash::geometry::SnappingRanges2d< T >::scale(), gnash::geometry::SnappingRanges2d< T >::contains(), and gnash::geometry::SnappingRanges2d< T >::intersect().
bool gnash::geometry::SnappingRanges2d::isWorld | ( | ) | const [inline] |
Returns true, when the ranges equal world range.
Referenced by gnash::geometry::SnappingRanges2d< T >::growBy(), gnash::geometry::SnappingRanges2d< T >::scale(), gnash::geometry::SnappingRanges2d< T >::setWorld(), gnash::geometry::SnappingRanges2d< T >::contains(), and gnash::geometry::SnappingRanges2d< T >::intersect().
void gnash::geometry::SnappingRanges2d::scale | ( | const float | factor | ) | [inline] |
Scale all ranges by the specified factor.
void gnash::geometry::SnappingRanges2d::setNull | ( | ) | [inline] |
void gnash::geometry::SnappingRanges2d::setRangeCountLimit | ( | const size_type | limit | ) | [inline] |
Sets the maximum number of ranges allowed (to avoid lots of small ranges)
void gnash::geometry::SnappingRanges2d::setSingleMode | ( | const bool | mode | ) | [inline] |
if mode==true, then the snapping ranges will act like a normal Range2d
void gnash::geometry::SnappingRanges2d::setSnapFactor | ( | const float | factor | ) | [inline] |
Sets the snapping factor (which must be > 1.0). Higher factors make the ranges more attractive for snapping. A good value is usually 1.3.
void gnash::geometry::SnappingRanges2d::setWorld | ( | ) | [inline] |
Resets to one range with world flags.
Referenced by gnash::gui::GtkOvgGlue::setRenderHandlerSize(), gnash::movie_root::add_invalidated_bounds(), gnash::geometry::SnappingRanges2d< T >::SnappingRanges2d(), and gnash::geometry::SnappingRanges2d< T >::add().
size_type gnash::geometry::SnappingRanges2d::size | ( | ) | const [inline] |
Returns the number of ranges in the list.
Referenced by gnash::AOS4AggGlue::setInvalidatedRegions(), gnash::AOS4CairoGlue::setInvalidatedRegions(), gnash::gui::FBAggGlue::setInvalidatedRegions(), gnash::gui::FBOvgGlue::setInvalidatedRegions(), gnash::FltkGui::setInvalidatedRegions(), gnash::GtkGui::setInvalidatedRegions(), gnash::HaikuAggGlue::setInvalidatedRegions(), gnash::KdeAggGlue::setInvalidatedRegions(), gnash::Qt4Gui::setInvalidatedRegions(), gnash::Renderer_cairo::begin_display(), gnash::SdlAggGlue::setInvalidatedRegions(), gnash::geometry::SnappingRanges2d< T >::isWorld(), gnash::geometry::SnappingRanges2d< T >::getRange(), gnash::geometry::SnappingRanges2d< T >::contains(), and gnash::geometry::SnappingRanges2d< T >::intersect().
bool gnash::geometry::SnappingRanges2d::visit | ( | V & | visitor | ) | const [inline] |
Visit the current Ranges set.
Visitor functor will be invoked for each RangeType in the current set.
The visitor functor will receive a RangeType reference; must return true if it wants next item or true to exit the loop.
Referenced by gnash::geometry::SnappingRanges2d< T >::add().
void gnash::geometry::SnappingRanges2d::visitAll | ( | V & | visitor | ) | const [inline] |
Visit the current Ranges set.
Visitor functor will be invoked inconditionally for each RangeType in the current set.
The visitor functor will receive a RangeType reference.
std::ostream& operator<< | ( | std::ostream & | os, |
const SnappingRanges2d< U > & | r | ||
) | [friend] |