|
From: <ob...@us...> - 2010-04-20 09:07:18
|
Revision: 722
http://scstudio.svn.sourceforge.net/scstudio/?rev=722&view=rev
Author: obouda
Date: 2010-04-20 09:07:09 +0000 (Tue, 20 Apr 2010)
Log Message:
-----------
addition of forgotten files to r721 and r715
Added Paths:
-----------
trunk/doc/help/pictures/add_instances_options.png
trunk/src/view/visio/addon/shapeutils.h
Added: trunk/doc/help/pictures/add_instances_options.png
===================================================================
(Binary files differ)
Property changes on: trunk/doc/help/pictures/add_instances_options.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/src/view/visio/addon/shapeutils.h
===================================================================
--- trunk/src/view/visio/addon/shapeutils.h (rev 0)
+++ trunk/src/view/visio/addon/shapeutils.h 2010-04-20 09:07:09 UTC (rev 722)
@@ -0,0 +1,73 @@
+/*
+ * scstudio - Sequence Chart Studio
+ * http://scstudio.sourceforge.net
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * Copyright (c) 2010 Ondrej Bouda <ond...@wh...>
+ *
+ * $$
+ */
+
+#pragma once
+#include "stdafx.h"
+#include "extract.h"
+
+enum TOrderingDirection {
+ ORDER_ASC,
+ ORDER_DESC,
+};
+
+/**
+ * A utility class for functionality on a Visio Shape.
+ */
+class CShapeUtils
+{
+public:
+
+ static double GetShapeBeginX(Visio::IVShapePtr shape) { return shape->CellsSRC[visSectionObject][visRowXForm1D][vis1DBeginX]->Result[""]; }
+ static double GetShapeEndX(Visio::IVShapePtr shape) { return shape->CellsSRC[visSectionObject][visRowXForm1D][vis1DEndX]->Result[""]; }
+ static double GetShapeBeginY(Visio::IVShapePtr shape) { return shape->CellsSRC[visSectionObject][visRowXForm1D][vis1DBeginY]->Result[""]; }
+ static double GetShapeEndY(Visio::IVShapePtr shape) { return shape->CellsSRC[visSectionObject][visRowXForm1D][vis1DEndY]->Result[""]; }
+
+};
+
+/**
+ * Orders two shapes according to their X-coordinate
+ */
+bool operator < (const Visio::IVShapePtr shapeOne, const Visio::IVShapePtr shapeTwo)
+{
+ return CShapeUtils::GetShapeBeginX(shapeOne) < CShapeUtils::GetShapeBeginX(shapeTwo);
+}
+
+bool operator > (const Visio::IVShapePtr shapeOne, const Visio::IVShapePtr shapeTwo)
+{
+ return CShapeUtils::GetShapeBeginX(shapeTwo) < CShapeUtils::GetShapeBeginX(shapeOne);
+}
+
+/**
+ * Shape comparator suitable for sorting. Allows for ascending or descending order.
+ */
+class CShapeComparator
+{
+ TOrderingDirection direction;
+public:
+ CShapeComparator(TOrderingDirection direction=ORDER_ASC) : direction(direction) {}
+
+ bool operator()(const Visio::IVShapePtr shapeOne, const Visio::IVShapePtr shapeTwo)
+ {
+ if (direction == ORDER_ASC)
+ return (shapeOne < shapeTwo);
+ else
+ return (shapeTwo < shapeOne);
+ }
+};
+
+// $Id$
Property changes on: trunk/src/view/visio/addon/shapeutils.h
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|