Changes between Version 3 and Version 4 of ossimPlanetAPI
- Timestamp:
- Feb 4, 2008, 11:17:02 AM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ossimPlanetAPI
v3 v4 68 68 to a Planet Object. The ossimPlanet_LayerPtr is the native pointer to a Planet layer. 69 69 70 {{{ 70 71 typedef void* ossimPlanet_StatePtr; 71 72 typedef void* ossimPlanet_PlanetPtr; … … 75 76 typedef const char* ossimPlanet_ConstStringType; 76 77 typedef char* ossimPlanet_StringType; 78 }}} 77 79 78 80 The 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. … … 82 84 * 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. 83 85 86 {{{ 84 87 typedef enum ossimPlanet_ContextType 85 88 { … … 96 99 ossimPlanet_TRUE = 1 97 100 }; 101 }}} 98 102 99 103 === Setup and Initialization === … … 101 105 102 106 '''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. 103 107 108 {{{ 104 109 /** 105 110 * @param path Path to add to the Library search path. … … 109 114 OSSIMPLANET_DLL void ossimPlanet_addOpenSceneGraphLibraryPath(ossimPlanet_ConstStringType path, 110 115 ossimPlanet_BOOL insertFrontFlag); 116 }}} 111 117 112 118 113 119 '''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. 114 120 121 {{{ 115 122 /** 116 123 * @param path Path to add to the Data search path. … … 120 127 OSSIMPLANET_DLL void ossimPlanet_addOpenSceneGraphDataPath(ossimPlanet_ConstStringType path, 121 128 ossimPlanet_BOOL insertFrontFlag); 129 }}} 122 130 123 131 '''ossimPlanet_loadOssimPreferenceFile''' exposes the OSSIM core engines preference loading from a file. 124 132 133 {{{ 125 134 /** 126 135 * @param preferenceFile The preference file to load. 127 136 */ 128 137 OSSIMPLANET_DLL void ossimPlanet_loadOssimPreferenceFile(ossimPlanet_ConstStringType preferenceFile); 138 }}} 129 139 130 140 '''ossimPlanet_setOssimPreferenceNameValue''' Allows you access to the OSSIM core engine's preference variables and you can set them. 141 142 {{{ 131 143 /** 132 144 * @param name The name of the preference variable. … … 135 147 OSSIMPLANET_DLL void ossimPlanet_setOssimPreferenceNameValue(ossimPlanet_ConstStringType name, 136 148 ossimPlanet_ConstStringType value); 149 }}} 137 150 138 151 '''ossimPlanet_addOssimPlugin''' Adds an ossim core plugin. If this is a directory then all files in the directoy that are plugins are added 152 153 {{{ 139 154 /** 140 155 * @param path Path to add to the OSSIM Plugin search path. … … 144 159 OSSIMPLANET_DLL void ossimPlanet_addOssimPlugin(ossimPlanet_ConstStringType path, 145 160 ossimPlanet_BOOL insertFrontFlag); 161 }}} 162 146 163 147 164 '''ossimPlanet_addOssimElevation''' Add elevation to the OSSIM core system. 165 {{{ 148 166 /** 149 167 * @param path Path to add to the Elevation. … … 151 169 OSSIMPLANET_DLL void ossimPlanet_addOssimElevation(ossimPlanet_ConstStringType path); 152 170 153 171 }}} 154 172 155 173 '''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. 156 174 175 {{{ 157 176 /** 158 177 * @param path Path to add to the Geoid search path. … … 165 184 ossimByteOrder byteOrder, 166 185 ossimPlanet_BOOL insertFrontFlag); 186 }}} 167 187 168 188 '''ossimPlanet_init''' Used to initialize the system. This is typically called one time. It initializes internal registries. 169 189 190 {{{ 170 191 void ossimPlanet_init(); 192 }}} 171 193 172 194 '''ossimPlanet_initWithArgs''' Allows one to init by passing command line arguments. This is typically used by command line applications. 173 195 196 {{{ 174 197 /** 175 198 * @param argc A pointer to an integer. … … 177 200 */ 178 201 OSSIMPLANET_DLL void ossimPlanet_initWithArgs(int* argc, char** argv[]); 202 }}} 179 203 180 204 '''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.*"); 181 205 182 206 '''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: 207 {{{ 183 208 /** 184 209 * ^ Matches at beginning of a line … … 202 227 */ 203 228 OSSIMPLANET_DLL void ossimPlanet_setTracePattern(ossimPlanet_ConstStringType pattern); 229 }}} 204 230 205 231 '''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. 206 232 233 {{{ 207 234 void ossimPlanet_finalize(); 235 }}} 208 236 209 237 '''ossimPlanet_microSecondSleep''' Gives access to a microsecond sleep. 238 {{{ 210 239 /** 211 240 * @param microSeconds Specify how many microseconds to sleep. 212 241 */ 213 242 OSSIMPLANET_DLL void ossimPlanet_microSecondSleep(ossimPlanet_SizeType microSeconds); 214 243 }}} 244 215 245 216 246 '''ossimPlanet_milliSecondSleep''' Gives access to a millisecond sleep. 247 248 {{{ 217 249 /** 218 250 * @param milliSeconds Specify how many microseconds to sleep. 219 251 */ 220 252 OSSIMPLANET_DLL void ossimPlanet_milliSecondSleep(ossimPlanet_SizeType milliSeconds); 253 }}} 221 254 222 255 223 256 '''ossimPlanet_secondSleep''' Gives access to a seconds sleep. 224 257 258 {{{ 225 259 /** 226 260 * @param seconds Specify how many microseconds to sleep. 227 261 */ 228 262 OSSIMPLANET_DLL void ossimPlanet_secondSleep(ossimPlanet_SizeType seconds); 263 }}} 229 264 230 265 === State Interface === … … 234 269 '''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. 235 270 271 {{{ 236 272 /** 237 273 * @param contextType This specifies the type of context you would like to create. @see ossimPlanet_contextType. … … 241 277 OSSIMPLANET_DLL ossimPlanet_StatePtr ossimPlanet_newState(ossimPlanet_ContextType type); 242 278 279 }}} 243 280 244 281 '''ossimPlanet_deleteState''' will delete the passed in state and set the pointer back to 0. 245 282 283 {{{ 246 284 /** 247 285 * @param state This is the state to delete. 248 286 */ 249 287 OSSIMPLANET_DLL void ossimPlanet_deleteState(ossimPlanet_StatePtr state); 288 }}} 250 289 251 290 === View Interface === … … 257 296 '''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. 258 297 298 {{{ 259 299 /** 260 300 * @param state The state to modify. 261 301 */ 262 302 OSSIMPLANET_DLL void ossimPlanet_setSceneDataToView(ossimPlanet_StatePtr state); 303 }}} 263 304 264 305 '''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. … … 266 307 '''ossimPlanet_setViewManipulator''' Allows one to set a manipulator for the view. For now, we only support manipulator type ossimPlanetManipulator. 267 308 309 {{{ 268 310 /** 269 311 * @param state The state to modify. … … 279 321 */ 280 322 OSSIMPLANET_DLL void setViewportToCurrentGlSettings(ossimPlanet_StatePtr state); 323 }}} 281 324 282 325 '''ossimPlanet_setViewManipulator''' will set your current state view manipulator. 326 {{{ 283 327 /** 284 328 * Only support ossimPlanetManipulator type for now. … … 297 341 OSSIMPLANET_DLL void setViewportToCurrentGlSettings(ossimPlanet_StatePtr state); 298 342 343 }}} 344 299 345 '''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. 300 346 347 {{{ 301 348 /** 302 349 * @param state State to modify. 303 350 */ 304 351 OSSIMPLANET_DLL void setProjectionMatrixToCurrentGlSettings(ossimPlanet_StatePtr state); 352 }}} 305 353 306 354 '''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. 307 355 356 {{{ 308 357 /** 309 358 * @param state State to modify. 310 359 */ 311 360 OSSIMPLANET_DLL void setModelViewMatrixToCurrentGlSettings(ossimPlanet_StatePtr state); 361 }}} 312 362 313 363 '''ossimPlanet_setProjectionMatrixAsPerspective''' will allow one to set the perspective. 314 364 365 {{{ 315 366 /** 316 367 * @param state The state to modify. … … 325 376 double near, 326 377 double far); 378 }}} 327 379 328 380 '''ossimPlanet_setProjectionMatrixAsFrustum''' is identical to using the glFrustum call. 329 381 382 {{{ 330 383 /** 331 384 * @param state The state to modify. … … 341 394 double bottom, double top, 342 395 double zNear, double zFar); 396 }}} 343 397 344 398 '''ossimPlanet_setProjectionMatrixAsOrtho''' is identical to the glOrtho call and creates and orthographic projection. 345 399 400 {{{ 346 401 /** 347 402 * @param state The state to modify. … … 357 412 double bottom, double top, 358 413 double zNear, double zFar); 414 }}} 359 415 360 416 '''ossimPlanet_setProjectionMatrixAsOrtho2D''' will set to a 2D orthographic projection. See OpenGL glOrtho2D documentation for further details. 417 {{{ 361 418 /** 362 419 * @param state The state to modify. … … 369 426 double left, double right, 370 427 double bottom, double top); 428 }}} 371 429 372 430 '''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.