Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11582/src/net/sourceforge/bprocessor/gl/view
Modified Files:
Display.java PopupMenu.java
Log Message:
Grid drawing changed
Index: Display.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v
retrieving revision 1.95
retrieving revision 1.96
diff -C2 -d -r1.95 -r1.96
*** Display.java 26 Jun 2009 15:39:13 -0000 1.95
--- Display.java 9 Sep 2009 10:31:03 -0000 1.96
***************
*** 719,723 ****
private static void draw(Line line) {
! double size = (grid != null) ? grid.getSize() : 50;
Edge edge = line.edge(size);
--- 719,723 ----
private static void draw(Line line) {
! double size = (grid != null) ? grid.getWidth() : 50;
Edge edge = line.edge(size);
***************
*** 809,814 ****
for (Constructor current : constructors) {
if (!excluded.contains(current)) {
! double size = (grid != null) ? grid.getSize() / 2 : 50;
! Collection<Edge> guides = current.guides(size);
selectEdges(guides);
if (current instanceof CoordinateSystem) {
--- 809,820 ----
for (Constructor current : constructors) {
if (!excluded.contains(current)) {
! double size = (grid != null) ? grid.getWidth() / 2 : 50;
! Collection<Edge> guides = null;
! if (current instanceof Grid) {
! guides = ((Grid) current).guides(Project.getInstance().getActiveCoordinateSystem());
! } else {
! guides = current.guides(size);
! }
!
selectEdges(guides);
if (current instanceof CoordinateSystem) {
***************
*** 1310,1322 ****
private static void draw(Grid grid) {
!
gl.glColor3fv(grey, 0);
gl.glLineWidth(1.0f);
!
! Collection<Edge> guides = grid.guides(grid.getSize() / 2);
for (Edge edge : guides) {
draw(edge);
}
}
/**
--- 1316,1345 ----
private static void draw(Grid grid) {
! CoordinateSystem system = Project.getInstance().getActiveCoordinateSystem();
!
gl.glColor3fv(grey, 0);
gl.glLineWidth(1.0f);
! drawCircle(system, 0.3);
! //Collection<Edge> guides = grid.guides(grid.getWidth() / 2);
! Collection<Edge> guides = grid.guides(system);
for (Edge edge : guides) {
draw(edge);
}
}
+
+ private static void drawCircle(CoordinateSystem system, double radius) {
+ int n = 32;
+ gl.glBegin(GL.GL_LINE_LOOP);
+ for (int i = 0; i < n; i++) {
+ double angle = 2 * i * Math.PI / n;
+ double x = Math.cos(angle) * radius;
+ double y = Math.sin(angle) * radius;
+ Vertex v = new Vertex(x, y, 0);
+ v = system.unTranslate(v);
+ gl.glVertex3d(v.getX(), v.getY(), v.getZ());
+ }
+ gl.glEnd();
+ }
+
/**
Index: PopupMenu.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/PopupMenu.java,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** PopupMenu.java 29 Jun 2009 10:57:48 -0000 1.36
--- PopupMenu.java 9 Sep 2009 10:31:03 -0000 1.37
***************
*** 443,446 ****
--- 443,453 ----
}
+ AbstractAction item = new SpaceMenuAction(sp, "Consistency Check") {
+ public void actionPerformed(ActionEvent arg0) {
+ space.verify();
+ }
+ };
+ menu.add(item);
+
if (CHECKS) {
AbstractAction check = new SpaceMenuAction(sp, "Consistency Check") {
|