當前位置: 首頁>>代碼示例>>Java>>正文


Java Box類代碼示例

本文整理匯總了Java中gov.nasa.worldwind.geom.Box的典型用法代碼示例。如果您正苦於以下問題:Java Box類的具體用法?Java Box怎麽用?Java Box使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Box類屬於gov.nasa.worldwind.geom包,在下文中一共展示了Box類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: drawBoundingVolumes

import gov.nasa.worldwind.geom.Box; //導入依賴的package包/類
protected void drawBoundingVolumes(DrawContext dc, ArrayList<TextureTile> tiles)
{
	GL2 gl = dc.getGL().getGL2(); // GL initialization checks for GL2 compatibility.

	float[] previousColor = new float[4];
	gl.glGetFloatv(GL2.GL_CURRENT_COLOR, previousColor, 0);
	gl.glColor3d(0, 1, 0);

	for (TextureTile tile : tiles)
	{
		if (tile.getExtent(dc) instanceof Renderable)
               ((Renderable) tile.getExtent(dc)).render(dc);
	}

       Box c = Sector.computeBoundingBox(dc.getGlobe(), dc.getVerticalExaggeration(), this.levels.getSector());
       gl.glColor3d(1, 1, 0);
       c.render(dc);

       gl.glColor4fv(previousColor, 0);
}
 
開發者ID:iedadata,項目名稱:geomapapp,代碼行數:21,代碼來源:ScalingTiledImageLayer.java

示例2: drawBoundingVolumes

import gov.nasa.worldwind.geom.Box; //導入依賴的package包/類
protected void drawBoundingVolumes(DrawContext dc, ArrayList<TextureTile> tiles)
{
	GL2 gl = dc.getGL().getGL2(); // GL initialization checks for GL2 compatibility.
    float[] previousColor = new float[4];
    gl.glGetFloatv(GL2.GL_CURRENT_COLOR, previousColor, 0);
    gl.glColor3d(0, 1, 0);

    for (TextureTile tile : tiles)
    {
        ((Cylinder) tile.getExtent(dc)).render(dc);
    }

    Box c = Sector.computeBoundingBox(dc.getGlobe(), dc.getVerticalExaggeration(), this.levels.getSector());
    gl.glColor3d(1, 1, 0);
    c.render(dc);

    gl.glColor4fv(previousColor, 0);
}
 
開發者ID:iedadata,項目名稱:geomapapp,代碼行數:19,代碼來源:DynamicImageTileLayer.java

示例3: goTo

import gov.nasa.worldwind.geom.Box; //導入依賴的package包/類
/**
 * Move to see a given sector.
 * 
 * @param sector
 *            the sector to go to.
 * @param animate
 *            if <code>true</code>, it animates to the position.
 */
public void goTo( Sector sector, boolean animate ) {
    View view = getWwd().getView();
    view.stopAnimations();
    view.stopMovement();
    if (sector == null) {
        return;
    }
    // Create a bounding box for the specified sector in order to estimate
    // its size in model coordinates.
    Box extent = Sector.computeBoundingBox(getWwd().getModel().getGlobe(),
            getWwd().getSceneController().getVerticalExaggeration(), sector);

    // Estimate the distance between the center position and the eye
    // position that is necessary to cause the sector to
    // fill a viewport with the specified field of view. Note that we change
    // the distance between the center and eye
    // position here, and leave the field of view constant.
    Angle fov = view.getFieldOfView();
    double zoom = extent.getRadius() / fov.cosHalfAngle() / fov.tanHalfAngle();

    // Configure OrbitView to look at the center of the sector from our
    // estimated distance. This causes OrbitView to
    // animate to the specified position over several seconds. To affect
    // this change immediately use the following:

    if (animate) {
        view.goTo(new Position(sector.getCentroid(), 0d), zoom);
    } else {
        ((OrbitView) wwd.getView()).setCenterPosition(new Position(sector.getCentroid(), 0d));
        ((OrbitView) wwd.getView()).setZoom(zoom);
    }
}
 
開發者ID:TheHortonMachine,項目名稱:hortonmachine,代碼行數:41,代碼來源:NwwPanel.java


注:本文中的gov.nasa.worldwind.geom.Box類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。