VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Friends
makVrv::DtObserverViewsManager Class Reference

Manager for the observer view records loaded in the application.

Inheritance diagram for makVrv::DtObserverViewsManager:
Inheritance graph
[legend]

Public Types

enum  ViewProjection { Projection2D, Projection3D }
 

Public Member Functions

virtual ~DtObserverViewsManager ()
 
virtual void loadTerrainObserverViewsFile (const DtUnicode &pathTofile, bool reload)
 
virtual void loadObserverViewsFile (const DtUnicode &pathTofile)
 
virtual std::string generateUniqueNameForObserverViewRecord (const makArchives::DtObserverStateRecord &) const
 
virtual void addObserverViewRecordToList (const makArchives::DtObserverStateRecord &observerStateRecord)
 
virtual void setObserverViewByName (const std::string &observerViewName, bool animate=false)
 
virtual void setObserverViewByNameAndMode (const std::string &observerViewName, ViewProjection projection, bool animate=false)
 
virtual void associateObserverViewsToTerrain (bool associate)
 
virtual const std::string & observerView3DDefaultRecordName () const
 
virtual void setObserverView3DDefaultRecordName (const std::string &val)
 
virtual const std::string & observerView2DDefaultRecordName () const
 
virtual void setObserverView2DDefaultRecordName (const std::string &val)
 
virtual bool getTerrainDefaultObserverView (std::string &defaultView, ViewProjection &projection)
 
virtual void setTerrainDefaultObserverView ()
 
virtual void setSuppressDefaultView (const std::string &observerName)
 
virtual const
makArchives::DtObserverStateRecordsList
observerViewList ()
 
virtual void setObserverViewList (const makArchives::DtObserverStateRecordsList &val)
 
virtual void saveObserverViewsFile (const DtUnicode &filename)
 
virtual void saveObserverViewFile (const DtUnicode &filename, const std::string &observerViewName, ViewProjection projection)
 
virtual bool renameObserverRecord (const std::string &newName, const std::string &oldName, ViewProjection projection)
 
virtual void setDefaultObserverViewRecord (const std::string &recordName, ViewProjection projection)
 
virtual void unSetDefaultObserverViewRecord (const std::string &recordName, ViewProjection projection)
 
virtual void clearObserverViewList ()
 
virtual bool removeObserverViewRecord (const std::string &observerViewName, ViewProjection projection)
 
virtual bool isRecordAssociatedToTerrain (const std::string &recordDisplayName)
 
virtual void setIsDefaultObserverViewRecord (const std::string &newName, bool isDefault)
 
virtual void setIsDefaultObserverViewRecord (const makArchives::DtObserverStateRecord &record, bool isDefault)
 
virtual bool setAssociateObserverViewRecord (const std::string &, bool associate)
 
virtual unsigned int countAssociatedViews () const
 
virtual void captureAndAddObserverView ()
 
virtual const std::string & rightClickedObserverViewName () const
 
virtual void setRightClickedObserverViewName (const std::string &val)
 
virtual ViewProjection rightClickedObserverViewProjection () const
 
virtual void setRightClickedObserverViewProjection (ViewProjection projection)
 
virtual bool rightClickedObserverViewIsAttached () const
 
virtual void setRightClickedObserverViewIsAttached (bool val)
 
virtual void setRightClickedObserverViewIsAttached (const std::string &recordName)
 
virtual bool rightClickedObserverViewIsAssociated () const
 
virtual void setRightClickedObserverViewIsAssociated (bool val)
 
virtual void setRightClickedObserverViewIsAssociated (const std::string &recordName)
 
virtual const std::string & observerViewsFile () const
 
virtual void setObserverViewsFile (const std::string &val)
 
virtual bool isDirty () const
 
virtual void setDirty (bool val)
 
virtual bool areDefaultsDirty () const
 
virtual void setDefaultsDirty (bool val)
 
virtual const std::string & terrainObserverViewRecordsFileName () const
 
virtual void setTerrainObserverViewRecordsFileName (const std::string &val)
 
virtual void setObserverViewRecordsFromIntializer ()
 
virtual bool findObserverViewByNameAndMode (const std::string &observerName, ViewProjection projection, makArchives::DtObserverStateRecord &record)
 
virtual void setObserverViewByRecord (makArchives::DtObserverStateRecord &record, bool animate=false)
 

Protected Member Functions

 DtObserverViewsManager (DtDe &myDe)
 
virtual bool readObserverViewListFromFile (const DtUnicode &fileName, makArchives::DtObserverStateRecordsList &recordList)
 
virtual void slot_terrainCleared (bool reload)
 
virtual void slot_onApplicationQuit ()
 
virtual void slot_observerModeIs2dChanged (int mode)
 
virtual void slot_closeConfirmationMessageToBeDisplayed ()
 
virtual void processObserverViewRecordsList (makArchives::DtObserverStateRecordsList &incomingList, bool associated)
 
virtual DtObserverfindObserverToUse ()
 
virtual bool observerOnSuppressList (const std::string &observerName)
 

Protected Attributes

DtDemyDe
 
std::string myObserverView3DDefaultRecordName
 
std::string myObserverView2DDefaultRecordName
 
makArchives::DtObserverStateRecordsList myObserverViewList
 
std::string myTerrainObserverViewRecordsFileName
 
std::string myRightClickedObserverViewName
 
ViewProjection myRightClickedObserverViewProjection
 
bool myRightClickedObserverViewIsAttached
 
bool myRightClickedObserverViewIsAssociated
 
std::string myObserverViewsFile
 
DtSignalConnectionManager myConnections
 
bool myHasSetupObserverRecords
 
bool myIsDirty
 
bool myDefaultsDirty
 
bool myApplicationIsClosing
 
std::list< std::string > myObserversSuppressDefaultView
 

Private Member Functions

 DtObserverViewsManager ()
 

Friends

class DtObserverViewsManagerCreator
 

Member Enumeration Documentation

Enumerator
Projection2D 
Projection3D 

Constructor & Destructor Documentation

virtual makVrv::DtObserverViewsManager::~DtObserverViewsManager ( )
virtual
makVrv::DtObserverViewsManager::DtObserverViewsManager ( )
private

Unimplemented default CTOR.

makVrv::DtObserverViewsManager::DtObserverViewsManager ( DtDe myDe)
protected

CTOR - Called only by Creator method.

Member Function Documentation

virtual void makVrv::DtObserverViewsManager::loadTerrainObserverViewsFile ( const DtUnicode pathTofile,
bool  reload 
)
virtual

Loads the observer view file (.osrx) associate to the terrain adds the records to the observer view list and set the terrain's default view. If reload is true, then this function will simply return, as we don't need to (re) load terrain associated files on a terrain reload.

Reimplemented in makVrf::DtVrfObserverViewsManager.

virtual void makVrv::DtObserverViewsManager::loadObserverViewsFile ( const DtUnicode pathTofile)
virtual

loads an observer view file (.osrx) and add the records to the observer view list.

Reimplemented in makVrf::DtVrfObserverViewsManager.

virtual std::string makVrv::DtObserverViewsManager::generateUniqueNameForObserverViewRecord ( const makArchives::DtObserverStateRecord ) const
virtual

Generates a unique name based on the supplied observer record and what is already in the list.

virtual void makVrv::DtObserverViewsManager::addObserverViewRecordToList ( const makArchives::DtObserverStateRecord observerStateRecord)
virtual

Adds an observer view record to the current observer view list.

virtual void makVrv::DtObserverViewsManager::setObserverViewByName ( const std::string &  observerViewName,
bool  animate = false 
)
virtual

finds the observer view record by name in the view list and calls findObserverToUse() to determine the observer to apply the view to.

virtual void makVrv::DtObserverViewsManager::setObserverViewByNameAndMode ( const std::string &  observerViewName,
ViewProjection  projection,
bool  animate = false 
)
virtual

finds the observer view record by name in the view list and calls findObserverToUse() to determine the observer to apply the view to.

virtual void makVrv::DtObserverViewsManager::associateObserverViewsToTerrain ( bool  associate)
virtual

Associates all the observer view records in the current list to the current loaded terrain.

virtual const std::string& makVrv::DtObserverViewsManager::observerView3DDefaultRecordName ( ) const
virtual

returns the name of the default 3D observer view

virtual void makVrv::DtObserverViewsManager::setObserverView3DDefaultRecordName ( const std::string &  val)
virtual

sets the name of the default 3D observer view

virtual const std::string& makVrv::DtObserverViewsManager::observerView2DDefaultRecordName ( ) const
virtual

returns the name of the default 2D observer view

virtual void makVrv::DtObserverViewsManager::setObserverView2DDefaultRecordName ( const std::string &  val)
virtual

sets the name of the default 2D observer view

virtual bool makVrv::DtObserverViewsManager::getTerrainDefaultObserverView ( std::string &  defaultView,
ViewProjection projection 
)
virtual

setTerrainDefaultObserverView calls this to determine which saved view record, if any, should be used as the default view. A saved view file may contain a default view for 2D and one for 3D. If the application supports 3D, the 3D default will be used if it exists. If not, and the application supports 2D, the 2D default view will be used if it exists. Otherwise, this method returns false, and no default view should be applied.

virtual void makVrv::DtObserverViewsManager::setTerrainDefaultObserverView ( )
virtual

Set up the loaded terrain default observer view. This method first calls getDefaultTerrainView() to determine which view in the file should be used. If an appropriate view exists, it calls setObserverViewByName with the name of the saved view chosen.

Reimplemented in makVrf::DtVrfObserverViewsManager.

virtual void makVrv::DtObserverViewsManager::setSuppressDefaultView ( const std::string &  observerName)
virtual

Suppress setting a default view when a terrain saved view file is loaded (by loadTerrainObserverViewsFile()) for a specific observer. This is called when the command line contains a bindObserver parameter; the list of observers is cleared when loadTerrainObserverViewsFile() exits.

virtual const makArchives::DtObserverStateRecordsList& makVrv::DtObserverViewsManager::observerViewList ( )
virtual

returns the current observer view list

virtual void makVrv::DtObserverViewsManager::setObserverViewList ( const makArchives::DtObserverStateRecordsList val)
virtual

set the current observer view list

virtual void makVrv::DtObserverViewsManager::saveObserverViewsFile ( const DtUnicode filename)
virtual

save the current observer view list into a file

Reimplemented in makVrf::DtVrfObserverViewsManager.

virtual void makVrv::DtObserverViewsManager::saveObserverViewFile ( const DtUnicode filename,
const std::string &  observerViewName,
ViewProjection  projection 
)
virtual

save a single observer view into a file

virtual bool makVrv::DtObserverViewsManager::renameObserverRecord ( const std::string &  newName,
const std::string &  oldName,
ViewProjection  projection 
)
virtual

Handles the logic to rename an observer view record.

Reimplemented in makVrf::DtVrfObserverViewsManager.

virtual void makVrv::DtObserverViewsManager::setDefaultObserverViewRecord ( const std::string &  recordName,
ViewProjection  projection 
)
virtual

Handles the logic to set an observer view record as default.

virtual void makVrv::DtObserverViewsManager::unSetDefaultObserverViewRecord ( const std::string &  recordName,
ViewProjection  projection 
)
virtual

Handles the logic to un set an observer view record as default.

virtual void makVrv::DtObserverViewsManager::clearObserverViewList ( )
virtual

clear the current observer view list

Reimplemented in makVrf::DtVrfObserverViewsManager.

virtual bool makVrv::DtObserverViewsManager::removeObserverViewRecord ( const std::string &  observerViewName,
ViewProjection  projection 
)
virtual

finds an observer view record by name and removes it from the list

Reimplemented in makVrf::DtVrfObserverViewsManager.

virtual bool makVrv::DtObserverViewsManager::isRecordAssociatedToTerrain ( const std::string &  recordDisplayName)
virtual

finds an observer view record by name and returns if is associated to the opened terrain in scene

virtual void makVrv::DtObserverViewsManager::setIsDefaultObserverViewRecord ( const std::string &  newName,
bool  isDefault 
)
virtual

Set the observer record as a default view.

virtual void makVrv::DtObserverViewsManager::setIsDefaultObserverViewRecord ( const makArchives::DtObserverStateRecord record,
bool  isDefault 
)
virtual

Set the observer record as a default view.

virtual bool makVrv::DtObserverViewsManager::setAssociateObserverViewRecord ( const std::string &  ,
bool  associate 
)
virtual

Returns true if there is a record with the specified name.

virtual unsigned int makVrv::DtObserverViewsManager::countAssociatedViews ( ) const
virtual

return the number of view records associated to the current terrain on scene

virtual void makVrv::DtObserverViewsManager::captureAndAddObserverView ( )
virtual

captures the observer view record of the current observer given by the input driver and

Reimplemented in makVrf::DtVrfObserverViewsManager.

virtual const std::string& makVrv::DtObserverViewsManager::rightClickedObserverViewName ( ) const
virtual

returns the name of the observer view where the gui called the right click event

virtual void makVrv::DtObserverViewsManager::setRightClickedObserverViewName ( const std::string &  val)
virtual

set the name of the observer view where the gui called the right click event

virtual ViewProjection makVrv::DtObserverViewsManager::rightClickedObserverViewProjection ( ) const
virtual

returns the mode of the observer view where the gui called the right click event

virtual void makVrv::DtObserverViewsManager::setRightClickedObserverViewProjection ( ViewProjection  projection)
virtual

set the mode of the observer view where the gui called the right click event

virtual bool makVrv::DtObserverViewsManager::rightClickedObserverViewIsAttached ( ) const
virtual

returns if the observer view where the gui called the right click event is attached to an entity

virtual void makVrv::DtObserverViewsManager::setRightClickedObserverViewIsAttached ( bool  val)
virtual

set if the observer view where the gui called the right click event is attached to an entity

virtual void makVrv::DtObserverViewsManager::setRightClickedObserverViewIsAttached ( const std::string &  recordName)
virtual

finds an observer view by name and returns if the observer view is attached to an entity

virtual bool makVrv::DtObserverViewsManager::rightClickedObserverViewIsAssociated ( ) const
virtual

returns if the observer view where the gui called the right click event is associated to the terrain opened in the scene

virtual void makVrv::DtObserverViewsManager::setRightClickedObserverViewIsAssociated ( bool  val)
virtual

set if the observer view where the gui called the right click event is associated to the terrain opened in the scene

virtual void makVrv::DtObserverViewsManager::setRightClickedObserverViewIsAssociated ( const std::string &  recordName)
virtual

finds an observer view by name and returns if the observer view is associated to the terrain opened in the scene

virtual const std::string& makVrv::DtObserverViewsManager::observerViewsFile ( ) const
virtual

returns an name of the observer view file associate to the current terrain opened in the scene

virtual void makVrv::DtObserverViewsManager::setObserverViewsFile ( const std::string &  val)
virtual

set an name of the observer view file associate to the current terrain opened in the scene

virtual bool makVrv::DtObserverViewsManager::isDirty ( ) const
virtual

returns if the list has changes that needs to be saved or (re)associated

virtual void makVrv::DtObserverViewsManager::setDirty ( bool  val)
virtual

sets if the list has changes that needs to be saved

virtual bool makVrv::DtObserverViewsManager::areDefaultsDirty ( ) const
virtual

returns if default views need to be (re)associated

virtual void makVrv::DtObserverViewsManager::setDefaultsDirty ( bool  val)
virtual

sets if default views need to be (re)associated

virtual const std::string& makVrv::DtObserverViewsManager::terrainObserverViewRecordsFileName ( ) const
virtual

returns the file name of the observer view file associated to the terrain opened in scene

virtual void makVrv::DtObserverViewsManager::setTerrainObserverViewRecordsFileName ( const std::string &  val)
virtual

sets the file name of the observer view file associated to the terrain opened in scene

virtual void makVrv::DtObserverViewsManager::setObserverViewRecordsFromIntializer ( )
virtual

read observer view records send through command line using bdnx file

virtual bool makVrv::DtObserverViewsManager::findObserverViewByNameAndMode ( const std::string &  observerName,
ViewProjection  projection,
makArchives::DtObserverStateRecord record 
)
virtual

find observer view by name and mode. returns true if the observer was found sets it in the state record parameter

virtual void makVrv::DtObserverViewsManager::setObserverViewByRecord ( makArchives::DtObserverStateRecord record,
bool  animate = false 
)
virtual

sets the observer with the data in the given record

virtual bool makVrv::DtObserverViewsManager::readObserverViewListFromFile ( const DtUnicode fileName,
makArchives::DtObserverStateRecordsList recordList 
)
protectedvirtual

Reads and converts observer view records from a file to a DtObserverStateRecordsList.

virtual void makVrv::DtObserverViewsManager::slot_terrainCleared ( bool  reload)
protectedvirtual

on terrain clear, clean up the observer view list, unless reload is true; then nothing needs to be done

Reimplemented in makVrf::DtVrfObserverViewsManager.

virtual void makVrv::DtObserverViewsManager::slot_onApplicationQuit ( )
protectedvirtual

on terrain clear, clean up the observer view list

virtual void makVrv::DtObserverViewsManager::slot_observerModeIs2dChanged ( int  mode)
protectedvirtual

handle observer mode projection changes

virtual void makVrv::DtObserverViewsManager::slot_closeConfirmationMessageToBeDisplayed ( )
protectedvirtual

slot receiving the signal before the close confirmation window pops up

virtual void makVrv::DtObserverViewsManager::processObserverViewRecordsList ( makArchives::DtObserverStateRecordsList incomingList,
bool  associated 
)
protectedvirtual

process the incoming observer view list to be added to the application observer view list sets a unique name for every record and sets if they are associated to a terrain

virtual DtObserver* makVrv::DtObserverViewsManager::findObserverToUse ( )
protectedvirtual

Determine which observer to apply a saved view to. Normally, the current observer is used (the observer with mouse/keybrd focus) but its possible that no observer may have focus yet. In this case, the observer named "Observer 1" will be used; if that doesn't exist, the first observer in the DtInputDriver's observer list is used. If that fails, the request to apply a saved view is ignored.

virtual bool makVrv::DtObserverViewsManager::observerOnSuppressList ( const std::string &  observerName)
protectedvirtual

Friends And Related Function Documentation

friend class DtObserverViewsManagerCreator
friend

Member Data Documentation

DtDe& makVrv::DtObserverViewsManager::myDe
protected
std::string makVrv::DtObserverViewsManager::myObserverView3DDefaultRecordName
protected

name of 3D default observer view record

std::string makVrv::DtObserverViewsManager::myObserverView2DDefaultRecordName
protected

name of 2D default observer view record

makArchives::DtObserverStateRecordsList makVrv::DtObserverViewsManager::myObserverViewList
protected

Observer Views List.

std::string makVrv::DtObserverViewsManager::myTerrainObserverViewRecordsFileName
protected

terrain osrx file name

std::string makVrv::DtObserverViewsManager::myRightClickedObserverViewName
protected
ViewProjection makVrv::DtObserverViewsManager::myRightClickedObserverViewProjection
protected
bool makVrv::DtObserverViewsManager::myRightClickedObserverViewIsAttached
protected
bool makVrv::DtObserverViewsManager::myRightClickedObserverViewIsAssociated
protected
std::string makVrv::DtObserverViewsManager::myObserverViewsFile
protected
DtSignalConnectionManager makVrv::DtObserverViewsManager::myConnections
protected
bool makVrv::DtObserverViewsManager::myHasSetupObserverRecords
protected
bool makVrv::DtObserverViewsManager::myIsDirty
protected

tracks if any change in the saved view list needs to be saved

bool makVrv::DtObserverViewsManager::myDefaultsDirty
protected

Tracks changes to defaults, which mean we should enable re-association but not enough to nag / enable for 'save' if we have an imported file.

bool makVrv::DtObserverViewsManager::myApplicationIsClosing
protected
std::list<std::string> makVrv::DtObserverViewsManager::myObserversSuppressDefaultView
protected

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

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)