Thread: [Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/view View.java, 1.120, 1.121
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2006-07-23 09:17:50
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16655/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Possible to draw in active plane Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.120 retrieving revision 1.121 diff -C2 -d -r1.120 -r1.121 *** View.java 21 Jul 2006 19:23:33 -0000 1.120 --- View.java 23 Jul 2006 09:17:44 -0000 1.121 *************** *** 263,266 **** --- 263,269 ---- private boolean selectIntersections; + /** Excluded for hit-detection */ + private Collection excluded; + /** The drawing mode. Either wireframe, solid og lighting */ protected int drawMode = View.LIGHTING_MODE; *************** *** 1055,1059 **** drawConstructorLine(cs.getOrigin(), n, dist); } ! } } --- 1058,1087 ---- drawConstructorLine(cs.getOrigin(), n, dist); } ! } else { ! if (cs.isActive()) { ! Vertex origin = cs.getOrigin(); ! Vertex v = i.copy(); ! Vertex u = j.copy(); ! v.scale(5); ! u.scale(5); ! Vertex a = origin.add(u).minus(v); ! Vertex b = origin.add(u).add(v); ! Vertex c = origin.minus(u).add(v); ! Vertex d = origin.minus(u).minus(v); ! ! gl.glEnable(GL.GL_POLYGON_STIPPLE); ! gl.glPolygonStipple(seethrough); ! if (colorize) { ! gl.glColor3fv(CONSTRUCTOR_COLOR); ! } ! gl.glBegin(GL.GL_QUADS); ! gl.glVertex3d(a.getX(), a.getY(), a.getZ()); ! gl.glVertex3d(b.getX(), b.getY(), b.getZ()); ! gl.glVertex3d(c.getX(), c.getY(), c.getZ()); ! gl.glVertex3d(d.getX(), d.getY(), d.getZ()); ! gl.glEnd(); ! gl.glDisable(GL.GL_POLYGON_STIPPLE); ! } ! } } *************** *** 1691,1726 **** while (iter.hasNext()) { Constructor current = (Constructor) iter.next(); ! if (camera.getType() == Camera.PERSPECTIVE) { ! dist = (current.getOrigin().minus(v)).length() * scale; ! } ! if (selectIntersections) { ! pushName(gl, current.getOrigin()); ! drawVertexHit(current.getOrigin()); ! popName(gl); ! if (current instanceof Line) { ! Line line = (Line) current; ! ! Vertex origin = line.getOrigin(); ! Vertex direction = line.getDirection().copy(); ! direction.scale(View.gridSize() * 2); ! Vertex from = origin.minus(direction); ! Vertex to = origin.add(direction); ! Edge constructor = new Edge(from, to); ! constructor.setConstructor(true); ! ! Vertex tip = line.tip(dist / 16 + dist / 20); ! pushName(gl, tip); ! drawVertexHit(tip); popName(gl); ! if (current.isActive()) { ! pushName(gl, constructor); ! drawEdge(constructor); popName(gl); } } - } else { - pushName(gl, current); - drawGeneralConstructor(current, dist, false); - popName(gl); } } --- 1719,1756 ---- while (iter.hasNext()) { Constructor current = (Constructor) iter.next(); ! if (!excluded.contains(current)) { ! if (camera.getType() == Camera.PERSPECTIVE) { ! dist = (current.getOrigin().minus(v)).length() * scale; ! } ! if (selectIntersections) { ! pushName(gl, current.getOrigin()); ! drawVertexHit(current.getOrigin()); popName(gl); ! if (current instanceof Line) { ! Line line = (Line) current; ! Edge guide = line.edge(View.gridSize() * 2); ! Vertex tip = line.tip(dist / 16 + dist / 20); ! pushName(gl, tip); ! drawVertexHit(tip); popName(gl); + if (current.isActive()) { + pushName(gl, guide); + drawEdge(guide); + popName(gl); + } + } else if (current instanceof CoordinateSystem) { + CoordinateSystem system = (CoordinateSystem) current; + Surface surface = system.surface(5); + if (system.isActive() && system.onlyPlane()) { + pushName(gl, surface); + drawSurface(surface); + popName(gl); + } } + } else { + pushName(gl, current); + drawGeneralConstructor(current, dist, false); + popName(gl); } } } *************** *** 2237,2240 **** --- 2267,2272 ---- selectMode = ALL; selectIntersections = intersections; + excluded = unWantedEntities; + glv.repaint(true); |