Package gov.nasa.worldwind.view.orbit

Examples of gov.nasa.worldwind.view.orbit.BasicOrbitView


            return null;
        }

        protected void zoomTo(LatLon latLon, Angle heading, Angle pitch, double zoom)
        {
            BasicOrbitView view = (BasicOrbitView) this.getApp().getWwd().getView();
            view.stopMovement();
            view.addPanToAnimator(
                new Position(latLon, 0), heading, pitch, zoom, true);
        }
View Full Code Here


   public void zoomTo(
           Position posCenter,
           double dblZoom,
           boolean blnIsPoint)
   {
      BasicOrbitView view = (BasicOrbitView) super.getView();


      Angle heading = Angle.fromDegrees(0.0);
      Angle pitch = Angle.fromDegrees(30.0);

      //if (! blnIsPoint)
      //    dblZoom *= 10.d;

      view.addPanToAnimator(posCenter, heading, pitch, dblZoom, true);
   }
View Full Code Here

      view.addPanToAnimator(posCenter, heading, pitch, dblZoom, true);
   }

   public void resetWwdViewDefault()
   {
      BasicOrbitView view = (BasicOrbitView) super.getView();

      /*
       * This code works, but there is a trouble-shooting when reseting default veis
       * in Flat world.
       * This code has been taken from demo : RoundWorldEarthquakes
       *
       * In this demo, the following is performed :
      Configuration.setValue(AVKey.INITIAL_LATITUDE, 0);
      Configuration.setValue(AVKey.INITIAL_LONGITUDE, 0);
      Configuration.setValue(AVKey.INITIAL_ALTITUDE, 50e6);
       *
       * It ensures could behaviour when reseting default view with flat map.
       * In the applis, the AvKeys are kept to worldwin defaults, i.e :
       * definel in : ressources/config/worldwind.xml
       * <Property name="gov.nasa.worldwind.avkey.InitialLatitude" value="38"/>
       * <Property name="gov.nasa.worldwind.avkey.InitialAltitude" value="19.07e6"/>
       * The initial longitude is set in :
       * gov.nasa.worldwind.Configuration.initializeDefaults()
       * and depends on user time zone.
       *
       */
      Double lat = -9999.9d; //Configuration.getDoubleValue(AVKey.INITIAL_LATITUDE);
      Double lon = -9999.9d; // Configuration.getDoubleValue(AVKey.INITIAL_LONGITUDE);
      Double elevation = -9999.9d; // Configuration.getDoubleValue(AVKey.INITIAL_ALTITUDE);

 
      // beg bantchao
      Globe glbDefault = getModel().getGlobe();
           
      if (glbDefault instanceof FlatGlobe)
      {
         lat = 0d;
         lon = 0d;
         elevation = 50e6d;
      }

      else if (glbDefault instanceof Earth)
      {
         lat = Configuration.getDoubleValue(AVKey.INITIAL_LATITUDE);
         lon = Configuration.getDoubleValue(AVKey.INITIAL_LONGITUDE);
         elevation = 19.07e6d; // memo: default value, not really needed
      }

      else
      {
         System.err.println("Uncaught instanceof glbDefault: " + glbDefault.getClass().toString());
         System.exit(1);
      }
      // end bantchao

      Position targetPos = Position.fromDegrees(lat, lon, 0);
      view.addPanToAnimator(
              // The elevation component of 'targetPos' here is not the surface elevation,
              // so we ignore it when specifying the view center position.
              new Position(targetPos, 0),
              Angle.ZERO,
              Angle.ZERO,//pitch
View Full Code Here

         super.wwd.getModel().setGlobe(_glbGlobeRound);
         // Switch to orbit view and update with current position
         FlatOrbitView flatOrbitView = (FlatOrbitView) super.wwd.getView();


         BasicOrbitView orbitView = new BasicOrbitView();
         orbitView.setCenterPosition(flatOrbitView.getCenterPosition());
         orbitView.setZoom(flatOrbitView.getZoom());
         orbitView.setHeading(flatOrbitView.getHeading());
         orbitView.setPitch(flatOrbitView.getPitch());
         super.wwd.setView(orbitView);

      }
      else
      {
         if (this._glbGlobeFlat == null)
         {
            _createGlobeFlat();
         }


         // Switch to flat globe
         super.wwd.getModel().setGlobe(this._glbGlobeFlat);

         // Switch to flat view and update with current position
         BasicOrbitView orbitView = (BasicOrbitView) super.wwd.getView();
         FlatOrbitView flatOrbitView = new FlatOrbitView();
         flatOrbitView.setCenterPosition(orbitView.getCenterPosition());
         flatOrbitView.setZoom(orbitView.getZoom());
         flatOrbitView.setHeading(orbitView.getHeading());
         flatOrbitView.setPitch(orbitView.getPitch());
         super.wwd.setView(flatOrbitView);

      }

      // Change sky layer
View Full Code Here

           
    public void restoreStateOrbitView(String str)
    {
       if (this._cnv != null)
       {
          BasicOrbitView view = (BasicOrbitView) this._cnv.getView();
          view.restoreState(str);
       }
    }
View Full Code Here

   
    public String getRestorableStateOrbitView()
    {
       if (this._cnv != null)
       {
          BasicOrbitView view = (BasicOrbitView) this._cnv.getView();
          String strRestorableState = view.getRestorableState();
          return strRestorableState;
       }
      
       return null;
    }
View Full Code Here

TOP

Related Classes of gov.nasa.worldwind.view.orbit.BasicOrbitView

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.