Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7178/src/net/sourceforge/bprocessor/model
Modified Files:
Project.java
Log Message:
Added cams to the project
Index: Project.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** Project.java 16 Jan 2006 13:46:59 -0000 1.18
--- Project.java 19 Jan 2006 17:23:35 -0000 1.19
***************
*** 54,57 ****
--- 54,62 ----
private long spaceId;
+ /** The domains */
+ private HashMap cameras = new HashMap();
+ /** The domain id */
+ private long cameraId;
+
/**
* Get the instance
***************
*** 70,73 ****
--- 75,79 ----
public Project() {
super();
+ addCams(); // To do camera initializasation (MAYBE IT SHOULD NOT BE HERE)
observers = new LinkedList();
}
***************
*** 109,115 ****
--- 115,143 ----
surfaces.clear();
vertices.clear();
+ cameras.clear();
+ addCams();
changed(this);
}
+ /**
+ * Add the default cameras to cameras
+ */
+ private void addCams() {
+ Camera cam0 = Camera.create(Camera.VIEW_3D); // The starting cam
+ cam0.setId(new Long(cameraId++));
+ cameras.put(cam0.getId(), cam0);
+ Camera cam1 = Camera.create(Camera.VIEW_3D); // Reset to 3D position
+ cam1.setId(new Long(cameraId++));
+ cameras.put(cam1.getId(), cam1);
+ Camera cam2 = Camera.create(Camera.VIEW_XY); // Reset to 2D position XY with ortho
+ cam1.setId(new Long(cameraId++));
+ cameras.put(cam2.getId(), cam2);
+ Camera cam3 = Camera.create(Camera.VIEW_XZ); // Reset to 2D position XZ with ortho
+ cam1.setId(new Long(cameraId++));
+ cameras.put(cam3.getId(), cam3);
+ Camera cam4 = Camera.create(Camera.VIEW_YZ); // Reset to 2D position YZ with ortho
+ cam1.setId(new Long(cameraId++));
+ cameras.put(cam4.getId(), cam4);
+ }
/**
***************
*** 303,306 ****
--- 331,361 ----
/**
+ * Intern a camera
+ * @param c The camera
+ */
+ public void intern(Camera c) {
+ c.setId(new Long(cameraId++));
+ cameras.put(c.getId(), c);
+ changed(this);
+ }
+
+ /**
+ * Get all cameras
+ * @return The cameras
+ */
+ public Set getCameras() {
+ return new HashSet(cameras.values());
+ }
+
+ /**
+ * Find Camera by id
+ * @param id The id
+ * @return The Camera
+ */
+ public Camera findCameraById(Long id) {
+ return (Camera)cameras.get(id);
+ }
+
+ /**
* Find vertex based upon location and delta
* @param x The x coordinate
|