@Override public void drawAxis( final AxisConfig<float[]> config ) { final GL2 gl = this.glad.getGL().getGL2(); gl.glPushMatrix(); this.orient( gl ); final float zero = 0.001f; gl.glBegin( GL.GL_LINE_STRIP ); { gl.glLineWidth( (float)config.getRenderingConfig().getThickness() ); gl.glColor3f( config.getRenderingConfig().getColour()[0], config.getRenderingConfig().getColour()[1], config.getRenderingConfig().getColour()[2] ); final float n1 = this.calculatePosition( config.getMinValue() ).floatValue(); final float n2 = this.calculatePosition( config.getMaxValue() ).floatValue(); // We draw in the x axis, so the orientation has to be set appropriately gl.glVertex3f( n1, zero, zero ); gl.glVertex3f( n2, zero, zero ); } gl.glEnd(); gl.glPopMatrix(); }
this.orient( gl );
@Override public void drawMajorTickGridline( final double location, final AxisConfig<float[]> config ) { final GL2 gl = this.glad.getGL().getGL2(); gl.glPushMatrix(); this.orient( gl ); gl.glLineWidth( (float)config.getRenderingConfig().getMajorGridThickness() ); gl.glColor3f( config.getRenderingConfig().getMajorGridColour()[0], config.getRenderingConfig().getMajorGridColour()[1], config.getRenderingConfig().getMajorGridColour()[2] ); final float ll = this.calculatePosition( location ).floatValue(); final float zero = 0.001f; gl.glBegin( GL.GL_LINE_STRIP ); { // We draw in the x axis, so the orientation has to be set appropriately gl.glVertex3f( ll, zero, zero ); gl.glVertex3f( ll, 1, zero ); } gl.glEnd(); gl.glBegin( GL.GL_LINE_STRIP ); { // We draw in the x axis, so the orientation has to be set appropriately gl.glVertex3f( ll, zero, zero ); gl.glVertex3f( ll, zero, 1*this.gridDirection ); } gl.glEnd(); gl.glPopMatrix(); }
@Override public void drawMajorTick( final double location, final AxisConfig<float[]> config ) { final GL2 gl = this.glad.getGL().getGL2(); gl.glPushMatrix(); this.orient( gl ); gl.glLineWidth( (float)config.getRenderingConfig().getMajorTickThickness() ); gl.glColor3f( config.getRenderingConfig().getMajorTickColour()[0], config.getRenderingConfig().getMajorTickColour()[1], config.getRenderingConfig().getMajorTickColour()[2] ); final float l = (float)config.getRenderingConfig().getMajorTickLength(); final float l2 = -l; final float ll = this.calculatePosition( location ).floatValue(); final float zero = 0.001f; gl.glBegin( GL.GL_LINE_STRIP ); { // We draw in the x axis, so the orientation has to be set appropriately gl.glVertex3f( ll, l, zero ); gl.glVertex3f( ll, l2, zero ); } gl.glEnd(); gl.glBegin( GL.GL_LINE_STRIP ); { // We draw in the x axis, so the orientation has to be set appropriately gl.glVertex3f( ll, zero, l ); gl.glVertex3f( ll, zero, l2 ); } gl.glEnd(); gl.glPopMatrix(); }
this.orient( gl );