Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5541/src/net/sourceforge/bprocessor/model
Modified Files:
Geometry.java Camera.java
Log Message:
made a bit generic
Index: Camera.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Camera.java,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** Camera.java 29 Dec 2006 13:31:55 -0000 1.31
--- Camera.java 2 Jan 2007 18:30:33 -0000 1.32
***************
*** 59,63 ****
/** The list of clipplanes to this camera*/
! private ArrayList clipplanes;
/**
--- 59,63 ----
/** The list of clipplanes to this camera*/
! private ArrayList<ClippingPlane> clipplanes;
/**
***************
*** 65,69 ****
*/
Camera() {
! this.clipplanes = new ArrayList();
}
--- 65,69 ----
*/
Camera() {
! this.clipplanes = new ArrayList<ClippingPlane>();
}
***************
*** 82,86 ****
this.roll = roll;
this.focalwidth = 35;
! this.clipplanes = new ArrayList();
if (type == ORTHOGRAPHIC || type == PERSPECTIVE) {
this.type = type;
--- 82,86 ----
this.roll = roll;
this.focalwidth = 35;
! this.clipplanes = new ArrayList<ClippingPlane>();
if (type == ORTHOGRAPHIC || type == PERSPECTIVE) {
this.type = type;
***************
*** 426,434 ****
*/
public void zoomOn(Collection c, double aspect) {
! Set allVertices = Geometry.collect(c);
if (!allVertices.isEmpty()) {
//Computing center and radius of the minimal bounding sphere
! Set notTested = new HashSet(allVertices);
double radius = 0;
Vertex p1 = null;
--- 426,434 ----
*/
public void zoomOn(Collection c, double aspect) {
! Set<Vertex> allVertices = Geometry.collect(c);
if (!allVertices.isEmpty()) {
//Computing center and radius of the minimal bounding sphere
! Set<Vertex> notTested = new HashSet<Vertex>(allVertices);
double radius = 0;
Vertex p1 = null;
***************
*** 538,542 ****
*/
public List getAttributes() {
! ArrayList res = new ArrayList();
res.add(new Attribute("Name", getName()));
Attribute a = new Attribute("Type", type == ORTHOGRAPHIC ? "Orthographic" : "Perspective");
--- 538,542 ----
*/
public List getAttributes() {
! ArrayList<Attribute> res = new ArrayList<Attribute>();
res.add(new Attribute("Name", getName()));
Attribute a = new Attribute("Type", type == ORTHOGRAPHIC ? "Orthographic" : "Perspective");
***************
*** 544,558 ****
res.add(a);
! ArrayList cam = new ArrayList(3);
cam.add(new Attribute("X", new Double(getCamera()[0])));
cam.add(new Attribute("Y", new Double(getCamera()[1])));
cam.add(new Attribute("Z", new Double(getCamera()[2])));
res.add(new Attribute("Eye", cam));
! ArrayList cen = new ArrayList(3);
cen.add(new Attribute("X", new Double(getCenter()[0])));
cen.add(new Attribute("Y", new Double(getCenter()[1])));
cen.add(new Attribute("Z", new Double(getCenter()[2])));
res.add(new Attribute("Look-at", cen));
! ArrayList roll = new ArrayList(3);
roll.add(new Attribute("X", new Double(getRoll()[0])));
roll.add(new Attribute("Y", new Double(getRoll()[1])));
--- 544,558 ----
res.add(a);
! ArrayList<Attribute> cam = new ArrayList<Attribute>(3);
cam.add(new Attribute("X", new Double(getCamera()[0])));
cam.add(new Attribute("Y", new Double(getCamera()[1])));
cam.add(new Attribute("Z", new Double(getCamera()[2])));
res.add(new Attribute("Eye", cam));
! ArrayList<Attribute> cen = new ArrayList<Attribute>(3);
cen.add(new Attribute("X", new Double(getCenter()[0])));
cen.add(new Attribute("Y", new Double(getCenter()[1])));
cen.add(new Attribute("Z", new Double(getCenter()[2])));
res.add(new Attribute("Look-at", cen));
! ArrayList<Attribute> roll = new ArrayList<Attribute>(3);
roll.add(new Attribute("X", new Double(getRoll()[0])));
roll.add(new Attribute("Y", new Double(getRoll()[1])));
***************
*** 639,643 ****
currentCamera.setCamera(new double[]{cen.getX() + n.getX(),
cen.getY() + n.getY(), cen.getZ() + n.getZ()});
! Collection < Surface > c = new LinkedList < Surface > ();
c.add(s);
currentCamera.zoomOn(c, 1.0);
--- 639,643 ----
currentCamera.setCamera(new double[]{cen.getX() + n.getX(),
cen.getY() + n.getY(), cen.getZ() + n.getZ()});
! Collection<Surface> c = new LinkedList<Surface>();
c.add(s);
currentCamera.zoomOn(c, 1.0);
Index: Geometry.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometry.java,v
retrieving revision 1.40
retrieving revision 1.41
diff -C2 -d -r1.40 -r1.41
*** Geometry.java 13 Dec 2006 17:43:29 -0000 1.40
--- Geometry.java 2 Jan 2007 18:30:33 -0000 1.41
***************
*** 399,405 ****
* @return Set of vertices
*/
! public static Set collect(Collection geometrics) {
Iterator it = geometrics.iterator();
! Set result = new HashSet();
while (it.hasNext()) {
Object o = it.next();
--- 399,405 ----
* @return Set of vertices
*/
! public static Set<Vertex> collect(Collection geometrics) {
Iterator it = geometrics.iterator();
! Set<Vertex> result = new HashSet<Vertex>();
while (it.hasNext()) {
Object o = it.next();
|