VR-Vantage 3.1 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
ssShipFactory Class Reference

This class creates and manages ssShip, ssShipMotion, and ssShipWake objects. More...

Public Member Functions

 ssShipFactory ()
 Default Constructor.
 ~ssShipFactory ()
 Default Destructor.
void loadShipPerformanceData (const char *xmlFile)
 Load the data that describes how all ships of all sizes perform in all sea states.
void loadShipDefinitionData (const char *xmlFile)
 Load the data that defines the different ships that this class will manage.
void writeSeaStateDatFile (const char *seaAndShip_output_file)
 Dumps a flat file for plotting purposes, based on the XML input.
ssShipcreateShip (const char *shipName)
 Create and return a new ssShip object if the provides name matches a ship type that we have data for.

Protected Member Functions

virtual ssShipMotioncreateShipMotion ()
 Create a new ssShipMotion object.
virtual ssShipWakecreateShipWake ()
 Create a new ssShipWake object.

Private Member Functions

ssShipData * getShipData (const char *shipName)
 ...text...
float getNodeValue (char *name, xmlData *data, int vNodeIndex, int nodeIndex, bool &validData)
 ...text...

Private Attributes

ssShipPerformancem_shipPerformance
int m_seaState
ssShipFactoryImpl * m_impl

Detailed Description

This class creates and manages ssShip, ssShipMotion, and ssShipWake objects.

The instances of ssShipMotion that this class instantiates are based on the contents of the file that is passed to loadShipDefinitionData(). The motion of these ships are driven by the contents of the file passed to loadShipPerformanceData().

Users can define their own ship motion by deriving their own ssShipMotion class. In order for a derived ssShipMotion class to be used by this factory class and by ssISAR, users should derive their own ssShipFactory class as well. This ssShipFactory class should re-implement the virtual createShipMotion() method so that it instantiates their derived ssShipMotion class instead of the JRM implemented base class. The same can be done for ssShipWake.

Constructor & Destructor Documentation

ssShipFactory::ssShipFactory ( )

Default Constructor.

ssShipFactory::~ssShipFactory ( )

Default Destructor.

Member Function Documentation

void ssShipFactory::loadShipPerformanceData ( const char *  xmlFile)

Load the data that describes how all ships of all sizes perform in all sea states.

Parameters
xmlFile- relative path and name of the config xml file
void ssShipFactory::loadShipDefinitionData ( const char *  xmlFile)

Load the data that defines the different ships that this class will manage.

Each ship definition that is read from the provided file will result in a new ShipMotioin object being instantiated by and managed by this class. This is the only way to added ShipMotion object to this class.

Parameters
xmlFile- relative path and name of the config xml file
void ssShipFactory::writeSeaStateDatFile ( const char *  seaAndShip_output_file)

Dumps a flat file for plotting purposes, based on the XML input.

Assumes that the Sea State tags are ordered in ascending value. Note that loadDate must be called first.

Parameters
seaAndShip_output_file- Output file name
ssShip* ssShipFactory::createShip ( const char *  shipName)

Create and return a new ssShip object if the provides name matches a ship type that we have data for.

This virtual method is here so that derived classes can instantiate their own derived ssShip objects.

Returns
A pointer to a new ShipMotion derived object.
virtual ssShipMotion* ssShipFactory::createShipMotion ( )
inlineprotectedvirtual

Create a new ssShipMotion object.

This virtual method is here so that derived classes can instantiate their own derived ssShipMotion objects. This method is called by createShip().

Returns
A pointer to a new ssShipMotion or ssShipMotion derived object.
virtual ssShipWake* ssShipFactory::createShipWake ( )
inlineprotectedvirtual

Create a new ssShipWake object.

This virtual method is here so that derived classes can instantiate their own derived ssShipWake objects. This method is called by createShip().

Returns
A pointer to a new ssShipWake or ssShipWake derived object.
ssShipData* ssShipFactory::getShipData ( const char *  shipName)
private

...text...

float ssShipFactory::getNodeValue ( char *  name,
xmlData *  data,
int  vNodeIndex,
int  nodeIndex,
bool validData 
)
private

...text...

Member Data Documentation

ssShipPerformance* ssShipFactory::m_shipPerformance
private
int ssShipFactory::m_seaState
private
ssShipFactoryImpl* ssShipFactory::m_impl
private

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


Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)