Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
lpe-measure-segments.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Author(s):
4 * Jabiertxo Arraiza Cenoz <jabier.arraiza@marker.es>
5 * Some code and ideas migrated from dimensioning.py by
6 * Johannes B. Rutzmoser, johannes.rutzmoser (at) googlemail (dot) com
7 * https://github.com/Rutzmoser/inkscape_dimensioning
8 *
9 * Copyright (C) 2014 Author(s)
10 *
11 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
12 */
13
14#ifndef INKSCAPE_LPE_MEASURE_SEGMENTS_H
15#define INKSCAPE_LPE_MEASURE_SEGMENTS_H
16
17#include <vector>
18#include <glibmm/ustring.h>
19
20#include "live_effects/effect.h"
29
30namespace Gtk {
31class Widget;
32} // namespace Gtk
33
35
42
43class LPEMeasureSegments final : public Effect {
44public:
46
47 void doOnApply(SPLPEItem const* lpeitem) override;
48 void doBeforeEffect (SPLPEItem const* lpeitem) override;
49 void doOnRemove(SPLPEItem const* /*lpeitem*/) override;
50 void doEffect (SPCurve * curve) override {};
51 void doOnVisibilityToggled(SPLPEItem const* /*lpeitem*/) override;
52 bool doOnOpen(SPLPEItem const *lpeitem) override;
53 void processObjects(LPEAction lpe_action) override;
54 Gtk::Widget * newWidget() override;
55 void createLine(Geom::Point start,Geom::Point end, Glib::ustring name, size_t counter, bool main, bool remove, bool arrows = false);
56 void createTextLabel(Geom::Point &pos, size_t counter, double length, Geom::Coord angle, bool remove, bool valid);
57 void createArrowMarker(Glib::ustring mode);
58 bool isWhitelist(size_t i, std::string listsegments, bool whitelist);
59 void on_my_switch_page(Gtk::Widget* page, guint page_number);
60private:
90 std::vector<Glib::ustring> items;
97 bool legacy = false;
98 double fontsize;
99 double prevfontsize = 0;
102 Glib::ustring prevunit = "";
103 double arrow_gap;
105 gchar const* locale_base;
108 SPObject *parent = nullptr;
111
112};
113
114} // namespace Inkscape::LivePathEffect
115
116#endif // INKSCAPE_LPE_MEASURE_SEGMENTS_H
117
118/*
119 Local Variables:
120 mode:c++
121 c-file-style:"stroustrup"
122 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
123 indent-tabs-mode:nil
124 fill-column:99
125 End:
126*/
127// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
int main()
uint64_t page
Definition canvas.cpp:171
Two-dimensional point that doubles as a vector.
Definition point.h:66
void on_my_switch_page(Gtk::Widget *page, guint page_number)
bool isWhitelist(size_t i, std::string listsegments, bool whitelist)
LPEMeasureSegments(const LPEMeasureSegments &)=delete
void processObjects(LPEAction lpe_action) override
void doBeforeEffect(SPLPEItem const *lpeitem) override
Is performed each time before the effect is updated.
LPEMeasureSegments & operator=(const LPEMeasureSegments &)=delete
void createTextLabel(Geom::Point &pos, size_t counter, double length, Geom::Coord angle, bool remove, bool valid)
void doOnVisibilityToggled(SPLPEItem const *) override
void doOnApply(SPLPEItem const *lpeitem) override
Is performed a single time when the effect is freshly applied to a path.
void createLine(Geom::Point start, Geom::Point end, Glib::ustring name, size_t counter, bool main, bool remove, bool arrows=false)
bool doOnOpen(SPLPEItem const *lpeitem) override
Is performed on load document or revert If the item is fixed legacy return true.
Gtk::Widget * newWidget() override
This creates a managed widget.
Wrapper around a Geom::PathVector object.
Definition curve.h:28
SPObject is an abstract base class of all of the document nodes at the SVG document level.
Definition sp-object.h:160
double Coord
Floating point type used to store coordinates.
Definition coord.h:76
Geom::Point start
Geom::Point end
Coord length(LineSegment const &seg)
Definition desktop.h:50
Live Path Effects code.
static gint counter
Definition box3d.cpp:39
int mode
void remove(std::vector< T > &vec, T const &val)
Definition sanitize.cpp:94
Definition curve.h:24
Glib::ustring name
Definition toolbars.cpp:55