Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29421/src/net/sourceforge/bprocessor/model
Modified Files:
Space.java Plane.java CoordinateSystem.java
Log Message:
Implemented
- Plane.negate()
- CoordinateSystem.origin()
- CoordinteSystem.plane()
Fixed:
- Space.getElements() (now returns empty set if no elements)
Index: Space.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Space.java 22 Aug 2005 08:46:44 -0000 1.4
--- Space.java 6 Nov 2005 16:25:34 -0000 1.5
***************
*** 7,10 ****
--- 7,11 ----
package net.sourceforge.bprocessor.model;
+ import java.util.HashSet;
import java.util.Set;
***************
*** 65,69 ****
*/
public Set getElements() {
! return elements;
}
--- 66,74 ----
*/
public Set getElements() {
! if (elements == null) {
! return new HashSet();
! } else {
! return elements;
! }
}
Index: CoordinateSystem.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** CoordinateSystem.java 30 Oct 2005 15:50:38 -0000 1.6
--- CoordinateSystem.java 6 Nov 2005 16:25:34 -0000 1.7
***************
*** 108,111 ****
--- 108,131 ----
}
+ /**
+ * Return the origin
+ * @return The origin
+ */
+ public Vertex origin() {
+ return origin;
+ }
+
+ /**
+ * Return the xy plane of this CoordinateSystem
+ * @return The xy plane
+ */
+ public Plane plane() {
+ double d = 0;
+ double a = n.getX();
+ double b = n.getY();
+ double c = n.getZ();
+ d = -(a * origin.getX() + b * origin.getY() + c * origin.getZ());
+ return new Plane(a, b, c, d);
+ }
/**
Index: Plane.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Plane.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** Plane.java 1 Nov 2005 07:43:06 -0000 1.8
--- Plane.java 6 Nov 2005 16:25:34 -0000 1.9
***************
*** 55,58 ****
--- 55,66 ----
/**
+ * Negate the plane
+ * @return The negated plane
+ */
+ public Plane negate() {
+ return new Plane(-a, -b, -c, -d);
+ }
+
+ /**
* Find the orthogonal plane to this plane
* @param rayIn the ray into the view
|