Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Geom::GenericRect< C > Class Template Reference

Axis aligned, non-empty, generic rectangle. More...

#include <generic-rect.h>

Inheritance diagram for Geom::GenericRect< C >:

Public Types

using D1Value = CInterval
 
using D1Reference = CInterval &
 
using D1ConstReference = CInterval const &
 

Public Member Functions

Inspect dimensions.
CIntervaloperator[] (unsigned i)
 
CInterval const & operator[] (unsigned i) const
 
CIntervaloperator[] (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.
 
top () const
 Return top coordinate of the rectangle (+Y is downwards).
 
bottom () const
 Return bottom coordinate of the rectangle (+Y is downwards).
 
left () const
 Return leftmost coordinate of the rectangle (+X is to the right).
 
right () const
 Return rightmost coordinate of the rectangle (+X is to the right).
 
width () const
 Get the horizontal extent of the rectangle.
 
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.
 
area () const
 Compute the rectangle's area.
 
bool hasZeroArea () const
 Check whether the rectangle has zero area.
 
maxExtent () const
 Get the larger extent (width or height) of the rectangle.
 
minExtent () const
 Get the smaller extent (width or height) of the rectangle.
 
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.
 

Detailed Description

template<typename C>
class Geom::GenericRect< C >

Axis aligned, non-empty, generic rectangle.

Definition at line 58 of file generic-rect.h.

Member Typedef Documentation

◆ CInterval

template<typename C >
using Geom::GenericRect< C >::CInterval = typename CoordTraits<C>::IntervalType
private

Definition at line 61 of file generic-rect.h.

◆ CPoint

template<typename C >
using Geom::GenericRect< C >::CPoint = typename CoordTraits<C>::PointType
private

Definition at line 62 of file generic-rect.h.

◆ CRect

template<typename C >
using Geom::GenericRect< C >::CRect = typename CoordTraits<C>::RectType
private

Definition at line 63 of file generic-rect.h.

◆ D1ConstReference

template<typename C >
using Geom::GenericRect< C >::D1ConstReference = CInterval const &

Definition at line 70 of file generic-rect.h.

◆ D1Reference

template<typename C >
using Geom::GenericRect< C >::D1Reference = CInterval &

Definition at line 69 of file generic-rect.h.

◆ D1Value

template<typename C >
using Geom::GenericRect< C >::D1Value = CInterval

Definition at line 68 of file generic-rect.h.

◆ OptCRect

template<typename C >
using Geom::GenericRect< C >::OptCRect = typename CoordTraits<C>::OptRectType
private

Definition at line 64 of file generic-rect.h.

Constructor & Destructor Documentation

◆ GenericRect() [1/4]

template<typename C >
Geom::GenericRect< C >::GenericRect ( )
default

Create a rectangle that contains only the point at (0, 0).

◆ GenericRect() [2/4]

template<typename C >
Geom::GenericRect< C >::GenericRect ( CInterval const &  a,
CInterval const &  b 
)
inline

Create a rectangle from X and Y intervals.

Definition at line 77 of file generic-rect.h.

◆ GenericRect() [3/4]

template<typename C >
Geom::GenericRect< C >::GenericRect ( CPoint const &  a,
CPoint const &  b 
)
inline

Create a rectangle from two points.

Definition at line 79 of file generic-rect.h.

References Geom::X.

◆ GenericRect() [4/4]

template<typename C >
Geom::GenericRect< C >::GenericRect ( x0,
y0,
x1,
y1 
)
inline

Create rectangle from coordinates of two points.

Definition at line 81 of file generic-rect.h.

Member Function Documentation

◆ area()

◆ aspectRatio()

template<typename C >
Coord Geom::GenericRect< C >::aspectRatio ( ) const
inline

Get the ratio of width to height of the rectangle.

Definition at line 160 of file generic-rect.h.

References height, and width.

◆ bottom()

◆ clamp()

template<typename C >
CPoint Geom::GenericRect< C >::clamp ( CPoint const &  p) const
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().

◆ contains() [1/3]

template<typename C >
bool Geom::GenericRect< C >::contains ( CPoint const &  p) const
inline

Check whether the given point is within the rectangle.

Definition at line 224 of file generic-rect.h.

References Geom::X, and Geom::Y.

◆ contains() [2/3]

◆ contains() [3/3]

template<typename C >
bool Geom::GenericRect< C >::contains ( OptCRect const &  r) const
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().

◆ corner()

template<typename C >
CPoint Geom::GenericRect< C >::corner ( unsigned  i) const
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().

◆ dimensions()

◆ distanceSq()

template<typename C >
C Geom::GenericRect< C >::distanceSq ( CPoint const &  p) const
inline

Get rectangle's distance SQUARED away from the given point.

Definition at line 180 of file generic-rect.h.

◆ expandBy() [1/3]

◆ expandBy() [2/3]

template<typename C >
void Geom::GenericRect< C >::expandBy ( x,
y 
)
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.

References Geom::X, and Geom::Y.

◆ expandBy() [3/3]

template<typename C >
void Geom::GenericRect< C >::expandBy ( CPoint const &  p)
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.

References Geom::X, and Geom::Y.

◆ expandTo()

◆ from_array()

template<typename C >
static CRect Geom::GenericRect< C >::from_array ( CPoint const *  c,
unsigned  n 
)
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.

◆ from_range()

template<typename C >
template<typename InputIterator >
static CRect Geom::GenericRect< C >::from_range ( InputIterator  start,
InputIterator  end 
)
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.

Parameters
startBeginning of the range
endEnd of the range
Returns
Rectangle that contains all points from [start, end).

Definition at line 90 of file generic-rect.h.

References end, result, and start.

◆ from_xywh() [1/2]

◆ from_xywh() [2/2]

template<typename C >
static CRect Geom::GenericRect< C >::from_xywh ( CPoint const &  xy,
CPoint const &  wh 
)
inlinestatic

Create rectangle from origin and dimensions.

Definition at line 108 of file generic-rect.h.

◆ hasZeroArea()

template<typename C >
bool Geom::GenericRect< C >::hasZeroArea ( ) const
inline

Check whether the rectangle has zero area.

Definition at line 172 of file generic-rect.h.

References Geom::X, and Geom::Y.

◆ height()

template<typename C >
C Geom::GenericRect< C >::height ( ) const
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().

◆ infinite()

template<typename C >
static CRect Geom::GenericRect< C >::infinite ( )
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().

◆ intersects() [1/2]

◆ intersects() [2/2]

template<typename C >
bool Geom::GenericRect< C >::intersects ( OptCRect const &  r) const
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.

◆ left()

template<typename C >
C Geom::GenericRect< C >::left ( ) const
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().

◆ max()

◆ maxExtent()

template<typename C >
C Geom::GenericRect< C >::maxExtent ( ) const
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().

◆ midpoint()

◆ min()

template<typename C >
CPoint Geom::GenericRect< C >::min ( ) const
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().

◆ minExtent()

◆ nearestEdgePoint()

template<typename C >
CPoint Geom::GenericRect< C >::nearestEdgePoint ( CPoint const &  p) const
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.

◆ operator+=()

template<typename C >
GenericRect< C > & Geom::GenericRect< C >::operator+= ( CPoint const &  p)
inline

Offset the rectangle by a vector.

Definition at line 316 of file generic-rect.h.

References Geom::X, and Geom::Y.

◆ operator-=()

template<typename C >
GenericRect< C > & Geom::GenericRect< C >::operator-= ( CPoint const &  p)
inline

Offset the rectangle by the negation of a vector.

Definition at line 322 of file generic-rect.h.

References Geom::X, and Geom::Y.

◆ operator==()

template<typename C >
bool Geom::GenericRect< C >::operator== ( CRect const &  o) const
inline

Test for equality of rectangles.

Definition at line 337 of file generic-rect.h.

References Geom::X, and Geom::Y.

◆ operator[]() [1/4]

template<typename C >
CInterval & Geom::GenericRect< C >::operator[] ( Dim2  d)
inline

Definition at line 123 of file generic-rect.h.

◆ operator[]() [2/4]

template<typename C >
CInterval const & Geom::GenericRect< C >::operator[] ( Dim2  d) const
inline

Definition at line 124 of file generic-rect.h.

◆ operator[]() [3/4]

template<typename C >
CInterval & Geom::GenericRect< C >::operator[] ( unsigned  i)
inline

Definition at line 121 of file generic-rect.h.

◆ operator[]() [4/4]

template<typename C >
CInterval const & Geom::GenericRect< C >::operator[] ( unsigned  i) const
inline

Definition at line 122 of file generic-rect.h.

◆ operator|=() [1/2]

template<typename C >
GenericRect< C > & Geom::GenericRect< C >::operator|= ( CRect const &  o)
inline

Union two rectangles.

Definition at line 328 of file generic-rect.h.

◆ operator|=() [2/2]

template<typename C >
GenericRect< C > & Geom::GenericRect< C >::operator|= ( OptCRect const &  o)
inline

Definition at line 332 of file generic-rect.h.

◆ right()

◆ setBottom()

template<typename C >
void Geom::GenericRect< C >::setBottom ( val)
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().

◆ setLeft()

template<typename C >
void Geom::GenericRect< C >::setLeft ( val)
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().

◆ setMax()

template<typename C >
void Geom::GenericRect< C >::setMax ( CPoint const &  p)
inline

◆ setMin()

template<typename C >
void Geom::GenericRect< C >::setMin ( CPoint const &  p)
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().

◆ setRight()

template<typename C >
void Geom::GenericRect< C >::setRight ( val)
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().

◆ setTop()

template<typename C >
void Geom::GenericRect< C >::setTop ( val)
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().

◆ shrinkBy() [1/2]

template<typename C >
void Geom::GenericRect< C >::shrinkBy ( amount)
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().

◆ shrinkBy() [2/2]

template<typename C >
void Geom::GenericRect< C >::shrinkBy ( x,
y 
)
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.

◆ top()

template<typename C >
C Geom::GenericRect< C >::top ( ) const
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().

◆ unionWith() [1/2]

◆ unionWith() [2/2]

template<typename C >
void Geom::GenericRect< C >::unionWith ( OptCRect const &  b)
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.

◆ width()

template<typename C >
C Geom::GenericRect< C >::width ( ) const
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().

Member Data Documentation

◆ f

template<typename C >
CInterval Geom::GenericRect< C >::f[2]
protected

Definition at line 66 of file generic-rect.h.


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