VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Friends
makVrv::DtNavigationLightController Class Reference

The DtNavigationLightController can be attached to any articulated model through an articulated model agent that has switchable colored lights. It sets the objects light color; and it turns the light on and off according to a provided sequence string, time of day and visibility conditions. It is the responsibility of whatever attaches this to a model to set the attachment to Null (0) when the model is destroyed.

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

Public Types

enum  NavigationLightExhibitCondition { NavigationLightExhibitConditionAlways = 1, NavigationLightExhibitConditionDay = 2, NavigationLightExhibitConditionFog = 3, NavigationLightExhibitConditionNight = 4 }
 
typedef std::vector< float > SignalSequence
 
typedef std::vector< intColorSequence
 

Public Member Functions

virtual ~DtNavigationLightController ()
 
virtual void attach (DtBuoyOrBeaconFacade &buoyOrBeacon)
 
virtual void update (DtTime simTime, bool daylight, bool foggy)
 
virtual void setSignalSequence (const SignalSequence &sequence)
 
virtual const SignalSequencesignalSequence () const
 
virtual void setExhibitCondition (NavigationLightExhibitCondition condition)
 
virtual
NavigationLightExhibitCondition 
exhibitCondition () const
 
void setParameterValues (const std::string &values)
 
std::string parameterValues () const
 
virtual void setColors (const ColorSequence &sequence)
 
virtual const ColorSequencecolors () const
 
virtual void setOnOffState (bool state)
 
virtual bool onOffState () const
 
virtual void setTimer (DtTime nextStateTime)
 
virtual DtTime timer () const
 
virtual void setSequenceCursor (int cursor)
 
virtual int sequenceCursor () const
 
virtual void setLightColorSwitchNumber (int switchNum)
 
virtual int lightColorSwitchNumber () const
 
virtual void setLightSwitchNumber (int switchNum)
 
virtual int lightSwitchNumber () const
 
virtual void setEnabled (bool enabled)
 
virtual bool enabled () const
 
virtual void setHeight (float height)
 
virtual float height () const
 
virtual void setVisibleDistance (float distance)
 
virtual float visibleDistance () const
 
virtual void setIsAlternating (bool alt)
 
virtual bool isAlternating () const
 
- Public Member Functions inherited from makVrv::DtNavigationFeature
virtual ~DtNavigationFeature ()
 
DtUniqueID elementId () const
 
virtual void detach (DtBuoyOrBeaconFacade &buoyOrBeacon)
 
virtual void setPresenceSwitchNumber (int switchNum)
 
virtual int presenceSwitchNumber () const
 
virtual void setTypeSwitchNumber (int typeNum)
 
virtual int typeSwitchNumber () const
 
virtual void setAttachableType (DtBuoyBeaconLayer::AttachableTypes attType)
 
virtual
DtBuoyBeaconLayer::AttachableTypes 
attachableType ()
 
DtArticulatedModelAgent *const modelAgent () const
 
DtArticulatedModelAgent * modelAgent ()
 
void setPosition (const DtVector &position)
 
const DtVector & position () const
 

Public Attributes

std::string myParameterValues
 

Protected Member Functions

 DtNavigationLightController (DtUniqueID elementId)
 
 DtNavigationLightController ()
 
 DtNavigationLightController (const DtNavigationLightController &orig)
 
const DtNavigationLightControlleroperator= (const DtNavigationLightController &rhs)
 
void checkEnabledState (bool daylight, bool foggy)
 
virtual void attachModel (DtArticulatedModelAgent *modelAgent)
 
virtual void updateModel (DtArticulatedModelAgent *modelAgent, DtTime simTime, bool daylight, bool foggy)
 
virtual void setModelColors (DtArticulatedModelAgent *modelAgent)
 
virtual void setModelOnOffState (DtArticulatedModelAgent *modelAgent)
 
- Protected Member Functions inherited from makVrv::DtNavigationFeature
 DtNavigationFeature (DtUniqueID elementId)
 
 DtNavigationFeature ()
 
 DtNavigationFeature (const DtNavigationFeature &orig)
 
const DtNavigationFeatureoperator= (const DtNavigationFeature &rhs)
 

Protected Attributes

ColorSequence myColors
 
int myColorCursor
 
bool myOnOffState
 
DtTime myTimer
 
SignalSequence mySignalSequence
 
int mySequenceCursor
 
int myLightColorSwitchNumber
 
int myLightSwitchNumber
 
NavigationLightExhibitCondition myExhibitCondition
 
float myHeight
 
float myVisibleDistance
 
bool myEnabled
 
bool myIsAlternating
 
- Protected Attributes inherited from makVrv::DtNavigationFeature
DtUniqueID myElementId
 
DtVector myPosition
 
DtArticulatedModelAgent * myModelAgent
 
DtArticulatedModelAgent * myColorizedModelAgent
 
int myPresenceSwitchNumber
 
int myTypeSwitchNumber
 
DtBuoyBeaconLayer::AttachableTypes myAttachableType
 

Friends

class DtNavigationLightControllerCreator
 

Member Typedef Documentation

Type to hold a set of on/off times that define a signal sequence.

Member Enumeration Documentation

enumeration used for exhibit conditions

Enumerator
NavigationLightExhibitConditionAlways 
NavigationLightExhibitConditionDay 
NavigationLightExhibitConditionFog 
NavigationLightExhibitConditionNight 

Constructor & Destructor Documentation

virtual makVrv::DtNavigationLightController::~DtNavigationLightController ( )
virtual

DTOR.

makVrv::DtNavigationLightController::DtNavigationLightController ( DtUniqueID  elementId)
protected

CTOR (callable by creator)

makVrv::DtNavigationLightController::DtNavigationLightController ( )
protected

Default CTOR (unimplemented)

makVrv::DtNavigationLightController::DtNavigationLightController ( const DtNavigationLightController orig)
protected

Copy CTOR (unimplemented)

Member Function Documentation

virtual void makVrv::DtNavigationLightController::attach ( DtBuoyOrBeaconFacade buoyOrBeacon)
virtual

Attach the controller to an articulated model. The model should have a multiswitch for different colored lights; and an on/off switch for each light.

Reimplemented from makVrv::DtNavigationFeature.

virtual void makVrv::DtNavigationLightController::update ( DtTime  simTime,
bool  daylight,
bool  foggy 
)
virtual

Update the state of the light (on or off) based on daylight conditions, fog, and signal sequence. simTime is only used for signal sequencing, not day/night determination.

virtual void makVrv::DtNavigationLightController::setColors ( const ColorSequence sequence)
virtual

Set/get the color value this controller should set the model's light color switch to.

virtual const ColorSequence& makVrv::DtNavigationLightController::colors ( ) const
virtual

Set/get the color value this controller should set the model's light color switch to.

virtual void makVrv::DtNavigationLightController::setSignalSequence ( const SignalSequence sequence)
virtual

Set/get a signal sequence for the controller to use This is a series of ON and OFF times, in seconds, starting with an ON time.

virtual const SignalSequence& makVrv::DtNavigationLightController::signalSequence ( ) const
virtual
virtual void makVrv::DtNavigationLightController::setExhibitCondition ( NavigationLightExhibitCondition  condition)
virtual

Set/get the exhibit condition for the controlled light.

virtual NavigationLightExhibitCondition makVrv::DtNavigationLightController::exhibitCondition ( ) const
virtual
virtual void makVrv::DtNavigationLightController::setOnOffState ( bool  state)
virtual

Set/get the controlled light's on off state (usually handled internally)

virtual bool makVrv::DtNavigationLightController::onOffState ( ) const
virtual

Set/get the controlled light's on off state (usually handled internally)

virtual void makVrv::DtNavigationLightController::setTimer ( DtTime  nextStateTime)
virtual

Set/get the simTime that the controller should do the next signal sequence transition (usually handled internally). Set this to 0. will force a transition on the next update.

virtual DtTime makVrv::DtNavigationLightController::timer ( ) const
virtual

Set/get the simTime that the controller should do the next signal sequence transition (usually handled internally). Set this to 0. will force a transition on the next update.

virtual void makVrv::DtNavigationLightController::setSequenceCursor ( int  cursor)
virtual

Set/get the cursor for the sequence. When a transition occurs, this value is used to determine the time of the NEXT transition. If it is greater than the size of the signal sequence, it will be set to 0.

virtual int makVrv::DtNavigationLightController::sequenceCursor ( ) const
virtual

Set/get the cursor for the sequence. When a transition occurs, this value is used to determine the time of the NEXT transition. If it is greater than the size of the signal sequence, it will be set to 0.

virtual void makVrv::DtNavigationLightController::setLightColorSwitchNumber ( int  switchNum)
virtual

Set the number of the switch (State number) that controls the light color. By default, the controller uses DtModelSemanticsMapper::State::light_color.

virtual int makVrv::DtNavigationLightController::lightColorSwitchNumber ( ) const
virtual

Set the number of the switch (State number) that controls the light color. By default, the controller uses DtModelSemanticsMapper::State::light_color.

virtual void makVrv::DtNavigationLightController::setLightSwitchNumber ( int  switchNum)
virtual

Set the number of the switch (State number) that controls the light on/off state. By default, the controller uses DtModelSemanticsMapper::State::navigation_lights.

virtual int makVrv::DtNavigationLightController::lightSwitchNumber ( ) const
virtual

Set the number of the switch (State number) that controls the light on/off state. By default, the controller uses DtModelSemanticsMapper::State::navigation_lights.

virtual void makVrv::DtNavigationLightController::setEnabled ( bool  enabled)
virtual

Enable / disable a light. This is normally done internally based on exhibition condition, daylight, and fog indicators. To take manual control, set the exhibitCondition to NavigationLightExhibitConditionAlways.

virtual bool makVrv::DtNavigationLightController::enabled ( ) const
virtual

Enable / disable a light. This is normally done internally based on exhibition condition, daylight, and fog indicators. To take manual control, set the exhibitCondition to NavigationLightExhibitConditionAlways.

virtual void makVrv::DtNavigationLightController::setHeight ( float  height)
virtual

If a light height is specfied (!= 0.) then that height (and the object it's attached to's height of attach point) will be used to position the object (and hence the light height)

virtual float makVrv::DtNavigationLightController::height ( ) const
virtual

If a light height is specfied (!= 0.) then that height (and the object it's attached to's height of attach point) will be used to position the object (and hence the light height)

virtual void makVrv::DtNavigationLightController::setVisibleDistance ( float  distance)
virtual

If a light range is specified (!= 0) then that range will be used. Otherwise any range set in the osgSim::LightPointNode itself will be used. Note that this value is only used when the light is attached to a buoy or beacon; it must be set before the attachment occurs.

virtual float makVrv::DtNavigationLightController::visibleDistance ( ) const
virtual

If a light range is specified (!= 0) then that range will be used. Otherwise any range set in the osgSim::LightPointNode itself will be used. Note that this value is only used when the light is attached to a buoy or beacon; it must be set before the attachment occurs.

virtual void makVrv::DtNavigationLightController::setIsAlternating ( bool  alt)
virtual

Indicate if a light is alternating (rather than blinking) if it has a signal sequence An alternating light that is enabled is on all the time, but alternates colors.

virtual bool makVrv::DtNavigationLightController::isAlternating ( ) const
virtual

Indicate if a light is alternating (rather than blinking) if it has a signal sequence An alternating light that is enabled is on all the time, but alternates colors.

void makVrv::DtNavigationLightController::setParameterValues ( const std::string &  values)
inline
std::string makVrv::DtNavigationLightController::parameterValues ( ) const
inline
const DtNavigationLightController& makVrv::DtNavigationLightController::operator= ( const DtNavigationLightController rhs)
protected

Assignment Operator (unimplemented)

void makVrv::DtNavigationLightController::checkEnabledState ( bool  daylight,
bool  foggy 
)
protected

Check daylight and fog values against the light controller's exhibit conditions, and enable or disable the light as appropriate.

virtual void makVrv::DtNavigationLightController::attachModel ( DtArticulatedModelAgent *  modelAgent)
protectedvirtual

Model agent-specific forms of public methods.

virtual void makVrv::DtNavigationLightController::updateModel ( DtArticulatedModelAgent *  modelAgent,
DtTime  simTime,
bool  daylight,
bool  foggy 
)
protectedvirtual

Model agent-specific forms of public methods.

virtual void makVrv::DtNavigationLightController::setModelColors ( DtArticulatedModelAgent *  modelAgent)
protectedvirtual

Model agent-specific forms of public methods.

virtual void makVrv::DtNavigationLightController::setModelOnOffState ( DtArticulatedModelAgent *  modelAgent)
protectedvirtual

Model agent-specific forms of public methods.

Friends And Related Function Documentation

Constructed through this creator class.

Member Data Documentation

std::string makVrv::DtNavigationLightController::myParameterValues

For debugging.

ColorSequence makVrv::DtNavigationLightController::myColors
protected
int makVrv::DtNavigationLightController::myColorCursor
protected
bool makVrv::DtNavigationLightController::myOnOffState
protected
DtTime makVrv::DtNavigationLightController::myTimer
protected
SignalSequence makVrv::DtNavigationLightController::mySignalSequence
protected
int makVrv::DtNavigationLightController::mySequenceCursor
protected
int makVrv::DtNavigationLightController::myLightColorSwitchNumber
protected
int makVrv::DtNavigationLightController::myLightSwitchNumber
protected
NavigationLightExhibitCondition makVrv::DtNavigationLightController::myExhibitCondition
protected
float makVrv::DtNavigationLightController::myHeight
protected
float makVrv::DtNavigationLightController::myVisibleDistance
protected
bool makVrv::DtNavigationLightController::myEnabled
protected
bool makVrv::DtNavigationLightController::myIsAlternating
protected

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

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)