VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes
makVrf::DtVrfSaveScenarioHandler Class Reference

The DtVrfSaveScenarioHandler is responsible for getting the name of the scenario to save to and then saving the scenario as well as additional specific GUI information. More...

Inheritance diagram for makVrf::DtVrfSaveScenarioHandler:
Inheritance graph
[legend]

Public Member Functions

 DtVrfSaveScenarioHandler (makVrv::DtDe &)
 
virtual ~DtVrfSaveScenarioHandler ()
 
virtual bool saveScenarioAs ()
 
virtual int saveScenario (bool forceOverwrite=false, bool queueSave=false, bool useScenarioNameAsSeed=true)
 If force overwrite is true, and checkpointing, force an overwrite of the existing scenario file. More...
 
virtual void setScenario (const DtScenario *)
 
virtual bool isValidScenarioExtension (const DtString &extension) const
 Returns true if this extension is a valid save scenario extension (.scn, .scnx) More...
 
virtual bool saveScenario (const QString &s, bool setAsSaved=true, bool queueSave=false, bool preserveBackendMappings=true, bool startPlayingAfterSave=false)
 Saves the specified scenario, and, if optional flag is true, sets last saved filename to supplied filename. More...
 
virtual bool saveScenario (const DtFilename &s, bool setAsSaved=true, bool queueSave=false, bool preserveBackendMappings=true, bool startPlayingAfterSave=false)
 
virtual bool setupScenarioToSave (const QString &filename, bool setAsSaved)
 
virtual bool getScenarioSaveName (QString &, bool *asked=0, bool useScenarioNameAsSeed=true) const
 Gets a name to save the scenario under. More...
 
virtual DtFilename saveScenarioName (bool askIfDoesNotExist=true, bool *asked=0, bool useScenarioNameAsSeed=true) const
 The name of the scenario to be saved. More...
 
virtual void setCheckpointIdentifier (const std::string &)
 Sets the identifier that will identify checkpoint scenarios from their base scenario counterpart (default is at_time). More...
 
virtual const std::string & checkpointIdentifier () const
 
virtual DtFilename chooseScenarioNameBasedOn (const DtScenario &, bool saveIntoScenario=false)
 Choose a unique name based on the given scenario. More...
 
virtual QString makeRelativeTo (QString origFile, QString path) const
 
virtual void checkpointScenario (const QString &baseFilename, bool forceOverwrite=false, bool queueSave=false, bool startPlayingAfterSave=false)
 If queueSave is true queue the save at the end of the current save checkpoint queue rather than pushing to the beginning. More...
 
virtual QString checkpointIdentifier (const QString &filename, bool plain=false) const
 If plain is true, do not append _run for scenario batch run. More...
 
virtual QString checkpointIdentifier (const QString &filename, double currentSimTime, bool plain=false) const
 
virtual QString getTimeString (double time, char separator= '_') const
 
virtual void setDataIntoScenario (DtScenario &)
 Sets data into scenario structure (names, scenario data, etc) More...
 
virtual DtScenarioinitializeCheckpointedScenario (const DtFilename &scenarioName, double simTime)
 Returns a new DtScenario structure that represents a filename and other internals that will be checkpointed at the given sim time. More...
 
virtual std::string scenarioExtentInformation () const
 Returns a string representation of the scenario extent for all current entities in the scenario. More...
 
virtual void newScenario ()
 Called when a new scenario is started. Clears out some internal variables. More...
 
virtual void closeScenario ()
 Called when a scenario is closed. Clears out some internal variables. More...
 
virtual QString startingDirectory () const
 Accessor/mutator for starting directory. More...
 
virtual void setStartingDirectory (const QString &)
 
const DtScenarioscenario () const
 
virtual void setSaving (bool)
 
virtual bool saving () const
 
DtFilename savedFilename () const
 
virtual bool isDefaultObserverView (const std::string &) const
 
virtual std::string defaultObserverView (bool &is2D) const
 
virtual void setDefaultObserverView (const std::string &)
 
virtual void setTerrainViewVisible (const std::string &, bool vis)
 
virtual const std::set
< std::string > & 
hiddenTerrainViews () const
 
virtual std::set< std::string > & hiddenTerrainViews ()
 
virtual bool terrainViewHidden (const std::string &) const
 
virtual void setHiddenTerrainViews (const std::string &)
 These views are semi-colon separated views of the observer view format of name and mode. More...
 
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 Do nothing constructor. More...
 
virtual ~DtVirtualBaseClass ()
 Virtual do nothing destructor. More...
 

Static Public Member Functions

static DtVrfSaveScenarioHandlerinstance (makVrv::DtDe &de)
 Returns instance of the messager. More...
 

Protected Member Functions

virtual QString createFilterList () const
 
virtual QString relativePath () const
 
virtual QString dataFolder () const
 
virtual bool processPreserveMappings ()
 
virtual bool saveSelectionGroups (const QString &scenarioName, QString &selectionGroups, bool saveToZip) const
 
virtual bool saveOverlays (const QString &scenarioName, QString &overlayName, bool saveToZip) const
 
virtual bool saveGuiSettings (const QString &scenarioname, QString &guiSettingsName, bool saveToZip) const
 Save out gui settings file. More...
 
virtual bool saveObserverViews (const QString &scenarioname, QString &observerSettingsName, bool saveToZip) const
 Save out observer views file. More...
 

Static Protected Member Functions

static bool preserveMappings (void *)
 

Protected Attributes

makVrv::DtDemyDe
 
QString myStartingDirectory
 
DtScenariomyScenario
 
double myRootSaveSimTime
 
std::string myDefaultObserverView
 
std::string myCheckpointIdentifier
 
bool myRootSaveTimeSet
 
bool mySaving
 
std::set< std::string > myHiddenTerrainViews
 

Detailed Description

The DtVrfSaveScenarioHandler is responsible for getting the name of the scenario to save to and then saving the scenario as well as additional specific GUI information.

Constructor & Destructor Documentation

makVrf::DtVrfSaveScenarioHandler::DtVrfSaveScenarioHandler ( makVrv::DtDe )
virtual makVrf::DtVrfSaveScenarioHandler::~DtVrfSaveScenarioHandler ( )
virtual

Member Function Documentation

static DtVrfSaveScenarioHandler& makVrf::DtVrfSaveScenarioHandler::instance ( makVrv::DtDe de)
static

Returns instance of the messager.

virtual bool makVrf::DtVrfSaveScenarioHandler::saveScenarioAs ( )
virtual
virtual int makVrf::DtVrfSaveScenarioHandler::saveScenario ( bool  forceOverwrite = false,
bool  queueSave = false,
bool  useScenarioNameAsSeed = true 
)
virtual

If force overwrite is true, and checkpointing, force an overwrite of the existing scenario file.

Returns choice of how user wants to save scenario 0 - No save DtSaveStartingSnapshot - Save starting snapshot and/or DtSaveCurrentCheckpoint If queueSave is true queue the save at the end of the current save checkpoint queue rather than pushing to the beginning

virtual void makVrf::DtVrfSaveScenarioHandler::setScenario ( const DtScenario )
virtual
virtual bool makVrf::DtVrfSaveScenarioHandler::isValidScenarioExtension ( const DtString extension) const
virtual

Returns true if this extension is a valid save scenario extension (.scn, .scnx)

virtual bool makVrf::DtVrfSaveScenarioHandler::isDefaultObserverView ( const std::string &  ) const
virtual

Default observer view handling Because of observer view changes, the new default observer view format must be <observer name>="">:[2D|3D] to indicate observer view mode. If no mode is given after the colon assumes 2D

virtual std::string makVrf::DtVrfSaveScenarioHandler::defaultObserverView ( bool is2D) const
virtual
virtual void makVrf::DtVrfSaveScenarioHandler::setDefaultObserverView ( const std::string &  )
virtual
virtual void makVrf::DtVrfSaveScenarioHandler::setTerrainViewVisible ( const std::string &  ,
bool  vis 
)
virtual
virtual const std::set<std::string>& makVrf::DtVrfSaveScenarioHandler::hiddenTerrainViews ( ) const
virtual
virtual std::set<std::string>& makVrf::DtVrfSaveScenarioHandler::hiddenTerrainViews ( )
virtual
virtual bool makVrf::DtVrfSaveScenarioHandler::terrainViewHidden ( const std::string &  ) const
virtual
virtual void makVrf::DtVrfSaveScenarioHandler::setHiddenTerrainViews ( const std::string &  )
virtual

These views are semi-colon separated views of the observer view format of name and mode.

virtual bool makVrf::DtVrfSaveScenarioHandler::saveScenario ( const QString &  s,
bool  setAsSaved = true,
bool  queueSave = false,
bool  preserveBackendMappings = true,
bool  startPlayingAfterSave = false 
)
virtual

Saves the specified scenario, and, if optional flag is true, sets last saved filename to supplied filename.

virtual bool makVrf::DtVrfSaveScenarioHandler::saveScenario ( const DtFilename &  s,
bool  setAsSaved = true,
bool  queueSave = false,
bool  preserveBackendMappings = true,
bool  startPlayingAfterSave = false 
)
virtual
virtual bool makVrf::DtVrfSaveScenarioHandler::setupScenarioToSave ( const QString &  filename,
bool  setAsSaved 
)
virtual
virtual bool makVrf::DtVrfSaveScenarioHandler::getScenarioSaveName ( QString &  ,
bool asked = 0,
bool  useScenarioNameAsSeed = true 
) const
virtual

Gets a name to save the scenario under.

If asked is supplied will be filled in true/false if the user was asked for the name via a dialog

virtual DtFilename makVrf::DtVrfSaveScenarioHandler::saveScenarioName ( bool  askIfDoesNotExist = true,
bool asked = 0,
bool  useScenarioNameAsSeed = true 
) const
virtual

The name of the scenario to be saved.

If no name exists will ask the user for one. If asked is supplied filled with true if the user was asked for the scenario name

virtual void makVrf::DtVrfSaveScenarioHandler::setCheckpointIdentifier ( const std::string &  )
virtual

Sets the identifier that will identify checkpoint scenarios from their base scenario counterpart (default is at_time).

Make sure this is something that can be found via s string search in the file name (so a blank or simply an _ or single charactrer would not be recommended)

virtual const std::string& makVrf::DtVrfSaveScenarioHandler::checkpointIdentifier ( ) const
virtual
virtual DtFilename makVrf::DtVrfSaveScenarioHandler::chooseScenarioNameBasedOn ( const DtScenario ,
bool  saveIntoScenario = false 
)
virtual

Choose a unique name based on the given scenario.

If this class does not yet have a myScenario member, creates one and assigns it to this given scenario and also assigns a filename to it. The filename will be based on the scenario name in the scenario (uniquely in the userData/scenarios directory) or a default name of "Scenario N" where N is a number that is unique on disk

virtual QString makVrf::DtVrfSaveScenarioHandler::makeRelativeTo ( QString  origFile,
QString  path 
) const
virtual
virtual void makVrf::DtVrfSaveScenarioHandler::checkpointScenario ( const QString &  baseFilename,
bool  forceOverwrite = false,
bool  queueSave = false,
bool  startPlayingAfterSave = false 
)
virtual

If queueSave is true queue the save at the end of the current save checkpoint queue rather than pushing to the beginning.

If startPlayingAfterSave is will put the scenario into save mode after play

virtual QString makVrf::DtVrfSaveScenarioHandler::checkpointIdentifier ( const QString &  filename,
bool  plain = false 
) const
virtual

If plain is true, do not append _run for scenario batch run.

virtual QString makVrf::DtVrfSaveScenarioHandler::checkpointIdentifier ( const QString &  filename,
double  currentSimTime,
bool  plain = false 
) const
virtual
virtual QString makVrf::DtVrfSaveScenarioHandler::getTimeString ( double  time,
char  separator = '_' 
) const
virtual
virtual void makVrf::DtVrfSaveScenarioHandler::setDataIntoScenario ( DtScenario )
virtual

Sets data into scenario structure (names, scenario data, etc)

virtual DtScenario* makVrf::DtVrfSaveScenarioHandler::initializeCheckpointedScenario ( const DtFilename &  scenarioName,
double  simTime 
)
virtual

Returns a new DtScenario structure that represents a filename and other internals that will be checkpointed at the given sim time.

virtual std::string makVrf::DtVrfSaveScenarioHandler::scenarioExtentInformation ( ) const
virtual

Returns a string representation of the scenario extent for all current entities in the scenario.

Format is geometric center with the altitude of the highest entity being the altitude, and the half size of the maximum of the width and height of the extent box encompassed by the entities

virtual void makVrf::DtVrfSaveScenarioHandler::newScenario ( )
virtual

Called when a new scenario is started. Clears out some internal variables.

virtual void makVrf::DtVrfSaveScenarioHandler::closeScenario ( )
virtual

Called when a scenario is closed. Clears out some internal variables.

virtual QString makVrf::DtVrfSaveScenarioHandler::startingDirectory ( ) const
virtual

Accessor/mutator for starting directory.

virtual void makVrf::DtVrfSaveScenarioHandler::setStartingDirectory ( const QString &  )
virtual
const DtScenario* makVrf::DtVrfSaveScenarioHandler::scenario ( ) const
inline
virtual void makVrf::DtVrfSaveScenarioHandler::setSaving ( bool  )
virtual
virtual bool makVrf::DtVrfSaveScenarioHandler::saving ( ) const
inlinevirtual
DtFilename makVrf::DtVrfSaveScenarioHandler::savedFilename ( ) const
virtual QString makVrf::DtVrfSaveScenarioHandler::createFilterList ( ) const
protectedvirtual
virtual QString makVrf::DtVrfSaveScenarioHandler::relativePath ( ) const
protectedvirtual
virtual QString makVrf::DtVrfSaveScenarioHandler::dataFolder ( ) const
protectedvirtual
static bool makVrf::DtVrfSaveScenarioHandler::preserveMappings ( void *  )
staticprotected
virtual bool makVrf::DtVrfSaveScenarioHandler::processPreserveMappings ( )
protectedvirtual
virtual bool makVrf::DtVrfSaveScenarioHandler::saveSelectionGroups ( const QString &  scenarioName,
QString &  selectionGroups,
bool  saveToZip 
) const
protectedvirtual
virtual bool makVrf::DtVrfSaveScenarioHandler::saveOverlays ( const QString &  scenarioName,
QString &  overlayName,
bool  saveToZip 
) const
protectedvirtual
virtual bool makVrf::DtVrfSaveScenarioHandler::saveGuiSettings ( const QString &  scenarioname,
QString &  guiSettingsName,
bool  saveToZip 
) const
protectedvirtual

Save out gui settings file.

virtual bool makVrf::DtVrfSaveScenarioHandler::saveObserverViews ( const QString &  scenarioname,
QString &  observerSettingsName,
bool  saveToZip 
) const
protectedvirtual

Save out observer views file.

Member Data Documentation

makVrv::DtDe& makVrf::DtVrfSaveScenarioHandler::myDe
protected
QString makVrf::DtVrfSaveScenarioHandler::myStartingDirectory
mutableprotected
DtScenario* makVrf::DtVrfSaveScenarioHandler::myScenario
mutableprotected
double makVrf::DtVrfSaveScenarioHandler::myRootSaveSimTime
protected
std::string makVrf::DtVrfSaveScenarioHandler::myDefaultObserverView
protected
std::string makVrf::DtVrfSaveScenarioHandler::myCheckpointIdentifier
protected
bool makVrf::DtVrfSaveScenarioHandler::myRootSaveTimeSet
protected
bool makVrf::DtVrfSaveScenarioHandler::mySaving
protected
std::set<std::string> makVrf::DtVrfSaveScenarioHandler::myHiddenTerrainViews
protected

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

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)