]> git.lyx.org Git - lyx.git/blobdiff - src/Graph.h
Revert "Revert "Only set dummy X11 selection if we do not own it""
[lyx.git] / src / Graph.h
index 305cf70dcf0370ee36c7961b00966950df43c8fa..3f3404052f880b33a7cca7ffed89c92cfe2d99dc 100644 (file)
@@ -5,7 +5,7 @@
  * Licence details can be found in the file COPYING.
  *
  * \author Dekel Tsur (original code)
- * \author Richard Heck (re-implementation)
+ * \author Richard Kimberly Heck (re-implementation)
  *
  * Full author contact details are available in file CREDITS.
  */
@@ -16,6 +16,7 @@
 
 #include <list>
 #include <queue>
+#include <set>
 #include <vector>
 
 
@@ -30,10 +31,10 @@ public:
        ///
        typedef std::vector<int> EdgePath;
        /// \return a vector of the vertices from which "to" can be reached
-       std::vector<int> const getReachableTo(int to, bool clear_visited);
-       /// \return a vector of the vertices that can be reached from "from"
-       std::vector<int> const
-               getReachable(int from, bool only_viewable, bool clear_visited);
+       EdgePath const getReachableTo(int to, bool clear_visited);
+       /// \return a vector of the reachable vertices, avoiding all "excludes"
+       EdgePath const getReachable(int from, bool only_viewable,
+               bool clear_visited, std::set<int> excludes = std::set<int>());
        /// can "from" be reached from "to"?
        bool isReachable(int from, int to);
        /// find a path from "from" to "to". always returns one of the
@@ -47,20 +48,18 @@ public:
 private:
        ///
        bool bfs_init(int, bool clear_visited, std::queue<int> & Q);
-       /// used to recover a marked path 
-       void getMarkedPath(int from, int to, EdgePath & path);
        /// these represent the arrows connecting the nodes of the graph.
-       /// this is the basic representation of the graph: as a bunch of 
+       /// this is the basic representation of the graph: as a bunch of
        /// arrows.
        struct Arrow {
                ///
-               Arrow(int f, int t, int i): 
+               Arrow(int f, int t, int i):
                        from(f), to(t), id(i) {}
                /// the vertex at the tail of the arrow
                int from;
                /// the vertex at the head
                int to;
-               /// an id for this arrow, e.g., for use in describing paths 
+               /// an id for this arrow, e.g., for use in describing paths
                /// through the graph
                int id;
        };
@@ -88,7 +87,7 @@ private:
        /// of Format, this is easy, since the Format objects already have ints
        /// as identifiers.)
        std::vector<Vertex> vertices_;
-       
+
        /// a counter that we use to assign id's to the arrows
        /// FIXME This technique assumes a correspondence between the
        /// ids of the arrows and ids associated with Converters that