Java Movable类代码示例

本文整理汇总了Java中gov.nasa.worldwind.Movable的典型用法代码示例。如果您正苦于以下问题:Java Movable类的具体用法?Java Movable怎么用?Java Movable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Java Movable类代码示例

Movable类属于gov.nasa.worldwind包,在下文中一共展示了Movable类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: determineAdjustmentSide

import gov.nasa.worldwind.Movable; //导入依赖的package包/类
protected int determineAdjustmentSide(Movable dragObject, double factor) {
    if (dragObject instanceof SurfaceSector) {
        SurfaceSector quad = (SurfaceSector) dragObject;
        Sector s = quad.getSector(); // TODO: go over all sectors
        Position p = this.getWwd().getCurrentPosition();

        if (p == null) {
            return NONE;
        }

        double dN = abs(s.getMaxLatitude().subtract(p.getLatitude()).degrees);
        double dS = abs(s.getMinLatitude().subtract(p.getLatitude()).degrees);
        double dW = abs(s.getMinLongitude().subtract(p.getLongitude()).degrees);
        double dE = abs(s.getMaxLongitude().subtract(p.getLongitude()).degrees);

        double sLat = factor * s.getDeltaLatDegrees();
        double sLon = factor * s.getDeltaLonDegrees();

        if (dN < sLat && dW < sLon)
            return NORTHWEST;
        if (dN < sLat && dE < sLon)
            return NORTHEAST;
        if (dS < sLat && dW < sLon)
            return SOUTHWEST;
        if (dS < sLat && dE < sLon)
            return SOUTHEAST;
        if (dN < sLat)
            return NORTH;
        if (dS < sLat)
            return SOUTH;
        if (dW < sLon)
            return WEST;
        if (dE < sLon)
            return EAST;
    }

    return NONE;
} 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:39,代码来源:SectorSelector.java

示例2: resizeShape

import gov.nasa.worldwind.Movable; //导入依赖的package包/类
protected Sector resizeShape(Movable dragObject, int side) {
    if (dragObject instanceof SurfaceSector) {
        SurfaceSector quad = (SurfaceSector) dragObject;
        Sector s = quad.getSector(); // TODO: go over all sectors
        Position p = this.getWwd().getCurrentPosition();

        if (p == null || this.getPreviousPosition() == null) {
            return null;
        }

        Angle dLat = p.getLatitude().subtract(this.getPreviousPosition().getLatitude());
        Angle dLon = p.getLongitude().subtract(this.getPreviousPosition().getLongitude());

        Angle newMinLat = s.getMinLatitude();
        Angle newMinLon = s.getMinLongitude();
        Angle newMaxLat = s.getMaxLatitude();
        Angle newMaxLon = s.getMaxLongitude();

        if (side == NORTH) {
            newMaxLat = s.getMaxLatitude().add(dLat);
        } else if (side == SOUTH) {
            newMinLat = s.getMinLatitude().add(dLat);
        } else if (side == EAST) {
            newMaxLon = s.getMaxLongitude().add(dLon);
        } else if (side == WEST) {
            newMinLon = s.getMinLongitude().add(dLon);
        } else if (side == NORTHWEST) {
            newMaxLat = s.getMaxLatitude().add(dLat);
            newMinLon = s.getMinLongitude().add(dLon);
        } else if (side == NORTHEAST) {
            newMaxLat = s.getMaxLatitude().add(dLat);
            newMaxLon = s.getMaxLongitude().add(dLon);
        } else if (side == SOUTHWEST) {
            newMinLat = s.getMinLatitude().add(dLat);
            newMinLon = s.getMinLongitude().add(dLon);
        } else if (side == SOUTHEAST) {
            newMinLat = s.getMinLatitude().add(dLat);
            newMaxLon = s.getMaxLongitude().add(dLon);
        }

        return new Sector(newMinLat, newMaxLat, newMinLon, newMaxLon);
    }

    return null;
} 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:46,代码来源:SectorSelector.java

示例3: makeDraggable

import gov.nasa.worldwind.Movable; //导入依赖的package包/类
public static BasicDraggerRx makeDraggable(WorldWindow wwd, Movable movableObject){
    return new BasicDraggerRx(Objects.requireNonNull(wwd), Objects.requireNonNull(movableObject));
} 
开发者ID:eddieburns55,项目名称:RxWorldwind,代码行数:4,代码来源:BasicDraggerRx.java

本文标签属性:

示例:示例英文

代码:代码是什么

java:java游戏

上一篇:Python pylab.show函数代码示例
下一篇:C++ scale_surface函数代码示例

为您推荐