Main plugin class. More...
#include <PluginMultipleVessels.hpp>
Public Member Functions | |
PluginMultipleVessels (HINSTANCE hDLL) | |
Default ctor. | |
virtual | ~PluginMultipleVessels () |
Dtor. | |
MFDData * | AssociateMFDData (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 MFDData * | ConstructNewMFDData (VESSEL *vessel)=0 |
Creates and returns a new MFDData * compatible pointer. |
Main plugin class.
Abstract class with encapsulated multiple vessels support.
PluginMultipleVessels::PluginMultipleVessels | ( | HINSTANCE | hDLL | ) |
Default ctor.
hDLL | DLL handle, passed by Orbiter core at InitModule() |
|
virtual |
Dtor.
Deletes all MFDData objects
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.
vessel | passed to MFD |
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
|
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.
hVessel | handle to vessel, passed by Orbiter core. |
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.
|
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.
|
protectedpure virtual |
Updates client (derived) PluginMultipleVessels after simulation state update.
Implemented in MyPluginMultipleVessels.
|
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.
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.