Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24876/src/net/sourceforge/bprocessor/gl/view
Modified Files:
View.java
Log Message:
Removed drawing of lone vertices Ð gave bad performance
Index: View.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v
retrieving revision 1.47
retrieving revision 1.48
diff -C2 -d -r1.47 -r1.48
*** View.java 16 Jan 2006 10:07:28 -0000 1.47
--- View.java 18 Jan 2006 09:43:36 -0000 1.48
***************
*** 58,61 ****
--- 58,64 ----
private static Logger log = Logger.getLogger(View.class);
+ /** Specify if lone vertices are displayed */
+ private static final boolean DRAW_LONE_VERTICES = false;
+
/** the color of the x axis */
public static final float[] X_AXIS_COLOR = new float[] {0.1f, 0.8f, 0.1f};
***************
*** 439,447 ****
*/
public void display(GLDrawable gld) {
gl.glClearColor(bgColor[0], bgColor[1], bgColor[2], bgColor[3]);
Plane xy = new Plane(0, 0, 1, 0);
gl = gld.getGL();
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
!
glu = gld.getGLU();
int[] mode = new int[1];
--- 442,452 ----
*/
public void display(GLDrawable gld) {
+ boolean hitdetection = false;
+
gl.glClearColor(bgColor[0], bgColor[1], bgColor[2], bgColor[3]);
Plane xy = new Plane(0, 0, 1, 0);
gl = gld.getGL();
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
!
glu = gld.getGLU();
int[] mode = new int[1];
***************
*** 455,458 ****
--- 460,464 ----
gl.glSelectBuffer(512, selectBuffer);
gl.glRenderMode(GL.GL_SELECT);
+ hitdetection = true;
}
***************
*** 475,479 ****
--- 481,487 ----
gl.glColor3fv(lineColor);
gl.glLineWidth(1.0f);
+
drawAll(gld);
+
gl.glEnable(GL.GL_DEPTH_TEST);
***************
*** 824,856 ****
}
-
-
- // Draw any Vertex that are not part of an edge
{
! gl.glColor3fv(lineColor);
! Iterator it = vertices.iterator();
! while (it.hasNext()) {
! Vertex v = (Vertex)it.next();
! if (v.getEdges().isEmpty()) {
! gl.glColor3fv(lineColor);
! gl.glPointSize(5.0f);
! gl.glBegin(GL.GL_POINTS);
! gl.glVertex3d(v.getX(), v.getY(), v.getZ());
! gl.glEnd();
! gl.glPointSize(1.0f);
}
! }
! //Draw any temporary vertex not part of an edge
! gl.glColor3fv(lineColor);
! it = tempVertices.iterator();
! while (it.hasNext()) {
! Vertex v = (Vertex)it.next();
! if (v.getEdges().isEmpty()) {
! gl.glColor3fv(lineColor);
! gl.glPointSize(5.0f);
! gl.glBegin(GL.GL_POINTS);
! gl.glVertex3d(v.getX(), v.getY(), v.getZ());
! gl.glEnd();
! gl.glPointSize(1.0f);
}
}
--- 832,864 ----
}
{
! if (DRAW_LONE_VERTICES) {
! // Draw any Vertex that are not part of an edge
! gl.glColor3fv(lineColor);
! Iterator it = vertices.iterator();
! while (it.hasNext()) {
! Vertex v = (Vertex)it.next();
! if (v.getEdges().isEmpty()) {
! gl.glColor3fv(lineColor);
! gl.glPointSize(5.0f);
! gl.glBegin(GL.GL_POINTS);
! gl.glVertex3d(v.getX(), v.getY(), v.getZ());
! gl.glEnd();
! gl.glPointSize(1.0f);
! }
}
! // Draw any temporary vertex not part of an edge
! gl.glColor3fv(lineColor);
! it = tempVertices.iterator();
! while (it.hasNext()) {
! Vertex v = (Vertex)it.next();
! if (v.getEdges().isEmpty()) {
! gl.glColor3fv(lineColor);
! gl.glPointSize(5.0f);
! gl.glBegin(GL.GL_POINTS);
! gl.glVertex3d(v.getX(), v.getY(), v.getZ());
! gl.glEnd();
! gl.glPointSize(1.0f);
! }
}
}
|