public void makeOrderedRenderable(DrawContext dc, AirspaceRenderer renderer) { if (dc == null) { String message = Logging.getMessage("nullValue.DrawContextIsNull"); Logging.logger().severe(message); throw new IllegalArgumentException(message); } if (renderer == null) { String message = Logging.getMessage("nullValue.RendererIsNull"); Logging.logger().severe(message); throw new IllegalArgumentException(message); } for (Layer layer : this.layers) { if (!layer.isVisible()) continue; if (!layer.isAirspaceVisible(dc)) continue; // The layer is responsible for applying its own attributes, so we override its attributes // with our own just // before rendering. layer.setAttributes(this.getAttributes()); // Create an ordered renderable that draws each layer, but specifies this Cake as the picked // object. OrderedRenderable or = renderer.createOrderedRenderable(dc, layer, layer.computeEyeDistance(dc), this); dc.addOrderedRenderable(or); } }
public boolean isAirspaceVisible(DrawContext dc) { if (dc == null) { String message = Logging.getMessage("nullValue.DrawContextIsNull"); Logging.logger().severe(message); throw new IllegalArgumentException(message); } // If the parent Cake is not visible, then return false immediately without testing the child // layers. if (!super.isAirspaceVisible(dc)) return false; boolean visible = false; // The parent Cake is visible. Since the parent Cake's extent potentially contains volumes where // no child // geometry exists, test that at least one of the child layers are visible. for (Layer l : this.layers) { if (l.isAirspaceVisible(dc)) { visible = true; break; } } return visible; }
protected void doRenderGeometry(DrawContext dc, String drawStyle) { if (dc == null) { String message = Logging.getMessage("nullValue.DrawContextIsNull"); Logging.logger().severe(message); throw new IllegalArgumentException(message); } // Called by AirspaceRenderer's drawNow and pickNow methods. These methods do not use the // ordered renderable // queue, so TrackAirspace must explicitly initiate drawing its legs. When airspace rendering is // initiated via // AirspaceRenderer drawOrdered or pickOrdered, TrackAirspace does not add an ordered renderable // for itself, so // this method is never initiated. for (Layer l : this.layers) { if (!l.isVisible()) continue; if (!l.isAirspaceVisible(dc)) continue; l.renderGeometry(dc, drawStyle); } }