Logo Search packages:      
Sourcecode: inkscape version File versions

nodepath.cpp File Reference


Detailed Description

Path handler in node edit mode

Authors: Lauris Kaplinski <lauris@kaplinski.com> bulia byak <buliabyak@users.sf.net>

Portions of this code are in public domain; node sculpting functions written by bulia byak are under GNU GPL

Definition in file nodepath.cpp.

#include <gdk/gdkkeysyms.h>
#include "display/canvas-bpath.h"
#include "display/curve.h"
#include "display/sp-ctrlline.h"
#include "display/sodipodi-ctrl.h"
#include <glibmm/i18n.h>
#include "libnr/n-art-bpath.h"
#include "libnr/nr-path.h"
#include "helper/units.h"
#include "knot.h"
#include "inkscape.h"
#include "document.h"
#include "sp-namedview.h"
#include "desktop.h"
#include "desktop-handles.h"
#include "snap.h"
#include "message-stack.h"
#include "message-context.h"
#include "node-context.h"
#include "shape-editor.h"
#include "selection-chemistry.h"
#include "selection.h"
#include "xml/repr.h"
#include "prefs-utils.h"
#include "sp-metrics.h"
#include "sp-path.h"
#include "libnr/nr-matrix-ops.h"
#include "splivarot.h"
#include "svg/svg.h"
#include "verbs.h"
#include "display/bezier-utils.h"
#include <vector>
#include <algorithm>
#include <cstring>
#include <string>
#include "live_effects/lpeobject.h"
#include "live_effects/parameter/parameter.h"
#include "util/mathfns.h"
#include "helper/stlport.h"

Go to the source code of this file.

Classes

struct  NodeSort
 Helper struct. More...

Defines

#define __SP_NODEPATH_C__
#define KNOT_FILL   0xffffffff
#define KNOT_FILL_HI   0xff000000
#define KNOT_STROKE   0x000000ff
#define KNOT_STROKE_HI   0x000000ff
#define NODE_FILL   0xbfbfbf00
#define NODE_FILL_HI   0xff000000
#define NODE_FILL_SEL   0x0000ffff
#define NODE_FILL_SEL_HI   0xff000000
#define NODE_STROKE   0x000000ff
#define NODE_STROKE_HI   0x000000ff
#define NODE_STROKE_SEL   0x000000ff
#define NODE_STROKE_SEL_HI   0x000000ff
#define SP_IS_FLOWREGION(obj)   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SP_TYPE_FLOWREGION))
#define SP_IS_FLOWTEXT(obj)   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SP_TYPE_FLOWTEXT))
#define SP_TYPE_FLOWREGION   (sp_flowregion_get_type ())
#define SP_TYPE_FLOWTEXT   (sp_flowtext_get_type ())

Functions

double bezier_length (NR::Point a, NR::Point ah, NR::Point bh, NR::Point b)
static SPCurvecreate_curve (Inkscape::NodePath::Path *np)
static gchar * create_typestr (Inkscape::NodePath::Path *np)
static void node_clicked (SPKnot *knot, guint state, gpointer data)
static gboolean node_event (SPKnot *, GdkEvent *event, Inkscape::NodePath::Node *n)
static void node_grabbed (SPKnot *knot, guint state, gpointer data)
static void node_handle_clicked (SPKnot *knot, guint state, gpointer data)
static gboolean node_handle_event (SPKnot *knot, GdkEvent *event, Inkscape::NodePath::Node *n)
static void node_handle_grabbed (SPKnot *knot, guint state, gpointer data)
static void node_handle_moved (SPKnot *knot, NR::Point *p, guint state, gpointer data)
static gboolean node_handle_request (SPKnot *knot, NR::Point *p, guint state, gpointer data)
static void node_handle_ungrabbed (SPKnot *knot, guint state, gpointer data)
gboolean node_key (GdkEvent *event)
static gboolean node_request (SPKnot *knot, NR::Point *p, guint state, gpointer data)
static void node_rotate_one (Inkscape::NodePath::Node *n, gdouble angle, int which, gboolean screen)
static void node_rotate_one_internal (Inkscape::NodePath::Node const &n, gdouble const angle, Radial &rme, Radial &rother, gboolean const both)
static void node_rotate_one_internal_screen (Inkscape::NodePath::Node const &n, gdouble const angle, Radial &rme, Radial &rother, gboolean const both)
static void node_scale_one (Inkscape::NodePath::Node *n, gdouble grow, int which)
static void node_ungrabbed (SPKnot *knot, guint state, gpointer data)
void nodepath_grow_selection_linearly (Inkscape::NodePath::Path *nodepath, Inkscape::NodePath::Node *n, int grow)
void nodepath_grow_selection_spatially (Inkscape::NodePath::Path *nodepath, Inkscape::NodePath::Node *n, int grow)
static bool operator< (NodeSort const &a, NodeSort const &b)
static gchar * parse_nodetypes (gchar const *types, gint length)
static void point_line_closest (NR::Point *p, double a, NR::Point *closest)
static double point_line_distance (NR::Point *p, double a)
void restore_nodepath_selection (Inkscape::NodePath::Path *nodepath, GList *r)
 Restores selection by selecting nodes whose positions are in the list.
GList * save_nodepath_selection (Inkscape::NodePath::Path *nodepath)
 Saves selected nodes in a nodepath into a list containing integer positions of all selected nodes.
double sculpt_profile (double x, double alpha, guint profile)
GType sp_flowregion_get_type (void)
GType sp_flowtext_get_type (void)
static void sp_node_adjust_handle (Inkscape::NodePath::Node *node, gint which_adjust)
 Adjusts handle according to node type and line code.
static void sp_node_adjust_handles (Inkscape::NodePath::Node *node)
 Adjusts both handles according to node type and line code.
void sp_node_delete_preserve (GList *nodes_to_delete)
static void sp_node_ensure_knot_exists (SPDesktop *desktop, Inkscape::NodePath::Node *node, Inkscape::NodePath::NodeSide *side)
static
Inkscape::NodePath::NodeSide
sp_node_get_side (Inkscape::NodePath::Node *node, gint which)
static void sp_node_handle_mirror_n_to_p (Inkscape::NodePath::Node *node)
static void sp_node_handle_mirror_p_to_n (Inkscape::NodePath::Node *node)
void sp_node_moveto (Inkscape::NodePath::Node *node, NR::Point p)
static
Inkscape::NodePath::NodeSide
sp_node_opposite_side (Inkscape::NodePath::Node *node, Inkscape::NodePath::NodeSide *me)
static NRPathcode sp_node_path_code_from_side (Inkscape::NodePath::Node *node, Inkscape::NodePath::NodeSide *me)
void sp_node_selected_add_node (Inkscape::NodePath::Path *nodepath)
NR::Rect sp_node_selected_bbox (Inkscape::NodePath::Path *nodepath)
void sp_node_selected_break (Inkscape::NodePath::Path *nodepath)
NR::Maybe< NR::Coordsp_node_selected_common_coord (Inkscape::NodePath::Path *nodepath, NR::Dim2 axis)
void sp_node_selected_delete (Inkscape::NodePath::Path *nodepath)
void sp_node_selected_delete_segment (Inkscape::NodePath::Path *nodepath)
void sp_node_selected_duplicate (Inkscape::NodePath::Path *nodepath)
void sp_node_selected_join (Inkscape::NodePath::Path *nodepath)
void sp_node_selected_join_segment (Inkscape::NodePath::Path *nodepath)
void sp_node_selected_move (Inkscape::NodePath::Path *nodepath, gdouble dx, gdouble dy)
void sp_node_selected_move_absolute (Inkscape::NodePath::Path *nodepath, NR::Coord val, NR::Dim2 axis)
void sp_node_selected_move_screen (Inkscape::NodePath::Path *nodepath, gdouble dx, gdouble dy)
void sp_node_selected_set_line_type (Inkscape::NodePath::Path *nodepath, NRPathcode code)
void sp_node_selected_set_type (Inkscape::NodePath::Path *nodepath, Inkscape::NodePath::NodeType type)
static void sp_node_set_selected (Inkscape::NodePath::Node *node, gboolean selected)
static gchar const * sp_node_type_description (Inkscape::NodePath::Node *node)
static void sp_node_update_handle (Inkscape::NodePath::Node *node, gint which, gboolean show_handle, bool fire_move_signals)
static void sp_node_update_handles (Inkscape::NodePath::Node *node, bool fire_move_signals=true)
void sp_nodepath_add_node_near_point (Inkscape::NodePath::Path *nodepath, NR::Point p)
static void sp_nodepath_cleanup (Inkscape::NodePath::Path *nodepath)
void sp_nodepath_convert_node_type (Inkscape::NodePath::Node *node, Inkscape::NodePath::NodeType type)
static Inkscape::NodePath::Pathsp_nodepath_current ()
void sp_nodepath_curve_drag (int node, double t, NR::Point delta)
void sp_nodepath_deselect (Inkscape::NodePath::Path *nodepath)
 Deselect all nodes in the nodepath.
void sp_nodepath_destroy (Inkscape::NodePath::Path *np)
void sp_nodepath_ensure_livarot_path (Inkscape::NodePath::Path *np)
void sp_nodepath_flip (Inkscape::NodePath::Path *nodepath, NR::Dim2 axis, NR::Maybe< NR::Point > center)
Inkscape::NodePath::Nodesp_nodepath_get_node_by_index (int index)
static gint sp_nodepath_get_node_count (Inkscape::NodePath::Path *np)
static gint sp_nodepath_get_subpath_count (Inkscape::NodePath::Path *np)
static Inkscape::NodePath::Nodesp_nodepath_line_add_node (Inkscape::NodePath::Node *end, gdouble t)
static void sp_nodepath_line_midpoint (Inkscape::NodePath::Node *new_path, Inkscape::NodePath::Node *end, gdouble t)
 Fills node and handle positions for three nodes, splitting line marked by end at distance t.
void sp_nodepath_make_straight_path (Inkscape::NodePath::Path *np)
void sp_nodepath_move_node_and_handles (Inkscape::NodePath::Node *n, NR::Point delta, NR::Point delta_n, NR::Point delta_p)
Inkscape::NodePath::Pathsp_nodepath_new (SPDesktop *desktop, SPObject *object, bool show_handles, const char *repr_key_in, SPItem *item)
 Creates new nodepath from item.
static Inkscape::NodePath::Nodesp_nodepath_node_break (Inkscape::NodePath::Node *node)
 Break the path at the node: duplicate the argument node, start a new subpath with the duplicate, and copy all nodes after the argument node to it.
static void sp_nodepath_node_destroy (Inkscape::NodePath::Node *node)
static Inkscape::NodePath::Nodesp_nodepath_node_duplicate (Inkscape::NodePath::Node *node)
static Inkscape::NodePath::Nodesp_nodepath_node_new (Inkscape::NodePath::SubPath *sp, Inkscape::NodePath::Node *next, Inkscape::NodePath::NodeType type, NRPathcode code, NR::Point *ppos, NR::Point *pos, NR::Point *npos)
static void sp_nodepath_node_select (Inkscape::NodePath::Node *node, gboolean incremental, gboolean override)
 Select a node.
static SPCurvesp_nodepath_object_get_curve (SPObject *object, const gchar *key)
void sp_nodepath_remember_origins (Inkscape::NodePath::Path *nodepath)
 Saves all nodes' and handles' current positions in their origin members.
void sp_nodepath_select_all (Inkscape::NodePath::Path *nodepath, bool invert)
 Select or invert selection of all nodes in the nodepath.
void sp_nodepath_select_all_from_subpath (Inkscape::NodePath::Path *nodepath, bool invert)
void sp_nodepath_select_next (Inkscape::NodePath::Path *nodepath)
 Select the node after the last selected; if none is selected, select the first within path.
void sp_nodepath_select_prev (Inkscape::NodePath::Path *nodepath)
 Select the node before the first selected; if none is selected, select the last within path.
void sp_nodepath_select_rect (Inkscape::NodePath::Path *nodepath, NR::Rect const &b, gboolean incremental)
 Select all nodes that are within the rectangle.
void sp_nodepath_select_segment_near_point (Inkscape::NodePath::Path *nodepath, NR::Point p, bool toggle)
void sp_nodepath_selected_align (Inkscape::NodePath::Path *nodepath, NR::Dim2 axis)
void sp_nodepath_selected_distribute (Inkscape::NodePath::Path *nodepath, NR::Dim2 axis)
static void sp_nodepath_selected_nodes_move (Inkscape::NodePath::Path *nodepath, NR::Coord dx, NR::Coord dy, bool const snap=true)
void sp_nodepath_selected_nodes_rotate (Inkscape::NodePath::Path *nodepath, gdouble angle, int which, bool screen)
void sp_nodepath_selected_nodes_scale (Inkscape::NodePath::Path *nodepath, gdouble const grow, int const which)
void sp_nodepath_selected_nodes_scale_screen (Inkscape::NodePath::Path *nodepath, gdouble const grow, int const which)
static void sp_nodepath_selected_nodes_sculpt (Inkscape::NodePath::Path *nodepath, Inkscape::NodePath::Node *n, NR::Point delta)
static gint sp_nodepath_selection_get_node_count (Inkscape::NodePath::Path *np)
static gint sp_nodepath_selection_get_subpath_count (Inkscape::NodePath::Path *np)
static void sp_nodepath_set_curve (Inkscape::NodePath::Path *np, SPCurve *curve)
static void sp_nodepath_set_line_type (Inkscape::NodePath::Node *end, NRPathcode code)
static Inkscape::NodePath::Nodesp_nodepath_set_node_type (Inkscape::NodePath::Node *node, Inkscape::NodePath::NodeType type)
void sp_nodepath_show_handles (Inkscape::NodePath::Path *nodepath, bool show)
void sp_nodepath_show_helperpath (Inkscape::NodePath::Path *np, bool show)
static void sp_nodepath_subpath_close (Inkscape::NodePath::SubPath *sp)
static void sp_nodepath_subpath_destroy (Inkscape::NodePath::SubPath *subpath)
static gint sp_nodepath_subpath_get_node_count (Inkscape::NodePath::SubPath *subpath)
static
Inkscape::NodePath::SubPath
sp_nodepath_subpath_new (Inkscape::NodePath::Path *nodepath)
static void sp_nodepath_subpath_open (Inkscape::NodePath::SubPath *sp, Inkscape::NodePath::Node *n)
static void sp_nodepath_subpath_update_handles (Inkscape::NodePath::SubPath *subpath)
static void sp_nodepath_update_handles (Inkscape::NodePath::Path *nodepath)
void sp_nodepath_update_repr (Inkscape::NodePath::Path *np, const gchar *annotation)
static void sp_nodepath_update_repr_keyed (Inkscape::NodePath::Path *np, gchar const *key, const gchar *annotation)
void sp_nodepath_update_statusbar (Inkscape::NodePath::Path *nodepath)
 !!move to ShapeEditorsCollection
static void stamp_repr (Inkscape::NodePath::Path *np)
static NArtBpathsubpath_from_bpath (Inkscape::NodePath::Path *np, NArtBpath *b, gchar const *t)
static void update_object (Inkscape::NodePath::Path *np)
static void update_repr_internal (Inkscape::NodePath::Path *np)

Variables

static GMemChunk * nodechunk = NULL


Generated by  Doxygen 1.6.0   Back to index