Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30799/src/net/sourceforge/bprocessor/gl/view
Modified Files:
Display.java
Log Message:
Grid drawing according to active coordinate-system
Creates empty library when library-loading fails
Index: Display.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v
retrieving revision 1.53
retrieving revision 1.54
diff -C2 -d -r1.53 -r1.54
*** Display.java 12 Nov 2007 19:20:18 -0000 1.53
--- Display.java 12 Nov 2007 21:16:26 -0000 1.54
***************
*** 1159,1227 ****
}
private static void draw(Grid grid) {
Vertex origin = grid.origin();
double size = grid.size();
double delta = grid.delta();
!
gl.glColor3fv(grey, 0);
gl.glLineWidth(1.0f);
- {
- double x = origin.getX() - size / 2;
- double y = origin.getY();
- double z = origin.getZ();
- gl.glBegin(GL.GL_LINE_STRIP);
- gl.glVertex3d(x, y, z);
- gl.glVertex3d(x + size, y, z);
- gl.glEnd();
- int n = (int) Math.floor((size / 2) / delta);
- y = origin.getY();
- for (int i = 0; i < n; i++) {
- y += delta;
- gl.glBegin(GL.GL_LINE_STRIP);
- gl.glVertex3d(x, y, z);
- gl.glVertex3d(x + size, y, z);
- gl.glEnd();
- }
- y = origin.getY();
- for (int i = 0; i < n; i++) {
- y -= delta;
- gl.glBegin(GL.GL_LINE_STRIP);
- gl.glVertex3d(x, y, z);
- gl.glVertex3d(x + size, y, z);
- gl.glEnd();
- }
- }
! {
! double x = origin.getX();
! double y = origin.getY() - size / 2;
! double z = origin.getZ();
! gl.glBegin(GL.GL_LINE_STRIP);
! gl.glVertex3d(x, y, z);
! gl.glVertex3d(x, y + size, z);
! gl.glEnd();
!
! int n = (int) Math.floor((size / 2) / delta);
! x = origin.getX();
! for (int i = 0; i < n; i++) {
! x += delta;
! gl.glBegin(GL.GL_LINE_STRIP);
! gl.glVertex3d(x, y, z);
! gl.glVertex3d(x, y + size, z);
! gl.glEnd();
! }
! x = origin.getX();
! for (int i = 0; i < n; i++) {
! x -= delta;
! gl.glBegin(GL.GL_LINE_STRIP);
! gl.glVertex3d(x, y, z);
! gl.glVertex3d(x, y + size, z);
! gl.glEnd();
! }
!
}
}
-
/**
*
--- 1159,1200 ----
}
+
private static void draw(Grid grid) {
Vertex origin = grid.origin();
double size = grid.size();
double delta = grid.delta();
! CoordinateSystem system = Project.getInstance().getActiveCoordinateSystem();
! Vertex v = system.getI();
! Vertex u = system.getJ();
! int n = (int) Math.floor((size / 2) / delta);
gl.glColor3fv(grey, 0);
gl.glLineWidth(1.0f);
! for (int i = 0; i < n; i++) {
! Vertex o = origin.add(u.copy(i * delta));
! Line line = new Line(o, v);
! Edge edge = line.edge(size / 2);
! draw(edge);
! }
! for (int i = 1; i < n; i++) {
! Vertex o = origin.add(u.copy(-i * delta));
! Line line = new Line(o, v);
! Edge edge = line.edge(size / 2);
! draw(edge);
! }
! for (int i = 0; i < n; i++) {
! Vertex o = origin.add(v.copy(i * delta));
! Line line = new Line(o, u);
! Edge edge = line.edge(size / 2);
! draw(edge);
! }
! for (int i = 1; i < n; i++) {
! Vertex o = origin.add(v.copy(-i * delta));
! Line line = new Line(o, u);
! Edge edge = line.edge(size / 2);
! draw(edge);
}
}
/**
*
|