Inkscape
Vector Graphics Editor
|
#include <viewbox.h>
Public Member Functions | |
SPViewBox () | |
void | set_viewBox (const gchar *value) |
void | set_preserveAspectRatio (const gchar *value) |
void | write_viewBox (Inkscape::XML::Node *repr) const |
Write viewBox attribute to XML, if set. | |
void | write_preserveAspectRatio (Inkscape::XML::Node *repr) const |
Write preserveAspectRatio attribute to XML, if set. | |
void | apply_viewbox (const Geom::Rect &in, double scale_none=1.0) |
SPItemCtx | get_rctx (const SPItemCtx *ictx, double scale_none=1.0) |
Geom::OptRect | get_paintbox (double width, double height, Geom::OptRect const &size) const |
Public Attributes | |
bool | viewBox_set |
Geom::Rect | viewBox |
bool | aspect_set |
unsigned int | aspect_align |
unsigned int | aspect_clip |
Geom::Affine | c2p |
SPViewBox::SPViewBox | ( | ) |
Definition at line 40 of file viewbox.cpp.
void SPViewBox::apply_viewbox | ( | const Geom::Rect & | in, |
double | scale_none = 1.0 |
||
) |
Definition at line 182 of file viewbox.cpp.
References Geom::are_near(), aspect_align, aspect_clip, c2p, Geom::EPSILON, Geom::GenericRect< C >::height(), height, Geom::GenericRect< C >::left(), MAX, MIN, SP_ASPECT_MEET, SP_ASPECT_NONE, SP_ASPECT_XMAX_YMAX, SP_ASPECT_XMAX_YMID, SP_ASPECT_XMAX_YMIN, SP_ASPECT_XMID_YMAX, SP_ASPECT_XMID_YMID, SP_ASPECT_XMID_YMIN, SP_ASPECT_XMIN_YMAX, SP_ASPECT_XMIN_YMID, SP_ASPECT_XMIN_YMIN, Geom::GenericRect< C >::top(), viewBox, Geom::GenericRect< C >::width(), and width.
Referenced by get_rctx(), and SPPattern::update_view().
Geom::OptRect SPViewBox::get_paintbox | ( | double | width, |
double | height, | ||
Geom::OptRect const & | size | ||
) | const |
Definition at line 327 of file viewbox.cpp.
References aspect_align, aspect_clip, Geom::GenericRect< Coord >::from_xywh(), height, scale, size, SP_ASPECT_MEET, SP_ASPECT_NONE, SP_ASPECT_XMAX_YMAX, SP_ASPECT_XMAX_YMID, SP_ASPECT_XMAX_YMIN, SP_ASPECT_XMID_YMAX, SP_ASPECT_XMID_YMID, SP_ASPECT_XMID_YMIN, SP_ASPECT_XMIN_YMAX, SP_ASPECT_XMIN_YMID, and width.
Definition at line 260 of file viewbox.cpp.
References apply_viewbox(), c2p, SPItemCtx::i2doc, SPItemCtx::i2vp, Geom::identity(), Geom::GenericRect< C >::min(), viewBox, viewBox_set, and SPItemCtx::viewport.
Referenced by SPMarker::update(), SPImage::update(), SPRoot::update(), and SPSymbol::update().
void SPViewBox::set_preserveAspectRatio | ( | const gchar * | value | ) |
Definition at line 98 of file viewbox.cpp.
References aspect_align, aspect_clip, aspect_set, c, clip(), len, SP_ASPECT_MEET, SP_ASPECT_NONE, SP_ASPECT_SLICE, SP_ASPECT_XMAX_YMAX, SP_ASPECT_XMAX_YMID, SP_ASPECT_XMAX_YMIN, SP_ASPECT_XMID_YMAX, SP_ASPECT_XMID_YMID, SP_ASPECT_XMID_YMIN, SP_ASPECT_XMIN_YMAX, SP_ASPECT_XMIN_YMID, and SP_ASPECT_XMIN_YMIN.
Referenced by SPImage::set(), SPPattern::set(), SPRoot::set(), SPSymbol::set(), and SPMarker::set().
void SPViewBox::set_viewBox | ( | const gchar * | value | ) |
Definition at line 50 of file viewbox.cpp.
References Geom::GenericRect< Coord >::from_xywh(), height, viewBox, viewBox_set, and width.
Referenced by SPPattern::set(), SPRoot::set(), SPSymbol::set(), and SPMarker::set().
void SPViewBox::write_preserveAspectRatio | ( | Inkscape::XML::Node * | repr | ) | const |
Write preserveAspectRatio attribute to XML, if set.
Definition at line 305 of file viewbox.cpp.
References aspect_align, aspect_clip, aspect_set, Inkscape::XML::Node::setAttribute(), and SP_ASPECT_SLICE.
Referenced by SPMarker::write(), SPImage::write(), SPRoot::write(), and SPSymbol::write().
void SPViewBox::write_viewBox | ( | Inkscape::XML::Node * | repr | ) | const |
Write viewBox attribute to XML, if set.
Definition at line 289 of file viewbox.cpp.
References Geom::GenericRect< C >::height(), Geom::GenericRect< C >::left(), Inkscape::XML::Node::setAttribute(), Inkscape::SVGOStringStream::str(), Geom::GenericRect< C >::top(), viewBox, viewBox_set, and Geom::GenericRect< C >::width().
Referenced by SPMarker::write(), SPRoot::write(), and SPSymbol::write().
unsigned int SPViewBox::aspect_align |
Definition at line 39 of file viewbox.h.
Referenced by apply_viewbox(), get_paintbox(), set_preserveAspectRatio(), Inkscape::Extension::Internal::sp_symbol_render(), sp_validate_marker(), and write_preserveAspectRatio().
unsigned int SPViewBox::aspect_clip |
Definition at line 40 of file viewbox.h.
Referenced by apply_viewbox(), get_paintbox(), set_preserveAspectRatio(), Inkscape::Extension::Internal::sp_symbol_render(), and write_preserveAspectRatio().
bool SPViewBox::aspect_set |
Definition at line 38 of file viewbox.h.
Referenced by set_preserveAspectRatio(), sp_validate_marker(), and write_preserveAspectRatio().
Geom::Affine SPViewBox::c2p |
Definition at line 43 of file viewbox.h.
Referenced by Inkscape::UI::Dialog::CloneTiler::apply(), apply_viewbox(), SPSymbol::bbox(), get_rctx(), Inkscape::Extension::Internal::PdfBuilder::Document::get_tiling_pattern(), Inkscape::Extension::Internal::getODFItemTransform(), SPRoot::print(), SPSymbol::print(), Inkscape::Extension::Internal::PdfOutput::save(), SPRoot::show(), SPSymbol::show(), sp_marker_show_instance(), Inkscape::Extension::Internal::sp_symbol_render(), SPMarker::update(), SPImage::update(), SPRoot::update(), SPSymbol::update(), and SPPattern::update_view().
Geom::Rect SPViewBox::viewBox |
Definition at line 35 of file viewbox.h.
Referenced by apply_viewbox(), Persp3D::create_xml_element(), Inkscape::UI::Dialog::get_document_scale_helper(), get_rctx(), SPItem::getCenter(), SPDocument::getDocumentScale(), SPDocument::getHeight(), SPDocument::getViewBox(), SPDocument::getWidth(), SPGuide::moveto(), set_viewBox(), SPItem::setCenter(), SPDocument::setDocumentScale(), SPDocument::setHeight(), SPRoot::setRootDimensions(), SPDocument::setupViewport(), SPDocument::setViewBox(), SPDocument::setWidth(), SPDocument::setWidthAndHeight(), Inkscape::Extension::Internal::sp_symbol_render(), sp_validate_marker(), SPImage::update(), SPSymbol::update(), SPPattern::update_view(), Inkscape::UI::Dialog::DocumentProperties::update_viewbox(), and write_viewBox().
bool SPViewBox::viewBox_set |
Definition at line 34 of file viewbox.h.
Referenced by Inkscape::Extension::Internal::CairoRenderContext::_createPatternPainter(), Persp3D::create_xml_element(), get_rctx(), SPDocument::getDocumentScale(), SPDocument::getHeight(), SPDocument::getViewBox(), SPDocument::getWidth(), set_viewBox(), SPDocument::setDocumentScale(), SPDocument::setHeight(), SPRoot::setRootDimensions(), SPDocument::setupViewport(), SPDocument::setViewBox(), Inkscape::Extension::Internal::Metafile::setViewBoxIfMissing(), SPDocument::setWidth(), SPDocument::setWidthAndHeight(), sp_validate_marker(), SPImage::update(), and write_viewBox().