本文整理汇总了Java中gov.nasa.worldwind.View类的典型用法代码示例。如果您正苦于以下问题:Java View类的具体用法?Java View怎么用?Java View使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
View类属于gov.nasa.worldwind包,在下文中一共展示了View类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: needToSplit
import gov.nasa.worldwind.View; //导入依赖的package包/类
protected boolean needToSplit(DrawContext dc, Sector sector)
{
Vec4[] corners = sector.computeCornerPoints(dc.getGlobe(), dc.getVerticalExaggeration());
Vec4 centerPoint = sector.computeCenterPoint(dc.getGlobe(), dc.getVerticalExaggeration());
View view = dc.getView();
double d1 = view.getEyePoint().distanceTo3(corners[0]);
double d2 = view.getEyePoint().distanceTo3(corners[1]);
double d3 = view.getEyePoint().distanceTo3(corners[2]);
double d4 = view.getEyePoint().distanceTo3(corners[3]);
double d5 = view.getEyePoint().distanceTo3(centerPoint);
double minDistance = d1;
if (d2 < minDistance)
minDistance = d2;
if (d3 < minDistance)
minDistance = d3;
if (d4 < minDistance)
minDistance = d4;
if (d5 < minDistance)
minDistance = d5;
double cellSize = (Math.PI * sector.getDeltaLatRadians() * dc.getGlobe().getRadius()) / 20; // TODO
return !(Math.log10(cellSize) <= (Math.log10(minDistance) - this.splitScale));
}
开发者ID:iedadata,项目名称:geomapapp,代码行数:27,代码来源:DynamicImageTileLayer.java
示例2: needToSplit
import gov.nasa.worldwind.View; //导入依赖的package包/类
private boolean needToSplit(DrawContext dc, Sector sector)
{
Vec4[] corners = sector.computeCornerPoints(dc.getGlobe(), dc.getVerticalExaggeration());
Vec4 centerPoint = sector.computeCenterPoint(dc.getGlobe(), dc.getVerticalExaggeration());
View view = dc.getView();
double d1 = view.getEyePoint().distanceTo3(corners[0]);
double d2 = view.getEyePoint().distanceTo3(corners[1]);
double d3 = view.getEyePoint().distanceTo3(corners[2]);
double d4 = view.getEyePoint().distanceTo3(corners[3]);
double d5 = view.getEyePoint().distanceTo3(centerPoint);
double minDistance = d1;
if (d2 < minDistance)
minDistance = d2;
if (d3 < minDistance)
minDistance = d3;
if (d4 < minDistance)
minDistance = d4;
if (d5 < minDistance)
minDistance = d5;
double cellSize = (Math.PI * sector.getDeltaLatRadians() * dc.getGlobe().getRadius()) / this.density ; // TODO
return !(Math.log10(cellSize) <= (Math.log10(minDistance) - this.splitScale ));
}
开发者ID:iedadata,项目名称:geomapapp,代码行数:27,代码来源:WWSceneGraph.java
示例3: goToDefaultView
import gov.nasa.worldwind.View; //导入依赖的package包/类
/**
* Go to a view of a list of positions. This method computes a view looking straight down from
* an altitude that brings all of the positions into view.
*
* @param positions
* List of positions to bring into view
*/
public void goToDefaultView(final List<? extends Position> positions) {
final View view = this.wwd.getView();
final Globe globe = view.getGlobe();
if (globe == null) {
/*
* this happenes when a tour is selected and the 3d map is not yet opened but is being
* opened with an action button
*/
StatusUtil.logInfo("globe == null"); //$NON-NLS-1$
// try again
Display.getCurrent().timerExec(200, new Runnable() {
public void run() {
gotoView(positions);
}
});
return;
}
gotoView(positions);
}
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:33,代码来源:Map3ViewController.java
示例4: getScreenPointsPolygon
import gov.nasa.worldwind.View; //导入依赖的package包/类
/**
* Get the lat/long world geometry from two screen corner coordinates.
*
* @param wwd
* the {@link WorldWindow} instance.
* @param x1
* the first point screen x.
* @param y1
* the first point screen y.
* @param x2
* the second point screen x.
* @param y2
* the second point screen y.
* @return the world geomnetry.
*/
public static Geometry getScreenPointsPolygon( WorldWindow wwd, int x1, int y1, int x2, int y2 ) {
View view = wwd.getView();
Position p1 = view.computePositionFromScreenPoint(x1, y1);
Position p2 = view.computePositionFromScreenPoint(x1, y2);
Position p3 = view.computePositionFromScreenPoint(x2, y2);
Position p4 = view.computePositionFromScreenPoint(x2, y1);
Coordinate[] coords = { //
new Coordinate(p1.longitude.degrees, p1.latitude.degrees), //
new Coordinate(p2.longitude.degrees, p2.latitude.degrees), //
new Coordinate(p3.longitude.degrees, p3.latitude.degrees), //
new Coordinate(p4.longitude.degrees, p4.latitude.degrees)//
};
Geometry convexHull = GeometryUtilities.gf().createMultiPoint(coords).convexHull();
return convexHull;
}
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:32,代码来源:NwwUtilities.java
示例5: getViewportBounds
import gov.nasa.worldwind.View; //导入依赖的package包/类
public ReferencedEnvelope getViewportBounds() {
View view = wwd.getView();
Position posUL = view.computePositionFromScreenPoint(0, 0);
Position posLR = view.computePositionFromScreenPoint(getWidth(), getHeight());
if (posLR != null && posUL != null) {
double west = posUL.longitude.degrees;
double north = posUL.latitude.degrees;
double east = posLR.longitude.degrees;
double south = posLR.latitude.degrees;
ReferencedEnvelope env = new ReferencedEnvelope(west, east, south, north, DefaultGeographicCRS.WGS84);
return env;
} else {
return null;// new ReferencedEnvelope(-180, 180, -90, 90,
// DefaultGeographicCRS.WGS84);
}
}
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:19,代码来源:NwwPanel.java
示例6: focusPoint
import gov.nasa.worldwind.View; //导入依赖的package包/类
@Override
protected void focusPoint(final GeoPoint point, final boolean isRunning, final boolean animation) {
final long elevation = 5000 * 1000;
if (_controller == null || _controller.getWWd() == null) {
return;
}
// center the map on the given point
final LabeledPath label = point == null ? null : _pointToLabel.get(point);
if (label != null) {
highlightAnnotation(label, point);
final View view = _controller.getWWd().getView();
final OrbitViewInputHandler ovih = (OrbitViewInputHandler) view.getViewInputHandler();
if (animation && Env.INSTANCE.getAnimationSpeed() > 0) {
final Position pos = new Position(label.getLocations().iterator().next(), 10);
ovih.addPanToAnimator(pos, view.getHeading(), view.getPitch(), elevation, Env.INSTANCE.getAnimationSpeed(), true);
// if (_mode == Mode.TRACE_ROUTE && isRunning) {
// // if tracing, move at the speed of the timeout
// final Position pos = new Position(label.getLocations().iterator().next(), 10);
// ovih.addPanToAnimator(pos, view.getHeading(), view.getPitch(), elevation,
// Env.INSTANCE.getAnimationSpeed(), true);
// } else if (_mode == Mode.TRACE_ROUTE || !isRunning) {
// _controller.getWWd().getView()
// .goTo(new Position(label.getLocations().iterator().next(), 10), elevation);
// }
} else {
final Position p = new Position(Angle.fromDegrees(point.getLat()), Angle.fromDegrees(point.getLon()), 2000);
((OrbitView) view).setCenterPosition(p);
}
}
}
开发者ID:leolewis,项目名称:openvisualtraceroute,代码行数:31,代码来源:WWJPanel.java
示例7: needToSplit
import gov.nasa.worldwind.View; //导入依赖的package包/类
protected boolean needToSplit(DrawContext dc, RectTile tile)
{
Vec4[] corners = tile.sector.computeCornerPoints(dc.getGlobe(), dc.getVerticalExaggeration());
Vec4 centerPoint = tile.sector.computeCenterPoint(dc.getGlobe(), dc.getVerticalExaggeration());
View view = dc.getView();
double d1 = view.getEyePoint().distanceTo3(corners[0]);
double d2 = view.getEyePoint().distanceTo3(corners[1]);
double d3 = view.getEyePoint().distanceTo3(corners[2]);
double d4 = view.getEyePoint().distanceTo3(corners[3]);
double d5 = view.getEyePoint().distanceTo3(centerPoint);
double minDistance = d1;
if (d2 < minDistance)
minDistance = d2;
if (d3 < minDistance)
minDistance = d3;
if (d4 < minDistance)
minDistance = d4;
if (d5 < minDistance)
minDistance = d5;
double logDist = Math.log10(minDistance);
double target = this.computeTileResolutionTarget(dc, tile);
boolean useTile = tile.log10CellSize <= (logDist - target);
return !useTile;
}
开发者ID:iedadata,项目名称:geomapapp,代码行数:29,代码来源:MYEBSRectangularTessellator.java
示例8: computeHeading
import gov.nasa.worldwind.View; //导入依赖的package包/类
protected double computeHeading(View view)
{
if (view == null)
return 0.0;
return view.getHeading().getDegrees();
}
开发者ID:iedadata,项目名称:geomapapp,代码行数:8,代码来源:SunCompassLayer.java
示例9: computePitch
import gov.nasa.worldwind.View; //导入依赖的package包/类
protected double computePitch(View view)
{
if (view == null)
return 0.0;
if (!(view instanceof OrbitView))
return 0.0;
OrbitView orbitView = (OrbitView) view;
return orbitView.getPitch().getDegrees();
}
开发者ID:iedadata,项目名称:geomapapp,代码行数:12,代码来源:SunCompassLayer.java
示例10: computeHeading
import gov.nasa.worldwind.View; //导入依赖的package包/类
private double computeHeading(View view)
{
if (view == null)
return 0.0;
if (!(view instanceof OrbitView))
return 0.0;
OrbitView orbitView = (OrbitView) view;
return orbitView.getHeading().getDegrees();
}
开发者ID:iedadata,项目名称:geomapapp,代码行数:12,代码来源:DetailedIconRenderer.java
示例11: computePitch
import gov.nasa.worldwind.View; //导入依赖的package包/类
private double computePitch(View view)
{
if (view == null)
return 0.0;
if (!(view instanceof OrbitView))
return 0.0;
OrbitView orbitView = (OrbitView) view;
return orbitView.getPitch().getDegrees();
}
开发者ID:iedadata,项目名称:geomapapp,代码行数:12,代码来源:DetailedIconRenderer.java
示例12: panToPos
import gov.nasa.worldwind.View; //导入依赖的package包/类
public void panToPos(Position pos)
{
long timeInMilliseconds = 3000L; // Time in milliseconds you want the animation to take.
View view = wwMapPanel.getWwd().getView(); // How you get the view depends on the context.
OrbitViewInputHandler ovih = (OrbitViewInputHandler) view.getViewInputHandler();
ovih.addPanToAnimator(pos, view.getHeading(), view.getPitch(), 8000000, timeInMilliseconds, true);
}
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:9,代码来源:GISFrame.java
示例13: saveState
import gov.nasa.worldwind.View; //导入依赖的package包/类
private void saveState() {
/*
* It can happen that this view is not yet restored with restoreState() but the saveState()
* method is called which causes a NPE
*/
if (_graphId == null) {
return;
}
final boolean isLegendVisible = Map3Manager.getLayer_TourLegend().isEnabled();
final boolean isMarkerVisible = Map3Manager.getLayer_Marker().isEnabled();
final boolean isSliderVisible = Map3Manager.getLayer_TrackSlider().isEnabled();
final boolean isTrackVisible = Map3Manager.getLayer_TourTrack().isEnabled();
_state.put(STATE_IS_LEGEND_VISIBLE, isLegendVisible);
_state.put(STATE_IS_MARKER_VISIBLE, isMarkerVisible);
_state.put(STATE_IS_SYNC_MAP_POSITION_WITH_SLIDER, _isMapSynched_WithChartSlider);
_state.put(STATE_IS_SYNC_MAP_VIEW_WITH_TOUR, _isMapSynched_WithTour);
_state.put(STATE_IS_SYNC_MAP3_WITH_OTHER_MAP, _isMapSynched_WithOtherMap);
_state.put(STATE_IS_TOUR_VISIBLE, isTrackVisible);
_state.put(STATE_IS_TRACK_SLIDER_VISIBLE, isSliderVisible);
_state.put(STATE_TOUR_COLOR_ID, _graphId.name());
final View view = _wwCanvas.getView();
try {
_state.put(STATE_MAP3_VIEW, view.getRestorableState());
} catch (final Exception e) {
// this can occure
// StatusUtil.log(e);
}
}
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:35,代码来源:Map3View.java
示例14: setZoomLimits
import gov.nasa.worldwind.View; //导入依赖的package包/类
public void setZoomLimits( double minZoom, double maxZoom ) {
View view = getWwd().getView();
if (view != null && view instanceof OrbitView) {
OrbitView oView = (OrbitView) view;
OrbitViewLimits orbitViewLimits = oView.getOrbitViewLimits();
orbitViewLimits.setZoomLimits(minZoom, maxZoom);
}
}
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:9,代码来源:NwwPanel.java
示例15: setPitchLimits
import gov.nasa.worldwind.View; //导入依赖的package包/类
public void setPitchLimits( Angle minAngle, Angle maxangle ) {
View view = getWwd().getView();
if (view != null && view instanceof OrbitView) {
OrbitView oView = (OrbitView) view;
OrbitViewLimits orbitViewLimits = oView.getOrbitViewLimits();
orbitViewLimits.setPitchLimits(minAngle, maxangle);
}
}
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:9,代码来源:NwwPanel.java
示例16: goTo
import gov.nasa.worldwind.View; //导入依赖的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
示例17: gotoProduct
import gov.nasa.worldwind.View; //导入依赖的package包/类
private void gotoProduct(final Product product) {
if (product == null) return;
final View theView = getWwd().getView();
final Position origPos = theView.getEyePosition();
final GeoCoding geoCoding = product.getSceneGeoCoding();
if (geoCoding != null && origPos != null) {
final GeoPos centre = product.getSceneGeoCoding().getGeoPos(new PixelPos(product.getSceneRasterWidth() / 2,
product.getSceneRasterHeight() / 2), null);
centre.normalize();
theView.setEyePosition(Position.fromDegrees(centre.getLat(), centre.getLon(), origPos.getElevation()));
}
}
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:14,代码来源:WWBaseToolView.java
示例18: needToSplit
import gov.nasa.worldwind.View; //导入依赖的package包/类
protected boolean needToSplit(DrawContext dc, Sector sector, Level level)
{
Vec4[] corners = sector.computeCornerPoints(dc.getGlobe(), dc.getVerticalExaggeration());
Vec4 centerPoint = sector.computeCenterPoint(dc.getGlobe(), dc.getVerticalExaggeration());
// Get the eye distance for each of the sector's corners and its center.
View view = dc.getView();
double d1 = view.getEyePoint().distanceTo3(corners[0]);
double d2 = view.getEyePoint().distanceTo3(corners[1]);
double d3 = view.getEyePoint().distanceTo3(corners[2]);
double d4 = view.getEyePoint().distanceTo3(corners[3]);
double d5 = view.getEyePoint().distanceTo3(centerPoint);
// Find the minimum eye distance. Compute cell height at the corresponding point.
double minDistance = d1;
double cellHeight = corners[0].getLength3() * level.getTexelSize(); // globe radius x radian texel size
double texelSize = level.getTexelSize();
if (d2 < minDistance)
{
minDistance = d2;
cellHeight = corners[1].getLength3() * texelSize;
}
if (d3 < minDistance)
{
minDistance = d3;
cellHeight = corners[2].getLength3() * texelSize;
}
if (d4 < minDistance)
{
minDistance = d4;
cellHeight = corners[3].getLength3() * texelSize;
}
if (d5 < minDistance)
{
minDistance = d5;
cellHeight = centerPoint.getLength3() * texelSize;
}
// Split when the cell height (length of a texel) becomes greater than the specified fraction of the eye
// distance. The fraction is specified as a power of 10. For example, a detail factor of 3 means split when the
// cell height becomes more than one thousandth of the eye distance. Another way to say it is, use the current
// tile if its cell height is less than the specified fraction of the eye distance.
//
// NOTE: It's tempting to instead compare a screen pixel size to the texel size, but that calculation is
// window-size dependent and results in selecting an excessive number of tiles when the window is large.
return cellHeight > minDistance * Math.pow(10, -this.getDetailFactor());
}
开发者ID:iedadata,项目名称:geomapapp,代码行数:48,代码来源:ScalingTiledImageLayer.java
示例19: getScreenPoint
import gov.nasa.worldwind.View; //导入依赖的package包/类
public static Point getScreenPoint( WorldWindow wwd, int x1, int y1 ) {
View view = wwd.getView();
Position p = view.computePositionFromScreenPoint(x1, y1);
Coordinate c = new Coordinate(p.longitude.degrees, p.latitude.degrees);
return GeometryUtilities.gf().createPoint(c);
}
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:7,代码来源:NwwUtilities.java
示例20: redrawMap
import gov.nasa.worldwind.View; //导入依赖的package包/类
public static void redrawMap() {
final View view = _ww.getView();
view.firePropertyChange(AVKey.VIEW, null, view);
// _ww.redraw();
// if (_map3View != null) {
//
// _map3View.redraw();
// }
}
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:14,代码来源:Map3Manager.java
注:本文中的gov.nasa.worldwind.View类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论