Geom::D2< Interval > Class Template Reference
Rect class. More...
#include <rect.h>

Public Member Functions | |
| D2 () | |
| Best not to use this constructor, do not rely on what it initializes the object to. | |
| D2 (Interval const &a, Interval const &b) | |
| D2 (Point const &a, Point const &b) | |
| Interval & | operator[] (unsigned i) |
| Interval const & | operator[] (unsigned i) const |
| Point | min () const |
| Point | max () const |
| Point | corner (unsigned i) const |
| Returns the four corners of the rectangle in positive order (clockwise if +Y is up, anticlockwise if +Y is down). | |
| double | top () const |
| double | bottom () const |
| double | left () const |
| double | right () const |
| double | width () const |
| double | height () const |
| Point | dimensions () const |
| Returns a vector from min to max. | |
| Point | midpoint () const |
| double | area () const |
| Compute the area of this rectangle. | |
| bool | hasZeroArea (double eps=EPSILON) const |
| double | maxExtent () const |
| double | minExtent () const |
| bool | intersects (Rect const &r) const |
| bool | contains (Rect const &r) const |
| bool | contains (Point const &p) const |
| void | expandTo (Point p) |
| void | unionWith (Rect const &b) |
| void | unionWith (OptRect const &b) |
| void | expandBy (double amnt) |
| void | expandBy (Point const p) |
Private Attributes | |
| Interval | f [2] |
Detailed Description
template<>
class Geom::D2< Interval >
Rect class.
The Rect class is actually a specialisation of D2<Interval>.
Definition at line 60 of file rect.h.
Constructor & Destructor Documentation
Best not to use this constructor, do not rely on what it initializes the object to.
The default constructor creates a rect of default intervals.
Member Function Documentation
Compute the area of this rectangle.
Note that a zero area rectangle is not empty - just as the interval [0,0] contains one point, the rectangle [0,0] x [0,0] contains 1 point and no area.
- Return values:
-
For a valid return value, the rect must be tested for emptyness first.
Definition at line 116 of file rect.h.
References Geom::D2< T >::f, Geom::X, and Geom::Y.
Referenced by SPDesktop::zoom_quick().
Definition at line 99 of file rect.h.
References Geom::D2< T >::f, and Geom::Y.
Referenced by Geom::distanceSq(), and Inkscape::LivePathEffect::LPEMirrorSymmetry::doOnApply().
Definition at line 128 of file rect.h.
References Geom::D2< T >::f, Geom::X, and Geom::Y.
Referenced by cubic_bbox(), SnapManager::findBestSnap(), Inkscape::Text::Layout::getLetterAt(), is_within(), SPDesktop::isWithinViewport(), scroll_to_show_item(), Inkscape::UI::ControlPointSelection::selectArea(), and GrDrag::selectRect().
Returns the four corners of the rectangle in positive order (clockwise if +Y is up, anticlockwise if +Y is down).
Definition at line 88 of file rect.h.
References Geom::D2< T >::f, Geom::max(), Geom::min(), Point, Geom::X, and Geom::Y.
Referenced by Inkscape::UI::ControlPointSelection::_rotationRadius(), cornerFarthestFrom(), Inkscape::Text::Layout::createSelectionShape(), SPCurve::new_from_rect(), Inkscape::UI::TransformHandleSet::setBounds(), Inkscape::UI::SkewHandle::startTransform(), Inkscape::UI::RotateHandle::startTransform(), Inkscape::UI::ScaleSideHandle::startTransform(), Inkscape::UI::ScaleCornerHandle::startTransform(), and transform_rect().
Returns a vector from min to max.
Definition at line 107 of file rect.h.
References Geom::D2< T >::f, Point, Geom::X, and Geom::Y.
Referenced by Inkscape::SelTrans::_calcAbsAffineGeom(), Inkscape::SelTrans::_getGeomHandlePos(), Inkscape::UI::TransformHandleSet::_updateVisibility(), Inkscape::Text::Layout::createSelectionShape(), generate_marker(), Inkscape::SelTrans::grab(), Inkscape::UI::View::EditWidget::onWindowSizeAllocate(), pattern_tile(), SPDesktop::set_display_area(), sp_arc_drag(), sp_desktop_widget_update_scrollbars(), sp_dyna_draw_get_npoint(), sp_dyna_draw_get_vpoint(), sp_eraser_get_npoint(), sp_eraser_get_vpoint(), sp_gradient_get_g2d_matrix(), sp_gradient_get_gs2d_matrix(), sp_gradient_set_gs2d_matrix(), sp_rect_drag(), Inkscape::UI::View::EditWidget::updateScrollbars(), SPDesktop::zoom_absolute_keep_point(), and SPDesktop::zoom_relative_keep_point().
Definition at line 143 of file rect.h.
References Geom::D2< T >::f, Geom::X, and Geom::Y.
Referenced by Inkscape::ObjectSnapper::_findCandidates(), feed_path_to_cairo(), get_visual_bbox(), nr_arena_shape_pick(), SPDesktop::scroll_to_point(), SPDesktop::set_display_area(), and sp_canvas_bpath_point().
Definition at line 135 of file rect.h.
References Geom::D2< T >::f, Geom::X, and Geom::Y.
Referenced by SnapManager::_snapTransformed(), Inkscape::UI::Node::bounds(), bounds_exact_transformed(), feed_curve_to_cairo(), geom_curve_bbox_wind_distance(), Inkscape::SelTrans::grab(), and pathv_matrix_point_bbox_wind_distance().
Definition at line 117 of file rect.h.
Referenced by get_scale_transform_with_stroke(), Inkscape::Filters::Filter::render(), and sp_export_png_file().
00117 { return (area() <= eps); }
Definition at line 104 of file rect.h.
References Geom::D2< T >::f, and Geom::Y.
Referenced by Inkscape::UI::ClipboardManagerImpl::_onGet(), SPDocument::fitToRect(), sp_desktop_widget_size_allocate(), sp_do_export_png(), sp_export_png_file(), sp_flood_do_flood_fill(), and sp_marker_update().
Definition at line 125 of file rect.h.
References Geom::D2< T >::f, Geom::X, and Geom::Y.
Referenced by Inkscape::ObjectSnapper::_findCandidates(), feed_curve_to_cairo(), geom_curve_bbox_wind_distance(), Geom::mono_intersect(), Geom::mono_pair(), and overlaps().
Definition at line 100 of file rect.h.
References Geom::D2< T >::f, and Geom::X.
Referenced by Geom::distanceSq(), Inkscape::LivePathEffect::LPEMirrorSymmetry::doOnApply(), and Geom::outer_crossing().
Definition at line 84 of file rect.h.
References Geom::D2< T >::f, max(), Point, Geom::X, and Geom::Y.
Referenced by Inkscape::Filters::Filter::_filter_resolution(), Inkscape::SelTrans::_getGeomHandlePos(), Inkscape::Filters::Filter::bbox_enlarge(), Inkscape::UI::Dialog::BBoxSort::BBoxSort(), Inkscape::Text::Layout::createSelectionShape(), Inkscape::Extension::Internal::Grid::effect(), Inkscape::Filters::Filter::filter_effect_area(), SPDocument::fitToRect(), from_2geom(), SPDesktop::get_display_area(), Inkscape::Filters::get_item_bbox(), Box3D::Line::intersection_with_viewbox(), max(), SPDesktop::point(), SPDesktop::push_current_zoom(), render_pixbuf(), SPDesktop::scroll_to_point(), SPDesktop::set_display_area(), NRArenaShape::setPaintBox(), sp_desktop_widget_update_scrollbars(), sp_export_bbox_equal(), sp_flood_do_flood_fill(), sp_selection_tile(), sp_text_context_root_handler(), CtrlRect::update(), Inkscape::UI::View::EditWidget::updateRulers(), Inkscape::UI::View::EditWidget::updateScrollbars(), and SPDesktop::zoom_relative_keep_point().
Definition at line 119 of file rect.h.
References Geom::D2< T >::f, Geom::max(), Geom::X, and Geom::Y.
Referenced by Inkscape::UI::TransformHandleSet::_updateVisibility(), Geom::mono_intersect(), and Geom::mono_pair().
Definition at line 108 of file rect.h.
References Geom::D2< T >::f, Point, Geom::X, and Geom::Y.
Referenced by cornerFarthestFrom(), Inkscape::UI::Widget::ZoomStatus::on_value_changed(), Inkscape::UI::View::EditWidget::onWindowSizeAllocate(), Inkscape::ZoomVerb::perform(), scroll_to_show_item(), Inkscape::UI::TransformHandleSet::setBounds(), sp_arc_drag(), sp_desktop_widget_size_allocate(), sp_dtw_zoom_menu_handler(), sp_dtw_zoom_value_changed(), sp_file_revert_dialog(), sp_namedview_document_from_window(), SPDesktop::zoom_page_width(), and SPDesktop::zoom_quick().
Definition at line 83 of file rect.h.
References Geom::D2< T >::f, min(), Point, Geom::X, and Geom::Y.
Referenced by Inkscape::SelTrans::_calcAbsAffineGeom(), Inkscape::Filters::Filter::_filter_resolution(), Inkscape::SelTrans::_getGeomHandlePos(), Inkscape::Filters::Filter::bbox_enlarge(), Inkscape::UI::Dialog::BBoxSort::BBoxSort(), Inkscape::Text::Layout::createSelectionShape(), Inkscape::Extension::Internal::Grid::effect(), Inkscape::Filters::Filter::filter_effect_area(), SPDocument::fitToRect(), from_2geom(), SPDesktop::get_display_area(), Inkscape::Filters::get_item_bbox(), get_scale_transform_with_stroke(), Inkscape::SelTrans::grab(), Box3D::Line::intersection_with_viewbox(), min(), perform_bitmap_scanline_check(), SPDesktop::point(), SPDesktop::push_current_zoom(), render_pixbuf(), SPDesktop::scroll_to_point(), SPDesktop::scroll_world(), SPDesktop::set_display_area(), NRArenaShape::setPaintBox(), sp_desktop_widget_update_scrollbars(), sp_dyna_draw_get_npoint(), sp_dyna_draw_get_vpoint(), sp_eraser_get_npoint(), sp_eraser_get_vpoint(), sp_export_bbox_equal(), sp_flood_do_flood_fill(), sp_generate_internal_bitmap(), sp_gradient_get_g2d_matrix(), sp_gradient_get_gs2d_matrix(), sp_gradient_set_gs2d_matrix(), sp_rect_drag(), sp_selection_tile(), sp_text_context_root_handler(), CtrlRect::update(), Inkscape::UI::View::EditWidget::updateRulers(), Inkscape::UI::View::EditWidget::updateScrollbars(), Inkscape::Extension::Internal::OdfOutput::writeTree(), and SPDesktop::zoom_relative_keep_point().
Definition at line 120 of file rect.h.
References Geom::D2< T >::f, Geom::min(), Geom::X, and Geom::Y.
Referenced by Inkscape::UI::TransformHandleSet::_updateVisibility(), and SPDesktop::zoom_page().
Definition at line 101 of file rect.h.
References Geom::D2< T >::f, and Geom::X.
Referenced by Geom::distanceSq().
Definition at line 98 of file rect.h.
References Geom::D2< T >::f, and Geom::Y.
Referenced by Geom::distanceSq(), and Inkscape::LivePathEffect::LPEMirrorSymmetry::doOnApply().
| void Geom::Rect::unionWith | ( | OptRect const & | b | ) | [inline] |
Definition at line 138 of file rect.h.
References Geom::D2< T >::f, Geom::X, and Geom::Y.
Referenced by bounds_exact_transformed(), and Geom::union_list().
Definition at line 103 of file rect.h.
References Geom::D2< T >::f, and Geom::X.
Referenced by Inkscape::UI::ClipboardManagerImpl::_onGet(), SPDocument::fitToRect(), sp_desktop_widget_size_allocate(), sp_do_export_png(), sp_export_png_file(), sp_flood_do_flood_fill(), and sp_marker_update().
Member Data Documentation
The documentation for this class was generated from the following file:
