summaryrefslogtreecommitdiffstats
path: root/src/sp-mesh-patch.cpp
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2012-05-23 12:00:49 +0000
committertavmjong-free <tavmjong@free.fr>2012-05-23 12:00:49 +0000
commit0ea9b448ee16fe941d46395c2877f4d2e815b9ed (patch)
treea49cb57d691df46475d1e9fe197aeade8b0fa10c /src/sp-mesh-patch.cpp
parentCorrect improper flipping of sRGB transform from RGB to BGR with cairo change... (diff)
downloadinkscape-0ea9b448ee16fe941d46395c2877f4d2e815b9ed.tar.gz
inkscape-0ea9b448ee16fe941d46395c2877f4d2e815b9ed.zip
Add Mesh tool (experimental, requires Cario >= 1.11.4, disabled by default).
(bzr r11406)
Diffstat (limited to 'src/sp-mesh-patch.cpp')
-rw-r--r--src/sp-mesh-patch.cpp63
1 files changed, 63 insertions, 0 deletions
diff --git a/src/sp-mesh-patch.cpp b/src/sp-mesh-patch.cpp
new file mode 100644
index 000000000..ff1a18a01
--- /dev/null
+++ b/src/sp-mesh-patch.cpp
@@ -0,0 +1,63 @@
+/** @file
+ * @gradient meshpatch class.
+ */
+/* Authors:
+ * Lauris Kaplinski <lauris@kaplinski.com>
+ * bulia byak
+ * Johan Engelen <j.b.c.engelen@ewi.utwente.nl>
+ * Jon A. Cruz <jon@joncruz.org>
+ * Tavmjong Bah <tavjong@free.fr>
+ *
+ * Copyright (C) 1999,2005 authors
+ * Copyright (C) 2010 Jon A. Cruz
+ * Copyright (C) 2012 Tavmjong Bah
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+#include "sp-mesh-patch.h"
+#include "style.h"
+
+SPMeshPatch* SPMeshPatch::getNextMeshPatch()
+{
+ SPMeshPatch *result = 0;
+
+ for (SPObject* obj = getNext(); obj && !result; obj = obj->getNext()) {
+ if (SP_IS_MESHPATCH(obj)) {
+ result = SP_MESHPATCH(obj);
+ }
+ }
+
+ return result;
+}
+
+SPMeshPatch* SPMeshPatch::getPrevMeshPatch()
+{
+ SPMeshPatch *result = 0;
+
+ for (SPObject* obj = getPrev(); obj; obj = obj->getPrev()) {
+ // The closest previous SPObject that is an SPMeshPatch *should* be ourself.
+ if (SP_IS_MESHPATCH(obj)) {
+ SPMeshPatch* meshpatch = SP_MESHPATCH(obj);
+ // Sanity check to ensure we have a proper sibling structure.
+ if (meshpatch->getNextMeshPatch() == this) {
+ result = meshpatch;
+ } else {
+ g_warning("SPMeshPatch previous/next relationship broken");
+ }
+ break;
+ }
+ }
+
+ return result;
+}
+
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+ indent-tabs-mode:nil
+ fill-column:99
+ End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :