VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions
makVrv::DtOsgLightPointManager Class Reference

DtOsgLightPointManager registers LightPoint nodes so their TBO can be created and updated in a single place. More...

Inheritance diagram for makVrv::DtOsgLightPointManager:
Inheritance graph
[legend]

Public Member Functions

 DtOsgLightPointManager (DtDe &de)
 Light point manager contructor used by instance() call to setup the singleton instance. More...
 
virtual void registerInstancedLightPoints (LightPointVec &lightPoints, bool daylightControlled)
 Register a list of instanced light points daylightControlled is only used if the light points do not already have a type specified. More...
 
virtual void findAndRegisterLightPoints (osg::Node *node, const std::string &groupName, bool daylightControlled, const DtIndirectFadeParameters &fadeParameters, bool combineLightPoints)
 traverse node and find all the light points and then pass them to registerLightPoints. More...
 
virtual void registerLightPoints (const DtLightPointNodeAndXformVector &lightPoints, const std::string &groupName, bool daylightControlled, const DtIndirectFadeParameters &fadeParameters, bool combineLightPoints)
 Register a list of non instanced light points daylightControlled is only used if the light points do not already have a type specified. More...
 
virtual LightPointNodeObsSet aggregateLightPoints (const DtLightPointNodeAndXformVector &lightPoints, const std::string &groupName, bool daylightControlled, const DtIndirectFadeParameters &fadeParameters, bool combineLightPoints)
 combine light points that can be combined into less nodes and convert them into DtLightPointNodes if needed as well. More...
 
virtual DtLightPointNodecreateLightPointNode (osg::Node *nodeRef, bool daylightControlled)
 Create a DtLightPointNode based on an osgSim::LightPointNode also removes the osgSim::LightPointNode from the scenegraph Does nothing if shouldReplaceOsgSimLightPoints is set to false which is currently the default setting. More...
 
virtual DtGlBufferlightPointTypeBuffer ()
 Get and setup the light point type SSBO used for rendering the light points. More...
 
virtual DtGlBufferlightPointGroupBuffer ()
 Get and setup the light point group SSBO. More...
 
virtual DtGlBufferlightPointNodeBuffer (osg::Camera *camera)
 Get and setup the light point node buffer SSBO. More...
 
virtual void updateLightPointVertexBuffer (const std::vector< DtLightPointDrawable::LightPointVertexAttrib > &vertexAttribData, int minChanged, int maxChanged)
 positions and information about their direction and blinking. More...
 
virtual DtGlBufferlightPointVertexBufer ()
 get the ssbo for the light point vertex data. More...
 
virtual int nodeId (DtLightPointNode *lpNode, int instanceId)
 get the node id for the specified node and instance More...
 
virtual void slot_preTick ()
 handle the preTick signal. This clears the light point node buffer and updates the imGui More...
 
virtual void clearNodeBuffer (const osg::Camera *camera)
 Clear the node buffer for a particular camera. More...
 
unsigned int nodeBufferMaxNodeId (const osg::Camera *camera)
 get the number of node ids avilable for this camera's node buffer More...
 
virtual void setNodeBufferData (int nodeId, const osg::Camera *camera, const DtLightPointNodeDataLayout &nodeData)
 Set the light point node data for a particular node id (a node id is a one to one mapping to a node + instance) posScale is used to scale the position of the light point when model scaling is being used with instanced models radiusScale is used to scale the radius of the light point when model scaling is being used with any model. More...
 
virtual void processImGui ()
 Update the imGui debug Gui and process any changes from the Gui. More...
 
virtual DtLightPointDrawablemasterLightPointDrawable ()
 Get the master light point drawable that is used to draw all the light points. More...
 
virtual bool debugLabelsEnabled () const
 Check to see if debug labels are enabled. They are controlled by the imGui debug Gui. More...
 
virtual bool debugDirectionEnabled () const
 Check to see if debug direcion light points should be drawn. More...
 
virtual bool softerLightPointsEnabled ()
 Check to see if soften light points is enabled. More...
 
virtual float softenIntensity ()
 Get the intensity of the softening for the light points. More...
 
virtual void setShouldReplaceOsgSimLightPoints (bool enable)
 Set if the light point manager should replace osgSim light point nodes with DtLightPointNodes this defaults to false for now and is controlled by an environment variable in the managers contructor. More...
 
virtual bool shouldReplaceOsgSimLightPoints ()
 Get if the light point manager should replace osgSim light point nodes with DtLightPointNodes this defaults to false for now and is controlled by an environment variable in the managers contructor. More...
 
virtual void freeNodeIds (std::vector< int > &nodeIds)
 When a DtLightPointNode is deleted it calls this in order to free up the nodeIds. More...
 
virtual void releaseGLObjects (osg::State *state) const
 
virtual void setInstanceReflectionMatrix (const osg::Camera *camera, const osg::Matrixf &reflectMat)
 sets up the reflection pass matrix that converts from the main camera view space to the reflection camera view space. More...
 
virtual const osg::Matrixf & instanceReflectionMatrix (const osg::Camera *camera)
 gets the reflection pass matrix that converts from the main camera view space to the reflection camera view space. More...
 
virtual bool drawLightPoints ()
 controlled by IMgui and is used to stop drawing/culling light points entirely. More...
 
- Public Member Functions inherited from makVrv::DtLightPointManager
 DtLightPointManager (DtDe &de)
 Light point manager contructor used by instance() call to setup the singleton instance. More...
 
virtual bool groupExists (const std::string &group) const
 Get whether or not the manager has seen the specified group yet. More...
 
virtual DtColorValue groupColor (const std::string &group)
 Get the current value of the group color for the specified group string. More...
 
virtual int groupId (const std::string &group)
 get the groupId assigned to the specified group string used by the light point nodes and light point groups to associate a node or type to a group in the shader. More...
 
virtual int lightPointMaxCode ()
 get the lights table max code so we can know how many digits to render in the debug rendering of the light point code More...
 
void setGroupColor (const std::string &group, float colorR, float colorG, float colorB, float colorA)
 Set the current value of the group color for the specified group string should only be called on a master display engine and distributes the color to the slaves. More...
 
virtual void setGroupColor (const std::string &group, const DtColorValue &color)
 Set the current value of the group color for the specified group string should only be called on a master display engine and distributes the color to the slaves. More...
 
virtual const GroupIdMapgroupIdMap ()
 Get the current groupIdMap. More...
 
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 Do nothing constructor. More...
 
virtual ~DtVirtualBaseClass ()
 Virtual do nothing destructor. More...
 

Static Public Member Functions

static DtOsgLightPointManagerinstanceAsDtOsgLightPointManager (DtDe &de)
 get the DtOsgLightPointManger from the de instance registry More...
 
- Static Public Member Functions inherited from makVrv::DtLightPointManager
static DtLightPointManagerinstance (DtDe &de)
 Get/create the DtLightPointManager instance. More...
 
static void registerInstance (DtDe &de, DtLightPointManager *manager)
 
static const std::string & theClassName ()
 Get the name used to register this class. More...
 
static float defaultLightPointRange ()
 default light point range for when the light point should disappear More...
 

Public Attributes

boost::signalslib::signal
< void(LightPointNodeObsSet &)> 
signal_lightPointsRegistered
 Emitted when the terrain patch has light points added. More...
 

Protected Types

typedef std::map< const
osg::Camera *, std::vector
< float > > 
CameraVectorMap
 
typedef std::pair
< DtLightPointNode *, int
nodeIntPair
 
typedef std::map< nodeIntPair,
int
NodeIdMap
 
typedef std::map< std::string,
GroupIdMap
ParentGroupIdMap
 
- Protected Types inherited from makVrv::DtLightPointManager
typedef std::vector< DtColorValueColorVector
 

Protected Member Functions

virtual ~DtOsgLightPointManager ()
 DTOR. More...
 
virtual void slot_reloadShaders ()
 Handle the reload shaders signal and reload the shaders for the managed light points. More...
 
virtual void setupShaders ()
 Reload the shaders and assign them to the drawables VP. More...
 
int parseNodeGroupId (osg::Node *lightPointNode)
 look at the light point node and it's parents to see if there is a group setup Currently supports light_group comments or runway wizard generated names More...
 
std::string parseNodeGroupName (osg::Node *node)
 utility function for checking a node for the light_group comment. More...
 
virtual void populateLightPointNode (osg::Node *nodeRef, DtLightPointNode *dtLpRef, bool daylightControlled, bool newNode)
 Add incoming light points to an existing light point node. More...
 
- Protected Member Functions inherited from makVrv::DtLightPointManager
virtual ~DtLightPointManager ()
 DTOR. More...
 
void local_setGroupColor (const std::string &group, const DtColorValue &color)
 Set the current value of the group color for the specified group string called indirectly by setGroupColor and is used by the DtDeSharedState to modify the color for a group. More...
 

Static Protected Member Functions

static void cleanupNodes (osg::Node *node)
 Remove empty nodes, recursively upward in the graph. More...
 

Protected Attributes

DtGlBuffermyLightPointTypeBuffer
 
DtGlBuffermyLightPointGroupBuffer
 
CameraVectorMap myLightPointNodeDataMap
 
DtGlBuffermyLightPointNodeBuffer
 
DtGlBuffermyLightPointVertexBuffer
 
NodeIdMap myNodeIds
 
std::set< intmyFreeNodeIds
 
boost::mutex myMutex
 
boost::mutex myNodeIdMutex
 
boost::recursive_mutex myNodeBufferMutex
 
boost::shared_mutex myLightsTableMutex
 
osg::ref_ptr
< DtLightPointDrawable
myMasterLightPointDrawable
 
bool myDebugLabelsEnabled
 
bool myDebugDirectionEnabled
 
bool myShouldReplaceOsgSimLightPoints
 
bool mySofterLightPointsEnabled
 
float mySoftenIntensity
 
bool myDrawLightPoints
 
GroupIdMap myImGuiProcessedGroupIds
 
ParentGroupIdMap myImGuiGroups
 
std::map< const osg::Camera
*, osg::Matrixf > 
myInstanceReflectionMatrix
 
LightPointNodeObsSet myLightPointNodes
 
DtDemyDtDe
 
- Protected Attributes inherited from makVrv::DtLightPointManager
DtSignalConnectionManager mySignals
 
DtDemyDe
 
DtLightPointTable myLightsTable
 
GroupIdMap myGroupIds
 
ColorVector myGroupColors
 
int myLastUpdateLightPointMaxCode
 

Private Member Functions

 DtOsgLightPointManager ()=delete
 No default construction allowed. More...
 
 DtOsgLightPointManager (const DtOsgLightPointManager &other)=delete
 Copy Constructor not implemented – Copy Not Allowed. More...
 
DtOsgLightPointManageroperator= (const DtOsgLightPointManager &other)=delete
 Assignment Operator Not implemented – Assignment Not Allowed. More...
 

Additional Inherited Members

- Public Types inherited from makVrv::DtLightPointManager
typedef std::pair< std::string,
int
GroupIdPair
 
typedef std::map< std::string,
int
GroupIdMap
 
- Static Protected Attributes inherited from makVrv::DtLightPointManager
static const std::string theLightFilename
 
static const std::string theLightTunningFilename
 
static const std::string theLightDefaultValuesXmlFilename
 
static const std::string theLightDefaultValuesCsvFilename
 

Detailed Description

DtOsgLightPointManager registers LightPoint nodes so their TBO can be created and updated in a single place.

Main access point for adding light points to the new system. It registers the light points which (if enabled) replaces the

See Also
osgSim::LightPointNodes with
DtLightPointNodes or just passes a pointer for the
DtOsgLightPointManager to the
DtLightPointNode in the case of CDB light points. It also converts
osgSim::LightPoint objects to a light point type and manages the loading of the light point table which has the default light point types in it. Creates the
DtLightPointDrawable object that draws all the light points. Handles the creation and updating of the SSBO(Shader Storage Buffer Object) which is how the light type, light node, and light group data is passed down to the GPU. Sets up the shaders which are added as Virtual Program functions to the
DtLightPointDrawable. Sets up the imGui debug gui which can turn on debug labels and adjust the intensity of the light point groups.

Member Typedef Documentation

typedef std::map<const osg::Camera*, std::vector<float> > makVrv::DtOsgLightPointManager::CameraVectorMap
protected
typedef std::map<std::string, GroupIdMap> makVrv::DtOsgLightPointManager::ParentGroupIdMap
protected

Constructor & Destructor Documentation

makVrv::DtOsgLightPointManager::DtOsgLightPointManager ( DtDe de)

Light point manager contructor used by instance() call to setup the singleton instance.

makVrv::DtOsgLightPointManager::DtOsgLightPointManager ( )
privatedelete

No default construction allowed.

makVrv::DtOsgLightPointManager::DtOsgLightPointManager ( const DtOsgLightPointManager other)
privatedelete

Copy Constructor not implemented – Copy Not Allowed.

virtual makVrv::DtOsgLightPointManager::~DtOsgLightPointManager ( )
protectedvirtual

DTOR.

Member Function Documentation

static DtOsgLightPointManager& makVrv::DtOsgLightPointManager::instanceAsDtOsgLightPointManager ( DtDe de)
static

get the DtOsgLightPointManger from the de instance registry

DtOsgLightPointManager& makVrv::DtOsgLightPointManager::operator= ( const DtOsgLightPointManager other)
privatedelete

Assignment Operator Not implemented – Assignment Not Allowed.

virtual void makVrv::DtOsgLightPointManager::registerInstancedLightPoints ( LightPointVec lightPoints,
bool  daylightControlled 
)
virtual

Register a list of instanced light points daylightControlled is only used if the light points do not already have a type specified.

virtual void makVrv::DtOsgLightPointManager::findAndRegisterLightPoints ( osg::Node *  node,
const std::string &  groupName,
bool  daylightControlled,
const DtIndirectFadeParameters fadeParameters,
bool  combineLightPoints 
)
virtual

traverse node and find all the light points and then pass them to registerLightPoints.

virtual void makVrv::DtOsgLightPointManager::registerLightPoints ( const DtLightPointNodeAndXformVector lightPoints,
const std::string &  groupName,
bool  daylightControlled,
const DtIndirectFadeParameters fadeParameters,
bool  combineLightPoints 
)
virtual

Register a list of non instanced light points daylightControlled is only used if the light points do not already have a type specified.

virtual LightPointNodeObsSet makVrv::DtOsgLightPointManager::aggregateLightPoints ( const DtLightPointNodeAndXformVector lightPoints,
const std::string &  groupName,
bool  daylightControlled,
const DtIndirectFadeParameters fadeParameters,
bool  combineLightPoints 
)
virtual

combine light points that can be combined into less nodes and convert them into DtLightPointNodes if needed as well.

virtual DtLightPointNode* makVrv::DtOsgLightPointManager::createLightPointNode ( osg::Node *  nodeRef,
bool  daylightControlled 
)
virtual

Create a DtLightPointNode based on an osgSim::LightPointNode also removes the osgSim::LightPointNode from the scenegraph Does nothing if shouldReplaceOsgSimLightPoints is set to false which is currently the default setting.

daylightControlled is only used if the light points do not already have a type specified

virtual DtGlBuffer* makVrv::DtOsgLightPointManager::lightPointTypeBuffer ( )
virtual

Get and setup the light point type SSBO used for rendering the light points.

this buffer contains the data from the DtLightPointTable reorganized into a tightly packed list of only the data that is needed by the shader.

virtual DtGlBuffer* makVrv::DtOsgLightPointManager::lightPointGroupBuffer ( )
virtual

Get and setup the light point group SSBO.

This buffer contains the intensity settings for all of the light point groups.

virtual DtGlBuffer* makVrv::DtOsgLightPointManager::lightPointNodeBuffer ( osg::Camera *  camera)
virtual

Get and setup the light point node buffer SSBO.

This contains all the model view matrices for all the light point nodes. there is a node buffer per camera because we need a view matrix for each camera.

virtual void makVrv::DtOsgLightPointManager::updateLightPointVertexBuffer ( const std::vector< DtLightPointDrawable::LightPointVertexAttrib > &  vertexAttribData,
int  minChanged,
int  maxChanged 
)
virtual

positions and information about their direction and blinking.

Also contains ids for the type, node, and group

virtual DtGlBuffer* makVrv::DtOsgLightPointManager::lightPointVertexBufer ( )
virtual

get the ssbo for the light point vertex data.

This contains the light point positions and information about their direction and blinking. Also contains ids for the type, node, and group

virtual int makVrv::DtOsgLightPointManager::nodeId ( DtLightPointNode lpNode,
int  instanceId 
)
virtual

get the node id for the specified node and instance

virtual void makVrv::DtOsgLightPointManager::slot_preTick ( )
virtual

handle the preTick signal. This clears the light point node buffer and updates the imGui

virtual void makVrv::DtOsgLightPointManager::clearNodeBuffer ( const osg::Camera *  camera)
virtual

Clear the node buffer for a particular camera.

unsigned int makVrv::DtOsgLightPointManager::nodeBufferMaxNodeId ( const osg::Camera *  camera)

get the number of node ids avilable for this camera's node buffer

virtual void makVrv::DtOsgLightPointManager::setNodeBufferData ( int  nodeId,
const osg::Camera *  camera,
const DtLightPointNodeDataLayout nodeData 
)
virtual

Set the light point node data for a particular node id (a node id is a one to one mapping to a node + instance) posScale is used to scale the position of the light point when model scaling is being used with instanced models radiusScale is used to scale the radius of the light point when model scaling is being used with any model.

virtual void makVrv::DtOsgLightPointManager::processImGui ( )
virtual

Update the imGui debug Gui and process any changes from the Gui.

virtual DtLightPointDrawable* makVrv::DtOsgLightPointManager::masterLightPointDrawable ( )
virtual

Get the master light point drawable that is used to draw all the light points.

virtual bool makVrv::DtOsgLightPointManager::debugLabelsEnabled ( ) const
virtual

Check to see if debug labels are enabled. They are controlled by the imGui debug Gui.

virtual bool makVrv::DtOsgLightPointManager::debugDirectionEnabled ( ) const
virtual

Check to see if debug direcion light points should be drawn.

virtual bool makVrv::DtOsgLightPointManager::softerLightPointsEnabled ( )
virtual

Check to see if soften light points is enabled.

virtual float makVrv::DtOsgLightPointManager::softenIntensity ( )
virtual

Get the intensity of the softening for the light points.

virtual void makVrv::DtOsgLightPointManager::setShouldReplaceOsgSimLightPoints ( bool  enable)
virtual

Set if the light point manager should replace osgSim light point nodes with DtLightPointNodes this defaults to false for now and is controlled by an environment variable in the managers contructor.

virtual bool makVrv::DtOsgLightPointManager::shouldReplaceOsgSimLightPoints ( )
virtual

Get if the light point manager should replace osgSim light point nodes with DtLightPointNodes this defaults to false for now and is controlled by an environment variable in the managers contructor.

virtual void makVrv::DtOsgLightPointManager::freeNodeIds ( std::vector< int > &  nodeIds)
virtual

When a DtLightPointNode is deleted it calls this in order to free up the nodeIds.

virtual void makVrv::DtOsgLightPointManager::releaseGLObjects ( osg::State *  state) const
virtual
virtual void makVrv::DtOsgLightPointManager::setInstanceReflectionMatrix ( const osg::Camera *  camera,
const osg::Matrixf &  reflectMat 
)
virtual

sets up the reflection pass matrix that converts from the main camera view space to the reflection camera view space.

virtual const osg::Matrixf& makVrv::DtOsgLightPointManager::instanceReflectionMatrix ( const osg::Camera *  camera)
virtual

gets the reflection pass matrix that converts from the main camera view space to the reflection camera view space.

virtual bool makVrv::DtOsgLightPointManager::drawLightPoints ( )
virtual

controlled by IMgui and is used to stop drawing/culling light points entirely.

virtual void makVrv::DtOsgLightPointManager::slot_reloadShaders ( )
protectedvirtual

Handle the reload shaders signal and reload the shaders for the managed light points.

virtual void makVrv::DtOsgLightPointManager::setupShaders ( )
protectedvirtual

Reload the shaders and assign them to the drawables VP.

int makVrv::DtOsgLightPointManager::parseNodeGroupId ( osg::Node *  lightPointNode)
protected

look at the light point node and it's parents to see if there is a group setup Currently supports light_group comments or runway wizard generated names

std::string makVrv::DtOsgLightPointManager::parseNodeGroupName ( osg::Node *  node)
protected

utility function for checking a node for the light_group comment.

virtual void makVrv::DtOsgLightPointManager::populateLightPointNode ( osg::Node *  nodeRef,
DtLightPointNode dtLpRef,
bool  daylightControlled,
bool  newNode 
)
protectedvirtual

Add incoming light points to an existing light point node.

static void makVrv::DtOsgLightPointManager::cleanupNodes ( osg::Node *  node)
staticprotected

Remove empty nodes, recursively upward in the graph.

Some nodes are made empty by the light point aggregator, and are the only child of their parent, so can be removed, and so forth up into the graph.

Member Data Documentation

boost::signalslib::signal<void(LightPointNodeObsSet&)> makVrv::DtOsgLightPointManager::signal_lightPointsRegistered

Emitted when the terrain patch has light points added.

DtGlBuffer* makVrv::DtOsgLightPointManager::myLightPointTypeBuffer
protected
DtGlBuffer* makVrv::DtOsgLightPointManager::myLightPointGroupBuffer
protected
CameraVectorMap makVrv::DtOsgLightPointManager::myLightPointNodeDataMap
protected
DtGlBuffer* makVrv::DtOsgLightPointManager::myLightPointNodeBuffer
protected
DtGlBuffer* makVrv::DtOsgLightPointManager::myLightPointVertexBuffer
protected
NodeIdMap makVrv::DtOsgLightPointManager::myNodeIds
protected
std::set<int> makVrv::DtOsgLightPointManager::myFreeNodeIds
protected
boost::mutex makVrv::DtOsgLightPointManager::myMutex
protected
boost::mutex makVrv::DtOsgLightPointManager::myNodeIdMutex
protected
boost::recursive_mutex makVrv::DtOsgLightPointManager::myNodeBufferMutex
protected
boost::shared_mutex makVrv::DtOsgLightPointManager::myLightsTableMutex
protected
osg::ref_ptr<DtLightPointDrawable> makVrv::DtOsgLightPointManager::myMasterLightPointDrawable
protected
bool makVrv::DtOsgLightPointManager::myDebugLabelsEnabled
protected
bool makVrv::DtOsgLightPointManager::myDebugDirectionEnabled
protected
bool makVrv::DtOsgLightPointManager::myShouldReplaceOsgSimLightPoints
protected
bool makVrv::DtOsgLightPointManager::mySofterLightPointsEnabled
protected
float makVrv::DtOsgLightPointManager::mySoftenIntensity
protected
bool makVrv::DtOsgLightPointManager::myDrawLightPoints
protected
GroupIdMap makVrv::DtOsgLightPointManager::myImGuiProcessedGroupIds
protected
ParentGroupIdMap makVrv::DtOsgLightPointManager::myImGuiGroups
protected
std::map<const osg::Camera*, osg::Matrixf> makVrv::DtOsgLightPointManager::myInstanceReflectionMatrix
protected
LightPointNodeObsSet makVrv::DtOsgLightPointManager::myLightPointNodes
protected
DtDe& makVrv::DtOsgLightPointManager::myDtDe
protected

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

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)