Inkscape
Vector Graphics Editor
|
#include <units.h>
Public Member Functions | |
Quantity (double q, Unit const *u) | |
Initialize a quantity. | |
Quantity (double q, Glib::ustring const &u) | |
Quantity (double q, char const *u) | |
bool | compatibleWith (Unit const *u) const |
Checks if a quantity is compatible with the specified unit. | |
bool | compatibleWith (Glib::ustring const &u) const |
bool | compatibleWith (char const *u) const |
double | value (Unit const *u) const |
Return the quantity's value in the specified unit. | |
double | value (Glib::ustring const &u) const |
double | value (char const *u) const |
Glib::ustring | string (Unit const *u) const |
Return a printable string of the value in the specified unit. | |
Glib::ustring | string (Glib::ustring const &u) const |
Glib::ustring | string () const |
bool | operator< (Quantity const &rhs) const |
Comparison operators. | |
bool | operator== (Quantity const &other) const |
Static Public Member Functions | |
static double | convert (double from_dist, Unit const *from, Unit const *to) |
Convert distances. | |
static double | convert (double from_dist, Glib::ustring const &from, Unit const *to) |
static double | convert (double from_dist, Unit const *from, Glib::ustring const &to) |
static double | convert (double from_dist, Glib::ustring const &from, Glib::ustring const &to) |
static double | convert (double from_dist, char const *from, char const *to) |
Public Attributes | |
Unit const * | unit |
double | quantity |
Inkscape::Util::Quantity::Quantity | ( | double | q, |
Unit const * | u | ||
) |
Inkscape::Util::Quantity::Quantity | ( | double | q, |
Glib::ustring const & | u | ||
) |
Inkscape::Util::Quantity::Quantity | ( | double | q, |
char const * | u | ||
) |
bool Inkscape::Util::Quantity::compatibleWith | ( | char const * | u | ) | const |
Definition at line 497 of file units.cpp.
References compatibleWith(), and Inkscape::Util::UnitTable::get().
bool Inkscape::Util::Quantity::compatibleWith | ( | Glib::ustring const & | u | ) | const |
Definition at line 493 of file units.cpp.
References compatibleWith().
bool Inkscape::Util::Quantity::compatibleWith | ( | Unit const * | u | ) | const |
Checks if a quantity is compatible with the specified unit.
Definition at line 489 of file units.cpp.
References Inkscape::Util::Unit::compatibleWith(), and unit.
Referenced by compatibleWith(), and compatibleWith().
|
static |
Definition at line 541 of file units.cpp.
References convert(), and Inkscape::Util::UnitTable::get().
|
static |
Definition at line 537 of file units.cpp.
References convert(), Inkscape::Util::UnitTable::get(), and Inkscape::Util::UnitTable::getUnit().
|
static |
Definition at line 529 of file units.cpp.
References convert(), and Inkscape::Util::UnitTable::get().
|
static |
Definition at line 533 of file units.cpp.
References convert(), and Inkscape::Util::UnitTable::get().
|
static |
Convert distances.
no NULL check is performed on the passed pointers to Unit objects!
Definition at line 525 of file units.cpp.
References Inkscape::Util::Unit::convert().
Referenced by Inkscape::UI::Dialog::KnotPropertiesDialog::_apply(), Inkscape::Extension::Internal::SvgBuilder::_createPattern(), Inkscape::Extension::Internal::CairoRenderContext::_finishSurfaceSetup(), Inkscape::UI::Widget::UnitTracker::_fixupAdjustments(), Inkscape::UI::Toolbar::StarToolbar::_selectionModified(), Inkscape::UI::Dialog::KnotPropertiesDialog::_setKnotPoint(), Inkscape::UI::Toolbar::PageToolbar::_unit_to_size(), Inkscape::Extension::Internal::PrintEmf::begin(), Inkscape::Extension::Internal::PrintWmf::begin(), Inkscape::UI::Widget::calcScaleLineWidth(), Inkscape::UI::Dialog::details::AttributesPanel::change_value_px(), Inkscape::UI::Dialog::CloneTiler::CloneTiler(), convert(), convert(), convert(), convert(), PathVectorNodeSatellites::convertUnit(), Inkscape::UI::Tools::LpeTool::create_measuring_items(), Inkscape::ObjectSet::createBitmapCopy(), Inkscape::LivePathEffect::LPEMeasureSegments::createLine(), Inkscape::LivePathEffect::LPEMeasureSegments::createTextLabel(), InkFileExportCmd::do_export_png_now(), Inkscape::LivePathEffect::LPETiling::doBeforeEffect(), Inkscape::LivePathEffect::LPEFilletChamfer::doBeforeEffect(), Inkscape::LivePathEffect::LPEMeasureSegments::doBeforeEffect(), Inkscape::LivePathEffect::LPEOffset::doBeforeEffect(), Inkscape::LivePathEffect::LPEOffset::doEffect_path(), Inkscape::LivePathEffect::LPEPathLength::doEffect_pwd2(), Inkscape::LivePathEffect::LPERuler::doEffect_pwd2(), Inkscape::LivePathEffect::LPEFilletChamfer::doOnApply(), Inkscape::UI::Dialog::Print::draw_page(), Inkscape::UI::Dialog::CloneTiler::fill_height_changed(), Inkscape::UI::Dialog::CloneTiler::fill_width_changed(), SPILength::get_value(), Inkscape::Preferences::Entry::getDouble(), Inkscape::UI::Dialog::InkscapePreferences::initPageBitmaps(), Inkscape::UI::Toolbar::StarToolbar::length_value_changed(), Inkscape::Display::SnapIndicator::make_alignment_indicator(), Inkscape::Display::SnapIndicator::make_distribution_indicators(), Inkscape::Extension::Internal::Emf::myEnhMetaFileProc(), Inkscape::Extension::Internal::Wmf::myMetaFileProc(), Inkscape::UI::Toolbar::StarToolbar::notifyAttributeChanged(), Inkscape::UI::Widget::SelectedStyle::on_popup_preset(), Inkscape::Extension::Internal::GdkpixbufInput::open(), SPILength::read(), Inkscape::Extension::Internal::ImageResolution::readmagick(), Inkscape::UI::Widget::RenderingOptions::RenderingOptions(), Inkscape::Extension::Internal::CairoRenderer::renderPage(), Inkscape::Util::ExpressionEvaluator::resolveUnit(), Inkscape::LivePathEffect::LPERuler::ruler_mark(), SVGLength::set(), SPDocument::setHeight(), Inkscape::UI::Dialog::TextEdit::setPreviewText(), Inkscape::UI::Widget::StyleSwatch::setStyle(), Inkscape::UI::Dialog::Print::setup_page(), Inkscape::Extension::Internal::CairoRenderer::setupDocument(), Inkscape::Extension::Internal::LaTeXTextRenderer::setupDocument(), SPDocument::setupViewport(), Inkscape::Extension::Internal::Metafile::setViewBoxIfMissing(), SPDocument::setWidth(), SPDocument::setWidthAndHeight(), Inkscape::UI::Tools::MeasureTool::showCanvasItems(), Inkscape::Extension::Internal::sp_asbitmap_render(), sp_generate_internal_bitmap(), Inkscape::LivePathEffect::LPEOffset::sp_get_offset(), sp_style_css_size_px_to_units(), sp_svg_angle_read_lff(), sp_svg_length_read_lff(), sp_te_adjust_line_height(), Inkscape::UI::Tools::MeasureTool::toMarkDimension(), SVGLength::toValue(), Inkscape::UI::Dialog::CloneTiler::unit_changed(), Inkscape::UI::Widget::StrokeStyle::unitChangedCB(), Inkscape::UI::Widget::SelectedStyle::update(), SPRoot::update(), Inkscape::UI::Tools::LpeTool::update_measuring_items(), Inkscape::LivePathEffect::LPEFilletChamfer::updateAmount(), Inkscape::UI::Widget::StrokeStyle::updateLine(), value(), and Inkscape::UI::Widget::RotateableStrokeWidth::value_adjust().
bool Inkscape::Util::Quantity::operator< | ( | Quantity const & | rhs | ) | const |
bool Inkscape::Util::Quantity::operator== | ( | Quantity const & | other | ) | const |
Glib::ustring Inkscape::Util::Quantity::string | ( | ) | const |
Glib::ustring Inkscape::Util::Quantity::string | ( | Glib::ustring const & | u | ) | const |
Definition at line 518 of file units.cpp.
References Inkscape::Util::UnitTable::get(), and string().
Glib::ustring Inkscape::Util::Quantity::string | ( | Unit const * | u | ) | const |
Return a printable string of the value in the specified unit.
Definition at line 515 of file units.cpp.
References Inkscape::Util::Unit::abbr, Inkscape::ustring::format_classic(), and value().
Referenced by Inkscape::UI::Handle::_getDragTip(), Inkscape::UI::Node::_getDragTip(), Inkscape::UI::Tools::PenTool::_setAngleDistanceStatusMessage(), Inkscape::SelTrans::centerRequest(), SPText::description(), SPGuide::description(), Inkscape::UI::Tools::SpiralTool::drag(), Inkscape::UI::Tools::ArcTool::drag(), Inkscape::UI::Tools::RectTool::drag(), Inkscape::UI::Tools::StarTool::drag(), and Inkscape::SelTrans::moveTo().
double Inkscape::Util::Quantity::value | ( | char const * | u | ) | const |
Definition at line 510 of file units.cpp.
References Inkscape::Util::UnitTable::get(), and value().
double Inkscape::Util::Quantity::value | ( | Glib::ustring const & | u | ) | const |
double Inkscape::Util::Quantity::value | ( | Unit const * | u | ) | const |
Return the quantity's value in the specified unit.
Definition at line 502 of file units.cpp.
References convert(), quantity, and unit.
Referenced by Inkscape::UI::Widget::CanvasGrid::_createGuide(), Inkscape::Util::are_near(), Inkscape::Extension::Internal::PrintLatex::begin(), Inkscape::Pixbuf::create_from_buffer(), Inkscape::Pixbuf::create_from_data_uri(), Persp3D::create_xml_element(), SPGuide::createSPGuide(), Inkscape::UI::View::SVGViewWidget::doRescale(), Inkscape::svg_renderer::get_height_px(), Inkscape::Extension::Internal::TemplateBase::get_template_size(), Inkscape::svg_renderer::get_width_px(), SPItem::getCenter(), legacy_transform_backward(), legacy_transform_forward(), Inkscape::UI::Tools::lpetool_get_limiting_bbox_corners(), SPGuide::moveto(), operator<(), Inkscape::UI::Dialog::Print::Print(), SPGuide::set(), Inkscape::UI::Dialog::set_document_dimensions(), SPItem::setCenter(), Inkscape::UI::Tools::MeasureTool::setGuide(), Inkscape::Extension::Internal::Metafile::setViewBoxIfMissing(), InkviewWindow::show_document(), sp_file_convert_dpi(), string(), value(), and value().
double Inkscape::Util::Quantity::quantity |
Definition at line 96 of file units.h.
Referenced by Inkscape::Util::are_near(), SPText::description(), operator<(), operator==(), and value().
Unit const* Inkscape::Util::Quantity::unit |
Definition at line 95 of file units.h.
Referenced by Inkscape::Util::are_near(), compatibleWith(), Inkscape::LivePathEffect::LPERuler::doEffect_pwd2(), Inkscape::LivePathEffect::LPETiling::LPETiling(), operator<(), operator==(), Inkscape::LivePathEffect::LPERuler::ruler_mark(), Inkscape::Extension::Internal::Metafile::setViewBoxIfMissing(), string(), and value().