/** * Constructs a new <code>WorldWindowGLCanvas</code> on the default graphics device and shares graphics resources * with another <code>WorldWindow</code>. * * @param shareWith a <code>WorldWindow</code> with which to share graphics resources. * * @see GLCanvas#GLCanvas(javax.media.opengl.GLCapabilitiesImmutable, javax.media.opengl.GLCapabilitiesChooser, * javax.media.opengl.GLContext, java.awt.GraphicsDevice) */ public WorldWindowGLCanvas(WorldWindow shareWith) { base(Configuration.getRequiredGLCapabilities(), new BasicGLCapabilitiesChooser(), null); if (shareWith != null) { this.setSharedContext(shareWith.getContext()); } try { this.wwd = ((WorldWindowGLDrawable)WorldWind.createConfigurationComponent(AVKey.WORLD_WINDOW_CLASS_NAME)); this.wwd.initDrawable(this); if (shareWith != null) { this.wwd.initGpuResourceCache(shareWith.getGpuResourceCache()); } else { this.wwd.initGpuResourceCache(WorldWindowImpl.createGpuResourceCache()); } this.createView(); this.createDefaultInputHandler(); WorldWind.addPropertyChangeListener(WorldWind.SHUTDOWN_EVENT, this); this.wwd.endInitialization(); } catch (Exception e) { String message = Logging.getMessage("Awt.WorldWindowGLSurface.UnabletoCreateWindow"); Logging.logger().severe(message); throw new WWRuntimeException(message, e); } }
/** * Create a new globe, and set the position of the globe's center. The globe will be tessellated using tessellator * defined by the {@link AVKey#TESSELLATOR_CLASS_NAME} configuration parameter. * * @param equatorialRadius Radius of the globe at the equator. * @param polarRadius Radius of the globe at the poles. * @param es Square of the globe's eccentricity. * @param em Elevation model. May be null. * @param center Cartesian coordinates of the globe's center point. */ public EllipsoidalGlobe(double equatorialRadius, double polarRadius, double es, ElevationModel em, Vec4 center) { this.equatorialRadius = equatorialRadius; this.polarRadius = polarRadius; this.es = es; // assume it's consistent with the two radii this.center = center; this._elevationModel = em; this._tessellator = (Tessellator)WorldWind.createConfigurationComponent(AVKey.TESSELLATOR_CLASS_NAME); }
public BasicOrbitView() { this.viewInputHandler = (ViewInputHandler)WorldWind.createConfigurationComponent( AVKey.VIEW_INPUT_HANDLER_CLASS_NAME); this.viewLimits = new BasicOrbitViewLimits(); if (this.viewInputHandler == null) { this.viewInputHandler = new OrbitViewInputHandler(); } this.collisionSupport.setCollisionThreshold(COLLISION_THRESHOLD); this.collisionSupport.setNumIterations(COLLISION_NUM_ITERATIONS); loadConfigurationValues(); }
public SectorGeometryList tessellate(DrawContext dc) { if (_tessellator == null) { _tessellator = (Tessellator)WorldWind.createConfigurationComponent(AVKey.TESSELLATOR_CLASS_NAME); if (_tessellator == null) { string message = Logging.getMessage("Tessellator.TessellatorUnavailable"); Logging.logger().severe(message); throw new IllegalStateException(message); } } return(_tessellator.tessellate(dc)); }
/** * BasicRasterServer constructor reads a list of data raster sources from *.RasterServer.xml (the file that * accompanies layer description XML file), reads sector of each source and maintains a list of data sources, their * properties, * * @param o the RasterServer.xml source to read. May by a {@link java.io.File}, a file path, a URL or an * {@link org.w3c.dom.Element} * @param parameters optional metadata associated with the data source that might be useful to the BasicRasterServer. */ public BasicRasterServer(Object o, AVList parameters) { base(); if (null != parameters) { this.setValues(params); } try { this.readerFactory = (DataRasterReaderFactory)WorldWind.createConfigurationComponent( AVKey.DATA_RASTER_READER_FACTORY_CLASS_NAME); } catch (Exception e) { this.readerFactory = new BasicDataRasterReaderFactory(); } this.init(o); }
/** Constructs and attaches the {@link InputHandler} for this <code>WorldWindow</code>. */ protected void createDefaultInputHandler() { this.setInputHandler((InputHandler)WorldWind.createConfigurationComponent(AVKey.INPUT_HANDLER_CLASS_NAME)); }
/** Constructs and attaches the {@link View} for this <code>WorldWindow</code>. */ protected void createView() { this.setView((View)WorldWind.createConfigurationComponent(AVKey.VIEW_CLASS_NAME)); }