Inkscape
Vector Graphics Editor
|
3x3 matrix representing an affine transformation. More...
#include <affine.h>
Public Member Functions | |
Affine () | |
Affine (Coord c0, Coord c1, Coord c2, Coord c3, Coord c4, Coord c5) | |
Create a matrix from its coefficient values. | |
Coord | operator[] (unsigned i) const |
Access a coefficient by its index. | |
Coord & | operator[] (unsigned i) |
bool | operator== (Affine const &o) const |
Combine with other transformations | |
Affine & | operator*= (Affine const &m) |
Combine this transformation with another one. | |
Affine & | operator*= (Translate const &t) |
Combine this transformation with a translation. | |
Affine & | operator*= (Scale const &s) |
Combine this transformation with scaling. | |
Affine & | operator*= (Rotate const &r) |
Combine this transformation a rotation. | |
Affine & | operator*= (HShear const &h) |
Combine this transformation with horizontal shearing (skew). | |
Affine & | operator*= (VShear const &v) |
Combine this transformation with vertical shearing (skew). | |
Affine & | operator*= (Zoom const &) |
Get the parameters of the matrix's transform | |
Point | xAxis () const |
Point | yAxis () const |
Point | translation () const |
Gets the translation imparted by the Affine. | |
Coord | expansionX () const |
Calculates the amount of x-scaling imparted by the Affine. | |
Coord | expansionY () const |
Calculates the amount of y-scaling imparted by the Affine. | |
Point | expansion () const |
Modify the matrix | |
void | setXAxis (Point const &vec) |
void | setYAxis (Point const &vec) |
void | setTranslation (Point const &loc) |
Sets the translation imparted by the Affine. | |
void | setExpansionX (Coord val) |
void | setExpansionY (Coord val) |
void | setIdentity () |
Sets this matrix to be the Identity Affine. | |
Inspect the matrix's transform | |
bool | isIdentity (Coord eps=EPSILON) const |
Check whether this matrix is an identity matrix. | |
bool | isTranslation (Coord eps=EPSILON) const |
Check whether this matrix represents a pure translation. | |
bool | isScale (Coord eps=EPSILON) const |
Check whether this matrix represents pure scaling. | |
bool | isUniformScale (Coord eps=EPSILON) const |
Check whether this matrix represents pure uniform scaling. | |
bool | isRotation (Coord eps=EPSILON) const |
Check whether this matrix represents a pure rotation. | |
bool | isHShear (Coord eps=EPSILON) const |
Check whether this matrix represents pure horizontal shearing. | |
bool | isVShear (Coord eps=EPSILON) const |
Check whether this matrix represents pure vertical shearing. | |
bool | isNonzeroTranslation (Coord eps=EPSILON) const |
Check whether this matrix represents a pure nonzero translation. | |
bool | isNonzeroScale (Coord eps=EPSILON) const |
Check whether this matrix represents pure, nonzero scaling. | |
bool | isNonzeroUniformScale (Coord eps=EPSILON) const |
Check whether this matrix represents pure, nonzero uniform scaling. | |
bool | isNonzeroRotation (Coord eps=EPSILON) const |
Check whether this matrix represents a pure, nonzero rotation. | |
bool | isNonzeroNonpureRotation (Coord eps=EPSILON) const |
Check whether this matrix represents a non-zero rotation about any point. | |
Point | rotationCenter () const |
For a (possibly non-pure) non-zero-rotation matrix, calculate the rotation center. | |
bool | isNonzeroHShear (Coord eps=EPSILON) const |
Check whether this matrix represents pure, nonzero horizontal shearing. | |
bool | isNonzeroVShear (Coord eps=EPSILON) const |
Check whether this matrix represents pure, nonzero vertical shearing. | |
bool | isZoom (Coord eps=EPSILON) const |
Check whether this matrix represents zooming. | |
bool | preservesArea (Coord eps=EPSILON) const |
Check whether the transformation preserves areas of polygons. | |
bool | preservesAngles (Coord eps=EPSILON) const |
Check whether the transformation preserves angles between lines. | |
bool | preservesDistances (Coord eps=EPSILON) const |
Check whether the transformation preserves distances between points. | |
bool | flips () const |
Check whether this transformation flips objects. | |
bool | isSingular (Coord eps=EPSILON) const |
Check whether this matrix is singular. | |
Compute other matrices | |
Affine | withoutTranslation () const |
Affine | inverse () const |
Compute the inverse matrix. | |
Compute scalar values | |
Coord | det () const |
Calculate the determinant. | |
Coord | descrim2 () const |
Calculate the square of the descriminant. | |
Coord | descrim () const |
Calculate the descriminant. | |
Static Public Member Functions | |
static Affine | identity () |
Private Attributes | |
Coord | _c [6] |
Related Symbols | |
(Note that these are not member symbols.) | |
std::ostream & | operator<< (std::ostream &out_file, const Geom::Affine &m) |
Print out the Affine (for debugging). | |
Affine | identity () |
Create an identity matrix. | |
Affine | elliptic_quadratic_form (Affine const &m) |
Given a matrix m such that unit_circle = m*x, this returns the quadratic form x*A*x = 1. | |
bool | are_near (Affine const &a, Affine const &b, Coord eps) |
Nearness predicate for affine transforms. | |
3x3 matrix representing an affine transformation.
Affine transformations on elements of a vector space are transformations which can be expressed in terms of matrix multiplication followed by addition ( \(x \mapsto A x + b\)). They can be thought of as generalizations of linear functions ( \(y = a x + b\)) to vector spaces. Affine transformations of points on a 2D plane preserve the following properties:
All affine transformations on 2D points can be written as combinations of scaling, rotation, shearing and translation. They can be represented as a combination of a vector and a 2x2 matrix, but this form is inconvenient to work with. A better solution is to represent all affine transformations on the 2D plane as 3x3 matrices, where the last column has fixed values.
\[ A = \left[ \begin{array}{ccc} c_0 & c_1 & 0 \\ c_2 & c_3 & 0 \\ c_4 & c_5 & 1 \end{array} \right]\]
We then interpret points as row vectors of the form \([p_X, p_Y, 1]\). Applying a transformation to a point can be written as right-multiplication by a 3x3 matrix ( \(p' = pA\)). This subset of matrices is closed under multiplication - combination of any two transforms can be expressed as the multiplication of their matrices. In this representation, the \(c_4\) and \(c_5\) coefficients represent the translation component of the transformation.
Matrices can be multiplied by other more specific transformations. When multiplying, the transformations are applied from left to right, so for example m = a * b
means: m first transforms by a, then by b.
|
inline |
Coord Geom::Affine::descrim | ( | ) | const |
Calculate the descriminant.
If the matrix doesn't contain a shearing or non-uniform scaling component, this value says how will the length of any line segment change after applying this transformation to arbitrary objects on a plane. The new length will be
Definition at line 434 of file affine.cpp.
References descrim2(), and Geom::sqrt().
Referenced by Inkscape::UI::PathManipulator::_getStrokeTolerance(), Inkscape::UI::Tools::PencilTool::_interpolate(), Inkscape::UI::Tools::PencilTool::_sketchInterpolate(), _ungroup_compensate_source_transform(), Inkscape::CanvasItemGridAxonom::_update(), Inkscape::DrawingGlyphs::_updateItem(), Inkscape::UI::Tools::PencilTool::addPowerStrokePencil(), Inkscape::UI::Dialog::CloneTiler::apply(), Inkscape::UI::Widget::calcScaleLineWidth(), Inkscape::CanvasItemBpath::closest_distance_to(), SPText::description(), Inkscape::LivePathEffect::LPEOffset::doBeforeEffect(), Inkscape::LivePathEffect::LPESimplify::doEffect(), SPItem::doWriteTransform(), Inkscape::UI::Tools::StarTool::drag(), Inkscape::UI::Tools::SpiralTool::finishItem(), Inkscape::CanvasItemRect::get_shadow_size(), Inkscape::GridSnapper::getSnapLinesAxonom(), SPDesktop::DesktopAffine::getZoom(), item_find_paths(), Inkscape::UI::Toolbar::TextToolbar::lineheight_unit_changed(), Inkscape::LivePathEffect::lpe_shape_revert_stroke_and_fill(), modify_filter_gaussian_blur_from_item(), new_filter_simple_from_item(), objects_query_blur(), objects_query_fontnumbers(), objects_query_strokewidth(), Geom::Ellipse::operator*=(), Inkscape::LivePathEffect::ScalarParam::param_transform_multiply(), Inkscape::LivePathEffect::PowerStrokePointArrayParam::param_transform_multiply(), path_simplify(), SPPath::removeTransformsRecursively(), Inkscape::Filters::FilterDiffuseLighting::render_cairo(), Inkscape::Filters::FilterSpecularLighting::render_cairo(), SPOffset::set_shape(), SPLine::set_transform(), SPPath::set_transform(), SPText::set_transform(), SPGenericEllipse::set_transform(), SPFlowtext::set_transform(), Inkscape::UI::Widget::StrokeStyle::setStrokeDash(), sp_desktop_apply_css_recursive(), sp_gradient_convert_to_userspace(), sp_selected_path_create_offset_object(), sp_selected_path_do_offset(), sp_svg_transform_write(), sp_te_adjust_kerning_screen(), sp_te_adjust_linespacing_screen(), sp_te_adjust_rotation_screen(), sp_te_apply_style(), Inkscape::UI::Tools::sp_tweak_color_recursive(), Inkscape::UI::Tools::sp_tweak_dilate_recursive(), Inkscape::Extension::Internal::PrintLatex::stroke(), stroke_average_width(), take_style_from_item(), text_flow_into_shape(), Inkscape::UI::Toolbar::TextToolbar::text_outer_set_style(), text_put_on_path(), Inkscape::UI::ControlPointSelection::transform(), Inkscape::DrawingItem::update(), SPHatchPath::update(), SPShape::update(), and wrap_transforms().
Coord Geom::Affine::descrim2 | ( | ) | const |
Calculate the square of the descriminant.
This is simply the absolute value of the determinant.
Definition at line 424 of file affine.cpp.
References det().
Referenced by Geom::Parallelogram::area(), descrim(), PatternKnotHolderEntityScale::knot_grabbed(), preservesArea(), and wrap_transforms().
Coord Geom::Affine::det | ( | ) | const |
Calculate the determinant.
Definition at line 416 of file affine.cpp.
References _c.
Referenced by Inkscape::DrawingPattern::_updateItem(), Geom::decompose_degenerate(), descrim2(), flips(), inverse(), isSingular(), max_expansion(), Geom::EllipticalArc::operator*=(), Inkscape::UI::Widget::Stores::snapshot_combine(), Shape::TesteIntersection(), and wrap_transforms().
|
inline |
Definition at line 123 of file affine.h.
References expansionX(), and expansionY().
double Geom::Affine::expansionX | ( | ) | const |
Calculates the amount of x-scaling imparted by the Affine.
This is the scaling applied to the original x-axis region. It is \emph{not} the overall x-scaling of the transformation. Equivalent to L2(m.xAxis()).
Definition at line 64 of file affine.cpp.
References _c, and Geom::sqrt().
Referenced by Inkscape::Extension::Internal::SvgBuilder::_flushText(), Inkscape::Filters::FilterGaussian::area_enlarge(), Inkscape::Filters::FilterMorphology::area_enlarge(), Inkscape::Filters::FilterGaussian::complexity(), Inkscape::Filters::FilterMorphology::complexity(), Inkscape::LivePathEffect::LPEMeasureSegments::doBeforeEffect(), expansion(), Geom::Parallelogram::maxExtent(), Geom::Parallelogram::minExtent(), Inkscape::LivePathEffect::NodeSatelliteArrayParam::param_transform_multiply(), Inkscape::Filters::FilterDisplacementMap::render_cairo(), Inkscape::Filters::FilterGaussian::render_cairo(), Inkscape::Filters::FilterMorphology::render_cairo(), Inkscape::Filters::FilterOffset::render_cairo(), setExpansionX(), Inkscape::UI::Tools::MeasureTool::setMeasureItem(), Inkscape::Extension::Internal::LaTeXTextRenderer::sp_flowtext_render(), Inkscape::UI::Tools::spdc_check_for_and_apply_waiting_LPE(), Inkscape::Extension::Internal::PrintEmf::text(), Inkscape::Extension::Internal::PrintWmf::text(), and wrap_transforms().
double Geom::Affine::expansionY | ( | ) | const |
Calculates the amount of y-scaling imparted by the Affine.
This is the scaling applied before the other transformations. It is \emph{not} the overall y-scaling of the transformation. Equivalent to L2(m.yAxis()).
Definition at line 71 of file affine.cpp.
References _c, and Geom::sqrt().
Referenced by Inkscape::Filters::FilterGaussian::area_enlarge(), Inkscape::Filters::FilterMorphology::area_enlarge(), Inkscape::Filters::FilterGaussian::complexity(), Inkscape::Filters::FilterMorphology::complexity(), Inkscape::LivePathEffect::LPEMeasureSegments::doBeforeEffect(), expansion(), Geom::Parallelogram::maxExtent(), Geom::Parallelogram::minExtent(), Inkscape::LivePathEffect::NodeSatelliteArrayParam::param_transform_multiply(), Inkscape::Filters::FilterDisplacementMap::render_cairo(), Inkscape::Filters::FilterGaussian::render_cairo(), Inkscape::Filters::FilterMorphology::render_cairo(), Inkscape::Filters::FilterOffset::render_cairo(), setExpansionY(), Inkscape::UI::Tools::spdc_check_for_and_apply_waiting_LPE(), Inkscape::Extension::Internal::PrintEmf::text(), Inkscape::Extension::Internal::PrintWmf::text(), and wrap_transforms().
bool Geom::Affine::flips | ( | ) | const |
Check whether this transformation flips objects.
A transformation flips objects if it has a negative scaling component.
Definition at line 368 of file affine.cpp.
References det().
Referenced by Inkscape::CanvasItemCtrl::_update(), and Geom::TEST().
|
inlinestatic |
Referenced by Geom::identity(), Geom::TEST(), TEST(), and Geom::OptRect::transformTo().
Affine Geom::Affine::inverse | ( | ) | const |
Compute the inverse matrix.
Inverse is a matrix (denoted \(A^{-1}\)) such that \(AA^{-1} = A^{-1}A = I\). Singular matrices have no inverse (for example a matrix that has two of its columns equal). For such matrices, the identity matrix will be returned instead.
eps | Numerical tolerance |
Definition at line 388 of file affine.cpp.
References _c, det(), Geom::rel_error_bound(), and setIdentity().
Referenced by SPHatch::_calculateStripExtents(), Inkscape::UI::PathManipulator::_createGeometryFromControlPoints(), Inkscape::Extension::Internal::CairoRenderContext::_createHatchPainter(), Inkscape::UI::PathManipulator::_externalChange(), Inkscape::Extension::Internal::SvgBuilder::_getClip(), Inkscape::UI::Dialog::GuidelinePropertiesDialog::_modeChanged(), Inkscape::ObjectSet::_pathBoolOp(), Inkscape::DrawingImage::_pickItem(), Inkscape::UI::ControlPointSelection::_pointDragged(), Inkscape::UI::Tools::EraserTool::_probeUnlinkCutClonedGroup(), Inkscape::DrawingText::_renderItem(), Inkscape::UI::Tools::TextTool::_setupText(), _ungroup_compensate_source_transform(), SPDesktop::DesktopAffine::_update(), Inkscape::UI::PathManipulator::_updateDragPoint(), Inkscape::LivePathEffect::LPETiling::addCanvasIndicators(), Inkscape::Extension::Internal::SvgBuilder::addShadedFill(), SPItem::adjust_paint_recursive(), Inkscape::UI::Dialog::CloneTiler::apply(), Inkscape::ObjectSet::applyAffine(), Inkscape::UI::Widget::Graphics::check_single_page(), Inkscape::CanvasItemBpath::closest_distance_to(), Inkscape::CanvasItemBpath::contains(), Geom::Parallelogram::contains(), Geom::Parallelogram::contains(), Inkscape::DrawingMeshGradient::create_pattern(), SPImage::cropToArea(), Inkscape::UI::Tools::do_trace(), Inkscape::LivePathEffect::LPETiling::doAfterEffect(), Inkscape::LivePathEffect::LPEFillBetweenMany::doBeforeEffect(), Inkscape::LivePathEffect::LPEFillBetweenStrokes::doBeforeEffect(), Inkscape::LivePathEffect::LPEMeasureSegments::doBeforeEffect(), Inkscape::LivePathEffect::LPEMirrorSymmetry::doBeforeEffect(), Inkscape::LivePathEffect::LPEBool::doEffect(), Inkscape::LivePathEffect::LPETiling::doEffect_path(), Inkscape::LivePathEffect::LPEVonKoch::doEffect_path(), Inkscape::LivePathEffect::LPETiling::doEffect_path_post(), Inkscape::LivePathEffect::LPERoughHatches::doEffect_pwd2(), Inkscape::LivePathEffect::LPEFilletChamfer::doOnApply(), Inkscape::LivePathEffect::LPETiling::doOnVisibilityToggled(), PdfParser::doShadingPatternFillFallback(), SPItem::doWriteTransform(), Inkscape::UI::Tools::SpiralTool::drag(), Inkscape::UI::Tools::ArcTool::drag(), Inkscape::UI::Tools::RectTool::drag(), Inkscape::UI::Tools::StarTool::drag(), Inkscape::UI::TransformHandle::dragged(), SPItem::dt2i_affine(), SPShape::either_bbox(), Inkscape::UI::Widget::CairoGraphics::fast_snapshot_combine(), file_import(), Inkscape::LivePathEffect::findShadowedTime(), Inkscape::LivePathEffect::LPEPts2Ellipse::genFitEllipse(), SPBox3D::get_center_screen(), SPBox3D::get_corner_screen(), Inkscape::Filters::FilterUnits::get_matrix_display2pb(), Inkscape::Filters::FilterUnits::get_matrix_pb2display(), Inkscape::UI::Dialog::CloneTiler::get_transform(), SPItem::getClipPathVector(), Inkscape::Extension::Internal::getODFItemTransform(), i2i_affine(), Geom::intersect_polish_root(), Geom::intersect_polish_root(), Geom::Parallelogram::intersects(), PatternKnotHolderEntityScale::knot_grabbed(), KnotHolder::knot_grabbed_handler(), KnotHolder::knot_moved_handler(), HatchKnotHolderEntityScale::knot_set(), KnotHolder::knot_ungrabbed_handler(), Shape::MakeTweak(), SPUse::move_compensate(), PatternKnotHolderEntity::offset_to_cell(), Inkscape::UI::Dialog::Transformation::onReplaceMatrixToggled(), Geom::Ellipse::operator*=(), Inkscape::LivePathEffect::GroupBBoxEffect::original_bbox(), Inkscape::UI::Widget::CairoGraphics::paint_widget(), Inkscape::LivePathEffect::PathParam::paste_param_path(), Inkscape::UI::PathManipulator::PathManipulator(), Inkscape::LivePathEffect::LPEMeasureSegments::processObjects(), Inkscape::ObjectSet::relink(), SPPath::removeTransformsRecursively(), Inkscape::Filters::FilterImage::render_cairo(), Inkscape::Filters::FilterTurbulence::render_cairo(), Inkscape::DrawingPattern::renderPattern(), SPConnEndPair::reroutePathFromLibavoid(), Inkscape::UI::Tools::ToolBase::root_handler(), SPItem::rotate_rel(), Inkscape::UI::Dialog::rotateAround(), SPGroup::scaleChildItemsRec(), SPGradient::set_gs2d_matrix(), SPItem::set_i2d_affine(), Inkscape::UI::Tools::CalligraphicTool::set_to_accumulated(), SPText::set_transform(), SPGenericEllipse::set_transform(), SPFlowtext::set_transform(), SPSpiral::set_transform(), SPStar::set_transform(), Inkscape::UI::PathManipulator::setControlsTransform(), Inkscape::UI::Tools::MeasureTool::setGuide(), Inkscape::UI::Tools::MeasureTool::setLine(), Inkscape::ObjectSet::setMask(), Inkscape::UI::Tools::MeasureTool::setMeasureItem(), Inkscape::UI::Tools::MeasureTool::setPoint(), Inkscape::UI::Widget::RegisteredTransformedPoint::setValue(), Inkscape::BooleanBuilder::shape_commit(), Inkscape::Text::Layout::showGlyphs(), Inkscape::UI::Tools::MeasureTool::showInfoBox(), SPItem::skew_rel(), Inkscape::UI::Widget::CairoGraphics::snapshot_combine(), Inkscape::UI::Widget::Stores::snapshot_combine(), Inkscape::Extension::Internal::sp_asbitmap_render(), Inkscape::UI::Tools::sp_flood_do_flood_fill(), sp_gradient_convert_to_userspace(), sp_gradient_pattern_common_setup(), sp_import_document(), sp_item_gradient_set_coords(), sp_offset_move_compensate(), sp_selection_paste_impl(), Inkscape::UI::Tools::sp_spray_transform_path(), sp_te_get_position_by_coords(), sp_usepath_move_compensate(), Inkscape::UI::Tools::spdc_create_single_dot(), Inkscape::UI::Tools::spdc_flush_white(), Inkscape::LivePathEffect::LPESlice::splititem(), Inkscape::SelTrans::stamp(), Inkscape::UI::Widget::Stores::take_snapshot(), Geom::TEST(), Inkscape::ObjectSet::tile(), Inkscape::UI::Tools::MeasureTool::toGuides(), Inkscape::LivePathEffect::LPEBendPath::transform_multiply(), Inkscape::LivePathEffect::LPEBool::transform_multiply(), Inkscape::LivePathEffect::LPEOffset::transform_multiply(), Inkscape::LivePathEffect::LPEFillBetweenMany::transform_multiply_nested(), Inkscape::LivePathEffect::LPEFillBetweenStrokes::transform_multiply_nested(), Inkscape::UI::Tools::tweak_colors_in_gradient(), Inkscape::DrawingItem::update(), Inkscape::LivePathEffect::LPEFilletChamfer::updateAmount(), and wrap_transforms().
Check whether this matrix represents pure horizontal shearing.
eps | Numerical tolerance |
Definition at line 256 of file affine.cpp.
References _c, and are_near().
Referenced by sp_svg_transform_write(), and Geom::TEST().
Check whether this matrix is an identity matrix.
eps | Numerical tolerance |
Definition at line 109 of file affine.cpp.
References _c, and are_near().
Referenced by Inkscape::ObjectSet::applyAffine(), Inkscape::UI::Tools::do_trace(), SPItem::doWriteTransform(), SPMeshNodeArray::fill_box(), Inkscape::Extension::Internal::formatTransform(), Inkscape::Filters::FilterSlot::get_result(), SPFlowtext::getAsText(), SPItem::invoke_print(), Inkscape::DrawingCache::prepare(), refresh_offset_source(), SPGroup::scaleChildItemsRec(), Inkscape::DrawingGroup::setChildTransform(), Inkscape::DrawingPattern::setPatternToUserTransform(), Inkscape::DrawingItem::setTransform(), sp_item_group_ungroup(), sp_svg_transform_write(), Geom::TEST(), Inkscape::LivePathEffect::LPEFillBetweenMany::transform_multiply_nested(), Inkscape::LivePathEffect::LPEFillBetweenStrokes::transform_multiply_nested(), and write_transform().
Check whether this matrix represents pure, nonzero horizontal shearing.
eps | Numerical tolerance |
Definition at line 268 of file affine.cpp.
References _c, and are_near().
Referenced by Geom::TEST().
Check whether this matrix represents a non-zero rotation about any point.
eps | Numerical tolerance |
Definition at line 233 of file affine.cpp.
References _c, and are_near().
Referenced by Geom::TEST().
Check whether this matrix represents a pure, nonzero rotation.
eps | Numerical tolerance |
Definition at line 219 of file affine.cpp.
References _c, and are_near().
Referenced by Geom::TEST().
Check whether this matrix represents pure, nonzero scaling.
eps | Numerical tolerance |
Definition at line 160 of file affine.cpp.
References _c, are_near(), and isSingular().
Referenced by Geom::TEST().
Check whether this matrix represents a pure nonzero translation.
eps | Numerical tolerance |
Definition at line 134 of file affine.cpp.
References _c, and are_near().
Referenced by Geom::TEST().
Check whether this matrix represents pure, nonzero uniform scaling.
eps | Numerical tolerance |
Definition at line 189 of file affine.cpp.
References _c, are_near(), and isSingular().
Referenced by SPFlowtext::set_transform(), and Geom::TEST().
Check whether this matrix represents pure, nonzero vertical shearing.
eps | Numerical tolerance |
Definition at line 294 of file affine.cpp.
References _c, and are_near().
Referenced by Geom::TEST().
Check whether this matrix represents a pure rotation.
eps | Numerical tolerance |
Definition at line 206 of file affine.cpp.
References _c, and are_near().
Referenced by sp_svg_transform_write(), Geom::TEST(), and wrap_transforms().
Check whether this matrix represents pure scaling.
eps | Numerical tolerance |
Definition at line 147 of file affine.cpp.
References _c, are_near(), and isSingular().
Referenced by Geom::Ellipse::operator*=(), sp_svg_transform_write(), Geom::TEST(), and wrap_transforms().
Check whether this matrix is singular.
Singular matrices have no inverse, which means that applying them to a set of points results in a loss of information.
eps | Numerical tolerance |
Definition at line 377 of file affine.cpp.
References are_near(), and det().
Referenced by Inkscape::UI::ControlPointSelection::_pointDragged(), Inkscape::UI::Dialog::Transformation::applyPageTransform(), Geom::Parallelogram::contains(), Geom::Parallelogram::contains(), Inkscape::UI::TransformHandle::dragged(), Geom::Parallelogram::intersects(), isNonzeroScale(), isNonzeroUniformScale(), isScale(), isUniformScale(), isZoom(), preservesAngles(), Inkscape::DrawingItem::render(), Inkscape::UI::Widget::RegisteredTransformedPoint::setTransform(), and Geom::TEST().
Check whether this matrix represents a pure translation.
Will return true for the identity matrix, which represents a zero translation.
eps | Numerical tolerance |
Definition at line 123 of file affine.cpp.
References _c, and are_near().
Referenced by Inkscape::Filters::FilterSlot::_get_transformed_source_graphic(), Inkscape::ObjectSet::applyAffine(), SPItem::doWriteTransform(), Inkscape::Filters::FilterSlot::FilterSlot(), SPUse::move_compensate(), SPPage::movePage(), Inkscape::DrawingCache::prepare(), sp_offset_move_compensate(), sp_svg_transform_write(), Geom::TEST(), Inkscape::ObjectSet::toSymbol(), Inkscape::LivePathEffect::LPEOffset::transform_multiply(), and wrap_transforms().
Check whether this matrix represents pure uniform scaling.
eps | Numerical tolerance |
Definition at line 174 of file affine.cpp.
References _c, are_near(), and isSingular().
Referenced by SPLPEItem::optimizeTransforms(), SPSpiral::set_transform(), SPStar::set_transform(), Geom::TEST(), and wrap_transforms().
Check whether this matrix represents pure vertical shearing.
eps | Numerical tolerance |
Definition at line 281 of file affine.cpp.
References _c, and are_near().
Referenced by sp_svg_transform_write(), and Geom::TEST().
Check whether this matrix represents zooming.
Zooming is any combination of translation and uniform non-flipping scaling. It preserves angles, ratios of distances between arbitrary points and unit vectors of line segments.
eps | Numerical tolerance |
Definition at line 310 of file affine.cpp.
References _c, are_near(), and isSingular().
Referenced by Geom::TEST().
Combine this transformation with another one.
After this operation, the matrix will correspond to the transformation obtained by first applying the original version of this matrix, and then applying m.
Definition at line 442 of file affine.cpp.
References _c.
Combine this transformation with horizontal shearing (skew).
Definition at line 119 of file transforms.cpp.
References _c, and Geom::ShearBase< S >::f.
Combine this transformation a rotation.
Definition at line 111 of file transforms.cpp.
References Affine().
Combine this transformation with scaling.
Definition at line 103 of file transforms.cpp.
Combine this transformation with a translation.
Definition at line 96 of file transforms.cpp.
Combine this transformation with vertical shearing (skew).
Definition at line 127 of file transforms.cpp.
References _c.
Definition at line 134 of file transforms.cpp.
References _c, Geom::Zoom::_scale, Geom::Zoom::_trans, Geom::X, and Geom::Y.
|
inline |
|
inline |
|
inline |
Check whether the transformation preserves angles between lines.
This means that the transformation can be any combination of translation, uniform scaling, rotation and flipping.
eps | Numerical tolerance |
Definition at line 339 of file affine.cpp.
References _c, are_near(), and isSingular().
Referenced by Inkscape::LivePathEffect::LPEMeasureSegments::doBeforeEffect(), and Geom::TEST().
Check whether the transformation preserves areas of polygons.
This means that the transformation can be any combination of translation, rotation, shearing and squeezing (non-uniform scaling such that the absolute value of the product of Y-scale and X-scale is 1).
eps | Numerical tolerance |
Definition at line 321 of file affine.cpp.
References are_near(), and descrim2().
Referenced by Geom::TEST().
Check whether the transformation preserves distances between points.
This means that the transformation can be any combination of translation, rotation and flipping.
eps | Numerical tolerance |
Definition at line 359 of file affine.cpp.
References _c, and are_near().
Referenced by Geom::TEST().
Point Geom::Affine::rotationCenter | ( | ) | const |
For a (possibly non-pure) non-zero-rotation matrix, calculate the rotation center.
Definition at line 243 of file affine.cpp.
References _c.
Referenced by Geom::TEST().
void Geom::Affine::setExpansionX | ( | Coord | val | ) |
Definition at line 75 of file affine.cpp.
References _c, and expansionX().
Referenced by Inkscape::UI::Tools::spdc_check_for_and_apply_waiting_LPE().
void Geom::Affine::setExpansionY | ( | Coord | val | ) |
Definition at line 85 of file affine.cpp.
References _c, and expansionY().
Referenced by Inkscape::UI::Tools::spdc_check_for_and_apply_waiting_LPE().
void Geom::Affine::setIdentity | ( | ) |
Sets this matrix to be the Identity Affine.
Definition at line 96 of file affine.cpp.
References _c.
Referenced by Inkscape::UI::ControlPointSelection::_pointDragged(), Inkscape::UI::ControlPointSelection::_pointGrabbed(), Inkscape::UI::Dialog::PolarArrangeTab::arrange(), SPMeshNodeArray::fill_box(), Inkscape::UI::TransformHandle::grabbed(), inverse(), Inkscape::DrawingCache::prepare(), Inkscape::SelTrans::SelTrans(), Inkscape::Text::Layout::showGlyphs(), sp_offset_move_compensate(), SPPattern::update_view(), and wrap_transforms().
void Geom::Affine::setTranslation | ( | Point const & | loc | ) |
Sets the translation imparted by the Affine.
Definition at line 56 of file affine.cpp.
References _c.
Referenced by Inkscape::Extension::Internal::SvgBuilder::_flushText(), Inkscape::LivePathEffect::LPECurveStitch::doEffect_path(), Inkscape::UI::Widget::PatternEditor::get_selected_transform(), Inkscape::UI::Tools::spdc_check_for_and_apply_waiting_LPE(), Geom::Ellipse::unitCircleTransform(), Inkscape::DrawingItem::update(), withoutTranslation(), and wrap_transforms().
void Geom::Affine::setXAxis | ( | Point const & | vec | ) |
Definition at line 45 of file affine.cpp.
References _c.
Referenced by Inkscape::LivePathEffect::LPECurveStitch::doEffect_path(), and wrap_transforms().
void Geom::Affine::setYAxis | ( | Point const & | vec | ) |
Definition at line 50 of file affine.cpp.
References _c.
Referenced by Inkscape::LivePathEffect::LPECurveStitch::doEffect_path(), and wrap_transforms().
Point Geom::Affine::translation | ( | ) | const |
Gets the translation imparted by the Affine.
Definition at line 41 of file affine.cpp.
References _c.
Referenced by SPMarker::get_marker_transform(), Inkscape::DrawingCache::prepare(), Inkscape::Text::Layout::show(), and wrap_transforms().
|
inline |
Definition at line 169 of file affine.h.
References setTranslation().
Referenced by Inkscape::CanvasItemGuideLine::_render(), Inkscape::DrawingText::_renderItem(), Inkscape::CanvasItemGridXY::_update(), Inkscape::CanvasItemGridTiles::_update(), Inkscape::DrawingRadialGradient::create_pattern(), Inkscape::LivePathEffect::LPETiling::doAfterEffect(), Inkscape::LivePathEffect::LPECurveStitch::doEffect_path(), Inkscape::UI::Tools::MarkerTool::get_marker_transform(), Inkscape::GridSnapper::get_snap_lines(), Inkscape::Extension::Internal::PrintWmf::image(), PatternKnotHolderEntityScale::knot_grabbed(), Geom::Ellipse::operator*=(), Inkscape::LivePathEffect::VectorParam::param_transform_multiply(), Inkscape::ObjectSet::relink(), SPFlowtext::set_transform(), SPSpiral::set_transform(), SPStar::set_transform(), SPUse::snappoints(), Inkscape::Extension::Internal::LaTeXTextRenderer::sp_flowtext_render(), Inkscape::UI::Tools::sp_spray_recursive(), sp_svg_transform_write(), Inkscape::Extension::Internal::LaTeXTextRenderer::sp_text_render(), Inkscape::UI::Tools::sp_tweak_dilate_recursive(), Geom::TEST(), Geom::Ellipse::unitTangentAt(), and vectorStretch().
Point Geom::Affine::xAxis | ( | ) | const |
Definition at line 32 of file affine.cpp.
References _c.
Referenced by Geom::Parallelogram::isSheared(), Inkscape::Extension::Internal::LaTeXTextRenderer::sp_flowtext_render(), Inkscape::Extension::Internal::LaTeXTextRenderer::sp_text_render(), Inkscape::UI::Widget::PatternEditor::update_widgets_from_pattern(), and wrap_transforms().
Point Geom::Affine::yAxis | ( | ) | const |
Definition at line 36 of file affine.cpp.
References _c.
Referenced by Geom::Parallelogram::isSheared(), Inkscape::UI::Widget::PatternEditor::update_widgets_from_pattern(), and wrap_transforms().
Nearness predicate for affine transforms.
Definition at line 504 of file affine.cpp.
References Geom::are_near().
Referenced by isHShear(), isIdentity(), isNonzeroHShear(), isNonzeroNonpureRotation(), isNonzeroRotation(), isNonzeroScale(), isNonzeroTranslation(), isNonzeroUniformScale(), isNonzeroVShear(), isRotation(), isScale(), isSingular(), isTranslation(), isUniformScale(), isVShear(), isZoom(), preservesAngles(), preservesArea(), and preservesDistances().
Given a matrix m such that unit_circle = m*x, this returns the quadratic form x*A*x = 1.
Definition at line 461 of file affine.cpp.
|
related |
|
related |
|
private |
Definition at line 71 of file affine.h.
Referenced by Affine(), Affine(), det(), expansionX(), expansionY(), inverse(), isHShear(), isIdentity(), isNonzeroHShear(), isNonzeroNonpureRotation(), isNonzeroRotation(), isNonzeroScale(), isNonzeroTranslation(), isNonzeroUniformScale(), isNonzeroVShear(), isRotation(), isScale(), isTranslation(), isUniformScale(), isVShear(), isZoom(), operator*=(), operator*=(), operator*=(), operator*=(), operator*=(), operator*=(), operator==(), operator[](), operator[](), preservesAngles(), preservesDistances(), rotationCenter(), setExpansionX(), setExpansionY(), setIdentity(), setTranslation(), setXAxis(), setYAxis(), translation(), xAxis(), and yAxis().