private PointPlacemark getLabelPlacemark(Position pos, String label) { PointPlacemarkAttributes ppmAtttrs = new PointPlacemarkAttributes(); ppmAtttrs.setLabelOffset(new Offset(0.0, 0.0, AVKey.PIXELS, AVKey.PIXELS)); ppmAtttrs.setScale(0.0); PointPlacemark ppm = new PointPlacemark(pos); ppm.setAttributes(ppmAtttrs); ppm.setLabelText(label); return ppm; }
protected SurfaceTextureProgram getShaderProgram(RenderContext rc) { SurfaceTextureProgram program = (SurfaceTextureProgram) rc.getShaderProgram(SurfaceTextureProgram.KEY); if (program == null) { program = (SurfaceTextureProgram) rc.putShaderProgram(SurfaceTextureProgram.KEY, new SurfaceTextureProgram(rc.resources)); } return program; } }
/** * Constructs a Blue Marble background layer with the built-in WorldWind library resource * res/drawable/gov_nasa_worldwind_worldtopobathy2004053. The resource must be accessible from the Android Context * associated with the WorldWindow. */ public BackgroundLayer() { this(ImageSource.fromResource(R.drawable.gov_nasa_worldwind_worldtopobathy2004053), new ImageOptions(WorldWind.RGB_565)); }
public Texture renderText(String text, TextAttributes attributes) { TextCacheKey key = new TextCacheKey().set(text, attributes); Texture texture = null; if (text != null && attributes != null) { this.textRenderer.setTextColor(attributes.getTextColor()); this.textRenderer.setTextSize(attributes.getTextSize()); this.textRenderer.setTypeface(attributes.getTypeface()); this.textRenderer.setEnableOutline(attributes.isEnableOutline()); this.textRenderer.setOutlineColor(attributes.getOutlineColor()); this.textRenderer.setOutlineWidth(attributes.getOutlineWidth()); texture = this.textRenderer.renderText(text); } this.renderResourceCache.put(key, texture, (texture != null) ? texture.getByteCount() : 0); return texture; }
public ShapeAttributes() { this.drawInterior = true; this.drawOutline = true; this.drawVerticals = false; this.depthTest = true; this.enableLighting = false; this.interiorColor = new Color(1, 1, 1, 1); // white this.outlineColor = new Color(1, 0, 0, 1); // red this.outlineWidth = 1.0f; this.interiorImageSource = null; this.outlineImageSource = null; }
@Override public Tile createTile(Sector sector, Level level, int row, int column) { ImageTile tile = new ImageTile(sector, level, row, column); String urlString = this.urlForTile(level.levelNumber, row, column); if (urlString != null) { tile.setImageSource(ImageSource.fromUrl(urlString)); } return tile; }
public ShaderProgram putShaderProgram(Object key, ShaderProgram program) { this.renderResourceCache.put(key, program, (program != null) ? program.getProgramLength() : 0); return program; }
/** * Gets the waypoints of this trajectory. * * @return the waypoints of this trajectory * * @see Path#getPositions() */ @SuppressWarnings("unchecked") public Iterable<? extends Waypoint> getWaypoints() { return (Iterable<Waypoint>) super.getPositions(); }
public Texture putTexture(ImageSource imageSource, Texture texture) { this.renderResourceCache.put(imageSource, texture, (texture != null) ? texture.getByteCount() : 0); return texture; }
public BufferObject putBufferObject(Object key, BufferObject buffer) { this.renderResourceCache.put(key, buffer, (buffer != null) ? buffer.getBufferByteCount() : 0); return buffer; }
protected Texture createTexture(ImageSource imageSource, ImageOptions options, Bitmap bitmap) { Texture texture = new Texture(bitmap); if (options != null && options.resamplingMode == WorldWind.NEAREST_NEIGHBOR) { texture.setTexParameter(GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_NEAREST); texture.setTexParameter(GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_NEAREST); } if (options != null && options.wrapMode == WorldWind.REPEAT) { texture.setTexParameter(GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_REPEAT); texture.setTexParameter(GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_REPEAT); } return texture; }
/** * Gets the geometric extent of this obstacle path for a specified globe. * * @param globe the globe to be used for the conversion * * @return the geometric extent of this obstacle path * * @see Path#getExtent(Globe, double) */ @Override public Extent getExtent(Globe globe) { return super.getExtent(globe, 1d); }
public RenderResourceCache(int capacity, int lowWater) { super(capacity, lowWater); this.init(); }
public ShaderProgram getShaderProgram(Object key) { // TODO redesign ShaderProgram to operate as a resource accessible from DrawContext // TODO created automatically on OpenGL thread, unless the caller wants to explicitly create a program return (ShaderProgram) this.renderResourceCache.get(key); }
public void setResources(Resources res) { this.resources = res; ((ImageRetriever) this.imageRetriever).setResources(res); }
@Override public void release(DrawContext dc) { this.deleteProgram(dc); }
protected void determineActiveProgram(RenderContext rc) { this.activeProgram = (SurfaceTextureProgram) rc.getShaderProgram(SurfaceTextureProgram.KEY); if (this.activeProgram == null) { this.activeProgram = (SurfaceTextureProgram) rc.putShaderProgram(SurfaceTextureProgram.KEY, new SurfaceTextureProgram(rc.resources)); } }
public RenderResourceCache(int capacity) { super(capacity); this.init(); }