1
#ifndef __SHAPE_EDITOR_H__
2
#define __SHAPE_EDITOR_H__
5
* Inkscape::ShapeEditor
7
* This is a container class which contains either knotholder (for shapes) or nodepath (for
8
* paths). It is attached to a single item so only one of these is active at a time.
11
* bulia byak <buliabyak@users.sf.net>
23
#include "libnr/nr-path-code.h"
24
#include "libnr/nr-point.h"
25
#include "libnr/nr-maybe.h"
30
class ShapeEditorsCollective;
35
ShapeEditor(SPDesktop *desktop);
38
void set_item (SPItem *item);
39
void set_item_livepatheffect_parameter(SPItem *item, SPObject *lpeobject, const char * key);
46
bool has_knotholder ();
48
bool has_local_change ();
49
void decrement_local_change ();
51
GList *save_nodepath_selection ();
52
void restore_nodepath_selection (GList *saved);
54
void nodepath_destroyed ();
56
void update_statusbar ();
58
bool is_over_stroke (NR::Point event_p, bool remember);
60
void add_node_near_point(); // uses the shapeeditor's remembered point, if any
62
void select_segment_near_point(bool toggle); // uses the shapeeditor's remembered point, if any
68
void curve_drag (gdouble eventx, gdouble eventy);
72
void select_rect (NR::Rect const &rect, bool add);
74
bool has_selection ();
77
Inkscape::NodePath::Path *get_nodepath() {return nodepath;} //((deprecated))
78
ShapeEditorsCollective *get_container() {return container;}
83
void delete_nodes_preserving_shape();
84
void delete_segment();
86
void set_node_type(int type);
88
void break_at_nodes();
92
void duplicate_nodes();
94
void set_type_of_segments(NRPathcode code);
96
void move_nodes(gdouble dx, gdouble dy);
97
void move_nodes_screen(gdouble dx, gdouble dy);
99
void rotate_nodes(gdouble angle, int which, bool screen);
101
void scale_nodes(gdouble const grow, int const which);
102
void scale_nodes_screen(gdouble const grow, int const which);
104
void select_all (bool invert);
105
void select_all_from_subpath (bool invert);
109
void show_handles (bool show);
111
void flip (NR::Dim2 axis, NR::Maybe<NR::Point> center = NR::Nothing());
113
void distribute (NR::Dim2 axis);
114
void align (NR::Dim2 axis);
116
bool nodepath_edits_repr_key(gchar const *name);
121
Inkscape::NodePath::Path *nodepath;
122
SPKnotHolder *knotholder;
124
ShapeEditorsCollective *container;
126
//Inkscape::XML::Node *lidtened_repr;
129
int grab_node; // number of node grabbed by sp_node_context_is_over_stroke
131
NR::Point curvepoint_event; // int coords from event
132
NR::Point curvepoint_doc; // same, in doc coords
136
/* As the next stage, this will be a collection of multiple ShapeEditors,
137
with the same interface as the single ShapeEditor, passing the actions to all its
138
contained ShapeEditors. Thus it should be easy to switch node context from
139
using a single ShapeEditor to using a ShapeEditorsCollective. */
141
class ShapeEditorsCollective {
144
ShapeEditorsCollective(SPDesktop *desktop);
145
~ShapeEditorsCollective();
147
void update_statusbar();
150
std::vector<ShapeEditor> editors;
152
SPNodeContext *nc; // who holds us
161
c-file-style:"stroustrup"
162
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
167
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :