VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtCigiTimePublisher Class Reference

Detailed Description

This class demonstrates how to derive a publisher from DtCigiPublisherTemplate using the version-agnostic CigiBaseEnvCtrl packet type. It reads simulation time from the VR-Forces environmental state manager and drives celestial control packets for connected image generators.

#include <cigiTimePublisher.h>

Inheritance diagram for makVre::DtCigiTimePublisher:
[legend]

Public Member Functions

 DtCigiTimePublisher ()
 
virtual ~DtCigiTimePublisher ()
 
bool init () override
 
void tick (double dt) override
 
- Public Member Functions inherited from makVre::DtCigiPublisherTemplate< CigiBaseEnvCtrl, DtCigiTimePublisher, DtCigiPublisherBase >
 DtCigiPublisherTemplate ()
 
virtual ~DtCigiPublisherTemplate () override
 
CigiDatacigi ()
 
CigiData *const cigi () const
 
CigiDatashared ()
 
CigiData *const shared () const
 
- Public Member Functions inherited from makVre::DtSpSubClass< DtCigiTimePublisher, DtCigiPublisherBase >
 DtSpSubClass ()
 
virtual ~DtSpSubClass ()
 
Sptr self ()
 
std::string type () const override
 
- Public Member Functions inherited from makVre::DtCigiPublisherBase
 DtCigiPublisherBase ()
 
virtual ~DtCigiPublisherBase () override
 
DtCigiDataBaseshared ()
 
DtCigiDataBase *const shared () const
 
virtual void setEnabled (bool enabled)
 
virtual bool enabled () const
 
template<class CHILD_T>
std::shared_ptr< CHILD_T > addNewChild (const std::string &name="")
 
virtual bool addChild (Sptr child) override
 
virtual void publish (CigiOutgoingMsg &out)
 
virtual void setNeedsReceiptConfirmation (bool needs)
 
virtual bool needsReceiptConfirmation () const
 
virtual void receiptConfirmed ()
 
virtual double lastSent ()
 
virtual void markDirty (bool childrenToo=false)
 
virtual void markClean (bool childrenToo=false)
 
- Public Member Functions inherited from makVre::DtSpSubClass< DtCigiPublisherBase, DtTreeClass< DtCigiPublisherBase, DtCigiObjectBase > >
 DtSpSubClass ()
 
Sptr self ()
 
- Public Member Functions inherited from makVre::DtTreeClass< DtCigiPublisherBase, DtCigiObjectBase >
 DtTreeClass ()
 
virtual ~DtTreeClass () override
 
virtual void setOwnsChildren (bool owns)
 
virtual bool ownsChildren ()
 
virtual bool removeChild (Sptr child)
 
virtual void removeAllChildren ()
 
virtual bool forEachChild (ForChildFn fn)
 
virtual Sptr findChild (FindChildFn fn)
 
virtual Sptr findChild (const std::string &name)
 
virtual bool isChild (Sptr child)
 
virtual unsigned int numChildren ()
 
virtual bool hasChildren ()
 
virtual Sptr parent ()
 
- Public Member Functions inherited from makVre::DtSpSubClass< DtCigiPublisherBase, DtCigiObjectBase >
 DtSpSubClass ()
 
Sptr self ()
 
- Public Member Functions inherited from makVre::DtCigiObjectBase
 DtCigiObjectBase ()
 
virtual ~DtCigiObjectBase () override
 
CigiDatacigi ()
 
CigiData *const cigi () const
 
virtual Cigi_uint16 cigiType ()
 
virtual Sptr setSession (DtCigiSession &session)
 
virtual DtCigiSessionsession () const
 
virtual unsigned int sessionVersion () const
 
virtual void markDirty ()
 
virtual void markClean ()
 
virtual bool isDirty () const
 
- Public Member Functions inherited from makVre::DtSpSubClass< DtCigiObjectBase >
 DtSpSubClass ()
 
Sptr self ()
 
- Public Member Functions inherited from makVre::DtSpObject
 DtSpObject ()
 
virtual ~DtSpObject ()
 
Sptr self ()
 
virtual void setName (const std::string &name)
 
virtual std::string name () const
 

Static Public Member Functions

static void addToSession (DtCigiSession &session)
 
- Static Public Member Functions inherited from makVre::DtSpSubClass< DtCigiTimePublisher, DtCigiPublisherBase >
static std::string Type ()
 
static std::shared_ptr< DtCigiTimePublishercreate ()
 
static void registerCreator ()
 
static std::shared_ptr< DtCigiTimePublishercreateVersion (unsigned int version)
 
static void registerCreatorVersion (unsigned int version)
 
- Static Public Member Functions inherited from makVre::DtSpSubClass< DtCigiPublisherBase, DtTreeClass< DtCigiPublisherBase, DtCigiObjectBase > >
static std::string Type ()
 
static std::shared_ptr< DtCigiPublisherBasecreate ()
 
static void registerCreator ()
 
static std::shared_ptr< DtCigiPublisherBasecreateVersion (unsigned int version)
 
static void registerCreatorVersion (unsigned int version)
 
- Static Public Member Functions inherited from makVre::DtSpSubClass< DtCigiPublisherBase, DtCigiObjectBase >
static std::string Type ()
 
static std::shared_ptr< DtCigiPublisherBasecreate ()
 
static void registerCreator ()
 
static std::shared_ptr< DtCigiPublisherBasecreateVersion (unsigned int version)
 
static void registerCreatorVersion (unsigned int version)
 
- Static Public Member Functions inherited from makVre::DtSpSubClass< DtCigiObjectBase >
static std::string Type ()
 
static std::shared_ptr< DtCigiObjectBasecreate ()
 
static void registerCreator ()
 
static std::shared_ptr< DtCigiObjectBasecreateVersion (unsigned int version)
 
static void registerCreatorVersion (unsigned int version)
 
- Static Public Member Functions inherited from makVre::DtSpObject
template<class AS_T>
static std::shared_ptr< AS_T > cast (Sptr p)
 
template<class AS_T>
static std::shared_ptr< AS_T > unsafe_cast (Sptr p)
 

Protected Member Functions

void initCigi () override
 
void updateCigi () override
 
- Protected Member Functions inherited from makVre::DtCigiPublisherTemplate< CigiBaseEnvCtrl, DtCigiTimePublisher, DtCigiPublisherBase >
DtCigiDataBasecreateCigi () override
 
bool verifySharedType () override
 
- Protected Member Functions inherited from makVre::DtCigiPublisherBase
virtual std::string sharedKey ()
 
virtual void setupShared ()
 
virtual void initShared ()
 
virtual void updateShared ()
 
virtual void write (CigiOutgoingMsg &out)
 
virtual void createChildren ()
 
virtual void tickChildren (double dt)
 
virtual void publishChildren (CigiOutgoingMsg &out)
 
- Protected Member Functions inherited from makVre::DtTreeClass< DtCigiPublisherBase, DtCigiObjectBase >
virtual void setParent (Sptr parent)
 
virtual void pruneChildren ()
 
- Protected Member Functions inherited from makVre::DtCigiObjectBase
DtCigiDataBasecigiBase ()
 
DtCigiDataBase *const cigiBase () const
 
template<typename VALUE_T>
bool updateValue (VALUE_T *value, VALUE_T source)
 

Protected Attributes

double mySimTime
 
double myTimeTolerance
 
- Protected Attributes inherited from makVre::DtCigiPublisherBase
CigiBasePtr mySharedData
 
bool myEnabled
 
bool myNeedsConfirmation
 
double myLastSentToIg
 
- Protected Attributes inherited from makVre::DtTreeClass< DtCigiPublisherBase, DtCigiObjectBase >
OwnedChildList myOwnedChildren
 
UnownedChildList myUnownedChildren
 
ChildNameMap myChildrenByName
 
bool myOwnsChildren
 
Wptr myParent
 
- Protected Attributes inherited from makVre::DtCigiObjectBase
CigiBasePtr myCigiData
 
DtCigiSessionmySession
 
bool myDirty
 
- Protected Attributes inherited from makVre::DtSpObject
std::string myName
 

Additional Inherited Members

- Public Types inherited from makVre::DtCigiPublisherTemplate< CigiBaseEnvCtrl, DtCigiTimePublisher, DtCigiPublisherBase >
using Cigi
 
using CigiData
 
- Public Types inherited from makVre::DtSpSubClass< DtCigiTimePublisher, DtCigiPublisherBase >
using Super
 
using Ptr
 
using Sptr
 
using Wptr
 
- Public Types inherited from makVre::DtSpSubClass< DtCigiPublisherBase, DtTreeClass< DtCigiPublisherBase, DtCigiObjectBase > >
using Super
 
using Ptr
 
using Sptr
 
using Wptr
 
- Public Types inherited from makVre::DtTreeClass< DtCigiPublisherBase, DtCigiObjectBase >
using Sptr
 
using ForChildFn
 
using FindChildFn
 
- Public Types inherited from makVre::DtSpSubClass< DtCigiPublisherBase, DtCigiObjectBase >
using Super
 
using Ptr
 
using Sptr
 
using Wptr
 
- Public Types inherited from makVre::DtCigiObjectBase
using Cigi = CigiBasePacket
 
using CigiData = DtCigiDataTemplate<CigiBasePacket, DtCigiObjectBase>
 
using CigiBasePtr = std::shared_ptr<DtCigiDataBase>
 
- Public Types inherited from makVre::DtSpSubClass< DtCigiObjectBase >
using Super
 
using Ptr
 
using Sptr
 
using Wptr
 
- Public Types inherited from makVre::DtSpObject
using Ptr = DtSpObject*
 
using Sptr = std::shared_ptr<DtSpObject>
 
using Wptr = std::weak_ptr<DtSpObject>
 
- Protected Types inherited from makVre::DtTreeClass< DtCigiPublisherBase, DtCigiObjectBase >
using Wptr
 
using OwnedChildList
 
using UnownedChildList
 
using ChildNameMap
 
- Static Protected Member Functions inherited from makVre::DtSpSubClass< DtCigiTimePublisher, DtCigiPublisherBase >
static std::shared_ptr< DtBaseCreator< DtCigiTimePublisher > > & creator ()
 
static std::shared_ptr< DtBaseCreator< DtCigiTimePublisher > > & creatorVersion (unsigned int version)
 
- Static Protected Member Functions inherited from makVre::DtSpSubClass< DtCigiPublisherBase, DtTreeClass< DtCigiPublisherBase, DtCigiObjectBase > >
static std::shared_ptr< DtBaseCreator< DtCigiPublisherBase > > & creator ()
 
static std::shared_ptr< DtBaseCreator< DtCigiPublisherBase > > & creatorVersion (unsigned int version)
 
- Static Protected Member Functions inherited from makVre::DtSpSubClass< DtCigiPublisherBase, DtCigiObjectBase >
static std::shared_ptr< DtBaseCreator< DtCigiPublisherBase > > & creator ()
 
static std::shared_ptr< DtBaseCreator< DtCigiPublisherBase > > & creatorVersion (unsigned int version)
 
- Static Protected Member Functions inherited from makVre::DtSpSubClass< DtCigiObjectBase >
static std::shared_ptr< DtBaseCreator< DtCigiObjectBase > > & creator ()
 
static std::shared_ptr< DtBaseCreator< DtCigiObjectBase > > & creatorVersion (unsigned int version)
 

Constructor & Destructor Documentation

◆ DtCigiTimePublisher()

makVre::DtCigiTimePublisher::DtCigiTimePublisher ( )
inline

References mySimTime, and myTimeTolerance.

◆ ~DtCigiTimePublisher()

virtual makVre::DtCigiTimePublisher::~DtCigiTimePublisher ( )
inlinevirtual

Member Function Documentation

◆ addToSession()

static void makVre::DtCigiTimePublisher::addToSession ( DtCigiSession & session)
static

Instantiates a new time publisher and adds it to a CIGI session.

This helper is registered as a session-start callback by the example plugin so that each new CIGI session automatically gets a time-of-day publisher attached under the root publisher in the publisher tree.

References makVre::DtCigiObjectBase::session().

◆ init()

bool makVre::DtCigiTimePublisher::init ( )
overridevirtual

Initializes the publisher and validates required VR-Forces services.

This override checks that the CGF physical world and environmental state manager are available, reads the optional timeDeviationTolerance value from the session configuration, and then delegates to the base publisher initialization.

Returns
true if initialization succeeds and the publisher remains enabled.

Reimplemented from makVre::DtCigiPublisherBase.

◆ tick()

void makVre::DtCigiTimePublisher::tick ( double dt)
overridevirtual

Advances internal simulation time tracking and schedules updates.

This method accumulates expected simulation time using the frame delta, compares it against the authoritative time from the environmental state manager, and marks the publisher dirty when the deviation exceeds the configured tolerance before calling the base tick implementation.

Parameters
dtDelta time in seconds since the last tick.

Reimplemented from makVre::DtCigiPublisherBase.

◆ initCigi()

void makVre::DtCigiTimePublisher::initCigi ( )
overrideprotectedvirtual

Initializes constant CIGI packet fields that do not change over time.

Called once by the base publisher; sets up celestial body enable flags, star intensity, and marks the date/time fields as valid.

Reimplemented from makVre::DtCigiPublisherBase.

◆ updateCigi()

void makVre::DtCigiTimePublisher::updateCigi ( )
overrideprotectedvirtual

Updates dynamic CIGI date/time and ephemeris fields before sending.

When the publisher is dirty, this method updates the CIGI packet with the current simulation UTC date and time and controls whether the image generator advances time based on the simulation play/pause state.

Reimplemented from makVre::DtCigiPublisherBase.

Member Data Documentation

◆ mySimTime

double makVre::DtCigiTimePublisher::mySimTime
protected

Locally tracked simulation time in seconds based on accumulated dt.

Referenced by DtCigiTimePublisher().

◆ myTimeTolerance

double makVre::DtCigiTimePublisher::myTimeTolerance
protected

Maximum allowed deviation between tracked and actual sim time (seconds).

Referenced by DtCigiTimePublisher().


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