World Wind v1.4 API Specification

From World Wind Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 19:37, 22 June 2005 (edit)
143.232.86.153 (Talk)

← Previous diff
Revision as of 19:42, 22 June 2005 (edit) (undo)
143.232.86.153 (Talk)

Next diff →
Line 100: Line 100:
**** Under Construction **** Under Construction
-WorldWindow will contain an IAppContext object, which contains the persistant objects necessary for the construction of the WorldWindow environment. Among the DirectX devices, there is also a RootRenderable, a CameraManager, and a ParentWidget for which all GUI elements will reside under. IRenderables will need to subscribe to the CameraManager events to be able to update themselves as the camera moves around the environment. There is no longer an infinite updating loop, nor an infinite rendering loop. All DirectX-based GUI elements must derive the IWidget interface and add themselves to the ParentWidget. This allows a fully customizeable DX-based GUI+WorldWindow will contain an IAppContext object, which contains the persistant objects necessary for the construction of the WorldWindow environment. Among the DirectX devices, there is also a RootRenderable, a CameraManager, and a ParentWidget for which all GUI elements will reside under. IRenderables will need to subscribe to the CameraManager events to be able to update themselves as the camera moves around the environment. There is no longer an infinite updating loop, nor an infinite rendering loop. All DirectX-based GUI elements must derive the IWidget interface and add themselves to the ParentWidget. This allows a fully customizeable DX-based GUI. Also, the cameras are now free floating, meaning that they aren't necessary tied to any object, and thus, in order to get their Lat/Lon/Position, you'll need to calculate it from the Eye or Look vectors with respect to the "World" that you'd like a Lat/Lon/Distance of. It's not tough, just different. =b
'''Solutions:''' '''Solutions:'''

Revision as of 19:42, 22 June 2005

Key Interfaces that will be defined in the Plugin API

  • namespace WorldWindSDK
    • public interface IRenderable
      • Methods
        • void Dispose();
        • void Initialize();
        • void Render(ICamera camera);
      • Properties
        • IRenderableList ChildRenderables{get;set;}
        • bool Disposed{get;}
        • bool Initialized{get;}
        • Hashtable MetaData{get;set;}
        • string Id{get;set;}
        • byte Opacity{get;set;}
        • Quaternion Orientation{get;set;}
        • IRenderable ParentRenderable{get;set;}
        • Vector3 Position{get;set;}
        • bool Visible{get;set;} //used to be "IsOn"
    • public interface IRenderableList
      • Methods
        • void Add(IRenderable renderable);
        • void Clear();
        • void Insert(int index, IRenderable renderable);
        • IRenderable RemoveAt(int index);
        • IRenderable RemoveId(string Id);
      • Properties
        • int Count{get;}
        • IRenderableList ParentRenderableList{get;set;}
        • bool ShowOnlyOneLayer{get;set;}
      • Indexers
        • IRenderable this[int index] {get;set;}
    • public interface IInteractive //perhaps there are interfaces in .Net already for this...similar to JAVA KeyListener and MouseListener ?
      • Methods
        • void OnKeyDown(KeyEventArgs e);
        • void OnKeyUp(KeyEventArgs e);
        • void OnMouseDown(MouseEventArgs e);
        • void OnMouseEnter(EventArgs e);
        • void OnMouseLeave(EventArgs e);
        • void OnMouseMove(MouseEventArgs e);
        • void OnMouseUp(MouseEventArgs e);
        • void OnMouseWheel(MouseEventArgs e);
    • public delegate void CameraEvent(object sender, System.EventArgs e);
    • public interface ICamera
      • Methods
        • void SetupCamera(IAppContext appContext);
      • Events
        • event CameraEvent OnCameraMove;
      • Properties
        • Vector3 Eye{get;set;}
        • Vector3 LookAt{get;set;}
        • Vector3 Up{get;set;} //could be just {0, 0, 1} with Quaternion rotations applied afterwards
        • Quaternion EyeOrientation{get;set;} // Bank, Heading, and Tilt should be calculated from this
        • Quaternion LookAtOrientation{get;set;} // Heading and Tilt should should be calculated from this
        • Angle Fov{get;set;}
    • public interface ITerrainAccessor
      • Methods
        • double GetElevationAt(double lat, double lon, double targetSamplesPerDegree);
        • double[,] GetElevationArray(double north, double south, double west, double east, int samples);
    • public interface IWorld
      • Methods
        • Angle GetLatitudeFromCartesian(Vector3 cartesianPoint);
        • Angle GetLongitudeFromCartesian(Vector3 cartesianPoint);
        • double GetAltitudeFromCartesian(Vector3 cartesianPoint);
        • Angle GetViewRangeFromCartesian(Vector3 cartesianPoint);
      • Properties
        • double EquatorialRadius{get;}
        • double Flattening{get;}
        • double PolarRadius{get;}
        • ITerrainAccessor TerrainAccessor{get;}
    • public interface ICameraManager
      • Methods
        • void AddCamera(ICamera camera);
        • ICamera RemoveCamera(int index);
      • Events
        • event CameraEvent OnCameraMove;
      • Properties
        • int Count{get;}
      • Indexers
        • ICamera this[int index] {get;}
    • interface IAppContext
      • Properties
        • bool Repaint{get;set;} //might be removed
        • Microsoft.DirectX.Direct3D.Device Device3d{get;}
        • Microsoft.DirectX.DirectSound.Device DeviceSound{get;}
        • Microsoft.DirectX.Direct3D.Font DefaultDrawingFont{get;set;}
        • IRenderable RootRenderable{get;set;} //top level IRenderable for which all IRenderables will be children of
        • ICameraManager CameraManager{get;set;} //all IRenderables dependant on camera view position and angles should subscribe to the OnCameraMove event
        • System.Windows.Forms.Control ParentControl{get;} //might try using ParentControl.Invalidate() to signify a repaint
        • IWidget ParentWidget{get;} // top-level frame for all GUI Widgets
        • Hashtable ExtendableObjects {get;set;} //use to save "objects" that are not explicitly defined in IAppContext
    • public interface IWidget
      • Methods
        • Under Construction
      • Properties
        • Under Construction
    • public interface IWigdetCollection
      • Methods
        • Under Construction
      • Properties
        • Under Construction

WorldWindow will contain an IAppContext object, which contains the persistant objects necessary for the construction of the WorldWindow environment. Among the DirectX devices, there is also a RootRenderable, a CameraManager, and a ParentWidget for which all GUI elements will reside under. IRenderables will need to subscribe to the CameraManager events to be able to update themselves as the camera moves around the environment. There is no longer an infinite updating loop, nor an infinite rendering loop. All DirectX-based GUI elements must derive the IWidget interface and add themselves to the ParentWidget. This allows a fully customizeable DX-based GUI. Also, the cameras are now free floating, meaning that they aren't necessary tied to any object, and thus, in order to get their Lat/Lon/Position, you'll need to calculate it from the Eye or Look vectors with respect to the "World" that you'd like a Lat/Lon/Distance of. It's not tough, just different. =b

Solutions:

  • WorldWindSDK
    • produces API (version specific) DLLs
    • the idea is that this doesn't change often and should more or less be left alone.
  • WorldWindow
    • produces WorldWindow.dll
    • uses WorldWindSDK DLLs as base interfaces
  • WorldWind
    • produces WorldWind.exe
    • uses WorldWindow.dll

-- More to come...Feel free to comment

Personal tools