summaryrefslogtreecommitdiffstats
path: root/kig/misc/calcpaths.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitce599e4f9f94b4eb00c1b5edb85bce5431ab3df2 (patch)
treed3bb9f5d25a2dc09ca81adecf39621d871534297 /kig/misc/calcpaths.h
downloadtdeedu-ce599e4f9f94b4eb00c1b5edb85bce5431ab3df2.tar.gz
tdeedu-ce599e4f9f94b4eb00c1b5edb85bce5431ab3df2.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeedu@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kig/misc/calcpaths.h')
-rw-r--r--kig/misc/calcpaths.h88
1 files changed, 88 insertions, 0 deletions
diff --git a/kig/misc/calcpaths.h b/kig/misc/calcpaths.h
new file mode 100644
index 00000000..620558a3
--- /dev/null
+++ b/kig/misc/calcpaths.h
@@ -0,0 +1,88 @@
+// Copyright (C) 2002 Dominique Devriese <devriese@kde.org>
+
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+// 02110-1301, USA.
+
+#ifndef KIG_MISC_CALCPATHS_H
+#define KIG_MISC_CALCPATHS_H
+
+#include "../objects/common.h"
+
+/**
+ * This function sorts \p os such that they're in the right order for
+ * calc()-ing. This means that child objects must appear after their
+ * parents ( for you graph people, this is just a topological sort.. )
+ */
+std::vector<ObjectCalcer*> calcPath( const std::vector<ObjectCalcer*>& os );
+
+/**
+ * This is a different function for more or less the same purpose. It
+ * takes a few Objects, which are considered to have been calced
+ * already. Then, it puts the necessary part of their children in the
+ * right order, so that calc()-ing correctly updates all of their data
+ * ( they're calc'ed in the right order, i mean... ). The objects in
+ * from are normally not included in the output, unless they appear
+ * somewhere in the middle of the calc-path towards to...
+ */
+std::vector<ObjectCalcer*> calcPath( const std::vector<ObjectCalcer*>& from, const ObjectCalcer* to );
+
+/**
+ * This function returns all objects on the side of the path through
+ * the dependency tree from from down to to. This means that we look
+ * for any objects that don't depend on any of the objects in from
+ * themselves, but of which one of the direct children does. We need
+ * this function for Locus stuff...
+ */
+std::vector<ObjectCalcer*> sideOfTreePath( const std::vector<ObjectCalcer*>& from, const ObjectCalcer* to );
+
+/**
+ * This function returns all objects above the \p given in the
+ * dependency graph. The \p given objects are also included
+ * themselves..
+ */
+std::vector<ObjectCalcer*> getAllParents( const std::vector<ObjectCalcer*>& objs );
+/**
+ * \overload
+ */
+std::vector<ObjectCalcer*> getAllParents( ObjectCalcer* obj );
+
+/**
+ * This function returns all objects below the objects in \p objs in the
+ * dependency graphy. The objects in \p objs are also included
+ * themselves..
+ */
+std::set<ObjectCalcer*> getAllChildren( const std::vector<ObjectCalcer*> objs );
+
+/**
+ * \overload
+ */
+std::set<ObjectCalcer*> getAllChildren( ObjectCalcer* obj );
+
+/**
+ * Returns true if \p o is a descendant of any of the objects in \p os..
+ */
+bool isChild( const ObjectCalcer* o, const std::vector<ObjectCalcer*>& os );
+
+/**
+ * Return true if the given \p point is ( by construction ) on the given
+ * \p curve. This means that it is either a constrained point on the
+ * curve, or the curve is constructed through the point, or the point
+ * is an intersection point of the curve with another curve.
+ * Note that it is assumed that the given point is in fact a point and the
+ * given curve is in fact a curve.
+ */
+bool isPointOnCurve( const ObjectCalcer* point, const ObjectCalcer* curve );
+
+#endif