/** * Draws a tool at the current work coordinates. */ private void renderTool(GLAutoDrawable drawable) { GL2 gl = drawable.getGL().getGL2(); gl.glLineWidth(8.0f); byte []color; color = VisualizerUtils.Color.YELLOW.getBytes(); int verts = 0; int colors = 0; gl.glBegin(GL_LINES); gl.glColor3ub(color[0], color[1], color[2]); gl.glVertex3d(this.workCoord.x, this.workCoord.y, this.workCoord.z); gl.glColor3ub(color[0], color[1], color[2]); gl.glVertex3d(this.workCoord.x, this.workCoord.y, this.workCoord.z+(1.0/this.scaleFactor)); gl.glEnd(); }
this.vertexArrayDirty = false; gl.glLineWidth(1.0f); gl.glEnableClientState(GL2.GL_VERTEX_ARRAY); gl.glEnableClientState(GL2.GL_COLOR_ARRAY); gl.glLineWidth(1.0f);
public static void glLineWidth( float width) { gl().glLineWidth( width); }
protected void applyWidth(GL gl) { if(geometry==GL.GL_POINTS){ gl.getGL2().glPointSize(width); } else if(geometry==GL.GL_LINES){ gl.getGL2().glLineWidth(width); } }
@Override public void drawLineGL2(GL gl) { gl.getGL2().glLineWidth(wfwidth); if (wfcolor == null) { drawLineSegmentsGL2ByPointColor(gl); } else { drawLineSegmentsGL2ByWireColor(gl); } }
public static void drawCircle(GL2 gl, float x, float y, float size) { gl.glLineWidth(2); gl.glEnable(GL2.GL_LINE_SMOOTH); gl.glBegin(GL2.GL_LINE_STRIP); float f=0; for (int i=0; i<=w; i++) { gl.glVertex3d(Math.cos(f)*size + x, Math.sin(f)*size + y,0); f += incr; } gl.glEnd(); gl.glDisable(GL2.GL_LINE_SMOOTH); } }
private void drawVertex(GL2 gl, Point2D.Double startPoint, Point2D.Double endPoint, float lineWidth){ gl.glLineWidth(lineWidth); gl.glBegin(GL2.GL_LINES); gl.glVertex3d(startPoint.x, startPoint.y , zCoord); gl.glVertex3d(endPoint.x, endPoint.y, zCoord); gl.glEnd(); }
private void drawDottedLine(GL2 gl, ArrowEditor ae) { gl.glColor3fv(arrowEditorDottedLines, 0); gl.glLineWidth(DOTTED_LINE_WIDTH); Point3d editorOrigin = ae.getEditorOrigin(); Point3d arrowEnd = ae.arrowEnd(); LineDrawUtil.drawDottedLine(gl, editorOrigin, arrowEnd, DOTTED_LINE_SEGMENT_LENGTH); } }
private static void drawArrowFromAgentToTextLabel(Point2D.Double pos, GL2 gl) { gl.glColor4f(0.f, 0.2f, 1.f, 0.5f);// Blue gl.glLineWidth(2); gl.glBegin(GL.GL_LINE_STRIP); gl.glVertex3d((float) pos.x + 50, (float) pos.y + 50, 0); gl.glVertex3d((float) pos.x + 250, (float) pos.y + 250, 0); gl.glEnd(); }
public static void beginSimpleOutlineLine(GL2 gl) { gl.glEnable(GL.GL_CULL_FACE); gl.glCullFace(GL.GL_FRONT); gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL2GL3.GL_LINE); gl.glLineWidth(9); gl.glEnable(GL2GL3.GL_POLYGON_OFFSET_LINE); // offset polygons to back gl.glPolygonOffset(1.0f, 1.0f); // bold line gl.glDisable(GLLightingFunc.GL_LIGHTING); }
private void drawPlanPolyLine(GL2 gl) { Color color = Color.ORANGE; gl.glColor4d(color.getRed() / 255., color.getGreen() / 255., color.getBlue() / 255., .5); gl.glEnable(GL2.GL_BLEND); gl.glEnable(GL2.GL_LINE_SMOOTH); gl.glEnableClientState(GL2.GL_COLOR_ARRAY); gl.glEnableClientState(GL2.GL_VERTEX_ARRAY); gl.glLineWidth(1.f * OTFClientControl.getInstance().getOTFVisConfig().getLinkWidth()); gl.glColorPointer(4, GL2.GL_UNSIGNED_BYTE, 0, cols); gl.glVertexPointer(2, GL2.GL_FLOAT, 0, this.vert); gl.glDrawArrays(GL2.GL_LINE_STRIP, 0, this.vertex.size()); gl.glDisableClientState(GL2.GL_VERTEX_ARRAY); gl.glDisableClientState(GL2.GL_COLOR_ARRAY); gl.glDisable(GL2.GL_LINE_SMOOTH); gl.glDisable(GL2.GL_BLEND); }
@Override public void drawLineGL2(GL gl) { gl.getGL2().glBegin(GL.GL_LINE_STRIP); gl.getGL2().glLineWidth(wfwidth); if (filter == null) doDrawAllLines(gl); else doDrawLinesFiltered(gl); gl.getGL2().glEnd(); }
private void drawEdges(GL2 gl, List<LineSegment3d> edges) { // Lift up a little to avoid z-buffer problems gl.glTranslated(0, 0.1, 0); gl.glLineWidth(6); gl.glColor3fv(ROOF_EDGES_COLOR, 0); for (LineSegment3d line : edges) { gl.glBegin(GL.GL_LINES); Point3d begin = line.getBegin(); Point3d end = line.getEnd(); gl.glVertex3d(begin.x, begin.y, begin.z); gl.glVertex3d(end.x, end.y, end.z); gl.glEnd(); } }
public void drawGrid(float x, float y, float z, float size, int rows, int columns) { //Axis Width gl.glLineWidth(1f); gl.glTranslatef(-x/2, -y/2, -z/2); //Draw Rows gl.glBegin(GL.GL_LINES); int a = 0, b = 0; for (int i = 0;i < rows+1; i++) { gl.glVertex3d(a+size*i, 0.0, b+size*columns); gl.glVertex3d(a+size*i, 0, b); } for (int j = 0;j < columns+1; j++) { gl.glVertex3d(a+size*rows, 0.0, b+size*j); gl.glVertex3d(a, 0, b+size*j); } gl.glEnd(); gl.glTranslatef(x/2, y/2, z/2); }
public void drawTickLine(GL gl, Color color, double xpos, double ypos, double zpos, double xlab, double ylab, double zlab) { gl.getGL2().glColor3f(color.r, color.g, color.b); gl.getGL2().glLineWidth(1); // Draw the tick line gl.getGL2().glBegin(GL.GL_LINES); gl.getGL2().glVertex3d(xpos, ypos, zpos); gl.getGL2().glVertex3d(xlab, ylab, zlab); gl.getGL2().glEnd(); }
private void prepare(GL2 gl) { gl.glEnable(GL2.GL_BLEND); gl.glEnable(GL2.GL_LINE_SMOOTH); gl.glEnableClientState(GL2.GL_COLOR_ARRAY); gl.glEnableClientState(GL2.GL_VERTEX_ARRAY); gl.glLineWidth(1.f * getLineWidth()); gl.glColorPointer(4, GL2.GL_UNSIGNED_BYTE, 0, this.cols); gl.glVertexPointer(2, GL2.GL_FLOAT, 0, this.vert); gl.glDrawArrays(GL2.GL_LINES, 0, this.vertex.length); gl.glDisableClientState(GL2.GL_VERTEX_ARRAY); gl.glDisableClientState(GL2.GL_COLOR_ARRAY); gl.glDisable(GL2.GL_LINE_SMOOTH); }
public synchronized void drawHorizontalLineGL2(GL gl, Range xrange, float value) { gl.getGL2().glLineWidth(width); gl.getGL2().glBegin(GL.GL_LINE_STRIP); gl.getGL2().glColor4f(color.r, color.g, color.b, color.a); gl.getGL2().glVertex3f(xrange.getMin()-xrange.getRange()/30, value, 0); gl.getGL2().glVertex3f(xrange.getMax()+xrange.getRange()/30, value, 0); gl.getGL2().glEnd(); }
public synchronized void drawVerticalLineGL2(GL gl, Range yrange, float value) { gl.getGL2().glLineWidth(width); gl.getGL2().glBegin(GL.GL_LINE_STRIP); gl.getGL2().glColor4f(color.r, color.g, color.b, color.a); gl.getGL2().glVertex3f(value, yrange.getMin()-yrange.getRange()/30, 0); gl.getGL2().glVertex3f(value, yrange.getMax()+yrange.getRange()/30, 0); gl.getGL2().glEnd(); }
public synchronized void drawLineGL2(GL gl, Range yrange, Range zrange) { gl.getGL2().glLineWidth(width); gl.getGL2().glBegin(GL.GL_LINE_STRIP); gl.getGL2().glColor4f(color.r, color.g, color.b, color.a); gl.getGL2().glVertex3f(value, yrange.getMin()-yrange.getRange()/30, zrange.getMin()-2); gl.getGL2().glVertex3f(value, yrange.getMax()+yrange.getRange()/30, zrange.getMin()-2); gl.getGL2().glEnd(); }
public void drawLineGL2(GL gl) { if (stipple) { gl.getGL2().glPolygonMode(GL.GL_BACK, GL2GL3.GL_LINE); gl.glEnable(GL2.GL_LINE_STIPPLE); gl.getGL2().glLineStipple(stippleFactor, stipplePattern); } gl.getGL2().glLineWidth(wfwidth); gl.getGL2().glBegin(GL.GL_LINE_STRIP); if (wfcolor == null) { for (Point p : points) { colorGL2(gl, p.rgb); vertexGL2(gl, p.xyz); } } else { for (Point p : points) { colorGL2(gl, wfcolor); vertexGL2(gl, p.xyz); } } gl.getGL2().glEnd(); if (stipple) { gl.glDisable(GL2.GL_LINE_STIPPLE); } }