summaryrefslogtreecommitdiffstats
path: root/src/live_effects
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2010-01-14 15:54:06 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2010-01-14 15:54:06 +0000
commit4ffa8666045001bd3822db293ebb0b728b249492 (patch)
treec4595e3c98a260bab48d37a342b3fdc4002fd6b6 /src/live_effects
parentDo not append a segment when finishing an open path with right click (diff)
parentRe-enable snapping on release, for now. (diff)
downloadinkscape-4ffa8666045001bd3822db293ebb0b728b249492.tar.gz
inkscape-4ffa8666045001bd3822db293ebb0b728b249492.zip
Merge GSoC 2009 node tool rewrite
(bzr r8976)
Diffstat (limited to 'src/live_effects')
-rw-r--r--src/live_effects/effect.cpp8
-rw-r--r--src/live_effects/effect.h2
-rw-r--r--src/live_effects/lpe-constructgrid.cpp9
-rw-r--r--src/live_effects/lpe-constructgrid.h2
-rw-r--r--src/live_effects/lpe-gears.cpp9
-rw-r--r--src/live_effects/lpe-gears.h2
-rw-r--r--src/live_effects/lpe-lattice.cpp1
-rw-r--r--src/live_effects/lpe-spiro.cpp9
-rw-r--r--src/live_effects/lpe-spiro.h1
-rw-r--r--src/live_effects/lpe-vonkoch.cpp7
-rw-r--r--src/live_effects/parameter/path.cpp33
11 files changed, 24 insertions, 59 deletions
diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp
index 9232792f6..d53048c76 100644
--- a/src/live_effects/effect.cpp
+++ b/src/live_effects/effect.cpp
@@ -28,7 +28,6 @@
#include "tools-switch.h"
#include "message-stack.h"
#include "desktop.h"
-#include "nodepath.h"
#include "knotholder.h"
#include "live_effects/lpeobject.h"
@@ -665,13 +664,6 @@ Effect::resetDefaults(SPItem * /*item*/)
}
void
-Effect::setup_nodepath(Inkscape::NodePath::Path *np)
-{
- np->helperpath_rgba = 0xff0000ff;
- np->helperpath_width = 1.0;
-}
-
-void
Effect::transform_multiply(Geom::Matrix const& postmul, bool set)
{
// cycle through all parameters. Most parameters will not need transformation, but path and point params do.
diff --git a/src/live_effects/effect.h b/src/live_effects/effect.h
index 5d67ed016..a8d34a233 100644
--- a/src/live_effects/effect.h
+++ b/src/live_effects/effect.h
@@ -92,8 +92,6 @@ public:
*/
virtual void resetDefaults(SPItem * item);
- virtual void setup_nodepath(Inkscape::NodePath::Path *np);
-
/// /todo: is this method really necessary? it causes UI inconsistensies... (johan)
virtual void transform_multiply(Geom::Matrix const& postmul, bool set);
diff --git a/src/live_effects/lpe-constructgrid.cpp b/src/live_effects/lpe-constructgrid.cpp
index 144f4720d..4725573d7 100644
--- a/src/live_effects/lpe-constructgrid.cpp
+++ b/src/live_effects/lpe-constructgrid.cpp
@@ -16,8 +16,6 @@
#include <2geom/path.h>
#include <2geom/transforms.h>
-#include "nodepath.h"
-
namespace Inkscape {
namespace LivePathEffect {
@@ -81,13 +79,6 @@ LPEConstructGrid::doEffect_path (std::vector<Geom::Path> const & path_in)
}
}
-void
-LPEConstructGrid::setup_nodepath(Inkscape::NodePath::Path *np)
-{
- Effect::setup_nodepath(np);
- sp_nodepath_make_straight_path(np);
-}
-
} //namespace LivePathEffect
} /* namespace Inkscape */
diff --git a/src/live_effects/lpe-constructgrid.h b/src/live_effects/lpe-constructgrid.h
index 716960d32..c7e695794 100644
--- a/src/live_effects/lpe-constructgrid.h
+++ b/src/live_effects/lpe-constructgrid.h
@@ -27,8 +27,6 @@ public:
virtual std::vector<Geom::Path> doEffect_path (std::vector<Geom::Path> const & path_in);
- virtual void setup_nodepath(Inkscape::NodePath::Path *np);
-
private:
ScalarParam nr_x;
ScalarParam nr_y;
diff --git a/src/live_effects/lpe-gears.cpp b/src/live_effects/lpe-gears.cpp
index e211483c6..16eb19f44 100644
--- a/src/live_effects/lpe-gears.cpp
+++ b/src/live_effects/lpe-gears.cpp
@@ -14,8 +14,6 @@
#include <2geom/bezier-to-sbasis.h>
#include <2geom/path.h>
-#include "nodepath.h"
-
using std::vector;
using namespace Geom;
@@ -261,13 +259,6 @@ LPEGears::doEffect_path (std::vector<Geom::Path> const & path_in)
return path_out;
}
-void
-LPEGears::setup_nodepath(Inkscape::NodePath::Path *np)
-{
- Effect::setup_nodepath(np);
- sp_nodepath_make_straight_path(np);
-}
-
} // namespace LivePathEffect
} /* namespace Inkscape */
diff --git a/src/live_effects/lpe-gears.h b/src/live_effects/lpe-gears.h
index 4c3a9938b..bd5e4c4f9 100644
--- a/src/live_effects/lpe-gears.h
+++ b/src/live_effects/lpe-gears.h
@@ -24,8 +24,6 @@ public:
virtual std::vector<Geom::Path> doEffect_path (std::vector<Geom::Path> const & path_in);
- virtual void setup_nodepath(Inkscape::NodePath::Path *np);
-
private:
ScalarParam teeth;
ScalarParam phi;
diff --git a/src/live_effects/lpe-lattice.cpp b/src/live_effects/lpe-lattice.cpp
index 0beedb537..50ecdf04b 100644
--- a/src/live_effects/lpe-lattice.cpp
+++ b/src/live_effects/lpe-lattice.cpp
@@ -22,7 +22,6 @@
#include "sp-path.h"
#include "display/curve.h"
#include "svg/svg.h"
-#include "nodepath.h"
#include <2geom/sbasis.h>
#include <2geom/sbasis-2d.h>
diff --git a/src/live_effects/lpe-spiro.cpp b/src/live_effects/lpe-spiro.cpp
index 794fd980e..7c8262af6 100644
--- a/src/live_effects/lpe-spiro.cpp
+++ b/src/live_effects/lpe-spiro.cpp
@@ -7,7 +7,6 @@
#include "live_effects/lpe-spiro.h"
#include "display/curve.h"
-#include "nodepath.h"
#include <typeinfo>
#include <2geom/pathvector.h>
#include <2geom/matrix.h>
@@ -116,14 +115,6 @@ LPESpiro::~LPESpiro()
}
void
-LPESpiro::setup_nodepath(Inkscape::NodePath::Path *np)
-{
- Effect::setup_nodepath(np);
- sp_nodepath_show_handles(np, false);
-// sp_nodepath_show_helperpath(np, false);
-}
-
-void
LPESpiro::doEffect(SPCurve * curve)
{
using Geom::X;
diff --git a/src/live_effects/lpe-spiro.h b/src/live_effects/lpe-spiro.h
index 7256665a2..4fcd9eaaa 100644
--- a/src/live_effects/lpe-spiro.h
+++ b/src/live_effects/lpe-spiro.h
@@ -24,7 +24,6 @@ public:
virtual LPEPathFlashType pathFlashType() { return SUPPRESS_FLASH; }
- virtual void setup_nodepath(Inkscape::NodePath::Path *np);
virtual void doEffect(SPCurve * curve);
private:
diff --git a/src/live_effects/lpe-vonkoch.cpp b/src/live_effects/lpe-vonkoch.cpp
index 7fd0ac0b4..85f8cde0c 100644
--- a/src/live_effects/lpe-vonkoch.cpp
+++ b/src/live_effects/lpe-vonkoch.cpp
@@ -8,7 +8,6 @@
#include <cstdio>
#include "live_effects/lpe-vonkoch.h"
-#include "nodepath.h"
#include <2geom/transforms.h>
//using std::vector;
@@ -19,7 +18,7 @@ void
VonKochPathParam::param_setup_nodepath(Inkscape::NodePath::Path *np)
{
PathParam::param_setup_nodepath(np);
- sp_nodepath_make_straight_path(np);
+ //sp_nodepath_make_straight_path(np);
}
//FIXME: a path is used here instead of 2 points to work around path/point param incompatibility bug.
@@ -27,12 +26,12 @@ void
VonKochRefPathParam::param_setup_nodepath(Inkscape::NodePath::Path *np)
{
PathParam::param_setup_nodepath(np);
- sp_nodepath_make_straight_path(np);
+ //sp_nodepath_make_straight_path(np);
}
bool
VonKochRefPathParam::param_readSVGValue(const gchar * strvalue)
{
- std::vector<Geom::Path> old = _pathvector;
+ Geom::PathVector old = _pathvector;
bool res = PathParam::param_readSVGValue(strvalue);
if (res && _pathvector.size()==1 && _pathvector.front().size()==1){
return true;
diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp
index 33e50155c..43f4b5725 100644
--- a/src/live_effects/parameter/path.cpp
+++ b/src/live_effects/parameter/path.cpp
@@ -28,10 +28,8 @@
// needed for on-canvas editting:
#include "tools-switch.h"
#include "shape-editor.h"
-#include "node-context.h"
#include "desktop-handles.h"
#include "selection.h"
-#include "nodepath.h"
// clipboard support
#include "ui/clipboard.h"
// required for linking to other paths
@@ -40,6 +38,10 @@
#include "sp-text.h"
#include "display/curve.h"
+#include "ui/tool/node-tool.h"
+#include "ui/tool/multi-path-manipulator.h"
+#include "ui/tool/shape-record.h"
+
namespace Inkscape {
@@ -195,26 +197,33 @@ PathParam::param_newWidget(Gtk::Tooltips * tooltips)
void
PathParam::param_editOncanvas(SPItem * item, SPDesktop * dt)
{
- // If not already in nodecontext, goto it!
+ using namespace Inkscape::UI;
+
+ // TODO remove the tools_switch atrocity.
if (!tools_isactive(dt, TOOLS_NODES)) {
tools_switch(dt, TOOLS_NODES);
}
- ShapeEditor * shape_editor = dt->event_context->shape_editor;
+ InkNodeTool *nt = static_cast<InkNodeTool*>(dt->event_context);
+ std::set<ShapeRecord> shapes;
+ ShapeRecord r;
+
+ r.role = SHAPE_ROLE_LPE_PARAM;
+ r.edit_transform = Geom::identity(); // TODO this is almost certainly wrong
if (!href) {
- shape_editor->set_item_lpe_path_parameter(item, param_effect->getLPEObj(), param_key.c_str());
+ r.item = reinterpret_cast<SPItem*>(param_effect->getLPEObj());
+ r.lpe_key = param_key;
} else {
- // set referred item for editing
- shape_editor->set_item(ref.getObject(), SH_NODEPATH);
+ r.item = ref.getObject();
}
+ shapes.insert(r);
+ nt->_multipath->setItems(shapes);
}
void
-PathParam::param_setup_nodepath(Inkscape::NodePath::Path *np)
-{
- np->show_helperpath = true;
- np->helperpath_rgba = 0x009000ff;
- np->helperpath_width = 1.0;
+PathParam::param_setup_nodepath(Inkscape::NodePath::Path *)
+{
+ // TODO this method should not exist at all!
}
void