|
Gnash
0.8.11dev
|
#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 geometry::Range2d< T > | RangeType |
| 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. More... | |
| 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 More... | |
| 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. More... | |
| void | add (const SnappingRanges2d< T > &other) |
| combines two snapping ranges More... | |
| void | growBy (const T amount) |
| Grows all ranges by the specified amount. More... | |
| void | scale (const float factor) |
| Scale all ranges by the specified factor. More... | |
| void | setNull () |
| Resets to NULL range. More... | |
| void | setWorld () |
| Resets to one range with world flags. More... | |
| bool | isWorld () const |
| Returns true, when the ranges equal world range. More... | |
| bool | isNull () const |
| Returns true, when there is no range. More... | |
| size_type | size () const |
| Returns the number of ranges in the list. More... | |
| const RangeType & | getRange (size_type index) const |
| Returns the range at the specified index. More... | |
| RangeType | getFullArea () const |
| bool | intersects (const RangeType &r) const |
| Returns true if any of the ranges intersect the given range. More... | |
| bool | contains (T x, T y) const |
| Returns true if any of the ranges contains the point. More... | |
| bool | contains (const RangeType &r) const |
| Returns true if any of the ranges contains the range. More... | |
| 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. More... | |
| 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. More... | |
| template<class V > | |
| void | visitAll (V &visitor) const |
| Visit the current Ranges set. More... | |
Friends | |
| template<typename U > | |
| std::ostream & | operator<< (std::ostream &os, const SnappingRanges2d< U > &r) |
| typedef std::vector<RangeType> gnash::geometry::SnappingRanges2d< T >::RangeList |
| typedef geometry::Range2d<T> gnash::geometry::SnappingRanges2d< T >::RangeType |
| typedef RangeList::size_type gnash::geometry::SnappingRanges2d< T >::size_type |
|
inline |
|
inline |
Templated copy constructor, for casting between range types.
|
inline |
Add a Range to the set, merging when possible and appropriate.
Referenced by gnash::Bitmap::add_invalidated_bounds(), gnash::Video::add_invalidated_bounds(), gnash::Button::add_invalidated_bounds(), gnash::TextField::add_invalidated_bounds(), gnash::DisplayList::add_invalidated_bounds(), gnash::MovieClip::add_invalidated_bounds(), gnash::DisplayObject::add_invalidated_bounds(), gnash::DisplayObject::extend_invalidated_bounds(), gnash::geometry::SnappingRanges2d< std::int32_t >::intersect(), gnash::qwidget::paintEvent(), and gnash::geometry::SnappingRanges2d< std::int32_t >::SnappingRanges2d().
|
inline |
combines two snapping ranges
|
inline |
Combines known ranges. Previously merged ranges may have come close to other ranges. Algorithm could be optimized.
Referenced by gnash::Gui::notify_key_event(), and gnash::geometry::SnappingRanges2d< std::int32_t >::visitAll().
|
inline |
Returns true if any of the ranges contains the point.
Referenced by gnash::geometry::SnappingRanges2d< std::int32_t >::contains().
|
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.
|
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 !
|
inline |
Return a range that surrounds all added ranges. This is used mainly for compatibilty issues.
Referenced by gnash::geometry::SnappingRanges2d< std::int32_t >::combineRanges(), and gnash::Gui::setInvalidatedRegions().
|
inline |
Returns the range at the specified index.
Referenced by gnash::Renderer_cairo::begin_display(), gnash::geometry::SnappingRanges2d< std::int32_t >::contains(), gnash::geometry::SnappingRanges2d< std::int32_t >::intersect(), gnash::Gui::notify_key_event(), gnash::SdlAggGlue::setInvalidatedRegions(), gnash::KdeAggGlue::setInvalidatedRegions(), gnash::AOS4AggGlue::setInvalidatedRegions(), gnash::AOS4CairoGlue::setInvalidatedRegions(), gnash::HaikuAggGlue::setInvalidatedRegions(), gnash::FltkGui::setInvalidatedRegions(), gnash::gui::FBOvgGlue::setInvalidatedRegions(), gnash::gui::FBAggGlue::setInvalidatedRegions(), gnash::Qt4Gui::setInvalidatedRegions(), gnash::GtkGui::setInvalidatedRegions(), and gnash::geometry::SnappingRanges2d< std::int32_t >::SnappingRanges2d().
|
inline |
|
inline |
|
inline |
|
inline |
Grows all ranges by the specified amount.
Referenced by gnash::Gui::notify_key_event().
|
inline |
Copy the snapping settings from another ranges list, without copying the ranges itself
Referenced by gnash::DisplayList::add_invalidated_bounds().
|
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().
|
inline |
Intersects this ranges list with the given single range, updating the current ranges list.
|
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.
|
inline |
Returns true, when there is no range.
Referenced by gnash::geometry::SnappingRanges2d< std::int32_t >::contains(), gnash::geometry::SnappingRanges2d< std::int32_t >::growBy(), gnash::geometry::SnappingRanges2d< std::int32_t >::intersect(), gnash::Gui::notify_key_event(), gnash::geometry::SnappingRanges2d< std::int32_t >::scale(), and gnash::geometry::SnappingRanges2d< std::int32_t >::SnappingRanges2d().
|
inline |
Returns true, when the ranges equal world range.
Referenced by gnash::geometry::SnappingRanges2d< std::int32_t >::contains(), gnash::geometry::SnappingRanges2d< std::int32_t >::growBy(), gnash::geometry::SnappingRanges2d< std::int32_t >::intersect(), gnash::Gui::notify_key_event(), gnash::geometry::SnappingRanges2d< std::int32_t >::scale(), gnash::geometry::SnappingRanges2d< std::int32_t >::setWorld(), and gnash::geometry::SnappingRanges2d< std::int32_t >::SnappingRanges2d().
|
inline |
Scale all ranges by the specified factor.
|
inline |
Resets to NULL range.
Referenced by gnash::geometry::SnappingRanges2d< std::int32_t >::intersect(), gnash::DisplayObject::set_invalidated(), and gnash::geometry::SnappingRanges2d< std::int32_t >::SnappingRanges2d().
|
inline |
Sets the maximum number of ranges allowed (to avoid lots of small ranges)
|
inline |
if mode==true, then the snapping ranges will act like a normal Range2d
Referenced by gnash::Gui::notify_key_event().
|
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.
Referenced by gnash::Gui::notify_key_event().
|
inline |
Resets to one range with world flags.
Referenced by gnash::geometry::SnappingRanges2d< std::int32_t >::add(), gnash::movie_root::add_invalidated_bounds(), gnash::Gui::notify_key_event(), gnash::gui::GtkOvgGlue::setRenderHandlerSize(), and gnash::geometry::SnappingRanges2d< std::int32_t >::SnappingRanges2d().
|
inline |
Returns the number of ranges in the list.
Referenced by gnash::Renderer_cairo::begin_display(), gnash::geometry::SnappingRanges2d< std::int32_t >::contains(), gnash::geometry::SnappingRanges2d< std::int32_t >::getRange(), gnash::geometry::SnappingRanges2d< std::int32_t >::intersect(), gnash::geometry::SnappingRanges2d< std::int32_t >::isWorld(), gnash::Gui::notify_key_event(), gnash::SdlAggGlue::setInvalidatedRegions(), gnash::KdeAggGlue::setInvalidatedRegions(), gnash::AOS4AggGlue::setInvalidatedRegions(), gnash::AOS4CairoGlue::setInvalidatedRegions(), gnash::HaikuAggGlue::setInvalidatedRegions(), gnash::FltkGui::setInvalidatedRegions(), gnash::gui::FBOvgGlue::setInvalidatedRegions(), gnash::gui::FBAggGlue::setInvalidatedRegions(), gnash::Qt4Gui::setInvalidatedRegions(), gnash::GtkGui::setInvalidatedRegions(), and gnash::geometry::SnappingRanges2d< std::int32_t >::SnappingRanges2d().
|
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< std::int32_t >::add().
|
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.
|
friend |
1.8.12