All Classes Functions Typedefs
Public Member Functions | Protected Member Functions | List of all members
EnjoLib::MFDGoodies::PluginMultipleVessels Class Reference

Main plugin class. More...

#include <PluginMultipleVessels.hpp>

Inheritance diagram for EnjoLib::MFDGoodies::PluginMultipleVessels:
MyPluginMultipleVessels

Public Member Functions

 PluginMultipleVessels (HINSTANCE hDLL)
 Default ctor.
virtual ~PluginMultipleVessels ()
 Dtor.
MFDDataAssociateMFDData (VESSEL *vessel)
 Associates a given vessel with MFDData.
void UpdatePreStep (const SimulationTimeData &timeData)
 Updates the plugin.
void UpdatePostStep (const SimulationTimeData &timeData)
void clbkSimulationStart (RenderMode mode)
void clbkSimulationEnd ()
void Init ()
 Initialises the plugin.
void Cleanup ()
void DeleteVessel (OBJHANDLE hVessel)
 Deletes vessel.
void clbkPreStep (double simt, double simdt, double mjd)
 Time step notification before state update.
void clbkPostStep (double simt, double simdt, double mjd)
 Time step notification after state update.
void clbkDeleteVessel (OBJHANDLE hVessel)
 Vessel destruction notification.

Protected Member Functions

virtual void UpdateClientPreStep (MFDData *data, const SimulationTimeData &timeData)=0
 Updates client (derived) PluginMultipleVessels before simulation state update.
virtual void UpdateClientPostStep (MFDData *data, const SimulationTimeData &timeData)=0
 Updates client (derived) PluginMultipleVessels after simulation state update.
virtual void InitClient ()=0
 Initialises client (derived) PluginMultipleVessels.
virtual void CleanupClient ()=0
virtual MFDDataConstructNewMFDData (VESSEL *vessel)=0
 Creates and returns a new MFDData * compatible pointer.

Detailed Description

Main plugin class.

Abstract class with encapsulated multiple vessels support.

Warning
No public methods of this class should be overriden. You should rather derive from this class and implement the pure virtual methods

Constructor & Destructor Documentation

PluginMultipleVessels::PluginMultipleVessels ( HINSTANCE  hDLL)

Default ctor.

Parameters
hDLLDLL handle, passed by Orbiter core at InitModule()
PluginMultipleVessels::~PluginMultipleVessels ( )
virtual

Dtor.

Deletes all MFDData objects

Author
Szymon "Enjo" Ender

Member Function Documentation

MFDData * PluginMultipleVessels::AssociateMFDData ( VESSEL *  vessel)

Associates a given vessel with MFDData.

Associates a given vessel with MFDData using an internal MFDData register by creating a new MFDData object if this is a new vessel, or finds an existing MFDData object from internal struct, if the object has been already created. Should be called from initialisation list of an MFD.

Parameters
vesselpassed to MFD
Returns
a reference to the MFDData object
Author
Mohd "Computerex" Ali (concept, comments)
Szymon "Enjo" Ender (simplifications and other modifications)
void PluginMultipleVessels::clbkDeleteVessel ( OBJHANDLE  hVessel)

Vessel destruction notification.

Refer to OrbiterSDK documentation

void PluginMultipleVessels::clbkPostStep ( double  simt,
double  simdt,
double  mjd 
)

Time step notification after state update.

Refer to OrbiterSDK documentation

void PluginMultipleVessels::clbkPreStep ( double  simt,
double  simdt,
double  mjd 
)

Time step notification before state update.

Refer to OrbiterSDK documentation

virtual MFDData* EnjoLib::MFDGoodies::PluginMultipleVessels::ConstructNewMFDData ( VESSEL *  vessel)
protectedpure virtual

Creates and returns a new MFDData * compatible pointer.

This method should construct and return a new MFDData * compatible pointer,

ie. a pointer to an object that is derived from MFDData and used in your PluginMultipleVessels and MFD implementation Called from AssociateMFDData()

Implemented in MyPluginMultipleVessels.

void PluginMultipleVessels::DeleteVessel ( OBJHANDLE  hVessel)

Deletes vessel.

Handles vessel deletion in a secure manner, by simply invalidating the MFDData associated with the vessel being deleted. This way Orbiter won't crash on random occasions.

Parameters
hVesselhandle to vessel, passed by Orbiter core.
Author
Szymon "Enjo" Ender
void PluginMultipleVessels::Init ( )

Initialises the plugin.

Initialises the PluginMultipleVessels. The internals of this method are executed only once. Should be called on every simulation step, because it's the first opportunity to gain access to Orbiter's configuration files. Calls InitClient() only once.

Author
Szymon "Enjo" Ender
virtual void EnjoLib::MFDGoodies::PluginMultipleVessels::InitClient ( )
protectedpure virtual

Initialises client (derived) PluginMultipleVessels.

Initialises client (derived) PluginMultipleVessels. This method should gain access to Orbiter's configuration files and store the obtained data in member variables, so that they can be passed to MFD, if they are needed. This method is called only once in simulation.

Implemented in MyPluginMultipleVessels.

virtual void EnjoLib::MFDGoodies::PluginMultipleVessels::UpdateClientPostStep ( MFDData data,
const SimulationTimeData timeData 
)
protectedpure virtual

Updates client (derived) PluginMultipleVessels after simulation state update.

See Also
UpdateClientPreStep()

Implemented in MyPluginMultipleVessels.

virtual void EnjoLib::MFDGoodies::PluginMultipleVessels::UpdateClientPreStep ( MFDData data,
const SimulationTimeData timeData 
)
protectedpure virtual

Updates client (derived) PluginMultipleVessels before simulation state update.

Updates client (derived) PluginMultipleVessels for each valid MFDData object. The method should perform every necessary operations on MFDData object for a proper module operation when the MFD itself is turned off.

Parameters
data- one of the created MFDData object
timeData- simulation timess

Implemented in MyPluginMultipleVessels.

void PluginMultipleVessels::UpdatePreStep ( const SimulationTimeData timeData)

Updates the plugin.

Updates the PluginMultipleVessels, including all its MFDData members. Should be called on every simulation step. After necessary checks, calls UpdateClient() for each valid MFDData object.

Author
Szymon "Enjo" Ender

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