summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1673045)
raw | patch | inline | side by side (parent: 1673045)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Sun, 23 Mar 2008 20:29:06 +0000 (20:29 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Sun, 23 Mar 2008 20:29:06 +0000 (20:29 +0000) |
src/live_effects/parameter/path.cpp | patch | blob | history | |
src/live_effects/parameter/path.h | patch | blob | history |
index c87cff6135eddd48f583c44c6d80b249822d10e0..12e67693a79be027c8a41eda0cd8ac2fdeb0cf94 100644 (file)
_pathvector(),
must_recalculate_pwd2(false),
_pwd2(),
- referring(false)
+ href(NULL)
{
defvalue = g_strdup(default_value);
param_readSVGValue(defvalue);
std::vector<Geom::Path> const &
PathParam::get_pathvector()
{
- if (!referring) {
- return _pathvector;
- } else {
- update_from_referred();
- must_recalculate_pwd2 = true;
- return _pathvector;
- }
+ return _pathvector;
}
Geom::Piecewise<Geom::D2<Geom::SBasis> > const &
PathParam::get_pwd2()
{
- if (!referring) {
- ensure_pwd2();
- return _pwd2;
- } else {
- update_from_referred();
- ensure_pwd2();
- return _pwd2;
- }
+ ensure_pwd2();
+ return _pwd2;
}
void
{
if (strvalue) {
_pathvector.clear();
- _pathvector = SVGD_to_2GeomPath(strvalue);
+ if (href) {
+ g_free(href);
+ href = NULL;
+ }
must_recalculate_pwd2 = true;
+ if (false /*if strvalue is xlink*/) {
+ href = g_strdup(strvalue);
+ update_from_referred();
+ // TODO: add listener, because we must update when referred updates. we must always be up-to-date with referred path data
+ } else {
+ _pathvector = SVGD_to_2GeomPath(strvalue);
+ }
+
signal_path_changed.emit();
return true;
}
}
ShapeEditor * shape_editor = SP_NODE_CONTEXT( dt->event_context )->shape_editor;
- shape_editor->set_item_lpe_path_parameter(item, SP_OBJECT(param_effect->getLPEObj()), param_key.c_str());
+ if (!href) {
+ shape_editor->set_item_lpe_path_parameter(item, SP_OBJECT(param_effect->getLPEObj()), param_key.c_str());
+ } else {
+ // set referred item for editing
+ }
}
void
PathParam::param_transform_multiply(Geom::Matrix const& postmul, bool /*set*/)
{
// TODO: recode this to apply transform to _pathvector instead?
- if (!referring) {
+ if (!href) {
// only apply transform when not referring to other path
ensure_pwd2();
param_set_and_write_new_value( _pwd2 * postmul );
void
PathParam::update_from_referred()
{
- // TODO
+ if (!href) {
+ g_warning("PathParam::update_from_referred - logical error, this should not possible");
+ return;
+ }
+
+ // TODO: implement!
// optimize, only update from referred when referred changed.
}
index 6f2a0d1fdcc96ba8f6263efb1de88fe5280f0667..b294c0d2e00fb445531bfc3232076290df12de1e 100644 (file)
bool must_recalculate_pwd2; // set when _pathvector was updated, but _pwd2 not
void ensure_pwd2(); // ensures _pwd2 is up to date
- bool referring; // set when referring to another path, i.e. does not have its own pwd2, but should get it from another path
+ gchar * href; // contains link to other object, e.g. "#path2428", NULL if PathParam contains pathdata itself
void update_from_referred(); // updates path data by looking up refered path
void on_edit_button_click();