nodepath.h revision 70289ba954ffc5a7024fccd5cc845d1d6fa1fddd
#ifndef __SP_NODEPATH_H__
#define __SP_NODEPATH_H__
/** \file
* Path handler in node edit mode
*/
/*
* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
*
* This code is in public domain
*/
//#include "knot.h"
//#include "sp-path.h"
//#include "desktop-handles.h"
#include "libnr/nr-path-code.h"
#include <list>
}
}
/**
* Radial objects are represented by an angle and a distance from
* 0,0. 0,0 is represented by a == big_num.
*/
/** Radius */
double r;
/** Amplitude */
double a;
Radial() {}
// Radial(NR::Point const &p); // Convert a point to radial coordinates
// operator NR::Point() const;
/**
* Construct Radial from NR::Point.
*/
{
if (r > 0) {
} else {
a = HUGE_VAL; //undefined
}
}
/**
* Cast Radial to cartesian NR::Point.
*/
{
if (a == HUGE_VAL) {
} else {
}
}
};
/** defined in node-context.h */
/**
* This is a node on a subpath
*/
/**
* This is a subdivision of a NodePath
*/
/**
* This is a node (point) along a subpath
*/
/**
* This is a collection of subpaths which contain nodes
*
* In the following data model. Nodepaths are made up of subpaths which
* are comprised of nodes.
*
* Nodes are linked thus:
* \verbatim
n other
node -----> nodeside ------> node \endverbatim
*/
/** Pointer to the current desktop, for reporting purposes */
/** The parent path of this nodepath */
/** The context which created this nodepath. Important if this nodepath is deleted */
/** The subpaths which comprise this NodePath */
/** A list of nodes which are currently selected */
/** Transforms (userspace <---> virtual space? someone please describe )
njh: I'd be guessing that these are item <-> desktop transforms.*/
/** The DOM node which describes this NodePath */
//STL compliant method to get the selected nodes
/// livarot library is used for "point on path" and "nearest position on path", so we need to maintain its path representation as well
::Path *livarot_path;
/// true if we changed repr, to tell this change from an external one such as from undo, simplify, or another desktop
unsigned int local_change;
/// true if we're showing selected nodes' handles
bool show_handles;
};
/**
* This is the lowest list item, a simple list of nodes.
*/
/** The parent of this subpath */
/** Is this path closed (no endpoints) or not?*/
/** The nodes in this subpath. */
/** The last node of the subpath */
};
/**
* What kind of node is this? This is the value for the node->type
* field. NodeType indicates the degree of continuity required for
* the node. I think that the corresponding integer indicates which
* derivate is connected. (Thus 2 means that the node is continuous
* to the second derivative, i.e. has matching endpoints and tangents)
*/
typedef enum {
/** A normal node */
/** This node non-continuously joins two segments.*/
/** This node continuously joins two segments. */
/** This node is symmetric. */
} NodeType;
/**
* A NodeSide is a datarecord which may be on either side (n or p) of a node,
* which describes the segment going to the next node.
*/
/** Pointer to the next node, */
/** Position */
/** Origin (while dragging) in radial notation */
/** Origin (while dragging) in x/y notation */
/** Knots are Inkscape's way of providing draggable points. This
* Knot is the point on the curve representing the control point in a
* bezier curve.*/
/** What kind of rendering? */
SPCanvasItem * line;
};
/**
* A node along a NodePath
*/
/** The parent subpath of this node */
/** Type is selected from NodeType.*/
/** Code refers to which ArtCode is used to represent the segment
* (which segment?).*/
/** Boolean. Am I currently selected or not? */
/** */
/** */
/** Knots are Inkscape's way of providing draggable points. This
* Knot is the point on the curve representing the endpoint.*/
/** The NodeSide in the 'next' direction */
NodeSide n;
/** The NodeSide in the 'previous' direction */
NodeSide p;
/** The pointer to the nodeside which we are dragging out with Shift */
};
} // namespace NodePath
} // namespace Inkscape
enum {
};
// Do function documentation in nodepath.cpp
void sp_nodepath_select_rect (Inkscape::NodePath::Path * nodepath, NR::Rect const &b, gboolean incremental);
void sp_nodepath_select_segment_near_point(Inkscape::NodePath::Path *nodepath, NR::Point p, bool toggle);
/* possibly private functions */
void sp_node_selected_add_node (void);
void sp_node_selected_break (void);
void sp_node_selected_duplicate (void);
void sp_node_selected_join (void);
void sp_node_selected_join_segment (void);
void sp_node_selected_delete (void);
void sp_node_selected_delete_segment (void);
void sp_nodepath_show_handles(bool show);
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 grow, int which);
void sp_nodepath_selected_nodes_scale_screen (Inkscape::NodePath::Path * nodepath, gdouble grow, int which);
#endif