OpenIG  2.0.4
cross-platform open-source OpenSceneGraph Image Generator
Classes | Public Types | Public Member Functions | List of all members
OpenIG::Base::ImageGenerator Class Referenceabstract

The Image Generator abstract interface. This is base class for openig::OpenIG. More...

#include <ImageGenerator.h>

Inheritance diagram for OpenIG::Base::ImageGenerator:
OpenIG::Engine

Classes

struct  ReadNodeImplementationCallback
 Performs cleanup. More...
 

Public Types

enum  AnimationStatus {
  Play, Stop, Reset, Pause,
  Restore
}
 Changes the animation status. More...
 
typedef std::vector< unsigned int > ViewIdentifiers
 One might want to have the Image Generator only in some views, so this typedef holds the IDs of the views - an ID is the order of the View in it's parent CompositeViewer. More...
 
typedef std::map< unsigned int, LightAttributes > LightAttributesMap
 
typedef osg::ref_ptr< osg::MatrixTransform > Entity
 This is our Entity, a base for models in the scene. More...
 
typedef std::map< unsigned int, EntityEntityMap
 
typedef std::map< unsigned int, Entity >::iterator EntityMapIterator
 
typedef std::map< unsigned int, Entity >::const_iterator EntityMapConstIterator
 

Public Member Functions

 ImageGenerator ()
 Constructor. More...
 
virtual ~ImageGenerator ()
 Destructor. More...
 
virtual std::string version ()=0
 Gets the version. More...
 
virtual void init (osgViewer::CompositeViewer *viewer, const std::string &xmlFileName="openig.xml", const ViewIdentifiers &ids=ViewIdentifiers())=0
 Performs init of the ImageGenerator. More...
 
virtual void cleanup ()=0
 Performs cleanup. More...
 
virtual void setReadNodeImplementationCallback (ReadNodeImplementationCallback *cb)=0
 Sets the read node callback. More...
 
virtual ReadNodeImplementationCallbackgetReadNodeImplementationCallback ()=0
 Gets the read node callback. More...
 
virtual void setReadFileCallback (osgDB::Registry::ReadFileCallback *cb)=0
 Sets user ReadFileCallback. More...
 
virtual osgDB::Registry::ReadFileCallback * getReadFileCallback ()=0
 Gets the user ReadFileCallback. More...
 
virtual void frame (bool usePlugins=true)=0
 The frame, should be called in a loop. More...
 
virtual void addEntity (unsigned int id, const std::string &fileName, const osg::Matrixd &mx, const osgDB::Options *options=0)=0
 Adds Entity in the scene. More...
 
virtual void addEntity (unsigned int id, const osg::Node *node, const osg::Matrixd &mx, const osgDB::Options *options=0)=0
 Adds entity in the scene from osg::Node instead of loading it from a file. More...
 
virtual void removeEntity (unsigned int id)=0
 Removes Entity from the scene. More...
 
virtual void updateEntity (unsigned int id, const osg::Matrixd &mx)=0
 Updates Entity. More...
 
virtual void showEntity (unsigned int id, bool show)=0
 Show/Hide Entity. More...
 
virtual void bindToEntity (unsigned int id, unsigned int toEntityId)=0
 Attach one Entity to another. More...
 
virtual void unbindFromEntity (unsigned int id)=0
 Detach an Entity from its parent Entity. More...
 
virtual void reloadEntity (unsigned int id, const std::string &fileName, const osgDB::Options *options=0)=0
 
virtual void setEntityName (unsigned int id, const std::string &name)=0
 Sets a name for an Entity. More...
 
virtual std::string getEntityName (unsigned int id)=0
 Geets a name for an Entity. More...
 
virtual unsigned int getEntityId (unsigned int parentEntityId, const std::string &subEntityName)=0
 Gets the id of a entity based on the name. More...
 
virtual void addEffect (unsigned int id, const std::string &name, const osg::Matrixd &mx, const std::string &attributes)=0
 Adds effect to the scene. More...
 
virtual void removeEffect (unsigned int id)=0
 Removes effect from the scene. More...
 
virtual void bindEffect (unsigned int id, unsigned int entityID, const osg::Matrixd &mx)=0
 Binds effect to an Entity. More...
 
virtual void unbindEffect (unsigned int id)=0
 Unbinds effect to an Entity. More...
 
virtual void updateEffect (unsigned int id, const osg::Matrixd &mx)=0
 Update effect with new position/orientation. More...
 
virtual void setEffectImplementationCallback (GenericImplementationCallback *cb)=0
 Sets the effect implementation callback. More...
 
virtual void setCameraPosition (const osg::Matrixd &mx, bool viewMatrix=false, unsigned int cameraID=0)=0
 Set the position of the camera. More...
 
virtual void bindCameraToEntity (unsigned int id, const osg::Matrixd &mx, unsigned int cameraID=0)=0
 Binds camera to an Entity. More...
 
virtual void bindCameraUpdate (const osg::Matrixd &mx, unsigned int cameraID=0)=0
 Updates the camera. More...
 
virtual void unbindCameraFromEntity (unsigned int cameraID=0)=0
 Unbinds the Camera from an Entity. More...
 
virtual void bindEntityToCamera (unsigned int id, const osg::Matrixd &mx, unsigned int cameraID=0)=0
 Binds an Entity to the Camera. More...
 
virtual void bindEntityToCameraUpdate (unsigned int id, const osg::Matrixd &mx)=0
 Updates the Entity. More...
 
virtual void unbindEntityFromCamera (unsigned int id)=0
 Unbinds the Entity from a Camera. More...
 
virtual bool isCameraBoundToEntity (unsigned int cameraID=0)=0
 Checks if the Camera is bound to an Entity. More...
 
virtual void bindCameraSetFixedUp (bool fixedUp, bool freezeOrientation=false, unsigned int cameraID=0)=0
 Sets for fixed up Cametra orientation or not. More...
 
virtual void playAnimation (unsigned int entityId, const std::string &animationName)=0
 Plays animation on an Entity. More...
 
virtual void playAnimation (unsigned int entityId, const StringUtils::StringList &animations)=0
 Plays multiple animations on an Entity at once. More...
 
virtual void playAnimation (unsigned int entityId, const std::string &animationName, RefAnimationSequenceCallbacks *cbs)=0
 
virtual void stopAnimation (unsigned int entityId, const std::string &animationName)=0
 Stops the playback of animation. More...
 
virtual void stopAnimation (unsigned int entityId, const StringUtils::StringList &animations)=0
 Stops the playback of animation. More...
 
virtual void resetAnimation (unsigned int entityId, const std::string &animationName)=0
 Reset the playback of animation. More...
 
virtual void resetAnimation (unsigned int entityId, const StringUtils::StringList &animations)=0
 Reset the playback of multiple animations at once. More...
 
virtual void changeAnimationStatus (unsigned int entityId, AnimationStatus status, const StringUtils::StringList &animations)=0
 
virtual void setFog (double visibility)=0
 Sets fog in the scene. More...
 
virtual void setDate (unsigned int month, int day, int year)=0
 Sets the simulation date. More...
 
virtual void setTimeOfDay (unsigned int hour, unsigned int minutes)=0
 Sets the time of day. More...
 
virtual void setRain (double factor)=0
 Sets rain in the scene. More...
 
virtual void setSnow (double factor)=0
 Sets snow in the scene. More...
 
virtual void setWind (float speed, float direction=0.f)=0
 Sets wind in the scene. More...
 
virtual void addCloudLayer (unsigned int id, int type, double altitude, double thickness=0, double density=0.3, bool enable=true)=0
 Adds cloud layer in the scene. More...
 
virtual void enableCloudLayer (unsigned int id, bool enableIn=true)=0
 Enables a previously loaded but distabled cloud layer in the scene. More...
 
virtual void removeCloudLayer (unsigned int id)=0
 Removes a cloud layer from the scene. More...
 
virtual void updateCloudLayer (unsigned int id, double altitude, double thickness, double density)=0
 Update a cloud layer in the scene. More...
 
virtual void removeAllCloudlayers ()=0
 Removes all cloud layers from the scene. The openig::OpenIG is not implementing this instead it uses igplugincore::PluginContext::Attribute to pass commands to all the plugins that might deal with such atmospheric effects. See addCloudLayer for more info. More...
 
virtual void createCloudLayerFile (unsigned int id, int type, double altitude, double thickness=0, double density=0.3, bool enable=true, std::string filename="")=0
 Adds cloud layer in the scene. More...
 
virtual void removeCloudLayerFile (unsigned int id)=0
 Removes a cloud layer file from the system. More...
 
virtual void loadCloudLayerFile (unsigned int id, int type, std::string filename)=0
 Manipulates cloud layers using saved cloudlayer files from SilverLinings API. The openig::OpenIG is not implementing this instead it uses igplugincore::PluginContext::Attribute to pass commands to all the plugins that might deal with such atmospheric effects. See loadCloudLayer for more info. More...
 
virtual void setLightImplementationCallback (LightImplementationCallback *cb)=0
 Sets the light implementation callback. More...
 
virtual void addLight (unsigned int id, const LightAttributes &lightAttributes, const osg::Matrixd &mx)=0
 Adds light source in the scene. More...
 
virtual void removeLight (unsigned int id)=0
 Removes light from the scene. More...
 
virtual void updateLight (unsigned int id, const osg::Matrixd &mx)=0
 Updates a light in the scene. More...
 
virtual void setLightUserData (unsigned int id, osg::Referenced *data)=0
 Sets user data to a light created by a callback. More...
 
virtual void bindLightToEntity (unsigned int id, unsigned int entityId)=0
 Binds a light to an Entity. More...
 
virtual void unbindLightFromEntity (unsigned int id)=0
 Unbinds light from an Entity, if bound. More...
 
virtual void enableLight (unsigned int id, bool enable, bool hard=true)=0
 Enables/disables light in the scene. More...
 
virtual void bindLightToCamera (unsigned int id, const osg::Matrixd &offset=osg::Matrixd::identity())=0
 Binds light to a Camera. More...
 
virtual void unbindLightFromcamera (unsigned int id)=0
 Unbinds the light from a Camera. More...
 
virtual bool isLightEnabled (unsigned int id)=0
 Test if a light is enabled. More...
 
virtual LightAttributesMap & getLightAttributesMap ()=0
 Returns the LightAttributes map. More...
 
virtual LightAttributes getLightAttributes (unsigned int id)=0
 Returns the LightAttributes based on the light ID. More...
 
virtual void updateLightAttributes (unsigned int id, const LightAttributes &attribs)=0
 Update lights attributes, like colors etc.. More...
 
virtual osgViewer::CompositeViewer * getViewer ()=0
 Returns the viewer. More...
 
virtual osg::Node * getScene ()=0
 Get the managed scene. More...
 
virtual EntityMap & getEntityMap ()=0
 The ID based Entity std::map. More...
 
virtual float getTerrainHeight (const osg::Vec3 &position)=0
 The height of terrain at the given position. More...
 
virtual float getIntersect (const osg::Vec3 &pos, const osg::Vec3 &angles, float angle)=0
 The distance from input position to the first intersect. More...
 
virtual osg::Vec3 getIntersectPos (const osg::Vec3 &pos, const osg::Vec3 &angles, float angle, float height=100000)=0
 The distance from input position to the first intersect. More...
 
virtual osg::LightSource * getSunOrMoonLight ()=0
 The light that represents sun/moon in the scene. More...
 
virtual osg::Fog * getFog ()=0
 The scene fog. More...
 
virtual void preRender ()=0
 override preRender method to be called from within a frame More...
 
virtual void postRender ()=0
 override postRender method to be called from within a frame More...
 

Detailed Description

The Image Generator abstract interface. This is base class for openig::OpenIG.

Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Member Typedef Documentation

typedef osg::ref_ptr<osg::MatrixTransform> OpenIG::Base::ImageGenerator::Entity

This is our Entity, a base for models in the scene.

Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015
typedef std::vector<unsigned int> OpenIG::Base::ImageGenerator::ViewIdentifiers

One might want to have the Image Generator only in some views, so this typedef holds the IDs of the views - an ID is the order of the View in it's parent CompositeViewer.

Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Fri Feb 19 2016

Member Enumeration Documentation

Changes the animation status.

Changes the animation status

Parameters
entityIdThe ID of the entity
statusThe status of the animation
animationsThe names of the animations
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Tue May 17 2016

Constructor & Destructor Documentation

OpenIG::Base::ImageGenerator::ImageGenerator ( )

Constructor.

Constructor

Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015
virtual OpenIG::Base::ImageGenerator::~ImageGenerator ( )
virtual

Destructor.

Destructor

Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Member Function Documentation

virtual void OpenIG::Base::ImageGenerator::addCloudLayer ( unsigned int  id,
int  type,
double  altitude,
double  thickness = 0,
double  density = 0.3,
bool  enable = true 
)
pure virtual

Adds cloud layer in the scene.

Adds cloud layer in the scene. The openig::OpenIG is not implementing this feature instead it creates OpenIG::Base::CLoudLayerAttributes via igplugincore::PluginContext::Attribute and it is passing it to all the plugins. As a reference that implements this feature can be the SilverLiningPlugin. Also the cloud layers are expected to be ID based, the id provided here is the handle for any clouds operation you might use

Parameters
idThe id of the cloud layer
typeThe type of the cloud layer. Can be anything, or plugin specific
altitudeThe altitude of the cloud layer
thicknessThe thickness of the cloud layer
densityDensity of the cloud layer. This can be anything but some plugins that implement atmospheric effects like the SilverLiningPlugin are expecting this to be only in the range of 0.0-1.0
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::addEffect ( unsigned int  id,
const std::string &  name,
const osg::Matrixd &  mx,
const std::string &  attributes 
)
pure virtual

Adds effect to the scene.

Adds effect to the scene. This oonly manages internal structures, it is up to plugins to provide implementation

Parameters
idUnique effect to the scene
nameName of the effect
mxThe initial position/orientation of the effect
attributesString based attributes for the pugins provoding the implementation, in form of token=attr;token=attr ...
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jun 14 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::addEntity ( unsigned int  id,
const std::string &  fileName,
const osg::Matrixd &  mx,
const osgDB::Options *  options = 0 
)
pure virtual

Adds Entity in the scene.

OpenIG is using IDs for everything in the scene management. The IDs are mainly up to the user to maintain. However some plugins generates these IDs automatically, for example the ModelCompositionPlugin or the LightingPlugin. For the automated ID generations there is a class OpenIG::Base::GlobalIdGenerator.

Parameters
idThe id of the Entity. You should use this Entity id to refer to this model in the scene
fileNameThe file name of the model
mxInitial position as osg::Matrixd
optionsOptional. The option string can be processed by some plugins. Good example can be the VDBOffset which shifts the database by a given offset defined in the osgDB::Options string.
Returns
Nothing
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::addEntity ( unsigned int  id,
const osg::Node *  node,
const osg::Matrixd &  mx,
const osgDB::Options *  options = 0 
)
pure virtual

Adds entity in the scene from osg::Node instead of loading it from a file.

Adds entity in the scene from osg::Node instead of loading it from a file. See addEntity

Parameters
idThe id of the Entity. You should use this Entity id to refer to this model in the scene
nodeThe node to become an Entity
mxInitial position as osg::Matrixd
optionsOptional. The option string can be processed by some plugins. Good example can be the VDBOffset which shifts the database by a given offset defined in the osgDB::Options string.
Returns
Nothing
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Tue Jun 16 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::addLight ( unsigned int  id,
const LightAttributes &  lightAttributes,
const osg::Matrixd &  mx 
)
pure virtual

Adds light source in the scene.

Adds light source in the scene. As all others scene players, like Entity, Lights are ID based. The ID management is up to the user, or one can use the simple OpenIG::Base::GlobalIdGenerator. Actually the OpenIG::Base::GlobalIdGenerator is used by plugins to create lights for the scene that might be defined in XML. We will mention the ModelCompositionPlugin and the LightingPlugin which use automatic ID generation using the OpenIG::Base::GlobalIdGenerator class. The initial position and orientation of the lightsource is provided by a Matrix. If the light is bound to the Camera or an Entity this Matrix defines the local to Camera Entity offset ID 0 is reserved for scene sun/moon light

Parameters
idThe id of the light
mxThe initial position and orientation of the light. You might want to use OpenIG::Base::Math to create this matrix
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015
virtual void OpenIG::Base::ImageGenerator::bindCameraSetFixedUp ( bool  fixedUp,
bool  freezeOrientation = false,
unsigned int  cameraID = 0 
)
pure virtual

Sets for fixed up Cametra orientation or not.

Sets for fixed up Cametra orientation or not. When is set with false, and is bound to an Entity it follows the Entity orientation, as an example can be the Camera attached to a plane model to have pilot view. When set with true, then the up axis is fixed and the Camera is not following the Entity orientation, like a bird eye.

Parameters
fixedUptrue to fix the up axis or false to follow the Entity orientation
freezeOrientationtrue to freeze orientation
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::bindCameraToEntity ( unsigned int  id,
const osg::Matrixd &  mx,
unsigned int  cameraID = 0 
)
pure virtual

Binds camera to an Entity.

Binds the camera to an Entity. Then as the Entity is moving, the Camera is movving along with. The given Matrix is the local offset

Parameters
idThe id of the Entity, the one you have used with addEntity
mxThe local offset wrt. to the Entity
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::bindCameraUpdate ( const osg::Matrixd &  mx,
unsigned int  cameraID = 0 
)
pure virtual

Updates the camera.

Updates the camera if it is bound to an Entity with new position and orientation through Matrix. Might be handy to use OpenIG::Base::Math methods like OpenIG::Base::Math::toMatrix to construct the Matrix

Parameters
mxThe matrix to update position and orientation
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::bindEffect ( unsigned int  id,
unsigned int  entityID,
const osg::Matrixd &  mx 
)
pure virtual

Binds effect to an Entity.

Binds effect to an Entity

Parameters
idUnique effect to the scene
entityIDThe ID of the Entity
mxThe offset position/orientation of the effect
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jun 14 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::bindEntityToCamera ( unsigned int  id,
const osg::Matrixd &  mx,
unsigned int  cameraID = 0 
)
pure virtual

Binds an Entity to the Camera.

Binds an Entity to the Camera. The given Matrix is the local offset

Parameters
idThe id of the Entity, the one you have used with addEntity
mxThe local offset wrt. to the Entity
cameraIDThe ID of the Camera (think View)
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun May 02 2016

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::bindEntityToCameraUpdate ( unsigned int  id,
const osg::Matrixd &  mx 
)
pure virtual

Updates the Entity.

Updates the Entity if it is bound to the Camera with new position and orientation through Matrix. Might be handy to use OpenIG::Base::Math methods like OpenIG::Base::Math::toMatrix to construct the Matrix

Parameters
idThe id of the Entity, the one you have used with addEntity
mxThe matrix to update position and orientation
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun May 02 2016

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::bindLightToCamera ( unsigned int  id,
const osg::Matrixd &  offset = osg::Matrixd::identity() 
)
pure virtual

Binds light to a Camera.

Binds light to a Camera. Once this is called, the light follows the Camera moves and it is attached to a local Camera offset defined by the Matrix. You might want to use the OpenIG::Base::Math class to contruct the Matrix. To get more info about light implementation, light IDs and their management please refer to setLightImplementationCallback and addLight

Parameters
idThe ID of the light.
offsetThe matrix defining the offset position and orientation
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::bindLightToEntity ( unsigned int  id,
unsigned int  entityId 
)
pure virtual

Binds a light to an Entity.

Binds a light to an Entity. If you need to understand the ID paradigm refer to addEntity and addLight.

Parameters
idThe ID of the light
entityIdThe ID of the Entity
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::bindToEntity ( unsigned int  id,
unsigned int  toEntityId 
)
pure virtual

Attach one Entity to another.

Attach one Entity to another. Then it makes it Sub-Entity. The offset is defined with the osg::Matrixd used in update Entity. Then this position and orientation become local to the parent Entity

Parameters
idThe id of the Entity. This is the id you have used with addEntity
toEntityIdThe id of the parent Entity
Returns
Nothing
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::cleanup ( )
pure virtual

Performs cleanup.

Call it before destruction

Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::createCloudLayerFile ( unsigned int  id,
int  type,
double  altitude,
double  thickness = 0,
double  density = 0.3,
bool  enable = true,
std::string  filename = "" 
)
pure virtual

Adds cloud layer in the scene.

Adds a new cloud layer file to the system. The openig::OpenIG is not implementing this feature instead it creates OpenIG::Base::CLoudLayerAttributes via OpenIG::PluginBase::PluginContext::Attribute and it is passing it to all the plugins. As a reference that implements this feature can be the SilverLiningPlugin. Also the cloud layers are expected to be ID based, the id provided here is the handle for any clouds operation you might use

Parameters
idThe id of the cloud layer
typeThe type of the cloud layer. Can be anything, or plugin specific
altitudeThe attitude of the cloud layer
thicknessThe thickness of the cloud layer
densityDensity of the cloud layer. This can be anything but some plugins that implement atmospheric effects like the SilverLiningPlugin are expecting this to be only in the range of 0.0-1.0
enableThe enable setting for the cloudlayer, enabled(true) you can see it, disabled(false) it can be loaded but not visible and also not updated to increase performance. Enable it and its seen immediately with no delay/pause.
filenameThe full path where the saved cloud file will be written
Author
Curtis Rubel openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Tue Nov 8 2016

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::enableCloudLayer ( unsigned int  id,
bool  enableIn = true 
)
pure virtual

Enables a previously loaded but distabled cloud layer in the scene.

Enables a cloud layer already loaded into the atmosphere. The openig::OpenIG is not implementing this instead it uses OpenIG::PluginBase::PluginContext::Attribute to pass commands to all the plugins that might deal with such atmospheric effects. See addCloudLayer for more info

Parameters
idThe id of the clouds layer file to be enabled in the scene
enableWhether we are enabling or disabling this cloudLayer
Author
Curtis Rubel openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Tue Nov 08 2016

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::enableLight ( unsigned int  id,
bool  enable,
bool  hard = true 
)
pure virtual

Enables/disables light in the scene.

Enables/disables light in the scene. Please refer to addLight to get more info about lights ID and their management

Parameters
idThe ID of the light to enable/disable
enabletrue for enable, false for disable
hardtrue for enable/disable even if this is animated light wich might internally use callback for simulating pulses via this call
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Thu Nov 17 2016

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::frame ( bool  usePlugins = true)
pure virtual

The frame, should be called in a loop.

It calls viewer->frame() and performs internal calling of plugins hooks like, update, preFrame, postFrame. This method mimics the viewer->frame() call, only inserts hooks for igplugincore::Plugin methods, in this order, as is implemented in openig::OpenIG::frame :

// pseudocode
// call these first
_viewer->advance();
_viewer->eventTraversal();
_viewer->updateTraversal();
// here we call the igplugincore::Plugin::update on all plugins
// via igplugincore::PluginOperation
igplugincore::Plugin::update
// here ImageGenerator::preRender is called
// here we call the igplugincore::Plugin::preFrame on all plugins
// via igplugincore::PluginOperation
igplugincore::Plugin::preFrame
// call the rendering
_viewer->renderingTraversals();
// here we call the igplugincore::Plugin::postFrame on all plugins
// via igplugincore::PluginOperation
igplugincore::Plugin::postFrame
// here ImageGenerator::postRender is called
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual unsigned int OpenIG::Base::ImageGenerator::getEntityId ( unsigned int  parentEntityId,
const std::string &  subEntityName 
)
pure virtual

Gets the id of a entity based on the name.

Gets the id of a entity based on the name. Can be handy for lookup

Parameters
idThe id of parent entity
nameThe name of entity/sub-entity
Returns
The Sub-Entity id
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Fri Jun 17 2016

Implemented in OpenIG::Engine.

virtual EntityMap& OpenIG::Base::ImageGenerator::getEntityMap ( )
pure virtual

The ID based Entity std::map.

The ID based Entity std::map. Inheritants are expected to maintain this map along with all the scene management methods, as addEntuty etc ... openig::OpenIG is doing so

Returns
The recent ID based Entity std::map
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual std::string OpenIG::Base::ImageGenerator::getEntityName ( unsigned int  id)
pure virtual

Geets a name for an Entity.

Gets the name for an Entity. Can be handy for lookup

Parameters
idThe id of the attached Entity. This is the id you have used with addEntity
Returns
The Entity name
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Mon May 18 2015

Implemented in OpenIG::Engine.

virtual osg::Fog* OpenIG::Base::ImageGenerator::getFog ( )
pure virtual

The scene fog.

The scene Fog attribute. See setFog for more info

Returns
The scene Fog attribute
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual float OpenIG::Base::ImageGenerator::getIntersect ( const osg::Vec3 &  pos,
const osg::Vec3 &  angles,
float  angle 
)
pure virtual

The distance from input position to the first intersect.

The distance from the input position to the first intersect of the terrain, currently entity id 0

Returns
The distance from input position to the first intersect
Parameters
posCurrent position
anglesCurrent Yaw, Pitch and Roll
angleCurrent Heading
Author
Roni Zanolli openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Weds Aug 02 2016

Implemented in OpenIG::Engine.

virtual osg::Vec3 OpenIG::Base::ImageGenerator::getIntersectPos ( const osg::Vec3 &  pos,
const osg::Vec3 &  angles,
float  angle,
float  height = 100000 
)
pure virtual

The distance from input position to the first intersect.

The position of the intersection of our current pos and the angles input and the terrain, currently entity id 0

Returns
The distance from input position to the first intersect
Parameters
posCurrent position
anglesCurrent Yaw, Pitch and Roll
angleCurrent Heading
Author
Roni Zanolli openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Weds Aug 02 2016

Implemented in OpenIG::Engine.

virtual LightAttributes OpenIG::Base::ImageGenerator::getLightAttributes ( unsigned int  id)
pure virtual

Returns the LightAttributes based on the light ID.

Returns the LightAttributes for a given light. The inheritants are expected to keep track when they are updates. Plugins might use these

Parameters
idThe light ID
Returns
The light attributes of the Light
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sat Jun 06 2015

Implemented in OpenIG::Engine.

virtual LightAttributesMap& OpenIG::Base::ImageGenerator::getLightAttributesMap ( )
pure virtual

Returns the LightAttributes map.

Returns the LightAttributes map. The inheritants are expected to keep track when they are updates. Plugins might use these

Returns
The light attributes map
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sat Jun 06 2015

Implemented in OpenIG::Engine.

virtual osgDB::Registry::ReadFileCallback* OpenIG::Base::ImageGenerator::getReadFileCallback ( )
pure virtual

Gets the user ReadFileCallback.

Gets the user ReadFileCallback

Returns
The callback
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Thu Mar 17 2016

Implemented in OpenIG::Engine.

virtual ReadNodeImplementationCallback* OpenIG::Base::ImageGenerator::getReadNodeImplementationCallback ( )
pure virtual

Gets the read node callback.

Gets the Read node callback. See setReadNodeImplementationCallback

Returns
cb The callback
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Mon Jun 16 2015

Implemented in OpenIG::Engine.

virtual osg::Node* OpenIG::Base::ImageGenerator::getScene ( )
pure virtual

Get the managed scene.

Returns the node representing the managed scene. In openig::OpenIG this is the default osgShadow::ShadowedScene. Adding nodes to this scene will cause these nodes to be affected by plugins, as for example by the LightingPlugin which will have\ shaders applied to them.

Returns
The managed scene. See init
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual osg::LightSource* OpenIG::Base::ImageGenerator::getSunOrMoonLight ( )
pure virtual

The light that represents sun/moon in the scene.

The light that represents sun/moon in the scene. It is the reserved light with an ID of 0

Returns
The light that represents sun/moon in the scene
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual float OpenIG::Base::ImageGenerator::getTerrainHeight ( const osg::Vec3 &  position)
pure virtual

The height of terrain at the given position.

The height of the terrain, currently entity 0, at the current position

Returns
The height of terrain at the given position
Author
Roni Zanolli openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Weds Aug 02 2016

Implemented in OpenIG::Engine.

virtual osgViewer::CompositeViewer* OpenIG::Base::ImageGenerator::getViewer ( )
pure virtual

Returns the viewer.

Returns the viewer used in init . Handy when using the OpenIG::Base::ImageGenerator in igplugincore::PluginContext given to plugins igplugincore::Plugin to access the viewer from within plugins

Returns
The viewer passed in init
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::init ( osgViewer::CompositeViewer *  viewer,
const std::string &  xmlFileName = "openig.xml",
const ViewIdentifiers ids = ViewIdentifiers() 
)
pure virtual

Performs init of the ImageGenerator.

Should be called immediatelly after making an instance. Here the setup of the scene and other things happen. By default openig::OpenIG scene is osgShadow::ShadowedScene with LightSpacePerspective shadow map technique. So the user is expected to add nodes directly to getScene, or if they want to handle it their own way, there is still osgView::View(x)->getSceneData()

Parameters
viewerYour Viewer. It is up to you how you set up expected is to have at least one View.
xmlFileNameThe file name of the xml configuration file. Defaults to openig.xml, on Windows in bin/igdata MacOS and Linux in /usr/local/bin/igdata
idsList of Views to which we let OpenIG render. If empty it will use all the Views with no SceneData associated
Returns
Nothing
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual bool OpenIG::Base::ImageGenerator::isCameraBoundToEntity ( unsigned int  cameraID = 0)
pure virtual

Checks if the Camera is bound to an Entity.

Checks if the Camera is bound to an Entity

Returns
true if it is bounds, false otherwise
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual bool OpenIG::Base::ImageGenerator::isLightEnabled ( unsigned int  id)
pure virtual

Test if a light is enabled.

Test if a light is enabled. See addLight for more infor about lights IDs and their management.

Parameters
idThe ID of the light
Returns
true if the light is enabled, see enableLight, false otherwise
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::loadCloudLayerFile ( unsigned int  id,
int  type,
std::string  filename 
)
pure virtual

Manipulates cloud layers using saved cloudlayer files from SilverLinings API. The openig::OpenIG is not implementing this instead it uses igplugincore::PluginContext::Attribute to pass commands to all the plugins that might deal with such atmospheric effects. See loadCloudLayer for more info.

Parameters
idThe id of the cloud layer
filenameThe full path to the filename of the cloudlayer
typeThe SL CloudType enum as integer
Author
Curtis Rubel openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Tue Aug 02 2016

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::playAnimation ( unsigned int  entityId,
const std::string &  animationName 
)
pure virtual

Plays animation on an Entity.

Plays animation on an Entity. At present it uses the internal simple animation handling

  • see OpenIG::Base::Animations. The future versions will have FBX support as well. The present animations are defined in a model XML file and there are plugins that can support the simple animation management implemented in this core. As a reference can be the ModelComposition plugin that is reading this XML defined animations and make all the necessary steps to crate the build-in animations from XML definitions. The reason to have it this way, is the need of controlling the animation via run-time value from code. The pre-baked animations are somewhat complicated to control based on some run-time value, so we were to implement our own management that is allowing us to control the players in the animations as we control Entity es, by a run-tome value, with a Matrix.
    Parameters
    entityIdThe id of the Entity to play the animation
    animationNameThe name of the animation, as defined in the model XML or for future versions the hame of the FBX animation
    Author
    Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
    Date
    Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::playAnimation ( unsigned int  entityId,
const StringUtils::StringList &  animations 
)
pure virtual

Plays multiple animations on an Entity at once.

Plays multiple animations on an Entity at once. For more info how the animations are supported pleas see OpenIG::Base::ImageGenerator::playAnimation

Parameters
entityIdThe id of the Entity to play the animations
animationsThe name of the animations, as defined in the model XML or for future versions the hame of the FBX animations
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::postRender ( )
pure virtual

override postRender method to be called from within a frame

Override postRender method to be called from within a frame. See frame for reference

Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::preRender ( )
pure virtual

override preRender method to be called from within a frame

Override preRender method to be called from within a frame. See frame for reference

Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::reloadEntity ( unsigned int  id,
const std::string &  fileName,
const osgDB::Options *  options = 0 
)
pure virtual

You might want to replace the model with another and preserve the id.

Parameters
idThe id of the attached Entity. This is the id you have used with addEntity
fileNameThe file name of the model. Can be the same or new
optionsOptional. Some plugins can use the option string from the osgDB::Option object
Returns
Nothing
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::removeAllCloudlayers ( )
pure virtual

Removes all cloud layers from the scene. The openig::OpenIG is not implementing this instead it uses igplugincore::PluginContext::Attribute to pass commands to all the plugins that might deal with such atmospheric effects. See addCloudLayer for more info.

Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::removeCloudLayer ( unsigned int  id)
pure virtual

Removes a cloud layer from the scene.

Removes a cloud layer from the scene. The openig::OpenIG is not implementing this instead it uses igplugincore::PluginContext::Attribute to pass commands to all the plugins that might deal with such atmospheric effects. See addCloudLayer for more info

Parameters
idThe id of the clouds layer to be removed
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::removeCloudLayerFile ( unsigned int  id)
pure virtual

Removes a cloud layer file from the system.

Removes a cloud layer file from the system. The openig::OpenIG is not implementing this instead it uses OpenIG::PluginBase::PluginContext::Attribute to pass commands to all the plugins that might deal with such atmospheric effects. See addCloudLayer for more info

Parameters
idThe id of the clouds layer file to be removed, to ensure its also removed from the scene
filenameThe full path to the cloud file to be deleted
Author
Curtis Rubel openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Tue Nov 08 2016

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::removeEffect ( unsigned int  id)
pure virtual

Removes effect from the scene.

Removes effect from the scene

Parameters
idUnique effect to the scene
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jun 14 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::removeEntity ( unsigned int  id)
pure virtual

Removes Entity from the scene.

Removes the entity from the scene. See addEntity

Parameters
idThe id of the Entity. This is the id you have used with addEntity
Returns
Nothing
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::removeLight ( unsigned int  id)
pure virtual

Removes light from the scene.

Removes light from the scene. See addLight for more info.

Parameters
idThe ID of the light to be removed
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::resetAnimation ( unsigned int  entityId,
const std::string &  animationName 
)
pure virtual

Reset the playback of animation.

Reset the playback of animation by name and Entity ID. It placed the players at their initial position before the playback. See playAnimation

Parameters
entityIdThe ID of the entity
animationNameThe name of the animation
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
MOn May 18 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::resetAnimation ( unsigned int  entityId,
const StringUtils::StringList &  animations 
)
pure virtual

Reset the playback of multiple animations at once.

Reset the playback of multiple animations by their names and Entity ID. It places the players at their initial position before the playback. See playAnimation

Parameters
entityIdThe ID of the entity
animationsThe names of the animations
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
MOn May 18 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::setCameraPosition ( const osg::Matrixd &  mx,
bool  viewMatrix = false,
unsigned int  cameraID = 0 
)
pure virtual

Set the position of the camera.

Sets the position of the camera using Matrix. If the camera is bind to an Entity, then this Matrix is the local offset. One can check if the camera is bound by isCameraBoundToEntity

Parameters
mxThe inital position of the camera. World coordinates
viewMatrixSet true if the provided Matrix is View Matrix
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::setDate ( unsigned int  month,
int  day,
int  year 
)
pure virtual

Sets the simulation date.

Sets the simulation date. The core is not implementing this feature instead is creating OpenIG::Base::DateAttributes via igplugincore::PluginContext::Attribute and it is passing it to all the plugins to deal with.

Parameters
month
day
year
Author
Curtis G Rubel openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Wed May 25 2016

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::setEffectImplementationCallback ( GenericImplementationCallback *  cb)
pure virtual

Sets the effect implementation callback.

The ImageGenerator, OpenIG only manages structures for the effects. It is up to plugins to provide their implementation. This is the callback that provides the effect implementation

Parameters
cbThe callback
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jun 14 2015
virtual void OpenIG::Base::ImageGenerator::setEntityName ( unsigned int  id,
const std::string &  name 
)
pure virtual

Sets a name for an Entity.

Sets a name for an Entity. Can be handy for lookup

Parameters
idThe id of the attached Entity. This is the id you have used with addEntity
nameThe Entity name
Returns
Nothing
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::setFog ( double  visibility)
pure virtual

Sets fog in the scene.

Sets fog in the scene. The openig::OpenIG is adding a Fog attribute in the scene and it is up to plugins to implement it's appearance. Example is the LightingPlugin which computes the fog in a shader. Also, internaly openig::OpenIG is creating OpenIG::Base::FogAttributes via igplugincore::PluginContext::Attribute and passing it to all the plugins to deal with.

Parameters
visibilityVisibility in meters
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::setLightImplementationCallback ( LightImplementationCallback *  cb)
pure virtual

Sets the light implementation callback.

Sets the light implementation callback. openig::OpenIG is not implementing lights. It only manages some structures and it is up to plugins to give some lighting implementation. At the time of writing this, there are two that implements lighting in shaders: SimlpeLightingPlugin and LightingPlugin

Parameters
cbThe callback, expected to be implemented by a plugin
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015
virtual void OpenIG::Base::ImageGenerator::setLightUserData ( unsigned int  id,
osg::Referenced *  data 
)
pure virtual

Sets user data to a light created by a callback.

Sets user data to a light created by a callback

Parameters
idThe ID of the light.
dataUser data
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Tue May 17 2016

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::setRain ( double  factor)
pure virtual

Sets rain in the scene.

Sets rain in the scene. The openIG::OpenIG is not implementing but instead it creates OpenIG::Base::RainSnowAttributes via igplugincore::PluginContext::Attribute and it is passing it to all the plugins to deal with

Parameters
factorCan be anything, but some plugin that implement atmospheric effect like the SilverLiningPlugin is expecting this in the range of 0.0-1.0
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::setReadFileCallback ( osgDB::Registry::ReadFileCallback *  cb)
pure virtual

Sets user ReadFileCallback.

Sets a user read file callback. Please avoid setting the ReadFileCallback when using OpenIG - it has internal one. Set it through this method if you have one, it will work together with the OpenIG internal one

Parameters
cbThe callback
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Thu Mar 17 2016

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::setReadNodeImplementationCallback ( ReadNodeImplementationCallback cb)
pure virtual

Sets the read node callback.

Sets the Read node callback. Some might want to change how the file is read, like osgEarth for example. You have an option to read files differently then with osgDB::readNodeFile(...)

Parameters
cbThe callback
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Mon Jun 16 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::setSnow ( double  factor)
pure virtual

Sets snow in the scene.

Sets snow in the scene. The openIG::OpenIG is not implementing but instead it creates OpenIG::Base::RainSnowAttributes as igplugincore::PluginContext::Attribute and it is passing it to all the plugins to deal with

Parameters
factorCan be anything, but some plugin that implement atmospheric effect like the SilverLiningPlugin is expecting this in the range of 0.0-1.0
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::setTimeOfDay ( unsigned int  hour,
unsigned int  minutes 
)
pure virtual

Sets the time of day.

Sets the time of day. The core is not implementing this feature instead is creating OpenIG::Base::TimeOfDayAttributes via igplugincore::PluginContext::Attribute and it is passing it to all the plugins to deal with.

Parameters
hour
minutes
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::setWind ( float  speed,
float  direction = 0.f 
)
pure virtual

Sets wind in the scene.

Sets wind in the scene. The openIG::OpenIG is not implementing but instead it creates OpenIG::Base::RainSnowAttributes via igplugincore::PluginContext::Attribute and it is passing it to all the plugins to deal with

Parameters
speedSpeed of the wind. Can be anything or plugin specific. Good to mention here is that it might be expected by plugins to be in m/s/
directionThe direction. Can be anything or plugin specific. The SilverLiningPlugin is expecting this to be in degrees from North.
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::showEntity ( unsigned int  id,
bool  show 
)
pure virtual

Show/Hide Entity.

Show/Hide Entity

Parameters
idThe id of the Entity. This is the id you have used with addEntity
showIf true, the Entity will be present in the scene, if false it will not
Returns
Nothing
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::stopAnimation ( unsigned int  entityId,
const std::string &  animationName 
)
pure virtual

Stops the playback of animation.

Stops the playback of animation by name and Entity ID. See playAnimation

Parameters
entityIdThe ID of the entity
animationNameThe name of the animation
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
MOn May 18 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::stopAnimation ( unsigned int  entityId,
const StringUtils::StringList &  animations 
)
pure virtual

Stops the playback of animation.

Stops the playback of multiple animations by their names and Entity ID. See playAnimation

Parameters
entityIdThe ID of the entity
animationsThe names of the animations
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
MOn May 18 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::unbindCameraFromEntity ( unsigned int  cameraID = 0)
pure virtual

Unbinds the Camera from an Entity.

Unbinds the Camera from an Entity if it is already bound

Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::unbindEffect ( unsigned int  id)
pure virtual

Unbinds effect to an Entity.

Unbinds effect to an Entity

Parameters
idUnique effect to the scene
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jun 14 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::unbindEntityFromCamera ( unsigned int  id)
pure virtual

Unbinds the Entity from a Camera.

Unbinds the Entity from the Camera if it is already bound

Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun May 02 2016

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::unbindFromEntity ( unsigned int  id)
pure virtual

Detach an Entity from its parent Entity.

Dettach an Entity from its parent Entity. Internaly the position and orientation is computed from local to world space on detach so the Entity stays on its current position and orientation

Parameters
idThe id of the attached Entity. This is the id you have used with addEntity
Returns
Nothing
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::unbindLightFromcamera ( unsigned int  id)
pure virtual

Unbinds the light from a Camera.

Unbinds the light from a Camera, if bound. See bindLightToCamera

Parameters
idThe ID of the light
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::unbindLightFromEntity ( unsigned int  id)
pure virtual

Unbinds light from an Entity, if bound.

Unbinds light from an Entity, if bound. Please refer to addLight to get more info about lights ID and their management

Parameters
idThe ID of the light to be unbind
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::updateCloudLayer ( unsigned int  id,
double  altitude,
double  thickness,
double  density 
)
pure virtual

Update a cloud layer in the scene.

Updates a cloud layer in the scene with new values. The openig::OpenIG is not implementing this instead it uses igplugincore::PluginContext::Attribute to pass commands to all the plugins that might deal with such atmospheric effects. See addCloudLayer for more info

Parameters
idThe id of the cloud layer
altitudeAltitude of the cloud layer
thicknessThickness of the cloud layer
densityDensity of the cloud layer. This can be anything but some plugins that implement atmospheric effects like the SilverLiningPlugin are expecting this to be only in the range of 0.0-1.0
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::updateEffect ( unsigned int  id,
const osg::Matrixd &  mx 
)
pure virtual

Update effect with new position/orientation.

Update effect with new position/orientation

Parameters
idUnique effect to the scene
mxThe new position/orientation
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jun 14 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::updateEntity ( unsigned int  id,
const osg::Matrixd &  mx 
)
pure virtual

Updates Entity.

Updates Entity with new position and orientation by using a osg::Matrixd.

Parameters
idThe id of the Entity. This is the id you have used with addEntity
mxThe new position and orientation of the Entity. It is handy to use OpenIG::Base::Math methods to contruct this Matrix, as toMatrix(...)
Returns
Nothing
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::updateLight ( unsigned int  id,
const osg::Matrixd &  mx 
)
pure virtual

Updates a light in the scene.

Updates the light position and orientation in the scene. If bound to the Camera or Entity it is updating the local offset. You might want to use OpenIG::Base::Math to construct the needed Matrix for the update. See addLight for more info.

Parameters
idThe ID of the light.
mxNew position and orientation as Matrix
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015

Implemented in OpenIG::Engine.

virtual void OpenIG::Base::ImageGenerator::updateLightAttributes ( unsigned int  id,
const LightAttributes &  attribs 
)
pure virtual

Update lights attributes, like colors etc..

Updates light attributes via OpenIG::Base::LightAttributes . Once you set the new light attributes, be aware that you have to set the dirty mask there as well in order to have the update. Please see setLightImplementationCallback for more info about lights and their management

Parameters
idThe ID of the light you used with addLight
attribsThe new attributes
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Sun Jan 11 2015
virtual std::string OpenIG::Base::ImageGenerator::version ( )
pure virtual

Gets the version.

Returns
The version
Author
Trajce Nikolov Nick openi.nosp@m.g@co.nosp@m.mpro..nosp@m.net
Date
Fri May 16 2015

Implemented in OpenIG::Engine.


The documentation for this class was generated from the following file: