[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/view View.java, 1.97, 1.98
Status: Pre-Alpha
Brought to you by:
henryml
From: rimestad <rim...@us...> - 2006-07-06 15:10:40
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22938/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Changed the Drawing of point and line, and changed the implementation of getDirection in Line Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.97 retrieving revision 1.98 diff -C2 -d -r1.97 -r1.98 *** View.java 6 Jul 2006 10:43:00 -0000 1.97 --- View.java 6 Jul 2006 15:10:26 -0000 1.98 *************** *** 13,19 **** import net.sourceforge.bprocessor.model.ClippingPlane; - import net.sourceforge.bprocessor.model.Constructor; import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Defaults; import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Camera; --- 13,19 ---- import net.sourceforge.bprocessor.model.ClippingPlane; import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Defaults; + import net.sourceforge.bprocessor.model.Line; import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Camera; *************** *** 920,925 **** Iterator iter = cons.iterator(); while (iter.hasNext()) { ! Constructor c = (Constructor)iter.next(); ! drawVertexHit(c.getOrigin()); } } else { --- 920,933 ---- Iterator iter = cons.iterator(); while (iter.hasNext()) { ! Object o = iter.next(); ! if (o instanceof net.sourceforge.bprocessor.model.Point) { ! drawConstructorPoint((net.sourceforge.bprocessor.model.Point)o); ! } else if (o instanceof Line) { ! drawConstructorLine((Line)o); ! } else if (o instanceof Plane) { ! drawConstructorPlane((Plane)o); ! } else if (o instanceof CoordinateSystem) { ! drawConstructorCS((CoordinateSystem)o); ! } } } else { *************** *** 931,934 **** --- 939,997 ---- /** + * Draw the constructor Coordinate system + * @param system the coordinate system + */ + private void drawConstructorCS(CoordinateSystem system) { + // TODO Auto-generated method stub + + } + + /** + * Draw the plane constructor + * @param plane the constructorplane + */ + private void drawConstructorPlane(Plane plane) { + // TODO Auto-generated method stub + + } + + /** + * Draw the line constructor + * @param line the line the constructor represent + */ + private void drawConstructorLine(Line line) { + Vertex from = line.getOrigin(); + Vertex dir = line.getDirection(); + System.out.println(line); + gl.glColor3fv(CONSTRUCTOR_COLOR); + gl.glBegin(GL.GL_LINES); + gl.glVertex3d(from.getX(), from.getY(), from.getZ()); + gl.glVertex3d(dir.getX() + from.getX(), dir.getY() + from.getY(), dir.getZ() + from.getZ()); + gl.glEnd(); + GLUquadric quad = glu.gluNewQuadric(); + gl.glPushMatrix(); + gl.glTranslated(dir.getX() + from.getX(), dir.getY() + from.getY(), dir.getZ() + from.getZ()); + //gl.glRotated(-line.getDegreeZ(), 1, 0, 0); + gl.glRotated(line.getDegreeY(), 0, 0, 1); + gl.glRotated(-line.getDegreeX(), 0, 1, 0); + gl.glRotated(90, 0, 1, 0); + glu.gluCylinder(quad, 0.15, 0, 0.5, 10, 10); + gl.glPopMatrix(); + } + + /** + * Draw a constructor point + * @param point The constructor point + */ + private void drawConstructorPoint(net.sourceforge.bprocessor.model.Point point) { + Vertex origin = point.getOrigin(); + gl.glPointSize(8); + gl.glBegin(GL.GL_POINTS); + gl.glColor4fv(CONSTRUCTOR_COLOR); + gl.glVertex3d(origin.getX(), origin.getY(), origin.getZ()); + gl.glEnd(); + } + + /** * * @param gld The GLDrawable |