From 1fe76e33a2e85b2ee90e69b06287f6fc78b9e4ad Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sat, 2 Oct 2010 05:27:51 +0200 Subject: [PATCH] WIP: move the (planned) logic for virtual paths to ScopePath::navigate() --- src/proc/mobject/session/query-focus.hpp | 4 ++-- src/proc/mobject/session/scope-path.cpp | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/proc/mobject/session/query-focus.hpp b/src/proc/mobject/session/query-focus.hpp index de27f33fd..05a426277 100644 --- a/src/proc/mobject/session/query-focus.hpp +++ b/src/proc/mobject/session/query-focus.hpp @@ -122,14 +122,14 @@ namespace session { */ inline QueryFocus::operator Scope() const { - return currPath().getLeaf(); + return focus_->getLeaf(); } /**@note returning a copy */ inline ScopePath QueryFocus::currentPath() const { - return currPath(); + return *focus_; } diff --git a/src/proc/mobject/session/scope-path.cpp b/src/proc/mobject/session/scope-path.cpp index 7fdb2428e..cb937e403 100644 --- a/src/proc/mobject/session/scope-path.cpp +++ b/src/proc/mobject/session/scope-path.cpp @@ -107,8 +107,8 @@ namespace session { { if (!leaf.isValid()) return; // invalid leaf defines invalid path.... - append_all (discoverScopePath(leaf), path_); /////////////////////////////TICKET #663 extension point for meta-clip support - reverse (path_.begin(), path_.end()); + clear(); + navigate (leaf); } @@ -271,8 +271,17 @@ namespace session { ScopePath::navigate (Scope const& target) { ___check_notBottom (this, "Navigating"); - *this = ScopePath(target); //////////////////////////////TICKET #424 - ///////////////////////////////TICKET #663 extension point for meta-clip support + std::vector otherPath; + append_all (discoverScopePath(target), otherPath); + reverse (otherPath.begin(), otherPath.end()); + ////////////////////////////TICKET #663 extension point for meta-clip support + ASSERT (path_[0] == otherPath[0]); // sharing the root element + this->path_ = otherPath; // TODO really relate the two paths, including a treatment for meta-clips + // - if both are in the same sequence (same head element): just attach the tail of the other + // - if the other path points into a sequence which is attached as meta-clip to the current sequence, + // then attach the other path below that meta-clip + // - otherwise use the first timeline, to which the other path's sequence is attached + // - otherwise, if all else fails, use the raw otherPath }