summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f3a66fd)
raw | patch | inline | side by side (parent: f3a66fd)
author | cilix42 <cilix42@users.sourceforge.net> | |
Tue, 29 Jul 2008 14:56:32 +0000 (14:56 +0000) | ||
committer | cilix42 <cilix42@users.sourceforge.net> | |
Tue, 29 Jul 2008 14:56:32 +0000 (14:56 +0000) |
src/nodepath.cpp | patch | blob | history | |
src/sp-lpe-item.cpp | patch | blob | history |
diff --git a/src/nodepath.cpp b/src/nodepath.cpp
index f210b275c932b8ec1f87e23680ad4634117cd2f6..ffe2a6b8da2f6599914720afbac39b1c3a5d711d 100644 (file)
--- a/src/nodepath.cpp
+++ b/src/nodepath.cpp
static SPCanvasItem *
sp_nodepath_make_helper_item(Inkscape::NodePath::Path *np, /*SPDesktop *desktop, */const SPCurve *curve, bool show = false) {
- g_print ("sp_nodepath_make_helper_item()\n");
SPCurve *helper_curve = curve->copy();
helper_curve->transform(to_2geom(np->i2d));
SPCanvasItem *helper_path = sp_canvas_bpath_new(sp_desktop_controls(np->desktop), helper_curve);
@@ -176,21 +175,13 @@ sp_nodepath_make_helper_item(Inkscape::NodePath::Path *np, /*SPDesktop *desktop,
static SPCanvasItem *
canvasitem_from_pathvec(Inkscape::NodePath::Path *np, Geom::PathVector const &pathv, bool show) {
- g_print ("canvasitem_from_pathvec()\n");
SPCurve *helper_curve = new SPCurve(pathv);
return sp_nodepath_make_helper_item(np, helper_curve, show);
}
static void
sp_nodepath_create_helperpaths(Inkscape::NodePath::Path *np) {
- g_print ("sp_nodepath_create_helperpaths()\n");
//std::map<Inkscape::LivePathEffect::Effect *, std::vector<SPCanvasItem *> >* helper_path_vec;
- if (np->item) {
- g_print ("np->item: %s\n", SP_OBJECT_REPR(np->item)->attribute("id"));
- } else {
- g_print ("np->item == NULL!\n");
- }
-
if (!SP_IS_LPE_ITEM(np->item)) {
g_print ("Only LPEItems can have helperpaths!\n");
return;
for (PathEffectList::iterator i = lpelist.begin(); i != lpelist.end(); ++i) {
Inkscape::LivePathEffect::LPEObjectReference *lperef = (*i);
Inkscape::LivePathEffect::Effect *lpe = lperef->lpeobject->lpe;
- g_print ("Processing LPE %s\n", SP_OBJECT_REPR(lperef->lpeobject)->attribute("id"));
// create new canvas items from the effect's helper paths
std::vector<Geom::PathVector> hpaths = lpe->getHelperPaths(lpeitem);
for (std::vector<Geom::PathVector>::iterator j = hpaths.begin(); j != hpaths.end(); ++j) {
- g_print (" ... creating helper path\n");
(*np->helper_path_vec)[lpe].push_back(canvasitem_from_pathvec(np, *j, true));
}
}
- g_print ("\n");
}
void
sp_nodepath_update_helperpaths(Inkscape::NodePath::Path *np) {
- g_print ("sp_nodepath_update_helperpaths()\n");
//std::map<Inkscape::LivePathEffect::Effect *, std::vector<SPCanvasItem *> >* helper_path_vec;
if (!SP_IS_LPE_ITEM(np->item)) {
g_print ("Only LPEItems can have helperpaths!\n");
PathEffectList lpelist = sp_lpe_item_get_effect_list(lpeitem);
for (PathEffectList::iterator i = lpelist.begin(); i != lpelist.end(); ++i) {
Inkscape::LivePathEffect::Effect *lpe = (*i)->lpeobject->lpe;
- g_print ("Processing LPE %s\n", SP_OBJECT_REPR((*i)->lpeobject)->attribute("id"));
/* update canvas items from the effect's helper paths; note that this code relies on the
* fact that getHelperPaths() will always return the same number of helperpaths in the same
* order as during their creation in sp_nodepath_create_helperpaths
*/
std::vector<Geom::PathVector> hpaths = lpe->getHelperPaths(lpeitem);
for (unsigned int j = 0; j < hpaths.size(); ++j) {
- g_print (" ... updating helper path\n");
SPCurve *curve = new SPCurve(hpaths[j]);
curve->transform(to_2geom(np->i2d));
sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(((*np->helper_path_vec)[lpe])[j]), curve);
curve = curve->unref();
}
}
- g_print ("\n");
}
static void
sp_nodepath_destroy_helperpaths(Inkscape::NodePath::Path *np) {
- g_print ("sp_nodepath_destroy_helperpaths()\n");
for (HelperPathList::iterator i = np->helper_path_vec->begin(); i != np->helper_path_vec->end(); ++i) {
- g_print ("processing helper paths for LPE %s\n", SP_OBJECT_REPR((*i).first->getLPEObj())->attribute("id"));
for (std::vector<SPCanvasItem *>::iterator j = (*i).second.begin(); j != (*i).second.end(); ++j) {
- g_print (" ... destroying helper path\n");
GtkObject *temp = *j;
*j = NULL;
gtk_object_destroy(temp);
}
}
- g_print ("\n");
}
diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp
index 1138c3ccde7695a47707cab0380ac7cf30f29aeb..f3620ab2fd45169d20e3228a00d4fe2dee43b6c5 100644 (file)
--- a/src/sp-lpe-item.cpp
+++ b/src/sp-lpe-item.cpp
((SPObjectClass *) parent_class)->update(object, ctx, flags);
}
- g_print ("sp_lpe_item_update()\n");
-
// update the helperpaths of all LPEs applied to the item
// TODO: is there a more canonical place for this, since we don't have instant access to the item's nodepath?
// FIXME: this is called multiple (at least 3) times; how can we avoid this?
static void
sp_lpe_item_modified (SPObject *object, unsigned int flags)
{
- g_print ("sp_lpe_item_modified()\n");
-
if (SP_IS_GROUP(object) && (flags & SP_OBJECT_MODIFIED_FLAG) && (flags & SP_OBJECT_USER_MODIFIED_FLAG_B)) {
sp_lpe_item_update_patheffect(SP_LPE_ITEM(object), true, true);
}