Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16066/src/net/sourceforge/bprocessor/gui
Modified Files:
PopupMenu.java
Log Message:
changed viewentiremodel to zoomon which takes a colelction and a aspect. changed the implementation to reflect that. Now the focus on method choose the closest edge in the surface in respect to angle...
Index: PopupMenu.java
===================================================================
RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** PopupMenu.java 31 Oct 2006 13:24:20 -0000 1.14
--- PopupMenu.java 31 Oct 2006 14:22:54 -0000 1.15
***************
*** 73,77 ****
Vertex n = (s.normal());
Camera current = Project.getInstance().getCurrentCamera();
! Vertex c = s.center();
double[] center = current.getCenter();
double[] cam = current.getCamera();
--- 73,77 ----
Vertex n = (s.normal());
Camera current = Project.getInstance().getCurrentCamera();
! Vertex cen = s.center();
double[] center = current.getCenter();
double[] cam = current.getCamera();
***************
*** 79,88 ****
Vertex r = new Vertex(dir);
n = r.projectOnto(n);
! Vertex roll = ((Edge)(s.getEdges().get(0))).getDirection();
! roll.normalize();
! current.setRoll(new double[]{roll.getX(), roll.getY(), roll.getZ()});
! current.setCenter(new double[]{c.getX(), c.getY(), c.getZ()});
! current.setCamera(new double[]{c.getX() + n.getX(), c.getY() + n.getY(), c.getZ() + n.getZ()});
! Project.getInstance().getCurrentCamera().viewEntireModel(1);
}
};
--- 79,103 ----
Vertex r = new Vertex(dir);
n = r.projectOnto(n);
! Iterator iter = s.getEdges().iterator();
! Vertex roll = new Vertex(current.getRoll());
! Vertex newroll = null;
! double angle = 2 * 3.14;
! while (iter.hasNext()) {
! Edge e = (Edge)iter.next();
! Vertex d = e.getDirection();
! double tmp = d.angle(roll);
! if (tmp < angle) {
! angle = tmp;
! newroll = d;
! }
! }
! newroll.normalize();
! current.setRoll(new double[]{newroll.getX(), newroll.getY(), newroll.getZ()});
! current.setCenter(new double[]{cen.getX(), cen.getY(), cen.getZ()});
! current.setCamera(new double[]{cen.getX() + n.getX(),
! cen.getY() + n.getY(), cen.getZ() + n.getZ()});
! Collection c = new LinkedList();
! c.add(s);
! Project.getInstance().getCurrentCamera().zoomOn(c, 1.0);
}
};
|