Inkscape
Vector Graphics Editor
|
#include <measure-tool.h>
Public Member Functions | |
MeasureTool (SPDesktop *desktop) | |
~MeasureTool () override | |
bool | root_handler (CanvasEvent const &event) override |
void | showCanvasItems (bool to_guides=false, bool to_item=false, bool to_phantom=false, Inkscape::XML::Node *measure_repr=nullptr) |
void | reverseKnots () |
void | toGuides () |
void | toPhantom () |
void | toMarkDimension () |
void | toItem () |
void | reset () |
void | setMarkers () |
void | setMarker (bool isStart) |
Geom::Point | readMeasurePoint (bool is_start) const |
void | writeMeasurePoint (Geom::Point point, bool is_start) const |
void | showInfoBox (Geom::Point cursor, bool into_groups) |
void | showItemInfoText (Geom::Point pos, Glib::ustring const &measure_str, double fontsize) |
void | setGuide (Geom::Point origin, double angle, const char *label) |
void | setPoint (Geom::Point origin, Inkscape::XML::Node *measure_repr) |
void | setLine (Geom::Point start_point, Geom::Point end_point, bool markers, guint32 color, Inkscape::XML::Node *measure_repr=nullptr) |
void | setMeasureCanvasText (bool is_angle, double precision, double amount, double fontsize, Glib::ustring unit_name, Geom::Point position, guint32 background, bool to_left, bool to_item, bool to_phantom, Inkscape::XML::Node *measure_repr, Glib::ustring label="") |
void | setMeasureCanvasItem (Geom::Point position, bool to_item, bool to_phantom, Inkscape::XML::Node *measure_repr) |
void | setMeasureCanvasControlLine (Geom::Point start, Geom::Point end, bool to_item, bool to_phantom, Inkscape::CanvasItemColor color, Inkscape::XML::Node *measure_repr) |
void | setLabelText (Glib::ustring const &value, Geom::Point pos, double fontsize, Geom::Coord angle, guint32 background, Inkscape::XML::Node *measure_repr=nullptr) |
void | knotStartMovedHandler (SPKnot *, Geom::Point const &ppointer, guint state) |
void | knotEndMovedHandler (SPKnot *, Geom::Point const &ppointer, guint state) |
void | knotClickHandler (SPKnot *knot, guint state) |
void | knotUngrabbedHandler (SPKnot *, unsigned int) |
void | setMeasureItem (Geom::PathVector pathv, bool is_curve, bool markers, guint32 color, Inkscape::XML::Node *measure_repr) |
Create a measure item in current document. | |
void | createAngleDisplayCurve (Geom::Point const ¢er, Geom::Point const &end, Geom::Point const &anchor, double angle, bool to_phantom, Inkscape::XML::Node *measure_repr=nullptr) |
Given an angle, the arc center and edge point, draw an arc segment centered around that edge point. | |
void | copyToClipboard () |
Copies some measurements to the clipboard. | |
std::vector< Geom::Point > | calcDeltaBasePoint (double dX, double dY) |
Calculates the base point from which to draw the dX and dY lines. | |
bool | equalWithinRange (double value, double reference_value, double epsilon, bool positiveAllowed=true, bool negativeAllowed=true) |
Checks if a value is very close to a reference value and can be considered equal to it. | |
![]() | |
ToolBase (SPDesktop *desktop, std::string &&prefs_path, std::string &&cursor_filename, bool uses_snap=true) | |
virtual | ~ToolBase () |
virtual void | set (Preferences::Entry const &val) |
Called by our pref_observer if a preference has been changed. | |
virtual bool | item_handler (SPItem *item, CanvasEvent const &event) |
Handles item specific events. | |
virtual void | menu_popup (CanvasEvent const &event, SPObject *obj=nullptr) |
Create popup menu and tell Gtk to show it. | |
virtual bool | can_undo (bool redo=false) |
virtual bool | is_ready () const |
virtual void | switching_away (std::string const &new_tool) |
std::string const & | getPrefsPath () const |
void | enableSelectionCue (bool enable=true) |
Enables/disables the ToolBase's SelCue. | |
MessageContext * | defaultMessageContext () const |
SPDesktop * | getDesktop () const |
SPGroup * | currentLayer () const |
void | set_last_active_tool (Glib::ustring last_tool) |
const Glib::ustring & | get_last_active_tool () const |
bool | start_root_handler (CanvasEvent const &event) |
Handles snapping events for all tools and then passes to tool_root_handler. | |
bool | tool_root_handler (CanvasEvent const &event) |
Calls the right tool's event handler, depending on the selected tool and state. | |
bool | start_item_handler (SPItem *item, CanvasEvent const &event) |
Starts handling item snapping and pass to virtual_item_handler afterwards. | |
bool | virtual_item_handler (SPItem *item, CanvasEvent const &event) |
bool | is_panning () const |
True if we're panning with any method (space bar, middle-mouse, right-mouse+Ctrl) | |
bool | is_space_panning () const |
True if we're panning with the space bar. | |
void | snap_delay_handler (gpointer item, gpointer item2, MotionEvent const &event, DelayedSnapEvent::Origin origin) |
Analyses the current event, calculates the mouse speed, turns snapping off (temporarily) if the mouse speed is above a threshold, and stores the current event such that it can be re-triggered when needed (re-triggering is controlled by a timeout). | |
void | process_delayed_snap_event () |
When the delayed snap event timer expires, this method will be called and will re-inject the last motion event in an appropriate place, with snapping being turned on again. | |
void | discard_delayed_snap_event () |
If a delayed snap event has been scheduled, this function will cancel it. | |
void | set_cursor (std::string filename) |
Sets the current cursor to the given filename. | |
void | use_cursor (Glib::RefPtr< Gdk::Cursor > cursor) |
Set the cursor to this specific one, don't remember it. | |
Glib::RefPtr< Gdk::Cursor > | get_cursor (Gtk::Widget &widget, std::string const &filename) const |
Returns the Gdk Cursor for the given filename. | |
void | use_tool_cursor () |
Uses the saved cursor, based on the saved filename. | |
void | enableGrDrag (bool enable=true) |
bool | deleteSelectedDrag (bool just_one) |
Delete a selected GrDrag point. | |
bool | hasGradientDrag () const |
Return true if there is a gradient drag. | |
GrDrag * | get_drag () |
Public Attributes | |
MT::ClipboardMeaClass | clipBMeas |
![]() | |
std::unique_ptr< MessageContext > | message_context |
SelCue * | _selcue = nullptr |
GrDrag * | _grdrag = nullptr |
ShapeEditor * | shape_editor = nullptr |
bool | _uses_snap = false |
Private Attributes | |
std::optional< Geom::Point > | explicit_base |
std::optional< Geom::Point > | last_end |
SPKnot * | knot_start = nullptr |
SPKnot * | knot_end = nullptr |
int | dimension_offset = 20 |
Geom::Point | start_p |
Geom::Point | end_p |
Geom::Point | last_pos |
std::vector< CanvasItemPtr< CanvasItem > > | measure_tmp_items |
std::vector< CanvasItemPtr< CanvasItem > > | measure_phantom_items |
std::vector< CanvasItemPtr< CanvasItem > > | measure_item |
double | item_width |
double | item_height |
double | item_x |
double | item_y |
double | item_length |
SPItem * | over |
sigc::scoped_connection | _knot_start_moved_connection |
sigc::scoped_connection | _knot_start_ungrabbed_connection |
sigc::scoped_connection | _knot_start_click_connection |
sigc::scoped_connection | _knot_end_moved_connection |
sigc::scoped_connection | _knot_end_click_connection |
sigc::scoped_connection | _knot_end_ungrabbed_connection |
Additional Inherited Members | |
![]() | |
void | setup_for_drag_start (ButtonPressEvent const &ev) |
void | saveDragOrigin (Geom::Point const &pos) |
bool | checkDragMoved (Geom::Point const &pos) |
Analyse the current position and return true once it has moved farther than tolerance from the drag origin (indicating they intend to move the object, not click). | |
void | grabCanvasEvents (EventMask mask=EventType::KEY_PRESS|EventType::BUTTON_RELEASE|EventType::MOTION|EventType::BUTTON_PRESS) |
Grab events from the Canvas Catchall. | |
void | ungrabCanvasEvents () |
Ungrab events from the Canvas Catchall. | |
bool | sp_event_context_knot_mouseover () const |
Returns true if we're hovering above a knot (needed because we don't want to pre-snap in that case). | |
void | set_high_motion_precision (bool high_precision=true) |
Enable (or disable) high precision for motion events. | |
![]() | |
Glib::RefPtr< Gdk::Cursor > | _cursor |
std::string | _cursor_filename = "select.svg" |
std::string | _cursor_default = "select.svg" |
Geom::IntPoint | xyp |
where drag started | |
bool | dragging = false |
are we dragging? | |
int | tolerance = 0 |
bool | within_tolerance = false |
are we still within tolerance of origin | |
bool | _button1on = false |
bool | _button2on = false |
bool | _button3on = false |
SPItem * | item_to_select = nullptr |
the item where mouse_press occurred, to be selected if this is a click not drag | |
SPDesktop * | _desktop = nullptr |
Util::ActionAccel | _acc_undo |
Util::ActionAccel | _acc_redo |
Util::ActionAccel | _acc_quick_preview |
Util::ActionAccel | _acc_quick_zoom |
Util::ActionAccel | _acc_quick_pan |
Definition at line 121 of file measure-tool.h.
Inkscape::UI::Tools::MeasureTool::MeasureTool | ( | SPDesktop * | desktop | ) |
Definition at line 322 of file measure-tool.cpp.
References _knot_end_click_connection, _knot_end_moved_connection, _knot_end_ungrabbed_connection, _knot_start_click_connection, _knot_start_moved_connection, _knot_start_ungrabbed_connection, Inkscape::CANVAS_ITEM_CTRL_TYPE_POINT, SPKnot::click_signal, desktop, end_p, knot_end, knot_start, knotClickHandler(), knotEndMovedHandler(), knotStartMovedHandler(), knotUngrabbedHandler(), SPKnot::moved_signal, SPKnot::moveto(), readMeasurePoint(), SPKnot::show(), showCanvasItems(), start_p, SPKnot::ungrabbed_signal, and SPKnot::updateCtrl().
|
override |
Definition at line 351 of file measure-tool.cpp.
References Inkscape::UI::Tools::ToolBase::enableGrDrag(), knot_end, knot_start, Inkscape::UI::Tools::ToolBase::ungrabCanvasEvents(), and SPKnot::unref().
std::vector< Geom::Point > Inkscape::UI::Tools::MeasureTool::calcDeltaBasePoint | ( | double | dX, |
double | dY | ||
) |
Calculates the base point from which to draw the dX and dY lines.
It puts the point on the opposite side from where the angle is drawn The returned array contains the following points:
___point0 is the base point; ___point1 is the dX normal; ___point2 is the dY normal;
___point3 is the dXbase (mid point along the dX line);
___point4 is the dYbase (mid point along the dY line)
Definition at line 1700 of file measure-tool.cpp.
References end_p, result, start_p, Geom::X, and Geom::Y.
Referenced by showCanvasItems().
void Inkscape::UI::Tools::MeasureTool::copyToClipboard | ( | ) |
Copies some measurements to the clipboard.
It deals with Alt + C event
It copies the measurements to the clipboard. The settings for what should be copied are in the MeasureToolSettingsDialog. The path to the settings of the MeasureToolSettingsDialog is saved in the preferences, so if for any reason the path of the MeasureToolSettingsDialog is changed, no change is needed here. Probably all settings can go in /tools/measure/, but the other dialogs have their own path starting with /dialog/, so I have done it the same.
The measurements are unset only when they are not visible, visible measurements are always accurate. Measurements that are not visible have not been (re)calculated, so the stored value may be inaccurate.
Definition at line 1552 of file measure-tool.cpp.
References Inkscape::UI::Tools::ToolBase::_desktop, Inkscape::UI::Tools::MT::ANGLE, clipBMeas, Inkscape::UI::Tools::MT::ClipboardMeaClass::composeMeaStr(), Inkscape::UI::ClipboardManager::copyString(), Inkscape::UI::Tools::MT::DX, Inkscape::UI::Tools::MT::DY, Inkscape::MessageStack::flash(), Inkscape::Preferences::get(), Inkscape::UI::ClipboardManager::get(), Inkscape::Preferences::getBool(), Inkscape::Preferences::getInt(), Inkscape::Preferences::getString(), Inkscape::INFORMATION_MESSAGE, key, Inkscape::UI::Tools::MT::LENGTH, Inkscape::UI::Tools::MT::LENGTH_BETWEEN, Inkscape::UI::Tools::MT::ClipboardMeaClass::lengths, Inkscape::UI::Tools::MT::ClipboardMeaClass::measureIsSet, SPDesktop::messageStack(), Inkscape::UI::Tools::MT::ClipboardMeaClass::segLengths, Inkscape::UI::Tools::MT::SEGMENT, Inkscape::UI::Tools::MT::SHAPE_HEIGHT, Inkscape::UI::Tools::MT::SHAPE_LENGTH, Inkscape::UI::Tools::MT::SHAPE_WIDTH, Inkscape::UI::Tools::MT::SHAPE_X, Inkscape::UI::Tools::MT::SHAPE_Y, and Inkscape::UI::Tools::MT::ClipboardMeaClass::symbols.
Referenced by root_handler().
void Inkscape::UI::Tools::MeasureTool::createAngleDisplayCurve | ( | Geom::Point const & | center, |
Geom::Point const & | end, | ||
Geom::Point const & | anchor, | ||
double | angle, | ||
bool | to_phantom, | ||
Inkscape::XML::Node * | measure_repr = nullptr |
||
) |
Given an angle, the arc center and edge point, draw an arc segment centered around that edge point.
desktop | the desktop that is being used. |
center | the center point for the arc. |
end | the point that ends at the edge of the arc segment. |
anchor | the anchor point for displaying the text label. |
angle | the angle of the arc segment to draw. |
measure_rpr | the container of the curve if converted to items. |
Definition at line 224 of file measure-tool.cpp.
References Inkscape::UI::Tools::ToolBase::_desktop, Geom::Path::appendNew(), Inkscape::CANVAS_ITEM_SECONDARY, Inkscape::LayerManager::currentLayer(), SPDesktop::doc2dt(), Geom::PathVector::empty(), Inkscape::UI::end, SPDesktop::getCanvasTemp(), SPDesktop::layerManager(), measure_phantom_items, measure_tmp_items, Geom::PathVector::push_back(), setMeasureItem(), Geom::Path::start(), Geom::X, and Geom::Y.
Referenced by showCanvasItems().
bool Inkscape::UI::Tools::MeasureTool::equalWithinRange | ( | double | value, |
double | reference_value, | ||
double | epsilon, | ||
bool | positiveAllowed = true , |
||
bool | negativeAllowed = true |
||
) |
Checks if a value is very close to a reference value and can be considered equal to it.
epsilon | the value of the acceptable discrepancy from true equality |
positiveAllowed | if true (default) it checks for reference_value + epsilon range |
negativeAllowed | if true (default) it checks for reference_value - epsilon range |
If value is not allowed to cross a limit, then the range can be limited to either side of the limit by setting the appropriate flag to false
Definition at line 1756 of file measure-tool.cpp.
Referenced by showCanvasItems().
void Inkscape::UI::Tools::MeasureTool::knotClickHandler | ( | SPKnot * | knot, |
guint | state | ||
) |
Definition at line 391 of file measure-tool.cpp.
References Inkscape::UI::Tools::ToolBase::_desktop, explicit_base, Inkscape::UI::Tools::explicit_base_tmp, Inkscape::Preferences::get(), and Inkscape::UI::Dialog::KnotPropertiesDialog::showDialog().
Referenced by MeasureTool().
void Inkscape::UI::Tools::MeasureTool::knotEndMovedHandler | ( | SPKnot * | , |
Geom::Point const & | ppointer, | ||
guint | state | ||
) |
Definition at line 422 of file measure-tool.cpp.
References Inkscape::UI::Tools::ToolBase::_desktop, Inkscape::SnapCandidatePoint::addOrigin(), end_p, SnapManager::freeSnap(), SPDesktop::getNamedView(), Inkscape::SnappedPoint::getPoint(), knot_end, knot_start, SPKnot::moveto(), SPKnot::position(), SnapManager::setup(), showCanvasItems(), SPNamedView::snap_manager, Inkscape::SNAPSOURCE_OTHER_HANDLE, Inkscape::UI::Tools::spdc_endpoint_snap_rotation(), start_p, and SnapManager::unSetup().
Referenced by MeasureTool().
void Inkscape::UI::Tools::MeasureTool::knotStartMovedHandler | ( | SPKnot * | , |
Geom::Point const & | ppointer, | ||
guint | state | ||
) |
Definition at line 401 of file measure-tool.cpp.
References Inkscape::UI::Tools::ToolBase::_desktop, Inkscape::SnapCandidatePoint::addOrigin(), end_p, SnapManager::freeSnap(), SPDesktop::getNamedView(), Inkscape::SnappedPoint::getPoint(), knot_end, knot_start, SPKnot::moveto(), SPKnot::position(), SnapManager::setup(), showCanvasItems(), SPNamedView::snap_manager, Inkscape::SNAPSOURCE_OTHER_HANDLE, Inkscape::UI::Tools::spdc_endpoint_snap_rotation(), start_p, and SnapManager::unSetup().
Referenced by MeasureTool().
void Inkscape::UI::Tools::MeasureTool::knotUngrabbedHandler | ( | SPKnot * | , |
unsigned int | |||
) |
Definition at line 443 of file measure-tool.cpp.
References end_p, knot_end, knot_start, SPKnot::moveto(), showCanvasItems(), and start_p.
Referenced by MeasureTool().
Geom::Point Inkscape::UI::Tools::MeasureTool::readMeasurePoint | ( | bool | is_start | ) | const |
Definition at line 366 of file measure-tool.cpp.
References Inkscape::UI::Tools::endpoint_to_pref(), Inkscape::Preferences::get(), Inkscape::Preferences::getPoint(), and Geom::infinity().
Referenced by MeasureTool().
void Inkscape::UI::Tools::MeasureTool::reset | ( | ) |
Definition at line 949 of file measure-tool.cpp.
References SPKnot::hide(), knot_end, knot_start, and measure_tmp_items.
Referenced by toItem().
void Inkscape::UI::Tools::MeasureTool::reverseKnots | ( | ) |
Definition at line 378 of file measure-tool.cpp.
References Inkscape::UI::end, end_p, knot_end, knot_start, SPKnot::moveto(), SPKnot::show(), showCanvasItems(), Inkscape::UI::start, and start_p.
|
overridevirtual |
Reimplemented from Inkscape::UI::Tools::ToolBase.
Definition at line 476 of file measure-tool.cpp.
References Inkscape::UI::Tools::ToolBase::_desktop, Inkscape::BUTTON_PRESS, Inkscape::BUTTON_RELEASE, Inkscape::UI::Tools::ToolBase::checkDragMoved(), copyToClipboard(), end_p, explicit_base, Inkscape::UI::Tools::explicit_base_tmp, Inkscape::Preferences::get(), SPDesktop::getNamedView(), Inkscape::UI::Tools::gobble_motion_events(), Inkscape::UI::Tools::ToolBase::grabCanvasEvents(), SPKnot::hide(), Inkscape::inspect_event(), Inkscape::KEY_PRESS, Inkscape::KEY_RELEASE, knot_end, knot_start, last_end, last_pos, Geom::LInfty(), measure_item, Inkscape::CanvasEvent::modifiers, Inkscape::MOTION, SPKnot::moveto(), Inkscape::UI::Tools::ToolBase::root_handler(), Inkscape::UI::Tools::ToolBase::saveDragOrigin(), SnapManager::setup(), SPKnot::show(), showCanvasItems(), showInfoBox(), SPNamedView::snap_manager, Inkscape::SNAPSOURCE_OTHER_HANDLE, Inkscape::UI::Tools::spdc_endpoint_snap_rotation(), start_p, Inkscape::UI::Tools::ToolBase::tolerance, Inkscape::UI::Tools::ToolBase::ungrabCanvasEvents(), and SPDesktop::w2d().
void Inkscape::UI::Tools::MeasureTool::setGuide | ( | Geom::Point | origin, |
double | angle, | ||
const char * | label | ||
) |
Definition at line 759 of file measure-tool.cpp.
References Inkscape::UI::Tools::ToolBase::_desktop, SPObject::appendChild(), Inkscape::XML::Document::createElement(), SPDesktop::getDocument(), SPDocument::getHeight(), SPDesktop::getNamedView(), SPDocument::getReprDoc(), SPDocument::getRoot(), Geom::identity(), Geom::Affine::inverse(), SPDesktop::is_yaxisdown(), label, origin, Inkscape::GC::release(), root, Geom::rot90(), Inkscape::XML::Node::setAttribute(), Inkscape::Util::Quantity::value(), Geom::X, and Geom::Y.
Referenced by showCanvasItems(), and toGuides().
void Inkscape::UI::Tools::MeasureTool::setLabelText | ( | Glib::ustring const & | value, |
Geom::Point | pos, | ||
double | fontsize, | ||
Geom::Coord | angle, | ||
guint32 | background, | ||
Inkscape::XML::Node * | measure_repr = nullptr |
||
) |
Definition at line 834 of file measure-tool.cpp.
References Inkscape::UI::Tools::ToolBase::_desktop, Inkscape::XML::Node::addChild(), Inkscape::XML::Document::createElement(), Inkscape::XML::Document::createTextNode(), css, SPDesktop::current_zoom(), Inkscape::LayerManager::currentLayer(), SPDesktop::doc(), SPDesktop::doc2dt(), Inkscape::UI::Tools::fontsize, SPDocument::getReprDoc(), Geom::Translate::inverse(), Geom::Scale::inverse(), SPDesktop::layerManager(), Inkscape::GC::release(), Inkscape::Colors::rgba_to_hex(), scale, Inkscape::XML::Node::setAttribute(), Inkscape::XML::Node::setAttributeSvgDouble(), sp_desktop_apply_style_tool(), sp_repr_css_attr_new(), sp_repr_css_attr_unref(), sp_repr_css_set_property(), sp_repr_css_set_property_double(), sp_repr_css_set_property_string(), and sp_repr_css_write_string().
Referenced by setMeasureCanvasText(), and toMarkDimension().
void Inkscape::UI::Tools::MeasureTool::setLine | ( | Geom::Point | start_point, |
Geom::Point | end_point, | ||
bool | markers, | ||
guint32 | color, | ||
Inkscape::XML::Node * | measure_repr = nullptr |
||
) |
Definition at line 798 of file measure-tool.cpp.
References Inkscape::UI::Tools::ToolBase::_desktop, Geom::Path::appendNew(), Inkscape::LayerManager::currentLayer(), SPDesktop::doc2dt(), Geom::PathVector::empty(), end_p, SPItem::i2doc_affine(), Geom::Affine::inverse(), Geom::Point::isFinite(), SPDesktop::layerManager(), Geom::PathVector::push_back(), setMeasureItem(), Geom::Path::start(), and start_p.
Referenced by setMeasureCanvasControlLine(), toItem(), and toMarkDimension().
void Inkscape::UI::Tools::MeasureTool::setMarker | ( | bool | isStart | ) |
Definition at line 616 of file measure-tool.cpp.
References Inkscape::UI::Tools::ToolBase::_desktop, SPObject::appendChildRepr(), Inkscape::XML::Document::createElement(), css, SPDocument::getDefs(), SPDesktop::getDocument(), SPDocument::getReprDoc(), Inkscape::GC::release(), Inkscape::XML::Node::setAttribute(), sp_repr_css_attr_new(), sp_repr_css_attr_unref(), sp_repr_css_set_property(), and sp_repr_css_write_string().
Referenced by setMarkers().
void Inkscape::UI::Tools::MeasureTool::setMarkers | ( | ) |
Definition at line 603 of file measure-tool.cpp.
References Inkscape::UI::Tools::ToolBase::_desktop, SPDesktop::getDocument(), SPDocument::getObjectById(), and setMarker().
Referenced by toMarkDimension().
void Inkscape::UI::Tools::MeasureTool::setMeasureCanvasControlLine | ( | Geom::Point | start, |
Geom::Point | end, | ||
bool | to_item, | ||
bool | to_phantom, | ||
Inkscape::CanvasItemColor | color, | ||
Inkscape::XML::Node * | measure_repr | ||
) |
Definition at line 1009 of file measure-tool.cpp.
References Inkscape::UI::Tools::ToolBase::_desktop, Inkscape::CANVAS_ITEM_PRIMARY, Inkscape::UI::end, SPDesktop::getCanvasTemp(), measure_phantom_items, measure_tmp_items, setLine(), and Inkscape::UI::start.
Referenced by showCanvasItems().
void Inkscape::UI::Tools::MeasureTool::setMeasureCanvasItem | ( | Geom::Point | position, |
bool | to_item, | ||
bool | to_phantom, | ||
Inkscape::XML::Node * | measure_repr | ||
) |
Definition at line 990 of file measure-tool.cpp.
References Inkscape::UI::Tools::ToolBase::_desktop, Inkscape::CANVAS_ITEM_CTRL_TYPE_MARKER, SPDesktop::getCanvasTemp(), measure_phantom_items, measure_tmp_items, and setPoint().
Referenced by showCanvasItems().
void Inkscape::UI::Tools::MeasureTool::setMeasureCanvasText | ( | bool | is_angle, |
double | precision, | ||
double | amount, | ||
double | fontsize, | ||
Glib::ustring | unit_name, | ||
Geom::Point | position, | ||
guint32 | background, | ||
bool | to_left, | ||
bool | to_item, | ||
bool | to_phantom, | ||
Inkscape::XML::Node * | measure_repr, | ||
Glib::ustring | label = "" |
||
) |
Definition at line 957 of file measure-tool.cpp.
References Inkscape::UI::Tools::ToolBase::_desktop, Inkscape::UI::Tools::fontsize, Inkscape::ustring::format_classic(), SPDesktop::getCanvasTemp(), label, measure_phantom_items, measure_tmp_items, and setLabelText().
Referenced by showCanvasItems().
void Inkscape::UI::Tools::MeasureTool::setMeasureItem | ( | Geom::PathVector | pathv, |
bool | is_curve, | ||
bool | markers, | ||
guint32 | color, | ||
Inkscape::XML::Node * | measure_repr | ||
) |
Create a measure item in current document.
pathv | the path to create. |
markers | if the path results get markers. |
color | of the stroke. |
measure_repr | container element. |
Definition at line 1483 of file measure-tool.cpp.
References Inkscape::UI::Tools::ToolBase::_desktop, Inkscape::Selection::add(), Inkscape::XML::Node::addChild(), Inkscape::ObjectSet::clear(), Inkscape::XML::Document::createElement(), css, SPDesktop::current_zoom(), Inkscape::LayerManager::currentLayer(), Geom::Affine::expansionX(), SPDesktop::getDocument(), SPDocument::getReprDoc(), SPDesktop::getSelection(), SPItem::i2doc_affine(), Geom::Affine::inverse(), item, SPDesktop::layerManager(), Inkscape::GC::release(), Inkscape::Colors::rgba_to_hex(), Inkscape::XML::Node::setAttribute(), sp_repr_css_attr_new(), sp_repr_css_attr_unref(), sp_repr_css_set_property(), sp_repr_css_set_property_string(), sp_repr_css_write_string(), sp_svg_write_path(), and SPObject::updateRepr().
Referenced by createAngleDisplayCurve(), setLine(), and setPoint().
void Inkscape::UI::Tools::MeasureTool::setPoint | ( | Geom::Point | origin, |
Inkscape::XML::Node * | measure_repr | ||
) |
Definition at line 814 of file measure-tool.cpp.
References Inkscape::UI::Tools::ToolBase::_desktop, SPDesktop::current_zoom(), Inkscape::LayerManager::currentLayer(), SPDesktop::doc2dt(), Geom::PathVector::empty(), SPItem::i2doc_affine(), Geom::Affine::inverse(), Geom::Scale::inverse(), SPDesktop::layerManager(), origin, scale, setMeasureItem(), and sp_svg_read_pathv().
Referenced by setMeasureCanvasItem().
void Inkscape::UI::Tools::MeasureTool::showCanvasItems | ( | bool | to_guides = false , |
bool | to_item = false , |
||
bool | to_phantom = false , |
||
Inkscape::XML::Node * | measure_repr = nullptr |
||
) |
Definition at line 1159 of file measure-tool.cpp.
References Inkscape::UI::Tools::ToolBase::_desktop, Inkscape::UI::Tools::MT::ANGLE, Geom::Path::appendNew(), calcDeltaBasePoint(), Inkscape::UI::Tools::calculate_intersections(), Inkscape::CANVAS_ITEM_PRIMARY, Inkscape::CANVAS_ITEM_SECONDARY, clipBMeas, Inkscape::Util::Quantity::convert(), createAngleDisplayCurve(), Inkscape::LayerManager::currentLayer(), SPDesktop::d2w(), dimension_offset, SPDesktop::dkey, SPDesktop::doc2dt(), SPDesktop::dt2doc(), Inkscape::UI::Tools::MT::DX, Inkscape::UI::Tools::MT::DY, Inkscape::UI::end, end_p, equalWithinRange(), explicit_base, Inkscape::UI::Tools::fontsize, Inkscape::Preferences::get(), SPDesktop::getDocument(), SPDocument::getItemsPartiallyInBox(), SPDesktop::getSelection(), Inkscape::Selection::includes(), Geom::Point::isFinite(), item, items, Inkscape::LayerManager::layerForObject(), SPDesktop::layerManager(), Inkscape::UI::Tools::MT::LENGTH, Inkscape::UI::Tools::MT::LENGTH_BETWEEN, Inkscape::UI::Tools::MT::ClipboardMeaClass::lengths, measure_tmp_items, Inkscape::UI::Tools::MT::ClipboardMeaClass::measureIsSet, Inkscape::Text::Layout::iterator::nextGlyph(), origin, pathv_to_linear_and_cubic_beziers(), Geom::PathVector::pointAt(), Geom::PathVector::push_back(), Geom::rot90(), scale, Inkscape::UI::Tools::MT::ClipboardMeaClass::segLengths, Inkscape::UI::Tools::MT::SEGMENT, setGuide(), setMeasureCanvasControlLine(), setMeasureCanvasItem(), setMeasureCanvasText(), Geom::Path::start(), Inkscape::UI::start, start_p, Inkscape::UI::Tools::MT::ClipboardMeaClass::symbols, te_get_layout(), Geom::unit_vector(), SPDesktop::w2d(), writeMeasurePoint(), Geom::X, and Geom::Y.
Referenced by knotEndMovedHandler(), knotStartMovedHandler(), knotUngrabbedHandler(), MeasureTool(), reverseKnots(), root_handler(), toGuides(), toItem(), and toPhantom().
void Inkscape::UI::Tools::MeasureTool::showInfoBox | ( | Geom::Point | cursor, |
bool | into_groups | ||
) |
Definition at line 1043 of file measure-tool.cpp.
References Inkscape::UI::Tools::ToolBase::_desktop, SPItem::bounds(), clipBMeas, SPDesktop::current_zoom(), Inkscape::UI::Tools::fontsize, SPItem::GEOMETRIC_BBOX, Inkscape::Preferences::get(), SPDocument::get_origin_follows_page(), SPNamedView::getDisplayUnit(), SPDesktop::getDocument(), SPDesktop::getItemAtPoint(), SPDesktop::getNamedView(), SPDocument::getPageManager(), Inkscape::PageManager::getSelectedPageAffine(), SPDesktop::getSelection(), SPItem::i2dt_affine(), Inkscape::Selection::includes(), Geom::Affine::inverse(), Geom::Scale::inverse(), item_height, item_length, item_width, item_x, item_y, Geom::length(), Inkscape::UI::Tools::MT::ClipboardMeaClass::lengths, measure_item, Inkscape::UI::Tools::MT::ClipboardMeaClass::measureIsSet, origin, over, scale, Inkscape::UI::Tools::MT::SHAPE_HEIGHT, Inkscape::UI::Tools::MT::SHAPE_LENGTH, Inkscape::UI::Tools::MT::SHAPE_WIDTH, Inkscape::UI::Tools::MT::SHAPE_X, Inkscape::UI::Tools::MT::SHAPE_Y, showItemInfoText(), Inkscape::UI::Tools::MT::ClipboardMeaClass::unsetShapeMeasures(), SPItem::VISUAL_BBOX, SPDesktop::w2d(), Geom::X, Geom::Y, and SPDesktop::yaxisdir().
Referenced by root_handler().
void Inkscape::UI::Tools::MeasureTool::showItemInfoText | ( | Geom::Point | pos, |
Glib::ustring const & | measure_str, | ||
double | fontsize | ||
) |
Definition at line 1031 of file measure-tool.cpp.
References Inkscape::UI::Tools::ToolBase::_desktop, Inkscape::UI::Tools::fontsize, SPDesktop::getCanvasTemp(), and measure_item.
Referenced by showInfoBox().
void Inkscape::UI::Tools::MeasureTool::toGuides | ( | ) |
Definition at line 651 of file measure-tool.cpp.
References Inkscape::UI::Tools::ToolBase::_desktop, Geom::Ray::angle(), Inkscape::LayerManager::currentLayer(), SPDesktop::doc2dt(), Inkscape::DocumentUndo::done(), Inkscape::UI::end, end_p, SPDocument::ensureUpToDate(), explicit_base, SPDesktop::getDocument(), SPDesktop::getNamedView(), SPItem::i2doc_affine(), Geom::Affine::inverse(), Geom::Point::isFinite(), SPDesktop::layerManager(), setGuide(), Geom::Ray::setPoints(), showCanvasItems(), Inkscape::UI::start, and start_p.
void Inkscape::UI::Tools::MeasureTool::toItem | ( | ) |
Definition at line 697 of file measure-tool.cpp.
References Inkscape::UI::Tools::ToolBase::_desktop, SPObject::appendChildRepr(), Inkscape::XML::Document::createElement(), Inkscape::LayerManager::currentLayer(), SPDesktop::doc(), Inkscape::DocumentUndo::done(), end_p, SPDocument::ensureUpToDate(), SPDesktop::getDocument(), SPDocument::getReprDoc(), Geom::Point::isFinite(), SPDesktop::layerManager(), measure_item, Inkscape::GC::release(), reset(), setLine(), showCanvasItems(), and start_p.
void Inkscape::UI::Tools::MeasureTool::toMarkDimension | ( | ) |
Definition at line 717 of file measure-tool.cpp.
References Inkscape::UI::Tools::ToolBase::_desktop, Geom::Ray::angle(), Inkscape::Util::Quantity::convert(), dimension_offset, Inkscape::DocumentUndo::done(), Inkscape::UI::end, end_p, SPDocument::ensureUpToDate(), Inkscape::UI::Tools::fontsize, Inkscape::ustring::format_classic(), Inkscape::Preferences::get(), SPDesktop::getDocument(), Inkscape::Preferences::getDouble(), Inkscape::Preferences::getInt(), Inkscape::Preferences::getString(), SPDesktop::is_yaxisdown(), Geom::Point::isFinite(), Geom::middle_point(), scale, setLabelText(), setLine(), setMarkers(), Inkscape::UI::start, and start_p.
void Inkscape::UI::Tools::MeasureTool::toPhantom | ( | ) |
Definition at line 682 of file measure-tool.cpp.
References Inkscape::UI::Tools::ToolBase::_desktop, Inkscape::DocumentUndo::done(), end_p, SPDocument::ensureUpToDate(), SPDesktop::getDocument(), Geom::Point::isFinite(), measure_phantom_items, measure_tmp_items, showCanvasItems(), and start_p.
void Inkscape::UI::Tools::MeasureTool::writeMeasurePoint | ( | Geom::Point | point, |
bool | is_start | ||
) | const |
Definition at line 371 of file measure-tool.cpp.
References Inkscape::UI::Tools::endpoint_to_pref(), Inkscape::Preferences::get(), and Inkscape::Preferences::setPoint().
Referenced by showCanvasItems().
|
private |
Definition at line 195 of file measure-tool.h.
Referenced by MeasureTool().
|
private |
Definition at line 194 of file measure-tool.h.
Referenced by MeasureTool().
|
private |
Definition at line 196 of file measure-tool.h.
Referenced by MeasureTool().
|
private |
Definition at line 193 of file measure-tool.h.
Referenced by MeasureTool().
|
private |
Definition at line 191 of file measure-tool.h.
Referenced by MeasureTool().
|
private |
Definition at line 192 of file measure-tool.h.
Referenced by MeasureTool().
MT::ClipboardMeaClass Inkscape::UI::Tools::MeasureTool::clipBMeas |
Definition at line 169 of file measure-tool.h.
Referenced by copyToClipboard(), showCanvasItems(), and showInfoBox().
|
private |
Definition at line 176 of file measure-tool.h.
Referenced by showCanvasItems(), and toMarkDimension().
|
private |
Definition at line 178 of file measure-tool.h.
Referenced by calcDeltaBasePoint(), knotEndMovedHandler(), knotStartMovedHandler(), knotUngrabbedHandler(), MeasureTool(), reverseKnots(), root_handler(), setLine(), showCanvasItems(), toGuides(), toItem(), toMarkDimension(), and toPhantom().
|
private |
Definition at line 172 of file measure-tool.h.
Referenced by knotClickHandler(), root_handler(), showCanvasItems(), and toGuides().
|
private |
Definition at line 186 of file measure-tool.h.
Referenced by showInfoBox().
|
private |
Definition at line 189 of file measure-tool.h.
Referenced by showInfoBox().
|
private |
Definition at line 185 of file measure-tool.h.
Referenced by showInfoBox().
|
private |
Definition at line 187 of file measure-tool.h.
Referenced by showInfoBox().
|
private |
Definition at line 188 of file measure-tool.h.
Referenced by showInfoBox().
|
private |
Definition at line 175 of file measure-tool.h.
Referenced by knotEndMovedHandler(), knotStartMovedHandler(), knotUngrabbedHandler(), MeasureTool(), reset(), reverseKnots(), root_handler(), and ~MeasureTool().
|
private |
Definition at line 174 of file measure-tool.h.
Referenced by knotEndMovedHandler(), knotStartMovedHandler(), knotUngrabbedHandler(), MeasureTool(), reset(), reverseKnots(), root_handler(), and ~MeasureTool().
|
private |
Definition at line 173 of file measure-tool.h.
Referenced by root_handler().
|
private |
Definition at line 179 of file measure-tool.h.
Referenced by root_handler().
|
private |
Definition at line 183 of file measure-tool.h.
Referenced by root_handler(), showInfoBox(), showItemInfoText(), and toItem().
|
private |
Definition at line 182 of file measure-tool.h.
Referenced by createAngleDisplayCurve(), setMeasureCanvasControlLine(), setMeasureCanvasItem(), setMeasureCanvasText(), and toPhantom().
|
private |
Definition at line 181 of file measure-tool.h.
Referenced by createAngleDisplayCurve(), reset(), setMeasureCanvasControlLine(), setMeasureCanvasItem(), setMeasureCanvasText(), showCanvasItems(), and toPhantom().
|
private |
Definition at line 190 of file measure-tool.h.
Referenced by showInfoBox().
|
private |
Definition at line 177 of file measure-tool.h.
Referenced by calcDeltaBasePoint(), knotEndMovedHandler(), knotStartMovedHandler(), knotUngrabbedHandler(), MeasureTool(), reverseKnots(), root_handler(), setLine(), showCanvasItems(), toGuides(), toItem(), toMarkDimension(), and toPhantom().