Author: paperwing
Date: 2011-06-29 07:57:46 -0700 (Wed, 29 Jun 2011)
New Revision: 25974

Modified:
   
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/Graphics.java
   
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/Vector3.java
Log:


Modified: 
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/Graphics.java
===================================================================
--- 
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/Graphics.java
 2011-06-29 14:21:33 UTC (rev 25973)
+++ 
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/Graphics.java
 2011-06-29 14:57:46 UTC (rev 25974)
@@ -700,28 +700,30 @@
                        // Extend by c * tan(theta/2)
                        extend2 = EDGE_RADIUS * Math.tan(currentAngle / 2);
        
-                       // TODO: Find alternative
-                       if (Double.isNaN(extend2)) {
-                               extend2 = 0;
-                       }
                        
-//                     if (framesElapsed == 2) {
-//                             System.out.println("Segment: " + i);
-//                             System.out.println("Current segment angle: " + 
currentAngle);
-//                             System.out.println("Current extend1: " + 
extend1);
-//                             System.out.println("Current extend2: " + 
extend2);
-//                     }
-                       
                        direction = points[i + 1].subtract(points[i]);
                        direction.normalizeLocal();
-                       drawSingleEdge(gl, 
-                                       
points[i].subtract(direction.multiply(extend1)),
-                                       points[i + 
1].add(direction.multiply(extend2)));
+       
+                       if (framesElapsed == 2) {
+                               System.out.println("Segment: " + i);
+                               System.out.println("Current segment angle: " + 
currentAngle);
+                               System.out.println("Current extend1: " + 
extend1);
+                               System.out.println("Current extend2: " + 
extend2);
+                               System.out.println("Current p0: " + p0);
+                               System.out.println("Current p1: " + p1);
+                               System.out.println("Current p2: " + p2);
+                               System.out.println("Current direction: " + 
direction);
+                               
+                       }
                        
 //                     drawSingleEdge(gl, 
-//                                     points[i],
-//                                     points[i + 1]);
+//                                     
points[i].subtract(direction.multiply(extend1)),
+//                                     points[i + 
1].add(direction.multiply(extend2)));
                        
+                       drawSingleEdge(gl, 
+                                       points[i],
+                                       points[i + 1]);
+                       
                        extend1 = extend2;
                }
                

Modified: 
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/Vector3.java
===================================================================
--- 
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/Vector3.java
  2011-06-29 14:21:33 UTC (rev 25973)
+++ 
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/Vector3.java
  2011-06-29 14:57:46 UTC (rev 25974)
@@ -73,8 +73,10 @@
                // TODO: Check if alternative is needed to prevent NaN
                double cosArgument = (x * other.x + y * other.y + z * 
other.z)/Math.sqrt(lengthSquare * otherLengthSquare);
                
-               if (cosArgument >= 1) {
+               if (Double.isNaN(cosArgument)) {
                        return 0;
+               } else if (cosArgument >= 1) {
+                       return 0;
                } else if (cosArgument <= -1) {
                        return Math.PI;
                } else {

-- 
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