Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28676
Modified Files:
AbstractView.java
Log Message:
added special drawing of construction lines
Index: AbstractView.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/AbstractView.java,v
retrieving revision 1.61
retrieving revision 1.62
diff -C2 -d -r1.61 -r1.62
*** AbstractView.java 28 Nov 2005 22:24:50 -0000 1.61
--- AbstractView.java 29 Nov 2005 19:02:51 -0000 1.62
***************
*** 1032,1044 ****
*/
private void drawEdge(Edge e) {
Vertex to = e.getTo();
Vertex from = e.getFrom();
if (to != null && from != null) {
! gl.glBegin(GL.GL_LINE_STRIP);
! gl.glVertex3d(to.getX(), to.getY(), to.getZ());
! gl.glVertex3d(from.getX(), from.getY(), from.getZ());
! gl.glEnd();
}
! }
/**
--- 1032,1060 ----
*/
private void drawEdge(Edge e) {
+
Vertex to = e.getTo();
Vertex from = e.getFrom();
if (to != null && from != null) {
! if (e.getConstructor()) {
! Vertex minus = to.minus(from);
! minus.scale(1 / minus.length());
! gl.glEnable(GL.GL_LINE_STIPPLE);
! gl.glBegin(GL.GL_LINE_STRIP);
! gl.glVertex3d(to.getX() + minus.getX() * 50,
! to.getY() + minus.getY() * 50,
! to.getZ() + minus.getZ() * 50);
! gl.glVertex3d(from.getX() + minus.getX() * -50,
! from.getY() + minus.getY() * -50,
! from.getZ() + minus.getZ() * -50);
! gl.glEnd();
! gl.glDisable(GL.GL_LINE_STIPPLE);
! } else {
! gl.glBegin(GL.GL_LINE_STRIP);
! gl.glVertex3d(to.getX(), to.getY(), to.getZ());
! gl.glVertex3d(from.getX(), from.getY(), from.getZ());
! gl.glEnd();
! }
}
! }
/**
|