Logo Search packages:      
Sourcecode: inkscape version File versions  Download package

nodepath.cpp File Reference

Detailed Description

Path handler in node edit mode

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

This code is in public domain

Definition in file nodepath.cpp.

#include "config.h"
#include <math.h>
#include <gdk/gdkkeysyms.h>
#include "svg/svg.h"
#include "display/curve.h"
#include "display/sp-canvas-util.h"
#include "display/sp-ctrlline.h"
#include "display/sodipodi-ctrl.h"
#include <glibmm/i18n.h>
#include "libnr/n-art-bpath.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 "desktop-affine.h"
#include "snap.h"
#include "message-stack.h"
#include "message-context.h"
#include "node-context.h"
#include "nodepath.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 "sp-shape.h"
#include "libnr/nr-point-ops.h"
#include <libnr/nr-rect.h>
#include <libnr/nr-matrix-fns.h>
#include <libnr/nr-matrix-ops.h>
#include <libnr/nr-point-matrix-ops.h>
#include "livarot/Path.h"
#include "splivarot.h"
#include "helper/stlport.h"
#include <libnr/nr-point-fns.h>

Go to the source code of this file.


struct  NodeSort
 Helper struct. More...


#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_TYPE_FLOWREGION   (sp_flowregion_get_type ())
#define SP_TYPE_FLOWTEXT   (sp_flowtext_get_type ())


static SPCurvecreate_curve (Inkscape::NodePath::Path *np)
static gchar * create_typestr (Inkscape::NodePath::Path *np)
Path::cut_position get_nearest_position_on_Path (SPItem *item, NR::Point p)
static void node_clicked (SPKnot *knot, guint state, gpointer data)
static void node_ctrl_clicked (SPKnot *knot, guint state, gpointer data)
static gboolean node_ctrl_event (SPKnot *knot, GdkEvent *event, Inkscape::NodePath::Node *n)
static void node_ctrl_grabbed (SPKnot *knot, guint state, gpointer data)
static void node_ctrl_moved (SPKnot *knot, NR::Point *p, guint state, gpointer data)
static gboolean node_ctrl_request (SPKnot *knot, NR::Point *p, guint state, gpointer data)
static void node_ctrl_ungrabbed (SPKnot *knot, guint state, gpointer data)
static gboolean node_event (SPKnot *knot, GdkEvent *event, Inkscape::NodePath::Node *n)
static void node_grabbed (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)
gboolean nodepath_repr_d_changed (Inkscape::NodePath::Path *np, char const *newd)
 Returns true if the argument nodepath and the d attribute in its repr do not match.
gboolean nodepath_repr_typestr_changed (Inkscape::NodePath::Path *np, char const *newtypestr)
 Returns true if the argument nodepath and the sodipodi:nodetypes attribute in its repr do not match.
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.
GType sp_flowregion_get_type (void)
GType sp_flowtext_get_type (void)
static void sp_node_adjust_knot (Inkscape::NodePath::Node *node, gint which_adjust)
 Adjusts control point according to node type and line code.
static void sp_node_adjust_knots (Inkscape::NodePath::Node *node)
 Adjusts control point according to node type and line code.
static void sp_node_control_mirror_n_to_p (Inkscape::NodePath::Node *node)
static void sp_node_control_mirror_p_to_n (Inkscape::NodePath::Node *node)
static void sp_node_ensure_ctrls (Inkscape::NodePath::Node *node)
static void sp_node_ensure_knot (Inkscape::NodePath::Node *node, gint which, gboolean show_knot)
sp_node_get_side (Inkscape::NodePath::Node *node, gint which)
void sp_node_moveto (Inkscape::NodePath::Node *node, NR::Point p)
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 (void)
void sp_node_selected_break ()
void sp_node_selected_delete ()
void sp_node_selected_delete_segment (void)
void sp_node_selected_duplicate ()
void sp_node_selected_join ()
void sp_node_selected_join_segment ()
void sp_node_selected_move (gdouble dx, gdouble dy)
void sp_node_selected_move_screen (gdouble dx, gdouble dy)
void sp_node_selected_set_line_type (NRPathcode code)
void sp_node_selected_set_type (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)
void sp_nodepath_add_node_near_point (SPItem *item, 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 (Inkscape::NodePath::Node *e, double t, NR::Point delta, char *key)
void sp_nodepath_deselect (Inkscape::NodePath::Path *nodepath)
 Deselect all nodes in the nodepath.
void sp_nodepath_destroy (Inkscape::NodePath::Path *np)
static void sp_nodepath_ensure_ctrls (Inkscape::NodePath::Path *nodepath)
void sp_nodepath_flip (Inkscape::NodePath::Path *nodepath, NR::Dim2 axis)
Inkscape::NodePath::Nodesp_nodepath_get_node_by_index (int index)
static gint sp_nodepath_get_node_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 control positions for three nodes, splitting line marked by end at distance t.
Inkscape::NodePath::Pathsp_nodepath_new (SPDesktop *desktop, 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.
void sp_nodepath_select_all (Inkscape::NodePath::Path *nodepath)
 Select all nodes in the nodepath.
void sp_nodepath_select_all_from_subpath (Inkscape::NodePath::Path *nodepath)
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, NRRect *b, gboolean incremental)
 Select all nodes that are within the rectangle.
void sp_nodepath_select_segment_near_point (SPItem *item, 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_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)
static void sp_nodepath_subpath_close (Inkscape::NodePath::SubPath *sp)
static void sp_nodepath_subpath_destroy (Inkscape::NodePath::SubPath *subpath)
static void sp_nodepath_subpath_ensure_ctrls (Inkscape::NodePath::SubPath *subpath)
static gint sp_nodepath_subpath_get_node_count (Inkscape::NodePath::SubPath *subpath)
sp_nodepath_subpath_new (Inkscape::NodePath::Path *nodepath)
static void sp_nodepath_subpath_open (Inkscape::NodePath::SubPath *sp, Inkscape::NodePath::Node *n)
void sp_nodepath_update_statusbar (Inkscape::NodePath::Path *nodepath)
static void stamp_repr (Inkscape::NodePath::Path *np)
static NArtBpathsubpath_from_bpath (Inkscape::NodePath::Path *np, NArtBpath *b, gchar const *t)
double triangle_area (NR::Point p1, NR::Point p2, NR::Point p3)
static void update_object (Inkscape::NodePath::Path *np)
static void update_repr (Inkscape::NodePath::Path *np)
static void update_repr_internal (Inkscape::NodePath::Path *np)
static void update_repr_keyed (Inkscape::NodePath::Path *np, gchar const *key)


static Inkscape::NodePath::Nodeactive_node = NULL
static GMemChunk * nodechunk = NULL

Generated by  Doxygen 1.6.0   Back to index