Changes between Initial Version and Version 1 of ossimPlanetAPI


Ignore:
Timestamp:
Feb 4, 2008, 10:09:52 AM (16 years ago)
Author:
mlucas17
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ossimPlanetAPI

    v1 v1  
     1= ossimPlanet API =
     2
     3ossimPlanet is an advanced 3D global visualization system that builds upon the remote sensing and GIS capabilities in OSSIM and the advanced 3D visualization capabilities of OpenSceneGraph.  The core libraries are written in C++ and provide the ability to display and manipulate large geospatial files, 3D models, OGC WMS sites, WorldWind data servers, KML/KMZ files, and Predator motion video. The system also includes a powerful action/router communication system that allows peer to peer or server to client synchronization of navigation, data sets, and internal functions between multiple instances of ossimPlanet.
     4
     5[[Image:OssimPlanetAPI.jpg]]
     6
     7The design goals of the system emphasize:
     8
     9* High performance 3D visualization
     10* Photogrammetric accuracy
     11* Native File access (files don't need to be staged, or "pre-cooked"
     12* Advanced Collaboration (Data and Navigation synchronization)
     13* Leveraging existing OpenSceneGraph and OSSIM capabilities
     14
     15== Goals ==
     16The objective of the ossimPlanet Applications Programming Interface (API) is to make it easy to integrate ossimPlanet capabilities into other programs, solutions, technologies and computer languages.  A properly implemented API will minimize the learning curve and provide a simplified interface to integrate a 3D planet into a new application.  The ossimPlanet API will be implemented in C in an ossimPlanetAPI.c and ossimPlanetAPI.h header file.  That interface will be wrapped to provide bindings to other languages (Java, Python, Cocoa, etc) to provide native interfaces for the project.  There will initially be three modes, depending on application requirements, for use of the API:
     17
     18# The application owns and controls its own OpenGL Context and embeds planet as another drawable (SCOPES)
     19# The application owns and controls its own OpenSceneGraph,  planet is just a node in that scene graph
     20# The application gets all OpenSceneGraph and viewing capabilites from ossimPlanet, it creates the context and the rendering window
     21
     22The API should simplify the initialization and viewing of a fully capable planet with a minimum number of program calls.  The API implementation strategy will take advantage of the existing router/action communications infrastructure that is already established in ossimPlanet.  Once the planet is up and running, virtually all other functions can be controlled by sending messages to ossimPlanet.  These messages and their corresponding actions will be defined in a separate section of this API.  Java and other languages have simple mechanisms to transmit messages with standard communications protocols.  These requests can be sent generically at run time to trigger desired behavior in local or remote planets.
     23
     24This document will take a top down approach to the API and implement some quick start guides to show the developer how to quickly implement an application that incorporates ossimPlanet capabilities.  The ultimate reference for the API will be ossimPlanet/include/ossimPlanet/ossimPlanetApi.h and ossimPlanet/src/ossimPlanet/ossimPlanetApi.cpp in the svn ossim repository.  To check out the ossim repository, type in the following from a terminal:
     25 svn co https://svn.osgeo.org/ossim/trunk .
     26 For non developers use the technique that does not go through a secure socket:
     27 svn co http://svn.osgeo.org/ossim/trunk .
     28 (note the trailing . )
     29
     30== Quickstart Guide ==
     31
     32There are three potential paths to integrating ossimPlanet into your application:
     33
     34#  The application owns and controls its own OpenGL Context and embeds planet as another drawable (SCOPES)
     35#  The application owns and controls its own OpenSceneGraph,  planet is just a node in that scene graph
     36#  The application gets all OpenSceneGraph and viewing capabilites from ossimPlanet, it creates the context and the rendering window
     37
     38The initialization will begin with setting up a state pointer to ossimPlanet passing the appropriate mode from the list above.  This will initialize all needed resources for your application.
     39
     40== Case 1 The application owns and controls its own OpenGL Context ==
     41and embeds planet as another drawable
     42
     43[[Image:Case1ossimPlanetAPI.jpg]]
     44
     45Use this case if your application already creates and maintains its own OpenGL context.  Within that context, ossimPlanet is just another drawable.  Behind the scenes ossimPlanet will provide the globe which is managed by an OpenSceneGraph within the library.
     46
     47== Case 2 The application owns and controls its own OpenSceneGraph ==
     48planet is just a node in that scene graph
     49
     50[[Image:Case2ossimPlanetAPI.jpg]]
     51
     52This case is for applications that create and maintain their own OpenSceneGraph.  In this case the planet and it subtree of objects is just added as a node in the Application's tree.
     53
     54== Case 3 The application gets all OpenSceneGraph and viewing capabilites from ossimPlanet ==
     55it creates the context and the rendering window.
     56
     57[[Image:Case3ossimPlanetAPI.jpg]]
     58
     59OssimPlanet with create and provide the view, the tree, and the planet objects to the application.  For new applications and simulations this approach requires the least amount of programming.
     60
     61== C API Reference ==
     62=== Type Definitions ===
     63ossimPlanet_StatePtr is the main pointer.  All API calls will manpulate this state pointer. 
     64It will hold the planet layers, views, manipulators, ... etc. ossimPlanet_PlanetPtr is the native pointer
     65to a Planet Object.  The ossimPlanet_LayerPtr is the native pointer to a Planet layer.   
     66
     67   typedef void*        ossimPlanet_StatePtr;
     68   typedef void*        ossimPlanet_PlanetPtr;
     69   typedef void*        ossimPlanet_LayerPtr;
     70   typedef ossim_int64   ossimPlanet_IndexType;
     71   typedef ossim_uint64 ossimPlanet_SizeType;
     72   typedef const char*  ossimPlanet_ConstStringType;
     73   typedef char*        ossimPlanet_StringType;
     74   
     75The context type determines how much you want the API to manage and handle.  There are 3 ways you probably would like to use the library. 
     76
     77*CASE 1 -  ossimPlanet_NOVIEWER_CONTEXT option is used to embed  the scenegraph and bridge view parameters. There are 2 situations when you want to do this and both require that you create your own GL context and manage it. The first situation is if Planet is the drawable and you are in a GUI environment that creates a Gl context for you.  You just make it current and then draw the planet and use the API to bridge view parameters and manipulate layers.  The second situation is if you have a full GL application that you wrote and all you want to do is embed the planet as a drawable.  This requires some additional gl state saving when invoking the drawing of the planet.
     78* CASE 2 - ossimPlanet_PLANET_ONLY_CONTEXT option is used when you are wanting to use the API only to interface into the manipulation of the planet layers.  Typically this is done if you have your own OpenSceneGraph and your own View and gl context.  We will give you native access to the root planet class.
     79* CASE 3 - ossimPlanet_VIEWER_CONTEXT option is typical of a full command line application that all you are concerned about is scripting and running a full screen or windowed planet.  This will interface into osg::Viewer and will create a render window for you.
     80
     81 typedef enum ossimPlanet_ContextType
     82 {
     83      ossimPlanet_NOVIEWER_CONTEXT    = 0,
     84      ossimPlanet_PLANET_ONLY_CONTEXT = 1,
     85      ossimPlanet_VIEWER_CONTEXT      = 2
     86 };
     87
     88Standard boolean enumeration
     89
     90   typedef enum ossimPlanet_BOOL
     91   {
     92      ossimPlanet_FALSE = 0,
     93      ossimPlanet_TRUE  = 1
     94   };
     95
     96=== Setup and Initialization ===
     97This section is reserved for setup and initialization.  There are a number of setup interfaces that can be used to set internal variables and search paths before the init is called.
     98
     99'''ossimPlanet_addOpenSceneGraphLibraryPath''' Will add the passed in path to OpenSceneGraph's Library path.  This will be used mainly for finding OpenSceneGraph plugins.  If this needs to be setup it should be done before you call ossimPlanet_init and start adding layers to planet.
     100   
     101  /**
     102    * @param path Path to add to the Library search path.
     103    * @param insertFrontFlag Inserts the path to the front of the search path list if its ossimPlanet_TRUE and
     104    *                        appends to the end otherwise.
     105    */
     106   OSSIMPLANET_DLL void ossimPlanet_addOpenSceneGraphLibraryPath(ossimPlanet_ConstStringType path,
     107                                                                 ossimPlanet_BOOL insertFrontFlag);
     108
     109
     110'''ossimPlanet_addOpenSceneGraphDataPath''' Adds the passed in path to OpenSceeGraph's data path.  This allows one to give relative path naming to data that is loaded.  For example:  if you have a font called arial.ttf and it's located in /fonts then you can add /fonts to the search path and you can load a font by just the name "arial.ttf".  The /fonts will be prepended.  If this needs to be setup it should be done before you call ossimPlanet_init and start adding layers to planet.
     111
     112  /**
     113    * @param path Path to add to the Data search path.
     114    * @param insertFrontFlag Inserts the path to the front of the search path list if its ossimPlanet_TRUE and
     115    *                        appends to the end otherwise.
     116    */
     117   OSSIMPLANET_DLL void ossimPlanet_addOpenSceneGraphDataPath(ossimPlanet_ConstStringType path,
     118                                                              ossimPlanet_BOOL insertFrontFlag);
     119   
     120'''ossimPlanet_loadOssimPreferenceFile''' exposes the OSSIM core engines preference loading from a file.
     121
     122   /**
     123    * @param preferenceFile The preference file to load.
     124    */
     125   OSSIMPLANET_DLL void ossimPlanet_loadOssimPreferenceFile(ossimPlanet_ConstStringType preferenceFile);
     126
     127'''ossimPlanet_setOssimPreferenceNameValue''' Allows you access to the OSSIM core engine's preference variables and you can set them.
     128   /**
     129    * @param name The name of the preference variable.
     130    * @param value The value of the preference variable.
     131    */
     132   OSSIMPLANET_DLL void ossimPlanet_setOssimPreferenceNameValue(ossimPlanet_ConstStringType name,
     133                                                                ossimPlanet_ConstStringType value);
     134
     135'''ossimPlanet_addOssimPlugin'''     Adds an ossim core plugin.  If this is a directory then all files in the directoy that are plugins are added
     136   /**
     137    * @param path Path to add to the OSSIM Plugin search path.
     138    * @param insertFrontFlag Inserts the path to the front of the list if its ossimPlanet_TRUE and
     139    *                        appends to the end otherwise.
     140    */
     141   OSSIMPLANET_DLL void ossimPlanet_addOssimPlugin(ossimPlanet_ConstStringType path,
     142                                                   ossimPlanet_BOOL insertFrontFlag);
     143
     144'''ossimPlanet_addOssimElevation''' Add elevation to the OSSIM core system.
     145   /**
     146    * @param path Path to add to the Elevation.
     147    */
     148   OSSIMPLANET_DLL void ossimPlanet_addOssimElevation(ossimPlanet_ConstStringType path);
     149
     150
     151
     152'''ossimPlanet_addGeoid''' Elevation data is typically relative to mean sea level.  The geoid grids will be used to shift the Mean Sea Level to ellipsoidal heights.
     153
     154   /**
     155    * @param path Path to add to the Geoid search path.
     156    * @param byteOrder.  Most of the goid grids don't have Endian indication.  You can download little endian or big endian type geoid grids
     157    *        The basic 96 grid that comes with OSSIM egm96.grd is a big endian byte order.  You can downlod from
     158    * @param insertFrontFlag Inserts the path to the front of the search path list if its ossimPlanet_TRUE and
     159    *                        appends to the end otherwise.
     160    */
     161   OSSIMPLANET_DLL void ossimPlanet_addGeoid(ossimPlanet_ConstStringType path,
     162                                             ossimByteOrder byteOrder,
     163                                            ossimPlanet_BOOL insertFrontFlag);
     164
     165'''ossimPlanet_init''' Used to initialize the system.  This is typically called one time.  It initializes internal registries.
     166
     167 void ossimPlanet_init();
     168
     169'''ossimPlanet_initWithArgs''' Allows one to init by passing command line arguments.  This is typically used by command line applications.
     170
     171   /**
     172    * @param argc A pointer to an integer.
     173    * @param argv Pointer to the argv.
     174    */
     175   OSSIMPLANET_DLL void ossimPlanet_initWithArgs(int* argc, char** argv[]);
     176
     177'''ossimPlanet_setTracePattern''' Allows you to set the trace on and off for various classes in the system.  If you want to trace all ossim classes then do ossimPlanet_setTracePattern("ossim.*");
     178
     179'''ossimPlanet_setTracePattern''' Allows you to set the trace on and off for various classes in the system.  This is in the format of a regular expression.  Some of the special characters found in the regular expression are:
     180   /**
     181    * ^        Matches at beginning of a line
     182    * $        Matches at end of a line
     183    * .        Matches any single character
     184    * [ ]      Matches any character(s) inside the brackets
     185    * [^ ]     Matches any character(s) not inside the brackets
     186    * -        Matches any character in range on either side of a dash
     187    * *        Matches preceding pattern zero or more times
     188    * +        Matches preceding pattern one or more times
     189    * ?        Matches preceding pattern zero or once only
     190    *
     191    * ()       Saves a matched expression and uses it in a  later match
     192    *
     193    * If you want to trace all
     194    * ossim classes then do :
     195    *
     196    * ossimPlanet_setTracePattern("ossim.*");
     197    *
     198    * @param pattern A regular expression pattern to describe what to trace. 
     199    */
     200   OSSIMPLANET_DLL void ossimPlanet_setTracePattern(ossimPlanet_ConstStringType pattern);
     201
     202'''ossimPlanet_finalize''' Allows for cleanup.  It will cleanup wen the last finalize is called. So if multiple calls to init occur then the same number of finalizes need to occur.
     203
     204 void ossimPlanet_finalize();
     205
     206'''ossimPlanet_microSecondSleep''' Gives access to a microsecond sleep.
     207   /**
     208    * @param microSeconds Specify how many microseconds to sleep.
     209    */
     210   OSSIMPLANET_DLL void ossimPlanet_microSecondSleep(ossimPlanet_SizeType microSeconds);
     211   
     212
     213'''ossimPlanet_milliSecondSleep''' Gives access to a millisecond sleep.
     214   /**
     215    * @param milliSeconds Specify how many microseconds to sleep.
     216    */
     217   OSSIMPLANET_DLL void ossimPlanet_milliSecondSleep(ossimPlanet_SizeType milliSeconds);
     218
     219
     220'''ossimPlanet_secondSleep''' Gives access to a seconds sleep.
     221
     222   /**
     223    * @param seconds Specify how many microseconds to sleep.
     224    */
     225   OSSIMPLANET_DLL void ossimPlanet_secondSleep(ossimPlanet_SizeType seconds);
     226
     227=== State Interface ===
     228
     229Cases 1,2, & 3
     230
     231'''ossimPlanet_newState'''  will return an internal class that contains all the needed state information.  It will basically create a self contained manager for view, layers, manipulator, ... etc.  This Will be the main pointer that all API calls operate on.  Note: Currently there can be only 1 view assigned per state.
     232
     233    /**
     234    * @param contextType This specifies the type of context you would like to create.  @see ossimPlanet_contextType.
     235    *
     236    * @return State pointer;
     237    */
     238   OSSIMPLANET_DLL ossimPlanet_StatePtr ossimPlanet_newState(ossimPlanet_ContextType type);
     239   
     240   
     241'''ossimPlanet_deleteState''' will delete the passed in state and set the pointer back to 0.
     242
     243 /**
     244 * @param state This is the state to delete.
     245 */
     246 OSSIMPLANET_DLL void ossimPlanet_deleteState(ossimPlanet_StatePtr state);
     247
     248=== View Interface ===
     249
     250Cases 1 and 3
     251
     252The view interface portion of the API applies only to the ossimPlanet_VIEWER_CONTEXT and ossimPlanet_NOVIEWER_CONTEXT.  The API will define ways to manipulate the view, setup projection and View Matrices, define viewport settings, ... etc.
     253
     254'''ossimPlanet_setSceneDataToView''' is used to set the Planet layers to the view once you finish setting it up.  Typically, you initialize the layers to default values and then call this API to tie it to the view.
     255
     256   /**
     257    * @param state The state to modify.
     258    */
     259   OSSIMPLANET_DLL void ossimPlanet_setSceneDataToView(ossimPlanet_StatePtr state);
     260
     261'''setViewportToCurrentGlSettings''' will assume that a Gl context is created and that the Viewport is set.  It will use GL calls to get the current Viewport values and set to the internal structures associated with the passed in state.  This is used when you are manipulating the Viewport through GL calls.  If this is the case then you can call this before rendering the planet.
     262
     263'''ossimPlanet_setViewManipulator''' Allows one to set a manipulator for the view.  For now, we only support manipulator type ossimPlanetManipulator.
     264
     265   /**
     266    * @param state The state to modify.
     267    * @param typeName The type of Manipulator to create.  The current one is ossimPlanetManipulator.
     268    * @param receverPathName The recever path name given to this object.  We can pass setup commands to it.
     269    */
     270   OSSIMPLANET_DLL void ossimPlanet_setViewManipulator(ossimPlanet_StatePtr state,
     271                                                       ossimPlanet_ConstStringType typeName,
     272                                                       ossimPlanet_ConstStringType receiverPathName);
     273
     274   /**
     275    * @param state State to modify.
     276    */
     277   OSSIMPLANET_DLL void setViewportToCurrentGlSettings(ossimPlanet_StatePtr state);
     278
     279'''ossimPlanet_setViewManipulator''' will set your current state view manipulator.
     280   /**
     281    *  Only support ossimPlanetManipulator type for now.
     282    *
     283    * @param state The state to modify.
     284    * @param typeName The type of Manipulator to create.  The current one is ossimPlanetManipulator.
     285    * @param receverPathName The recever path name given to this object.  We can pass setup commands to it.
     286    */
     287   OSSIMPLANET_DLL void ossimPlanet_setViewManipulator(ossimPlanet_StatePtr state,
     288                                                       ossimPlanet_ConstStringType typeName,
     289                                                       ossimPlanet_ConstStringType receiverPathName);
     290
     291   /**
     292    * @param state State to modify.
     293    */
     294   OSSIMPLANET_DLL void setViewportToCurrentGlSettings(ossimPlanet_StatePtr state);
     295   
     296'''setProjectionMatrixToCurrentGlSettings''' This will assume that a Gl context is created and that the Projection Matrix is set.  It will use GL calls to get the current Projection Matrix values and set to the internal structures associated with the passed in state.  This is used when you are manipulating the Projection Matrix through  GL calls.  If this is the case then you can call this before rendering the planet.
     297
     298   /**
     299    * @param state State to modify.
     300    */
     301   OSSIMPLANET_DLL void setProjectionMatrixToCurrentGlSettings(ossimPlanet_StatePtr state);
     302   
     303'''setModelViewMatrixToCurrentGlSettings''' This will assume that a Gl context is created and that the ModelView Matrix is set.  It will use GL calls to get the current ModelView Matrix values and set to the internal structures associated with the passed in state.  This is used when you are manipulating the ModelView Matrix through GL calls.  If this is the case then you can call this before rendering the planet.
     304
     305   /**
     306    * @param state State to modify.
     307    */
     308   OSSIMPLANET_DLL void setModelViewMatrixToCurrentGlSettings(ossimPlanet_StatePtr state);
     309
     310'''ossimPlanet_setProjectionMatrixAsPerspective''' will allow one to set the perspective.
     311
     312   /**
     313    * @param state The state to modify.
     314    * @param fov Field of view in degrees.
     315    * @param aspectRatio The aspect ratio of the view.
     316    * @param near The near plane distance.
     317    * @param far The far plane distance.
     318    */
     319   OSSIMPLANET_DLL void ossimPlanet_setProjectionMatrixAsPerspective(ossimPlanet_StatePtr state,
     320                                                                     double fov,
     321                                                                     double aspectRatio,
     322                                                                     double near,
     323                                                                     double far);
     324
     325'''ossimPlanet_setProjectionMatrixAsFrustum''' is identical to using the  glFrustum call.
     326
     327   /**
     328    * @param state The state to modify.
     329    * @param left Left value.
     330    * @param right Right value.
     331    * @param bottom Bottom value.
     332    * @param top Top value.
     333    * @param zNear zNear value.
     334    * @param zFar zFar value.
     335    */
     336   OSSIMPLANET_DLL void ossimPlanet_setProjectionMatrixAsFrustum(ossimPlanet_StatePtr state,
     337                                                                 double left, double right,
     338                                                                 double bottom, double top,
     339                                                                 double zNear, double zFar);
     340
     341'''ossimPlanet_setProjectionMatrixAsOrtho''' is identical to the glOrtho call and creates and orthographic projection.
     342   
     343   /**
     344    * @param state The state to modify.
     345    * @param left Left value.
     346    * @param right Right value.
     347    * @param bottom Bottom value.
     348    * @param top Top value.
     349    * @param zNear zNear value.
     350    * @param zFar zFar value.
     351    */
     352   OSSIMPLANET_DLL void ossimPlanet_setProjectionMatrixAsOrtho(ossimPlanet_StatePtr state,
     353                                                               double left, double right,
     354                                                               double bottom, double top,
     355                                                               double zNear, double zFar);
     356   
     357'''ossimPlanet_setProjectionMatrixAsOrtho2D''' will set to a 2D orthographic projection. See OpenGL glOrtho2D documentation for further details.
     358   /**
     359    * @param state The state to modify.
     360    * @param left Left value.
     361    * @param right Right value.
     362    * @param bottom Bottom value.
     363    * @param top Top value.
     364    */
     365   OSSIMPLANET_DLL void ossimPlanet_setProjectionMatrixAsOrtho2D(ossimPlanet_StatePtr state,
     366                                                                 double left, double right,
     367                                                                 double bottom, double top);
     368
     369'''ossimPlanet_setProjectionMatrixAsRowOrderedArray'''  assumes a 4x4 array or 16 consecutive values.  The values are stored row ordered.  This means that the first 4 values are for the first row and the second four values are for the second row, ... etc.
     370
     371   /**
     372    * @param state The state to modify.
     373    * @param m The array of 16 values
     374    */
     375   OSSIMPLANET_DLL void ossimPlanet_setProjectionMatrixAsRowOrderedArray(ossimPlanet_StatePtr state,
     376                                                                         double* m);
     377   
     378'''ossimPlanet_setProjectionMatrix''' will set the projection matrix to the passed in values.  Note m00 - m03 identifies the first row of the matrix, then the next is the second row, ... etc.
     379
     380   /**
     381    * @param state The state to modify the view orientation matrix.
     382    * @param m00 row 0 col 0
     383    * @param m01 row 0 col 1
     384    * @param m02 row 0 col 2
     385    * @param m03 row 0 col 3
     386    * @param m10 row 1 col 0
     387    * @param m11 row 1 col 1
     388    * @param m12 row 1 col 2
     389    * @param m13 row 1 col 3
     390    * @param m20 row 2 col 0
     391    * @param m21 row 2 col 1
     392    * @param m22 row 2 col 2
     393    * @param m23 row 2 col 3
     394    * @param m30 row 3 col 0
     395    * @param m31 row 3 col 1
     396    * @param m32 row 3 col 2
     397    * @param m33 row 3 col 3
     398    *
     399    */
     400   OSSIMPLANET_DLL void ossimPlanet_setProjectionMatrix(ossimPlanet_StatePtr state,
     401                                                        double m00, double m01, double m02, double m03,
     402                                                        double m10, double m11, double m12, double m13,
     403                                                        double m20, double m21, double m22, double m23,
     404                                                        double m30, double m31, double m32, double m33);
     405
     406
     407'''ossimPlanet_setViewMatrixAsLlhHprRelativeTangent''' will allow one to pass in the lat, lon height and the euler angles to define the view matrix.  The Euler angles are relative to the tangent plane at the given lat lon position.  Note: this is for the camera and the Z-Axis is the plumb/Nadir axis.  This means that a heading, pitch and roll of all zero degrees will have the eye looking straight down.  Note: all lat lon values are assumed to be relative to the WGS84 ellipsoid. 
     408
     409  /**
     410    * @param state The state to modify.
     411    * @param lat The latitude of the view camera in degrees.
     412    * @param lon The longitude of the view camera in degrees.
     413    * @param height The height of the view camera in meters relative to the WGS84 ellipsoid.
     414    * @param heading The heading of the view camera in degrees.
     415    * @param pitch  The pitch of the view camera in degrees.
     416    * @param roll  The roll of the view camera in degrees.
     417    */
     418   OSSIMPLANET_DLL void ossimPlanet_setViewMatrixAsLlhHprRelativeTangent(ossimPlanet_StatePtr state,
     419                                                                         double lat,
     420                                                                         double lon,
     421                                                                         double height,
     422                                                                         double heading,
     423                                                                         double pitch,
     424                                                                         double roll);
     425   
     426'''ossimPlanet_setViewMatrixAsLlhHprAbsolute'''    will allow one to pass in the lat, lon height and the euler angles to define the view matrix.  The Euler angles are not relative to the tangent plane at the given lat lon position but instead the unit axis is used as the base for the camera and the Z-Axis is the plumb/Nadir axis.  Note: all lat lon values are assumed to be relative to the WGS84 ellipsoid. 
     427
     428
     429   /**
     430    * @param state The state to modify.
     431    * @param lat The latitude of the view camera in degrees.
     432    * @param lon The longitude of the view camera in degrees.
     433    * @param height The height of the view camera in meters relative to the WGS84 ellipsoid.
     434    * @param heading The heading of the view camera in degrees.
     435    * @param pitch  The pitch of the view camera in degrees.
     436    * @param roll  The roll of the view camera in degrees.
     437    */
     438   OSSIMPLANET_DLL void ossimPlanet_setViewMatrixAsLlhHprAbsolute(ossimPlanet_StatePtr state,
     439                                                                  double lat,
     440                                                                  double lon,
     441                                                                  double height,
     442                                                                  double heading,
     443                                                                  double pitch,
     444                                                                  double roll);
     445   
     446'''ossimPlanet_setViewMatrixAsRowOrderedArray''' will set the matrix to the passed in row ordered array.
     447
     448   /**
     449    * @param state The state to modify the view orientation matrix.
     450    * @param m Row ordered view matrix.
     451    */
     452   OSSIMPLANET_DLL void ossimPlanet_setViewMatrixAsRowOrderedArray(ossimPlanet_StatePtr state,
     453                                                                   const double *m);
     454   
     455
     456'''ossimPlanet_setViewMatrix'''    will set the matrix to the passed in values.  Note m00 - m03 identifies the first row of the matrix, then the next is the second row, ... etc.
     457
     458   /**
     459    *
     460    * @param state The state to modify the view orientation matrix.
     461    * @param m00 row 0 col 0
     462    * @param m01 row 0 col 1
     463    * @param m02 row 0 col 2
     464    * @param m03 row 0 col 3
     465    * @param m10 row 1 col 0
     466    * @param m11 row 1 col 1
     467    * @param m12 row 1 col 2
     468    * @param m13 row 1 col 3
     469    * @param m20 row 2 col 0
     470    * @param m21 row 2 col 1
     471    * @param m22 row 2 col 2
     472    * @param m23 row 2 col 3
     473    * @param m30 row 3 col 0
     474    * @param m31 row 3 col 1
     475    * @param m32 row 3 col 2
     476    * @param m33 row 3 col 3
     477    *
     478    */
     479   OSSIMPLANET_DLL void ossimPlanet_setViewMatrix(ossimPlanet_StatePtr state,
     480                                                  double m00, double m01, double m02, double m03,
     481                                                  double m10, double m11, double m12, double m13,
     482                                                  double m20, double m21, double m22, double m23,
     483                                                  double m30, double m31, double m32, double m33);
     484
     485'''ossimPlanet_setViewport''' will allow you to set the viewport dimensions.
     486
     487   /**
     488    * @param state  The state to modify the viewport definitions.
     489    * @param x The x location in pixels of the viewport.  Typically 0
     490    * @param y The y location in pixels of the viewport.  Typically 0
     491    * @param w The width in pixels of the viewport.
     492    * @param h The height in pixels of the viewport.
     493    *
     494    */
     495   OSSIMPLANET_DLL void ossimPlanet_setViewport(ossimPlanet_StatePtr state,
     496                                                int x,
     497                                                int y,
     498                                                int w,
     499                                                int h);
     500
     501'''ossimPlanet_setViewportClearColor''' will clear the viewport with the passed in color.
     502
     503   /**
     504    * @param state  The state information to modify the clear color.
     505    * @param red The red component of the clear color.
     506    * @param green The green component of the clear color.
     507    * @param blue The blue component of the clear color.
     508    * @param alpha The alpha component of the clear color.
     509    */
     510   OSSIMPLANET_DLL void ossimPlanet_setViewportClearColor(ossimPlanet_StatePtr state,
     511                                                  float red,
     512                                                  float green,
     513                                                  float blue,
     514                                                  float alpha);
     515
     516=== Rendering Interface ===
     517Cases 2 and 3
     518
     519This will hold the basic rendering interface definitions.  We should supply a way to query if the graph needs rendering or not and a way to render the graph.
     520
     521
     522'''ossimPlanet_renderFrame'''  is the main rendering step.  This will render 1 frame.
     523
     524   /**
     525     * @param state The state to modify.
     526     * @return Returns ossimPlanet_TRUE if the render frame can continue again or
     527     *                 ossimPlanet_FALSE if it was canceled. 
     528     */
     529   OSSIMPLANET_DLL ossimPlanet_BOOL ossimPlanet_renderFrame(ossimPlanet_StatePtr state);
     530
     531'''ossimPlanet_renderFramePreserveState'''  is the main rendering step.  This will render 1 frame and preserve the state.  This will call osismPlanet_pushState before rendering and ossimPlanet_popState after rendering and will preserve gl attributes, View, Projection and Texture matrices.
     532
     533   /**
     534    * @param state The state to modify.
     535    * @return Returns ossimPlanet_TRUE if the render frame can continue again or
     536    *                 ossimPlanet_FALSE if it was canceled. 
     537    */
     538   OSSIMPLANET_DLL ossimPlanet_BOOL ossimPlanet_renderFramePreserveState(ossimPlanet_StatePtr state);
     539
     540
     541'''ossimPlanet_needsRendering''' is used determine if another frame is required to be rendered.  Call this to determine if you need to call ossimPlanet_renderFrame.   
     542
     543   /**
     544    * Example use:
     545    *
     546    *    if(ossimPlanet_needsRendering(state))
     547    *    {
     548    *        ossimPlanet_frame(state);
     549    *    }
     550    *
     551    * @param state The state to modify.
     552    * @return ossimPlanet_TRUE if needs to continue rendering or ossimPlanet_FALSE if
     553    *         no more rendering is required.
     554    */
     555   OSSIMPLANET_DLL ossimPlanet_BOOL ossimPlanet_needsRendering(ossimPlanet_StatePtr state);
     556
     557=== Layer interface ===
     558This section allows for generic Planet layer manipulation.
     559
     560'''ossimPlanet_addLayer''' adds a layer to planet. the layer type is used in the ossimPlanetLayerRegistry to construct a layer of the passed layerType.  The receiverName is used to set the receiver name of the layer created so action messages can be routed to it.
     561
     562   /**
     563    * @param state The state to modify.
     564    * @param layerType Layer type name to add.  This is used by the layer registry to construct a layer
     565    *                  specified by the layerType.
     566    * @param name This is the name you wish to give the layer.
     567    * @param id This is the id for the layer.
     568    * @param description This is the description for the layer.
     569    * @param receiverPathName Allows one to create a receiver name for the layer.  This is the target name for
     570    *                         Action messages(@see ossimPlanet_routeAction).
     571    *
     572    * @return The natve pointer to the layer added.
     573    */
     574   OSSIMPLANET_DLL ossimPlanet_LayerPtr ossimPlanet_addLayer(ossimPlanet_StatePtr state,
     575                                                             ossimPlanet_ConstStringType layerType,
     576                                                             ossimPlanet_ConstStringType name,
     577                                                             ossimPlanet_ConstStringType id,
     578                                                             ossimPlanet_ConstStringType description,
     579                                                             ossimPlanet_ConstStringType receiverPathName);
     580
     581'''ossimPlanet_getNumberOfLayers''' Allows one access to the number of layers currently defined for your state.
     582
     583   /**
     584    * @param state The state to use.
     585    *
     586    * @return Returns the number of layers defined in planet for the give state.
     587    */
     588   OSSIMPLANET_DLL ossimPlanet_SizeType ossimPlanet_getNumberOfLayers(ossimPlanet_StatePtr state);
     589
     590
     591'''ossimPlanet_getIndexOfLayerGivenPtr''' Allows one to get the layer index of the passed in layer.
     592
     593   /**
     594    * @param state The state to use.
     595    * @param layerPtr The layer pointer to use.
     596    *
     597    * @return Returns the index of the layer given it's pointer.
     598    */
     599   OSSIMPLANET_DLL ossimPlanet_IndexType ossimPlanet_getIndexOfLayerGivenPtr(ossimPlanet_StatePtr state,
     600                                                                             ossimPlanet_LayerPtr layerPtr);
     601 
     602'''ossimPlanet_getLayerGivenIndex''' Allows one to get the layer pointer from the passed in index. 
     603   /**
     604    * @param state The state to use.
     605    * @param idx The index number of the layer to return.
     606    *
     607    * @return Returns the layer pointer given an index.  NULL or 0 is returned if idx is out of range.
     608    */
     609   OSSIMPLANET_DLL ossimPlanet_LayerPtr ossimPlanet_getLayerGivenIndex(ossimPlanet_StatePtr state,
     610                                                                       ossimPlanet_IndexType idx);
     611
     612'''ossimPlanet_getLayerGivenId''' Will return the native layer pointer given the id   
     613   /**
     614    * @param state The state to use.
     615    * @param idThe id of the layer to search.
     616    *
     617    * @return Returns the layer pointer identified by id.
     618    */
     619   OSSIMPLANET_DLL ossimPlanet_LayerPtr ossimPlanet_getLayerGivenId(ossimPlanet_StatePtr state,
     620                                                                    ossimPlanet_ConstStringType id);
     621
     622'''ossimPlanet_getLayerName''' returns the layer name.
     623
     624   /**
     625    * @param state The state to use.
     626    * @param idx The index of the layer to access.
     627    *
     628    * @return The layer name for the layer at the specified index.
     629    */
     630   OSSIMPLANET_DLL ossimPlanet_ConstStringType ossimPlanet_getLayerName(ossimPlanet_LayerPtr layer);
     631
     632'''ossimPlanet_setLayerName''' allows one to set the layer name.
     633   
     634   /**
     635    * @param layer The layer to set.
     636    * @param name The name to set the layer to.
     637    */
     638   OSSIMPLANET_DLL void ossimPlanet_setLayerName(ossimPlanet_LayerPtr layer,
     639                                                 ossimPlanet_ConstStringType name);   
     640
     641'''ossimPlanet_getLayerId''' returns the layer id.
     642   
     643   /**
     644    * @param state The state to use.
     645    * @param idx The index of the layer to access.
     646    *
     647    * @return The layer name for the layer at the specified index.
     648    */
     649   OSSIMPLANET_DLL ossimPlanet_ConstStringType ossimPlanet_getLayerId(ossimPlanet_LayerPtr layer);
     650     
     651'''ossimPlanet_setLayerId''' Allows one to set the layer id.
     652
     653   /**
     654    * @param layer The layer to set.
     655    * @param id The id to set the layer to.
     656    */
     657   OSSIMPLANET_DLL void ossimPlanet_setLayerId(ossimPlanet_LayerPtr layer,
     658                                               ossimPlanet_ConstStringType id);
     659
     660'''ossimPlanet_getLayerDescription''' returns the layer description.
     661
     662   /**
     663    * @param state The state to use.
     664    * @param idx The index of the layer to access.
     665    *
     666    * @return The layer description for the layer at the specified index.
     667    */
     668   OSSIMPLANET_DLL ossimPlanet_ConstStringType ossimPlanet_getLayerDescription(ossimPlanet_LayerPtr layer);
     669
     670'''ossimPlanet_setLayerDescription''' Allows one to set the layer description.
     671
     672   /**
     673    * @param layer The layer to set.
     674    * @param description The description to set the layer to.
     675    */
     676   OSSIMPLANET_DLL void ossimPlanet_setLayerDescription(ossimPlanet_LayerPtr layer,
     677                                                        ossimPlanet_ConstStringType description);
     678
     679'''ossimPlanet_getLayerReceverPathName''' Returns the layer's receiver path name
     680
     681   /**
     682    * @param state The state to use.
     683    * @param idx The index of the layer to access.
     684    *
     685    * @return The recever path name for the layer at the specified index.
     686    */
     687   OSSIMPLANET_DLL ossimPlanet_ConstStringType ossimPlanet_getLayerReceverPathName(ossimPlanet_LayerPtr layer);
     688
     689'''ossimPlanet_setLayerReceiverPathName''' Allows one to change/set the layer receiver path name.     
     690   /**
     691    * @param layer The layer to set.
     692    * @param receiverName The description to set the layer to.
     693    */
     694   OSSIMPLANET_DLL void ossimPlanet_setLayerReceiverPathName(ossimPlanet_LayerPtr layer,
     695                                                             ossimPlanet_ConstStringType receiverPathName);
     696
     697== Action / Router and Receiver Command Reference ==
     698We will define the API used to send messages to different layers in the system.  followed by documentation on layers that have receiver commands.
     699
     700
     701'''ossimPlanet_routeActionForm1''' This will use ossimPlanet's Action router to route the message to the destination.  For example: lets say we have a receiver name as foo and we have an action called bar and it takes a single string as an argument then call ossimPlanet_routeActionForm1(":foo bar MySingleString"). This will route a action "bar" to the receiver "foo" and has 1 argument MySingleString.
     702
     703    /**
     704      * @param action
     705      */
     706   OSSIMPLANET_DLL void ossimPlanet_routeActionForm1(ossimPlanet_ConstStringType completeAction);
     707
     708
     709'''ossimPlanet_routeActionForm2'''  Is a utility call that is the same as ossimPlanet_routeActionForm1 but will do the concatenation of the target, action, and arg parameters into a single composite action.  ossimPlanet_routeActionForm2(":foo", "bar", "MySingleString") will perform the same action as Form1 above.
     710   /**
     711    * @param action
     712    */
     713   OSSIMPLANET_DLL void ossimPlanet_routeActionForm2(ossimPlanet_ConstStringType target,
     714                                                     ossimPlanet_ConstStringType action,
     715                                                     ossimPlanet_ConstStringType arg);
     716
     717'''ossimPlanet_postActionForm1'''  will use ossimPlanet's Action router to route the message to the destination.  The post call will instead add the action to a thread queue and route in the background without the caller having to wait for completion.  This is equivalent to ossimPlanet_routeActionForm1 above but will instead just add to thread queue for later processing.
     718 
     719   /**
     720    * @param action
     721    */
     722   OSSIMPLANET_DLL void ossimPlanet_postActionForm1(ossimPlanet_ConstStringType completeAction);
     723   
     724'''ossimPlanet_postActionForm2''' will use ossimPlanet's Action router to route the message to the destination.  The post call will instead add the action to a thread queue and route in the background without the caller having to wait for completion.  This is equivalent to ossimPlanet_routeActionForm2 above but will instead just add to thread queue for later processing.
     725
     726   /**
     727    * @param target The target receiver path name.
     728    * @param action The action to execute
     729    * @param arg the arguments for the action.
     730    */
     731   OSSIMPLANET_DLL void ossimPlanet_postActionForm2(ossimPlanet_ConstStringType target,
     732                                                     ossimPlanet_ConstStringType action,
     733                                                     ossimPlanet_ConstStringType arg);
     734=== ossimPlanetLand Receiver Commands ===
     735
     736'''add''' takes any number of arguments and can be of the form:
     737
     738* {Image {Parent {Name <name>} {Id <id>}} {Name <name>} {Id <id>} {Description <description>} {Filename <file>}}
     739This is the Image object definition and supplies all parameters for initialization.  For the {Image ..} you can give it a name, Id and a description.  The accessor in this example is a Filename type. Future accessor types will be given such as Wms.  The {Parent ...} object is used to identify the Parent you wish to add the layer to If this is not specified then the root Layer of the reference set is used as the parent.  You must call add {ImageGroup {...}} to create a group before adding to it any children  This basically allows you to group Image types into a common group.  Note, the name id and description are optional but if you want to later do a remove you might want to specify at least one or both name and id for the image being added.
     740* {ImageGroup {Parent {Name <name>} {Id <id>}} {Name <name>} {Id <id>} {Description <description>} }
     741Allows one to create a group and give it a name id and description.<br>
     742<br>
     743'''remove'''  takes any number of arguments and can be of the form:
     744*{Image {Name <name>} {Id <id>}}
     745This form is used to also delete layers of type ImageGroup.  For image groups you still use {Image and not {ImageGroup for the removal.
     746
     747'''Examples:'''<br>
     748Add a filename accessor to the root texture reference layer called /data/ccf_utm/foo.ccf and give it and id, description and name.  We add it as a child to a previosly created group with name MyRootLayer.
     749 ossimPlanet_routeActionForm1(":land add {Image  {Name MyName} {Id MyId} {Description my big description} {Filename /data/ccf_utm/foo.ccf} }"
     750
     751Add a filename accessor as a child of a layer with id MyRootIdan give it an id, description and name with a filename /data/ccf_utm/foo.ccf. 
     752 ossimPlanet_routeActionForm1(":land add {Image {Parent {Id MyRootId} {Name MyRootLayer} } {Name MyName} {Id MyId} {Description my big description} {Filename /data/ccf_utm/foo.ccf} }"
     753
     754Remove a layer
     755
     756   ossimPlanet_routeActionForm1(":land remove {Image {Name MyName} {Id MyId}}"
     757
     758Notice the Image object is eclosed by { } brackets.  You can have any number of them on one line {Image {.....}} {Image {...}} .... etc.
     759