public ContourPainter( float[] coordsX, float[] coordsY ) { this.path = new LinePath( ); this.style = new LineStyle( ); this.program = new LineProgram( ); this.coordsX = coordsX; this.coordsY = coordsY; int size = Math.min( coordsX.length, coordsY.length ); for ( int i = 0; i < size - 1; i += 2 ) { this.path.moveTo( coordsX[i], coordsY[i] ); this.path.lineTo( coordsX[i + 1], coordsY[i + 1] ); } }
public LineStripExamplePainter( ) { this.strip = new LineStrip( 64 ); // Set line appearance (except for thickness, which is set in doPaintTo) this.style = new LineStyle( ); style.thickness_PX = 4; style.joinType = JOIN_MITER; style.rgba = floats( 0.7f, 0, 0, 1 ); //style.stippleEnable = true; //style.stippleScale = 2; //style.stipplePattern = 0b0001010111111111; // Create the shader program for drawing lines this.prog = new LineProgram( ); }
float x = strip.logicalSize( ); float y = x + 10*( random.nextFloat( ) - 0.5f ); strip.grow1( x, y ); int iPerturb = strip.logicalSize( ) / 4; float xPerturb = iPerturb; float yPerturb = xPerturb + 10*( random.nextFloat( ) - 0.5f ); strip.edit( iPerturb, 1 ).put( xPerturb ).put( yPerturb ); this.prog.begin( gl ); try this.prog.setViewport( gl, bounds ); this.prog.setAxisOrtho( gl, axis ); this.prog.draw( gl, this.style, this.strip, ppvAspectRatio( axis ) ); this.prog.end( gl ); disableBlending( gl );
@Override public void doPaintTo( GlimpseContext context ) { GL3 gl = context.getGL( ).getGL3( ); Axis2D axis = requireAxis2D( context ); GlimpseBounds bounds = getBounds( context ); this.program.begin( gl ); try { this.program.setAxisOrtho( gl, axis ); this.program.setViewport( gl, bounds ); this.program.draw( gl, style, path ); } finally { this.program.end( gl ); } }
this.strip.clear( ); this.strip.grow1( ( float ) xA, ( float ) yA ); this.strip.grow1( ( float ) xB, ( float ) yB ); this.strip.grow1( ( float ) xC, ( float ) yC ); this.strip.grow1( ( float ) xD, ( float ) yD ); this.prog.begin( gl ); try this.prog.setViewport( gl, bounds ); this.prog.setAxisOrtho( gl, axis ); this.prog.draw( gl, this.style, this.strip, ppvAspectRatio( axis ) ); this.prog.end( gl ); disableBlending( gl );
tracks.put( i, track ); LineStyle style = new LineStyle( ); style.thickness_PX = 5f; style.stippleEnable = true;
@Override public void doPaintTo( GlimpseContext context ) { GlimpseBounds bounds = getBounds( context ); Axis2D axis = requireAxis2D( context ); GL2ES3 gl = context.getGL( ).getGL2ES3( ); enableStandardBlending( gl ); prog.begin( gl ); try { // Tell the shader program the pixel-size of our viewport prog.setViewport( gl, bounds ); // Tell the shader program that our line coords will be in xy-axis space prog.setAxisOrtho( gl, axis ); // Do the actual drawing prog.draw( gl, style, path, ppvAspectRatio( axis ) ); } finally { prog.end( gl ); disableBlending( gl ); } }
public CustomLinesPainter( ) this.path = new LinePath( ); int ni = 360; float xNext = 0f; float y2 = ( float ) ( y1 + dy ); path.moveTo( x0, y0 ); path.lineTo( x1, y1 ); path.lineTo( x2, y2 ); this.style = new LineStyle( ); style.thickness_PX = 5; style.feather_PX = 2; this.prog = new LineProgram( );
public CustomLinesPainter( Tag leftAngleTag_CWDEG, Tag rightAngleTag_CWDEG, Tag thicknessTag_PX, Tag featherTag_PX ) { // Create a path, which will be populated in doPaintTo() this.strip = new LineStrip( ); // Set line appearance this.style = new LineStyle( ); this.style.joinType = JOIN_MITER; this.style.rgba = floats( 0.7f, 0, 0, 0.5f ); // Create the shader program for drawing lines this.prog = new LineProgram( ); this.angleTagB_CWDEG = leftAngleTag_CWDEG; this.angleTagC_CWDEG = rightAngleTag_CWDEG; this.thicknessTag_PX = thicknessTag_PX; this.featherTag_PX = featherTag_PX; }
public static XYLinePainter createXYLinePainter1( ) { // add two data series to the plot float[] dataX = new float[NUM_POINTS]; float[] dataY = new float[NUM_POINTS]; XYLinePainter series1 = new XYLinePainter( ); generateData1( dataX, dataY, NUM_POINTS ); series1.setData( dataX, dataY, GlimpseColor.fromColorRgba( 1.0f, 0.0f, 0.0f, 1.0f ) ); LineStyle style = new LineStyle( ); style.thickness_PX = 3.5f; style.joinType = LineJoinType.JOIN_BEVEL; series1.setLineStyle( style ); series1.showPoints( true ); series1.setPointSize( 8f ); series1.setPointFeather( 4.0f ); return series1; }
prog.begin( gl ); try prog.setViewport( gl, bounds ); prog.setAxisOrtho( gl, axis ); prog.draw( gl, style, path, ppvAspectRatio( axis ) ); prog.end( gl ); disableBlending( gl );
LineStyle style = new LineStyle( ); style.joinType = LineJoinType.JOIN_MITER;