Inkscape
Vector Graphics Editor
|
Axis aligned, non-empty, generic rectangle. More...
#include <generic-rect.h>
Public Types | |
using | D1Value = CInterval |
using | D1Reference = CInterval & |
using | D1ConstReference = CInterval const & |
Public Member Functions | |
Inspect dimensions. | |
CInterval & | operator[] (unsigned i) |
CInterval const & | operator[] (unsigned i) const |
CInterval & | operator[] (Dim2 d) |
CInterval const & | operator[] (Dim2 d) const |
CPoint | min () const |
Get the corner of the rectangle with smallest coordinate values. | |
CPoint | max () const |
Get the corner of the rectangle with largest coordinate values. | |
CPoint | corner (unsigned i) const |
Return the n-th corner of the rectangle. | |
C | top () const |
Return top coordinate of the rectangle (+Y is downwards). | |
C | bottom () const |
Return bottom coordinate of the rectangle (+Y is downwards). | |
C | left () const |
Return leftmost coordinate of the rectangle (+X is to the right). | |
C | right () const |
Return rightmost coordinate of the rectangle (+X is to the right). | |
C | width () const |
Get the horizontal extent of the rectangle. | |
C | height () const |
Get the vertical extent of the rectangle. | |
Coord | aspectRatio () const |
Get the ratio of width to height of the rectangle. | |
CPoint | dimensions () const |
Get rectangle's width and height as a point. | |
CPoint | midpoint () const |
Get the point in the geometric center of the rectangle. | |
C | area () const |
Compute the rectangle's area. | |
bool | hasZeroArea () const |
Check whether the rectangle has zero area. | |
C | maxExtent () const |
Get the larger extent (width or height) of the rectangle. | |
C | minExtent () const |
Get the smaller extent (width or height) of the rectangle. | |
C | distanceSq (CPoint const &p) const |
Get rectangle's distance SQUARED away from the given point. | |
CPoint | clamp (CPoint const &p) const |
Clamp point to the rectangle. | |
CPoint | nearestEdgePoint (CPoint const &p) const |
Get the nearest point on the edge of the rectangle. | |
Test other rectangles and points for inclusion. | |
bool | intersects (GenericRect< C > const &r) const |
Check whether the rectangles have any common points. | |
bool | contains (GenericRect< C > const &r) const |
Check whether the rectangle includes all points in the given rectangle. | |
bool | intersects (OptCRect const &r) const |
Check whether the rectangles have any common points. | |
bool | contains (OptCRect const &r) const |
Check whether the rectangle includes all points in the given rectangle. | |
bool | contains (CPoint const &p) const |
Check whether the given point is within the rectangle. | |
Modify the rectangle. | |
void | setLeft (C val) |
Set the minimum X coordinate of the rectangle. | |
void | setRight (C val) |
Set the maximum X coordinate of the rectangle. | |
void | setTop (C val) |
Set the minimum Y coordinate of the rectangle. | |
void | setBottom (C val) |
Set the maximum Y coordinate of the rectangle. | |
void | setMin (CPoint const &p) |
Set the upper left point of the rectangle. | |
void | setMax (CPoint const &p) |
Set the lower right point of the rectangle. | |
void | expandTo (CPoint const &p) |
Enlarge the rectangle to contain the given point. | |
void | unionWith (CRect const &b) |
Enlarge the rectangle to contain the argument. | |
void | unionWith (OptCRect const &b) |
Enlarge the rectangle to contain the argument. | |
void | expandBy (C amount) |
Expand the rectangle in both directions by the specified amount. | |
void | shrinkBy (C amount) |
Shrink the rectangle in both directions by the specified amount. | |
void | expandBy (C x, C y) |
Expand the rectangle in both directions. | |
void | shrinkBy (C x, C y) |
Shrink the rectangle in both directions by possibly different amounts. | |
void | expandBy (CPoint const &p) |
Expand the rectangle by the coordinates of the given point. | |
Operators | |
GenericRect< C > & | operator+= (CPoint const &p) |
Offset the rectangle by a vector. | |
GenericRect< C > & | operator-= (CPoint const &p) |
Offset the rectangle by the negation of a vector. | |
GenericRect< C > & | operator|= (CRect const &o) |
Union two rectangles. | |
GenericRect< C > & | operator|= (OptCRect const &o) |
bool | operator== (CRect const &o) const |
Test for equality of rectangles. | |
Protected Attributes | |
CInterval | f [2] |
Private Types | |
using | CInterval = typename CoordTraits< C >::IntervalType |
using | CPoint = typename CoordTraits< C >::PointType |
using | CRect = typename CoordTraits< C >::RectType |
using | OptCRect = typename CoordTraits< C >::OptRectType |
Create rectangles. | |
GenericRect ()=default | |
Create a rectangle that contains only the point at (0, 0). | |
GenericRect (CInterval const &a, CInterval const &b) | |
Create a rectangle from X and Y intervals. | |
GenericRect (CPoint const &a, CPoint const &b) | |
Create a rectangle from two points. | |
GenericRect (C x0, C y0, C x1, C y1) | |
Create rectangle from coordinates of two points. | |
template<typename InputIterator > | |
static CRect | from_range (InputIterator start, InputIterator end) |
Create a rectangle from a range of points. | |
static CRect | from_array (CPoint const *c, unsigned n) |
Create a rectangle from a C-style array of points it should contain. | |
static CRect | from_xywh (C x, C y, C w, C h) |
Create rectangle from origin and dimensions. | |
static CRect | from_xywh (CPoint const &xy, CPoint const &wh) |
Create rectangle from origin and dimensions. | |
static CRect | infinite () |
Create infinite rectangle. | |
Axis aligned, non-empty, generic rectangle.
Definition at line 58 of file generic-rect.h.
|
private |
Definition at line 61 of file generic-rect.h.
|
private |
Definition at line 62 of file generic-rect.h.
|
private |
Definition at line 63 of file generic-rect.h.
using Geom::GenericRect< C >::D1ConstReference = CInterval const & |
Definition at line 70 of file generic-rect.h.
using Geom::GenericRect< C >::D1Reference = CInterval & |
Definition at line 69 of file generic-rect.h.
using Geom::GenericRect< C >::D1Value = CInterval |
Definition at line 68 of file generic-rect.h.
|
private |
Definition at line 64 of file generic-rect.h.
|
default |
Create a rectangle that contains only the point at (0, 0).
|
inline |
Create a rectangle from X and Y intervals.
Definition at line 77 of file generic-rect.h.
|
inline |
Create a rectangle from two points.
Definition at line 79 of file generic-rect.h.
References Geom::X.
|
inline |
Create rectangle from coordinates of two points.
Definition at line 81 of file generic-rect.h.
|
inline |
Compute the rectangle's area.
Definition at line 170 of file generic-rect.h.
References Geom::X, and Geom::Y.
Referenced by Inkscape::DrawingItem::_cacheScore(), Inkscape::ObjectSet::_sizeistItem(), Inkscape::UI::Widget::coarsen(), Geom::RTree::find_enlargement(), Geom::RTree::find_waste_area(), get_visual_bbox(), TEST(), and SPDesktop::zoom_quick().
|
inline |
Get the ratio of width to height of the rectangle.
Definition at line 160 of file generic-rect.h.
|
inline |
Return bottom coordinate of the rectangle (+Y is downwards).
Definition at line 149 of file generic-rect.h.
References Geom::Y.
Referenced by add_rectangle(), Inkscape::Filters::FilterOffset::area_enlarge(), Inkscape::SubItem::build_mosaic(), Geom::CLIPPER_CLASS::clipper_cr(), Geom::Rect::distance(), Geom::distanceSq(), draw_line_in_rect(), Inkscape::find_interior_point(), Geom::CLIPPER_CLASS::intersect(), Inkscape::UI::Widget::Canvas::redraw_area(), SVGBox::set(), SPPage::setDocumentRect(), Inkscape::Extension::Internal::SvgBuilder::setMargins(), SPDocument::setWidth(), Inkscape::UI::Dialog::sp_icon_doc_icon(), tighten(), and Inkscape::UI::Widget::CanvasGrid::updateRulers().
|
inline |
Clamp point to the rectangle.
Definition at line 185 of file generic-rect.h.
References Geom::X, and Geom::Y.
Referenced by Geom::Line::clip(), and Inkscape::UI::Widget::screen_to_local().
|
inline |
Check whether the given point is within the rectangle.
Definition at line 224 of file generic-rect.h.
|
inline |
Check whether the rectangle includes all points in the given rectangle.
Definition at line 212 of file generic-rect.h.
References Geom::X, and Geom::Y.
Referenced by SnapManager::_findCandidates(), Inkscape::DrawingImage::_pickItem(), Inkscape::DrawingGlyphs::_pickItem(), Geom::CLIPPER_CLASS::are_paired(), Geom::CLIPPER_CLASS::clip(), Inkscape::CanvasItemRect::contains(), cubic_bbox(), draw_line_in_rect(), draw_line_segment(), Geom::xAx::extrema(), Geom::RTree::find_enlargement(), Inkscape::PageManager::findPageAt(), Inkscape::Text::Layout::getLetterAt(), Toggle::handle_click(), Toggle::hit(), is_within(), SPPage::itemOnPage(), Inkscape::DrawingItem::pick(), Inkscape::UI::Widget::screen_to_local(), GrDrag::selectRect(), TEST(), tighten(), Geom::xAx::toCurve(), Inkscape::UI::Widget::Canvas::world_point_inside_canvas(), wrap_contains_coord(), and wrap_contains_ivl().
|
inline |
Check whether the rectangle includes all points in the given rectangle.
Empty rectangles will be contained in any non-empty rectangle.
Definition at line 524 of file generic-rect.h.
References Geom::contains().
|
inline |
Return the n-th corner of the rectangle.
Returns corners in the direction of growing angles, starting from the one given by min(). For the standard coordinate system used in 2Geom (+Y downwards), this means clockwise starting from the upper left.
Definition at line 137 of file generic-rect.h.
References Geom::max(), Geom::min(), Geom::X, and Geom::Y.
Referenced by SPText::_buildLayoutInit(), Inkscape::DrawingImage::_pickItem(), Inkscape::DrawingImage::_renderItem(), Inkscape::UI::ControlPointSelection::_rotationRadius(), Geom::CLIPPER_CLASS::clip(), Geom::Circle::contains(), Geom::ConvexHull::contains(), Inkscape::Text::Layout::createSelectionShape(), Geom::xAx::crossings(), Toggle::draw(), RectHandle::draw(), draw_ray(), Geom::xAx::extrema(), Geom::PathSink::feed(), fill_line_in_rect(), RectHandle::hit(), ink_cairo_draw_drop_shadow(), Geom::CLIPPER_CLASS::intersect(), Inkscape::intersect_line_rectangle(), SPPage::isViewportPage(), Inkscape::UI::Tools::PagesTool::middleOfSide(), Geom::Path::Path(), Inkscape::UI::Tools::PagesTool::resizeKnotMoved(), Inkscape::UI::Tools::PagesTool::resizeKnotSet(), Inkscape::UI::TransformHandleSet::setBounds(), Inkscape::Extension::Internal::LaTeXTextRenderer::setupDocument(), Inkscape::Extension::Internal::LaTeXTextRenderer::sp_flowtext_render(), sp_guide_create_guides_around_page(), SPCurve::SPCurve(), SPPage::swapPage(), TEST_F(), tighten(), tighten(), Inkscape::UI::Dialog::CloneTiler::transform_rect(), and Inkscape::UI::Toolbar::NodeToolbar::value_changed().
|
inline |
Get rectangle's width and height as a point.
Definition at line 165 of file generic-rect.h.
References Geom::X, and Geom::Y.
Referenced by Inkscape::SelTrans::_calcAbsAffineGeom(), Inkscape::SelTrans::_getGeomHandlePos(), Inkscape::UI::TransformHandleSet::_updateVisibility(), Inkscape::Extension::Internal::CairoRenderer::applyClipPath(), Inkscape::Extension::Internal::CairoRenderer::applyMask(), Inkscape::Extension::Internal::compute_final_page_dimensions(), Inkscape::Text::Layout::createSelectionShape(), Inkscape::UI::Tools::ArcTool::drag(), Inkscape::UI::Tools::RectTool::drag(), generate_marker(), SPGradient::get_g2d_matrix(), SPGradient::get_gs2d_matrix(), item_find_paths(), Inkscape::UI::Widget::local_to_screen(), Inkscape::UI::Widget::CairoGraphics::paint_widget(), Inkscape::DrawingCache::prepare(), SPPattern::produce(), Inkscape::UI::Widget::Stores::recreate_store(), Inkscape::UI::Widget::screen_to_local(), SPGradient::set_gs2d_matrix(), Inkscape::UI::Widget::CairoGraphics::shift_store(), Inkscape::UI::Widget::CairoGraphics::snapshot_combine(), Inkscape::UI::Widget::Stores::snapshot_combine(), Inkscape::UI::Tools::sp_flood_do_flood_fill(), sp_validate_marker(), Inkscape::ObjectSet::toMarker(), and Geom::Rect::transformTo().
|
inline |
Get rectangle's distance SQUARED away from the given point.
Definition at line 180 of file generic-rect.h.
|
inline |
Expand the rectangle in both directions by the specified amount.
Note that this is different from scaling. Negative values will shrink the rectangle. If -amount
is larger than half of the width, the X interval will contain only the X coordinate of the midpoint; same for height.
Definition at line 276 of file generic-rect.h.
Referenced by Inkscape::DistributionSnapper::_collectBBoxes(), SnapManager::_findCandidates(), Inkscape::DrawingShape::_pickItem(), Inkscape::DrawingGlyphs::_updateItem(), Inkscape::Filters::FilterGaussian::area_enlarge(), Inkscape::Filters::FilterDiffuseLighting::area_enlarge(), Inkscape::Filters::FilterDisplacementMap::area_enlarge(), Inkscape::Filters::FilterMorphology::area_enlarge(), Inkscape::Filters::FilterSpecularLighting::area_enlarge(), Inkscape::SubItem::build_mosaic(), SPGaussianBlur::calculate_region(), SPFeMorphology::calculate_region(), Inkscape::UI::Widget::coarsen(), Inkscape::LivePathEffect::LPEPowerMask::doBeforeEffect(), expandedBy(), expandedBy(), feed_path_to_cairo(), get_visual_bbox(), Geom::level_set(), Inkscape::DrawingItem::pick(), Inkscape::CanvasItem::render(), Geom::TEST(), wrap_expandBy(), and wrap_expandBy_pt().
|
inline |
Expand the rectangle in both directions.
Note that this is different from scaling. Negative values will shrink the rectangle. If -x
is larger than half of the width, the X interval will contain only the X coordinate of the midpoint; same for height.
Definition at line 291 of file generic-rect.h.
|
inline |
Expand the rectangle by the coordinates of the given point.
This will expand the width by the X coordinate of the point in both directions and the height by Y coordinate of the point. Negative coordinate values will shrink the rectangle. If -p[X]
is larger than half of the width, the X interval will contain only the X coordinate of the midpoint; same for height.
Definition at line 308 of file generic-rect.h.
|
inline |
Enlarge the rectangle to contain the given point.
Definition at line 258 of file generic-rect.h.
References Geom::X, and Geom::Y.
Referenced by Inkscape::UI::Widget::ColorWheelHSLuv::_updatePolygon(), Geom::xAx::arc_bound(), Geom::Parallelogram::bounds(), Inkscape::UI::Node::bounds(), cubic_bbox(), Inkscape::Extension::Internal::PovOutput::doCurve(), Geom::BezierCurveN< degree >::expandToTransformed(), Geom::EllipticalArc::expandToTransformed(), feed_curve_to_cairo(), geom_curve_bbox_wind_distance(), get_visual_bbox(), pathv_matrix_point_bbox_wind_distance(), Inkscape::PureTransform::snap(), tighten(), and tighten().
|
inlinestatic |
Create a rectangle from a C-style array of points it should contain.
Definition at line 100 of file generic-rect.h.
References c.
|
inlinestatic |
Create a rectangle from a range of points.
The resulting rectangle will contain all points from the range. The return type of iterators must be convertible to Point. The range must not be empty. For possibly empty ranges, see OptRect.
start | Beginning of the range |
end | End of the range |
Definition at line 90 of file generic-rect.h.
|
inlinestatic |
Create rectangle from origin and dimensions.
Definition at line 104 of file generic-rect.h.
References w.
Referenced by Inkscape::DrawingItem::_cacheScore(), Inkscape::UI::Tools::CalligraphicTool::brush(), cairo_to_geom(), SPImage::cropToArea(), Inkscape::UI::Tools::fit_item(), Inkscape::UI::Widget::get_active_area(), Inkscape::UI::Widget::ColorWheelHSLuv::on_click_pressed(), Inkscape::DrawingSurface::pixelArea(), Inkscape::UI::Preview::render_preview(), render_surface(), Inkscape::UI::Tools::DropperTool::root_handler(), sp_export_get_rows(), Inkscape::UI::Tools::sp_flood_do_flood_fill(), sp_generate_internal_bitmap(), and Inkscape::UI::Dialog::sp_icon_doc_icon().
|
inlinestatic |
Create rectangle from origin and dimensions.
Definition at line 108 of file generic-rect.h.
|
inline |
Check whether the rectangle has zero area.
Definition at line 172 of file generic-rect.h.
|
inline |
Get the vertical extent of the rectangle.
Definition at line 158 of file generic-rect.h.
References Geom::Y.
Referenced by Inkscape::Extension::Internal::CairoRenderContext::_createHatchPainter(), Inkscape::Extension::Internal::CairoRenderContext::_createPatternPainter(), Inkscape::CanvasItemText::_render(), Inkscape::ObjectSet::_sizeistItem(), Inkscape::CanvasItemText::_update(), Inkscape::UI::Tools::TextTool::_updateCursor(), SPViewBox::apply_viewbox(), Inkscape::Drawing::averageColor(), Inkscape::Extension::Internal::PrintEmf::begin(), Inkscape::Extension::Internal::PrintWmf::begin(), Inkscape::UI::Widget::bisect(), cairo_rectangle(), cairo_rectangle(), SPDimensions::calcDimsFromParentViewport(), SPMeshNodeArray::color_pick(), Persp3D::create_xml_element(), Inkscape::Pixbuf::cropTo(), InkFileExportCmd::do_export_png_now(), Toggle::draw(), Inkscape::Util::draw_border(), Inkscape::UI::Widget::draw_color_plate(), Inkscape::UI::Widget::PageSizePreview::draw_func(), Inkscape::Filters::FilterPrimitive::filter_primitive_area(), Inkscape::Filters::FilterSlot::FilterSlot(), SPDocument::fitToRect(), geom_to_cairo(), geom_to_gtk(), Inkscape::Filters::FilterSlot::get_result(), get_scale_transform_for_uniform_stroke(), get_scale_transform_for_variable_stroke(), SPItem::getCenter(), SPDocument::getDocumentScale(), SPDocument::getHeight(), ink_cairo_draw_drop_shadow(), Inkscape::PageManager::newPage(), Inkscape::UI::Dialog::BatchExport::onExport(), Inkscape::UI::Widget::CairoGraphics::paint_widget(), TextTagAttributes::readSingleAttribute(), Inkscape::DrawingContext::rectangle(), Inkscape::DrawingContext::rectangle(), Inkscape::CanvasItem::render(), Inkscape::Filters::FilterFlood::render_cairo(), Inkscape::Filters::FilterImage::render_cairo(), Inkscape::Filters::FilterTile::render_cairo(), Inkscape::UI::Preview::render_preview(), render_surface(), Inkscape::UI::Widget::CairoGraphics::request_tile_surface(), Inkscape::DrawingContext::revrectangle(), Inkscape::DrawingContext::revrectangle(), Inkscape::UI::Tools::TextTool::root_handler(), Inkscape::UI::Widget::round_rect(), Inkscape::Util::rounded_rectangle(), SPGenericEllipse::set(), SPRect::set(), SPDesktop::set_display_area(), Inkscape::Extension::Internal::PdfBuilder::DrawContext::set_shape_rectangle(), SPItem::setCenter(), SPDocument::setHeight(), SPPage::setRect(), SPRoot::setRootDimensions(), Inkscape::Extension::Internal::CairoRenderer::setupDocument(), Inkscape::Extension::Internal::LaTeXTextRenderer::setupDocument(), SPDocument::setWidthAndHeight(), Inkscape::UI::Widget::CairoGraphics::snapshot_combine(), sp_export_png_file(), sp_generate_internal_bitmap(), Inkscape::UI::Dialog::sp_icon_doc_icon(), Inkscape::Extension::Internal::sp_symbol_render(), sp_validate_marker(), Inkscape::ObjectSet::tile(), Inkscape::UI::Dialog::CloneTiler::trace_pick(), SPLinearGradient::update(), SPGenericEllipse::update(), SPLine::update(), SPRadialGradient::update(), SPShape::update(), SPSymbol::update(), SPText::update(), SPTextPath::update(), SPTSpan::update(), SPFilter::update_filter_all_regions(), Inkscape::UI::Dialog::DocumentProperties::update_viewbox_ui(), Geom::Path::winding(), and SPViewBox::write_viewBox().
|
inlinestatic |
Create infinite rectangle.
Definition at line 112 of file generic-rect.h.
References Geom::max(), and Geom::min().
Referenced by Inkscape::CanvasItemDrawing::_update(), and Inkscape::DrawingPattern::_updateItem().
|
inline |
Check whether the rectangles have any common points.
Definition at line 208 of file generic-rect.h.
References Geom::X, and Geom::Y.
Referenced by Inkscape::DistributionSnapper::_collectBBoxes(), SnapManager::_findCandidates(), Inkscape::DrawingItem::clip(), feed_curve_to_cairo(), geom_curve_bbox_wind_distance(), SPPage::itemOnPage(), main(), main(), Geom::mono_intersect(), Geom::mono_pair(), overlaps(), Inkscape::DrawingItem::update(), and wrap_intersects().
|
inline |
Check whether the rectangles have any common points.
Empty rectangles will not intersect with any other rectangle.
Definition at line 520 of file generic-rect.h.
References Geom::intersects.
|
inline |
Return leftmost coordinate of the rectangle (+X is to the right).
Definition at line 151 of file generic-rect.h.
References Geom::X.
Referenced by Inkscape::Extension::Internal::CairoRenderContext::_createPatternPainter(), Inkscape::Filters::FilterSlot::_get_transformed_background(), Inkscape::Filters::FilterSlot::_get_transformed_source_graphic(), Inkscape::UI::Tools::TextTool::_updateCursor(), add_rectangle(), SPViewBox::apply_viewbox(), Inkscape::Extension::Internal::CairoRenderer::applyClipPath(), Inkscape::Extension::Internal::CairoRenderer::applyMask(), Inkscape::Filters::FilterOffset::area_enlarge(), Inkscape::SubItem::build_mosaic(), cairo_rectangle(), cairo_rectangle(), Geom::CLIPPER_CLASS::clipper_cr(), Inkscape::Pixbuf::cropTo(), Geom::Rect::distance(), Geom::distanceSq(), Toggle::draw(), Inkscape::UI::Widget::PageSizePreview::draw_func(), draw_line_in_rect(), Inkscape::UI::Widget::CairoGraphics::fast_snapshot_combine(), Inkscape::Filters::FilterPrimitive::filter_primitive_area(), Inkscape::find_interior_point(), geom_to_cairo(), geom_to_gtk(), Inkscape::Filters::FilterSlot::get_result(), Geom::CLIPPER_CLASS::intersect(), Inkscape::UI::Toolbar::SelectToolbar::layout_widget_update(), Inkscape::PageManager::newPage(), Inkscape::UI::Widget::CairoGraphics::paint_widget(), Inkscape::DrawingContext::rectangle(), Inkscape::DrawingContext::rectangle(), Inkscape::UI::Widget::Canvas::redraw_area(), Inkscape::Filters::FilterImage::render_cairo(), Inkscape::DrawingPattern::renderPattern(), Inkscape::DrawingContext::revrectangle(), Inkscape::DrawingContext::revrectangle(), Inkscape::UI::Tools::TextTool::root_handler(), Inkscape::UI::Widget::round_rect(), Inkscape::Util::rounded_rectangle(), SVGBox::set(), SPDesktop::set_display_width(), Inkscape::Extension::Internal::PdfBuilder::DrawContext::set_shape_rectangle(), SPPage::setDocumentRect(), SPDocument::setDocumentScale(), Inkscape::Extension::Internal::SvgBuilder::setMargins(), SPPage::setRect(), SPDocument::setWidth(), SPDocument::setWidthAndHeight(), Inkscape::UI::Widget::CairoGraphics::shift_store(), Inkscape::UI::Widget::CairoGraphics::snapshot_combine(), Inkscape::UI::Dialog::sp_icon_doc_icon(), Inkscape::Extension::Internal::sp_symbol_render(), tighten(), Inkscape::ObjectSet::tile(), SPFilter::update_filter_all_regions(), Inkscape::UI::Widget::CanvasGrid::updateRulers(), Geom::Path::winding(), and SPViewBox::write_viewBox().
|
inline |
Get the corner of the rectangle with largest coordinate values.
In 2Geom standard coordinate system, this means lower right.
Definition at line 131 of file generic-rect.h.
References Geom::GenericRect< C >::max(), Geom::X, and Geom::Y.
Referenced by Inkscape::Extension::Internal::CairoRenderContext::_createHatchPainter(), Inkscape::Filters::Filter::_filter_resolution(), Inkscape::SelTrans::_getGeomHandlePos(), Inkscape::UI::Widget::ColorWheelHSLuv::_updatePolygon(), Inkscape::Filters::FilterConvolveMatrix::area_enlarge(), BBoxSort::BBoxSort(), Geom::Line::clip(), Inkscape::Text::Layout::createSelectionShape(), Inkscape::DistributionSnapper::distDown(), Inkscape::DistributionSnapper::distLeft(), Inkscape::DistributionSnapper::distRight(), Inkscape::DistributionSnapper::distUp(), Inkscape::Extension::Internal::PovOutput::doCurve(), Inkscape::Util::draw_border(), Inkscape::Extension::Internal::Grid::effect(), Geom::xAx::extrema(), SPDocument::fitToRect(), floor(), Inkscape::Display::get_x_and_sign(), Inkscape::Display::get_y_and_sign(), goal_function(), Geom::GenericRect< C >::max(), Geom::rect_line_intersect(), Inkscape::DrawingPattern::renderPattern(), Inkscape::PageManager::rotatePage(), Geom::sb2d_cubic_solve(), sbofsb_cubic_solve(), Inkscape::UI::Tools::sp_flood_do_flood_fill(), and toPoly().
|
inline |
Get the larger extent (width or height) of the rectangle.
Definition at line 175 of file generic-rect.h.
References Geom::X, and Geom::Y.
Referenced by Inkscape::UI::TransformHandleSet::_updateVisibility(), Geom::mono_intersect(), and Geom::mono_pair().
|
inline |
Get the point in the geometric center of the rectangle.
Definition at line 167 of file generic-rect.h.
References Geom::X, and Geom::Y.
Referenced by Inkscape::DistributionSnapper::_correctSelectionBBox(), canvas_transform(), SPDesktop::current_center(), Inkscape::UI::Tools::ArcTool::drag(), RectHandle::draw(), Inkscape::Util::draw_border(), Inkscape::UI::Widget::draw_color_plate(), SPDesktop::flip_absolute_center_point(), SPDesktop::flip_relative_center_point(), Inkscape::Display::get_x_and_sign(), Inkscape::Display::get_y_and_sign(), RectHandle::hit(), parallelogram_from_rect_rotate(), Inkscape::PageManager::rotatePage(), SPDesktop::set_display_area(), SPDesktop::set_display_center(), Inkscape::UI::TransformHandleSet::setBounds(), Inkscape::UI::Widget::Stores::snapshot_combine(), sortBoxesDown(), sortBoxesLeft(), sortBoxesRight(), sortBoxesUp(), TEST(), SPDesktop::zoom_absolute(), and SPDesktop::zoom_quick().
|
inline |
Get the corner of the rectangle with smallest coordinate values.
In 2Geom standard coordinate system, this means upper left.
Definition at line 128 of file generic-rect.h.
References Geom::GenericRect< C >::min(), Geom::X, and Geom::Y.
Referenced by Inkscape::SelTrans::_calcAbsAffineGeom(), Inkscape::Extension::Internal::CairoRenderContext::_createHatchPainter(), Inkscape::Filters::Filter::_filter_resolution(), Inkscape::SelTrans::_getGeomHandlePos(), Inkscape::CanvasItemText::_render(), Inkscape::DistributionSnapper::_snapEquidistantPoints(), Inkscape::UI::Widget::ColorWheelHSLuv::_updatePolygon(), Inkscape::Filters::FilterConvolveMatrix::area_enlarge(), Inkscape::Drawing::averageColor(), BBoxSort::BBoxSort(), Geom::Line::clip(), SPMeshNodeArray::color_pick(), Geom::compareIntersectionsTimesX(), Inkscape::Text::Layout::createSelectionShape(), Inkscape::DistributionSnapper::distDown(), Inkscape::DistributionSnapper::distLeft(), Inkscape::DistributionSnapper::distRight(), Inkscape::DistributionSnapper::distUp(), Inkscape::Extension::Internal::PovOutput::doCurve(), Inkscape::UI::Tools::RectTool::drag(), draw(), Inkscape::Util::draw_border(), Inkscape::UI::Widget::draw_color_plate(), Inkscape::UI::Widget::Ruler::draw_ruler(), Inkscape::UI::Widget::CairoGraphics::draw_tile(), Inkscape::Extension::Internal::Grid::effect(), Geom::xAx::extrema(), Inkscape::Filters::FilterSlot::FilterSlot(), SPDocument::fitToRect(), floor(), SPGradient::get_g2d_matrix(), SPGradient::get_gs2d_matrix(), SPViewBox::get_rctx(), get_scale_transform_for_uniform_stroke(), get_scale_transform_for_variable_stroke(), Inkscape::Display::get_x_and_sign(), Inkscape::Display::get_y_and_sign(), goal_function(), Inkscape::UI::Widget::local_to_screen(), main(), map_point(), Geom::Zoom::map_rect(), Geom::GenericRect< C >::min(), Inkscape::UI::Widget::CairoGraphics::paint_widget(), Inkscape::DrawingCache::prepare(), Geom::rect_line_intersect(), Inkscape::CanvasItem::render(), Inkscape::Filters::Filter::render(), Inkscape::Filters::FilterDiffuseLighting::render_cairo(), Inkscape::Filters::FilterFlood::render_cairo(), Inkscape::Filters::FilterImage::render_cairo(), Inkscape::Filters::FilterSpecularLighting::render_cairo(), Inkscape::Filters::FilterTile::render_cairo(), Inkscape::Filters::FilterTurbulence::render_cairo(), Inkscape::UI::Preview::render_preview(), render_surface(), Inkscape::PageManager::rotatePage(), Geom::sb2d_cubic_solve(), sbofsb_cubic_solve(), Inkscape::UI::Widget::screen_to_local(), SPDesktop::scroll_relative(), SPGradient::set_gs2d_matrix(), Inkscape::UI::Widget::CairoGraphics::shift_store(), Inkscape::UI::Widget::Stores::snapshot_combine(), sp_export_get_rows(), sp_export_png_file(), Inkscape::UI::Tools::sp_flood_do_flood_fill(), sp_generate_internal_bitmap(), Inkscape::UI::Dialog::sp_icon_doc_icon(), sp_import_document(), Inkscape::ObjectSet::tile(), Inkscape::ObjectSet::toMarker(), toPoly(), Inkscape::UI::Dialog::CloneTiler::trace_pick(), Geom::Rect::transformTo(), and Inkscape::UI::Dialog::DocumentProperties::update_viewbox_ui().
|
inline |
Get the smaller extent (width or height) of the rectangle.
Definition at line 177 of file generic-rect.h.
References Geom::X, and Geom::Y.
Referenced by Inkscape::UI::TransformHandleSet::_updateVisibility(), Inkscape::UI::Widget::coarsen(), Inkscape::Util::draw_border(), Inkscape::UI::Widget::draw_color_plate(), Inkscape::UI::Widget::local_to_screen(), Inkscape::UI::Widget::screen_to_local(), and Inkscape::PageManager::zoomToPage().
|
inline |
Get the nearest point on the edge of the rectangle.
Definition at line 189 of file generic-rect.h.
References Geom::contains(), result, Geom::X, and Geom::Y.
|
inline |
Offset the rectangle by a vector.
Definition at line 316 of file generic-rect.h.
|
inline |
Offset the rectangle by the negation of a vector.
Definition at line 322 of file generic-rect.h.
|
inline |
Test for equality of rectangles.
Definition at line 337 of file generic-rect.h.
|
inline |
Definition at line 123 of file generic-rect.h.
|
inline |
Definition at line 124 of file generic-rect.h.
|
inline |
Definition at line 121 of file generic-rect.h.
|
inline |
Definition at line 122 of file generic-rect.h.
|
inline |
Union two rectangles.
Definition at line 328 of file generic-rect.h.
|
inline |
Definition at line 332 of file generic-rect.h.
|
inline |
Return rightmost coordinate of the rectangle (+X is to the right).
Definition at line 153 of file generic-rect.h.
References Geom::X.
Referenced by add_rectangle(), Inkscape::Filters::FilterOffset::area_enlarge(), Inkscape::SubItem::build_mosaic(), Geom::CLIPPER_CLASS::clipper_cr(), Geom::Rect::distance(), Geom::distanceSq(), draw_line_in_rect(), Inkscape::find_interior_point(), Geom::CLIPPER_CLASS::intersect(), Inkscape::UI::Widget::Canvas::redraw_area(), SVGBox::set(), SPPage::setDocumentRect(), SPDocument::setHeight(), Inkscape::Extension::Internal::SvgBuilder::setMargins(), Inkscape::UI::Dialog::sp_icon_doc_icon(), tighten(), Inkscape::UI::Widget::CanvasGrid::updateRulers(), and Geom::Path::winding().
|
inline |
Set the maximum Y coordinate of the rectangle.
Definition at line 244 of file generic-rect.h.
References Geom::Y.
Referenced by SPPage::setDocumentRect().
|
inline |
Set the minimum X coordinate of the rectangle.
Definition at line 232 of file generic-rect.h.
References Geom::X.
Referenced by SPPage::setDocumentRect().
|
inline |
Set the lower right point of the rectangle.
Definition at line 253 of file generic-rect.h.
References Geom::X, and Geom::Y.
Referenced by Geom::xAx::arc_bound(), Inkscape::Filters::FilterConvolveMatrix::area_enlarge(), RectHandle::move_to(), Inkscape::UI::Tools::PagesTool::resizeKnotMoved(), SPDocument::setHeight(), SPDocument::setWidth(), and SPDocument::setWidthAndHeight().
|
inline |
Set the upper left point of the rectangle.
Definition at line 248 of file generic-rect.h.
References Geom::X, and Geom::Y.
Referenced by Geom::xAx::arc_bound(), Inkscape::Filters::FilterConvolveMatrix::area_enlarge(), RectHandle::move_to(), and Inkscape::UI::Tools::PagesTool::resizeKnotMoved().
|
inline |
Set the maximum X coordinate of the rectangle.
Definition at line 236 of file generic-rect.h.
References Geom::X.
Referenced by SPPage::setDocumentRect().
|
inline |
Set the minimum Y coordinate of the rectangle.
Definition at line 240 of file generic-rect.h.
References Geom::Y.
Referenced by SPPage::setDocumentRect().
|
inline |
Shrink the rectangle in both directions by the specified amount.
If the amount of shrinkage exceeds a half of the smaller dimension, the rectangle will be shrunk to a line segment.
Definition at line 284 of file generic-rect.h.
Referenced by Inkscape::Util::draw_border(), and Geom::TEST().
|
inline |
Shrink the rectangle in both directions by possibly different amounts.
If the amount of shrinkage exceeds a half of the corresponding dimension, the rectangle will be shrunk to a line segment.
Definition at line 300 of file generic-rect.h.
|
inline |
Return top coordinate of the rectangle (+Y is downwards).
Definition at line 147 of file generic-rect.h.
References Geom::Y.
Referenced by Inkscape::Extension::Internal::CairoRenderContext::_createPatternPainter(), Inkscape::Filters::FilterSlot::_get_transformed_background(), Inkscape::Filters::FilterSlot::_get_transformed_source_graphic(), Inkscape::UI::Tools::TextTool::_updateCursor(), add_rectangle(), SPViewBox::apply_viewbox(), Inkscape::Extension::Internal::CairoRenderer::applyClipPath(), Inkscape::Extension::Internal::CairoRenderer::applyMask(), Inkscape::Filters::FilterOffset::area_enlarge(), Inkscape::SubItem::build_mosaic(), cairo_rectangle(), cairo_rectangle(), Geom::CLIPPER_CLASS::clipper_cr(), Inkscape::Pixbuf::cropTo(), Geom::Rect::distance(), Geom::distanceSq(), Toggle::draw(), Inkscape::UI::Widget::PageSizePreview::draw_func(), draw_line_in_rect(), Inkscape::UI::Widget::CairoGraphics::fast_snapshot_combine(), Inkscape::Filters::FilterPrimitive::filter_primitive_area(), Inkscape::find_interior_point(), geom_to_cairo(), geom_to_gtk(), Inkscape::Filters::FilterSlot::get_result(), Geom::CLIPPER_CLASS::intersect(), Inkscape::PageManager::newPage(), Inkscape::UI::Widget::CairoGraphics::paint_widget(), Inkscape::DrawingContext::rectangle(), Inkscape::DrawingContext::rectangle(), Inkscape::UI::Widget::Canvas::redraw_area(), Inkscape::Filters::FilterImage::render_cairo(), Inkscape::DrawingContext::revrectangle(), Inkscape::DrawingContext::revrectangle(), Inkscape::UI::Tools::TextTool::root_handler(), Inkscape::UI::Widget::round_rect(), Inkscape::Util::rounded_rectangle(), SVGBox::set(), Inkscape::Extension::Internal::PdfBuilder::DrawContext::set_shape_rectangle(), SPPage::setDocumentRect(), SPDocument::setDocumentScale(), SPDocument::setHeight(), Inkscape::Extension::Internal::SvgBuilder::setMargins(), SPPage::setRect(), SPDocument::setWidthAndHeight(), Inkscape::UI::Widget::CairoGraphics::shift_store(), Inkscape::UI::Widget::CairoGraphics::snapshot_combine(), Inkscape::UI::Dialog::sp_icon_doc_icon(), Inkscape::Extension::Internal::sp_symbol_render(), tighten(), Inkscape::ObjectSet::tile(), SPFilter::update_filter_all_regions(), Inkscape::UI::Widget::CanvasGrid::updateRulers(), and SPViewBox::write_viewBox().
|
inline |
Enlarge the rectangle to contain the argument.
Definition at line 263 of file generic-rect.h.
References Geom::X, and Geom::Y.
Referenced by Inkscape::DistributionSnapper::_addBBoxForIntersectingBoxes(), Geom::Path::boundsExact(), Geom::Path::boundsFast(), SPFeOffset::calculate_region(), Inkscape::UI::Widget::coarsen(), Geom::RTree::create_nonleaf_record_from_rtreenode(), Geom::EllipticalArc::expandToTransformed(), Geom::RTree::find_enlargement(), Geom::RTree::find_waste_area(), Geom::RTree::pick_next(), Geom::union_list(), and wrap_unionWith().
|
inline |
Enlarge the rectangle to contain the argument.
Unioning with an empty rectangle results in no changes.
Definition at line 514 of file generic-rect.h.
|
inline |
Get the horizontal extent of the rectangle.
Definition at line 156 of file generic-rect.h.
References Geom::X.
Referenced by Inkscape::Extension::Internal::CairoRenderContext::_createHatchPainter(), Inkscape::Extension::Internal::CairoRenderContext::_createPatternPainter(), Inkscape::CanvasItemText::_render(), Inkscape::ObjectSet::_sizeistItem(), Inkscape::CanvasItemText::_update(), Inkscape::UI::Tools::TextTool::_updateCursor(), SPViewBox::apply_viewbox(), Inkscape::Drawing::averageColor(), Inkscape::Extension::Internal::PrintEmf::begin(), Inkscape::Extension::Internal::PrintWmf::begin(), Inkscape::UI::Widget::bisect(), Inkscape::DrawingImage::bounds(), cairo_rectangle(), cairo_rectangle(), SPDimensions::calcDimsFromParentViewport(), SPMeshNodeArray::color_pick(), Persp3D::create_xml_element(), Inkscape::LivePathEffect::LPEMeasureSegments::createTextLabel(), Inkscape::Pixbuf::cropTo(), InkFileExportCmd::do_export_png_now(), Toggle::draw(), Inkscape::Util::draw_border(), Inkscape::UI::Widget::draw_color_plate(), Inkscape::UI::Widget::PageSizePreview::draw_func(), Inkscape::Filters::FilterPrimitive::filter_primitive_area(), Inkscape::Filters::FilterSlot::FilterSlot(), Inkscape::find_interior_point(), SPDocument::fitToRect(), geom_to_cairo(), geom_to_gtk(), Inkscape::UI::Dialog::get_document_scale_helper(), Inkscape::Filters::FilterSlot::get_result(), get_scale_transform_for_uniform_stroke(), get_scale_transform_for_variable_stroke(), SPItem::getCenter(), SPDocument::getDocumentScale(), SPDocument::getWidth(), ink_cairo_draw_drop_shadow(), Geom::Zoom::map_rect(), SPGuide::moveto(), Inkscape::PageManager::newPage(), Inkscape::UI::Dialog::BatchExport::onExport(), Inkscape::UI::Widget::CairoGraphics::paint_widget(), TextTagAttributes::readSingleAttribute(), Inkscape::DrawingContext::rectangle(), Inkscape::DrawingContext::rectangle(), Inkscape::CanvasItem::render(), Inkscape::Filters::FilterFlood::render_cairo(), Inkscape::Filters::FilterImage::render_cairo(), Inkscape::Filters::FilterTile::render_cairo(), Inkscape::UI::Preview::render_preview(), render_surface(), Inkscape::UI::Widget::CairoGraphics::request_tile_surface(), Inkscape::DrawingContext::revrectangle(), Inkscape::DrawingContext::revrectangle(), Inkscape::UI::Tools::TextTool::root_handler(), Inkscape::UI::Widget::round_rect(), Inkscape::Util::rounded_rectangle(), SPGenericEllipse::set(), SPRect::set(), SPDesktop::set_display_area(), SPDesktop::set_display_width(), Inkscape::Extension::Internal::PdfBuilder::DrawContext::set_shape_rectangle(), SPItem::setCenter(), SPPage::setRect(), SPRoot::setRootDimensions(), Inkscape::Extension::Internal::CairoRenderer::setupDocument(), Inkscape::Extension::Internal::LaTeXTextRenderer::setupDocument(), SPDocument::setWidth(), SPDocument::setWidthAndHeight(), Inkscape::UI::Toolbar::PageToolbar::sizeChoose(), Inkscape::UI::Widget::CairoGraphics::snapshot_combine(), sp_export_png_file(), Inkscape::Extension::Internal::LaTeXTextRenderer::sp_flowtext_render(), sp_generate_internal_bitmap(), Inkscape::UI::Dialog::sp_icon_doc_icon(), Inkscape::Extension::Internal::sp_symbol_render(), sp_validate_marker(), Inkscape::ObjectSet::tile(), Inkscape::UI::Dialog::CloneTiler::trace_pick(), SPLinearGradient::update(), SPGenericEllipse::update(), SPLine::update(), SPRadialGradient::update(), SPShape::update(), SPSymbol::update(), SPText::update(), SPTextPath::update(), SPTSpan::update(), SPFilter::update_filter_all_regions(), Inkscape::UI::Dialog::DocumentProperties::update_viewbox_ui(), and SPViewBox::write_viewBox().
|
protected |
Definition at line 66 of file generic-rect.h.