Author: tomithy
Date: 2010-08-10 21:36:42 -0700 (Tue, 10 Aug 2010)
New Revision: 21332

Modified:
   cytoscapeweb/branches/gsoc2010/gbeb/src/gbeb/util/delaunay/ITriangle.as
   
cytoscapeweb/branches/gsoc2010/gbeb/src/gbeb/view/operator/router/GBEBRouter.as
Log:
-Version 0.9 
Cleaned up codes.

Modified: 
cytoscapeweb/branches/gsoc2010/gbeb/src/gbeb/util/delaunay/ITriangle.as
===================================================================
--- cytoscapeweb/branches/gsoc2010/gbeb/src/gbeb/util/delaunay/ITriangle.as     
2010-08-11 04:34:41 UTC (rev 21331)
+++ cytoscapeweb/branches/gsoc2010/gbeb/src/gbeb/util/delaunay/ITriangle.as     
2010-08-11 04:36:42 UTC (rev 21332)
@@ -1,3 +1,33 @@
+/*
+This file is part of Cytoscape Web.
+Copyright (c) 2009, The Cytoscape Consortium (www.cytoscape.org)
+
+The Cytoscape Consortium is:
+- Agilent Technologies
+- Institut Pasteur
+- Institute for Systems Biology
+- Memorial Sloan-Kettering Cancer Center
+- National Center for Integrative Biomedical Informatics
+- Unilever
+- University of California San Diego
+- University of California San Francisco
+- University of Toronto
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+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.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
 package gbeb.util.delaunay
 {
        public class ITriangle {
@@ -2,5 +32,14 @@
                
+               // ========[ PUBLIC PROPERTIES 
]============================================================
+               
                public var p1, p2, p3; //the 3 points that make up the triangle 
(references key positions in points array)
                public var eArray:Array; //this will store the edge IDs of all 
three triangle edges
                
+               
+               // ========[ CONSTRUCTOR 
]==================================================================
+               
+               /**
+                * This constructor will throw an error, as this is an abstract 
class. 
+                */
+               
                public function ITriangle() {

Modified: 
cytoscapeweb/branches/gsoc2010/gbeb/src/gbeb/view/operator/router/GBEBRouter.as
===================================================================
--- 
cytoscapeweb/branches/gsoc2010/gbeb/src/gbeb/view/operator/router/GBEBRouter.as 
    2010-08-11 04:34:41 UTC (rev 21331)
+++ 
cytoscapeweb/branches/gsoc2010/gbeb/src/gbeb/view/operator/router/GBEBRouter.as 
    2010-08-11 04:36:42 UTC (rev 21332)
@@ -14,6 +14,7 @@
     import flash.geom.Rectangle;
     import flash.text.TextField;
     
+    import gbeb.util.GBEBInterfaceUtil;
     import gbeb.util.GeometryUtil;
     import gbeb.util.delaunay.Delaunay;
     import gbeb.util.delaunay.ITriangle;
@@ -521,10 +522,8 @@
             meshEdge.name = (cycles++).toString(); //debug
             
             getNodesForMeshEdge(returnIndexFromXY(s1.centroid.x, 
s1.centroid.y), meshEdge, meshEdge.source, "None");
-                                               
-                                               
             
-                                               
if(GeometryUtil.calculateDistanceBetweenNodes(meshEdge.source, meshEdge.target) 
> 300) trace("GBEBRouter: meshEdge " + meshEdge.name + 
+                                               
if(GBEBInterfaceUtil.calculateDistanceBetweenNodes(meshEdge.source, 
meshEdge.target) > 300) trace("GBEBRouter: meshEdge " + meshEdge.name + 
                                                        " is too long " + 
gradient);
             
             //trace("Mesh: GenerateMeshEdges: Assigning names: " + 
meshEdge.x1);
@@ -844,11 +843,11 @@
                                                                                
                //trace("GBEBRouter: mergeNodes_All: Tracing Source Node: " + 
(currNode != null) + " | Target Node: " + (currEdge.target != null));
                                         
                         for each (var edge2:MeshEdge in _meshEdgeArray) {
-                            if 
(GeometryUtil.calculateDistanceBetweenNodes(currNode, edge2.source) < 
_meshNodesMinDistance) {
+                            if 
(GBEBInterfaceUtil.calculateDistanceBetweenNodes(currNode, edge2.source) < 
_meshNodesMinDistance) {
                                 mergeNodes_Pairwise(currEdge, "source", edge2, 
"source");
                                                                                
                                                nodeMoved = true;
                                 continue;
-                            } else if  
(GeometryUtil.calculateDistanceBetweenNodes(currNode, edge2.target) < 
_meshNodesMinDistance) {
+                            } else if  
(GBEBInterfaceUtil.calculateDistanceBetweenNodes(currNode, edge2.target) < 
_meshNodesMinDistance) {
                                 mergeNodes_Pairwise(currEdge, "source", edge2, 
"target");
                                                                                
                                                nodeMoved = true;
                                 continue;
@@ -857,11 +856,11 @@
                                                                                
                                //if(nodeMoved) break;
                             currNode = currEdge.target;
                                             
-                            if 
(GeometryUtil.calculateDistanceBetweenNodes(currNode, edge2.source) < 
_meshNodesMinDistance) {   
+                            if 
(GBEBInterfaceUtil.calculateDistanceBetweenNodes(currNode, edge2.source) < 
_meshNodesMinDistance) {   
                                 mergeNodes_Pairwise(currEdge, "target", edge2, 
"source");
                                                                                
                                                nodeMoved = true;
                                 continue;
-                            } else if 
(GeometryUtil.calculateDistanceBetweenNodes(currNode, edge2.target) < 
_meshNodesMinDistance) {
+                            } else if 
(GBEBInterfaceUtil.calculateDistanceBetweenNodes(currNode, edge2.target) < 
_meshNodesMinDistance) {
                                 mergeNodes_Pairwise(currEdge, "target", edge2, 
"target");
                                                                                
                                                nodeMoved = true;
                                 continue;
@@ -935,10 +934,9 @@
                                        
                                        var triangles:Array = 
Delaunay.triangulate(pointsArray);
                                        
-                                       Delaunay.drawDelaunay(triangles, 
pointsArray, visualization);
-                                       // Uncomment to draw Delaunay mesh
+                                       
GBEBInterfaceUtil.drawDelaunay(triangles, pointsArray, visualization);
                                        
-                                       _mesh.edges = 
Delaunay.convertToMeshEdges(triangles, pointsArray, _mesh.nodes);
+                                       _mesh.edges = 
GBEBInterfaceUtil.convertToMeshEdges(triangles, pointsArray, _mesh.nodes);
                                }
 
                                

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to