VR-Forces 4.6.1 Class Documentation
 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 | Friends
makVrv::DtObserverViewsManager Class Reference

Manager for the observer view records loaded in the application. More...

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)
 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.
virtual void loadObserverViewsFile (const DtUnicode &pathTofile)
 loads an observer view file (.osrx) and add the records to the observer view list.
virtual std::string generateUniqueNameForObserverViewRecord (const makArchives::DtObserverStateRecord &) const
 Generates a unique name based on the supplied observer record and what is already in the list.
virtual void addObserverViewRecordToList (const makArchives::DtObserverStateRecord &observerStateRecord)
 Adds an observer view record to the current observer view list.
virtual void setObserverViewByName (const std::string &observerViewName, bool animate=false)
 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 setObserverViewByNameAndMode (const std::string &observerViewName, ViewProjection projection, bool animate=false)
 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 associateObserverViewsToTerrain (bool associate)
 Associates all the observer view records in the current list to the current loaded terrain.
virtual const std::string & observerView3DDefaultRecordName () const
 returns the name of the default 3D observer view
virtual void setObserverView3DDefaultRecordName (const std::string &val)
 sets the name of the default 3D observer view
virtual const std::string & observerView2DDefaultRecordName () const
 returns the name of the default 2D observer view
virtual void setObserverView2DDefaultRecordName (const std::string &val)
 sets the name of the default 2D observer view
virtual bool getTerrainDefaultObserverView (std::string &defaultView, ViewProjection &projection)
 setTerrainDefaultObserverView calls this to determine which saved view record, if any, should be used as the default view.
virtual void setTerrainDefaultObserverView ()
 Set up the loaded terrain default observer view.
virtual const
makArchives::DtObserverStateRecordsList
observerViewList ()
 returns the current observer view list
virtual void setObserverViewList (const makArchives::DtObserverStateRecordsList &val)
 set the current observer view list
virtual void saveObserverViewsFile (const DtUnicode &filename)
 save the current observer view list into a file
virtual void saveObserverViewFile (const DtUnicode &filename, const std::string &observerViewName, ViewProjection projection)
 save a single observer view into a file
virtual bool renameObserverRecord (const std::string &newName, const std::string &oldName, ViewProjection projection)
 Handles the logic to rename an observer view record.
virtual void setDefaultObserverViewRecord (const std::string &recordName, ViewProjection projection)
 Handles the logic to set an observer view record as default.
virtual void unSetDefaultObserverViewRecord (const std::string &recordName, ViewProjection projection)
 Handles the logic to un set an observer view record as default.
virtual void clearObserverViewList ()
 clear the current observer view list
virtual bool removeObserverViewRecord (const std::string &observerViewName, ViewProjection projection)
 finds an observer view record by name and removes it from the list
bool isRecordAssociatedToTerrain (const std::string &recordDisplayName)
 finds an observer view record by name and returns if is associated to the opened terrain in scene
virtual void setIsDefaultObserverViewRecord (const std::string &newName, bool isDefault)
 Set the observer record as a default view.
virtual void setIsDefaultObserverViewRecord (const makArchives::DtObserverStateRecord &record, bool isDefault)
 Set the observer record as a default view.
virtual bool setAssociateObserverViewRecord (const std::string &, bool associate)
 Returns true if there is a record with the specified name.
virtual unsigned int countAssociatedViews () const
 return the number of view records associated to the current terrain on scene
virtual void captureAndAddObserverView ()
 captures the observer view record of the current observer given by the input driver and
const std::string & rightClickedObserverViewName () const
 returns the name of the observer view where the gui called the right click event
void setRightClickedObserverViewName (const std::string &val)
 set the name of the observer view where the gui called the right click event
ViewProjection rightClickedObserverViewProjection () const
 returns the mode of the observer view where the gui called the right click event
void setRightClickedObserverViewProjection (ViewProjection projection)
 set the mode of the observer view where the gui called the right click event
bool rightClickedObserverViewIsAttached () const
 returns if the observer view where the gui called the right click event is attached to an entity
void setRightClickedObserverViewIsAttached (bool val)
 set if the observer view where the gui called the right click event is attached to an entity
void setRightClickedObserverViewIsAttached (const std::string &recordName)
 finds an observer view by name and returns if the observer view is attached to an entity
bool rightClickedObserverViewIsAssociated () const
 returns if the observer view where the gui called the right click event is associated to the terrain opened in the scene
void setRightClickedObserverViewIsAssociated (bool val)
 set if the observer view where the gui called the right click event is associated to the terrain opened in the scene
void setRightClickedObserverViewIsAssociated (const std::string &recordName)
 finds an observer view by name and returns if the observer view is associated to the terrain opened in the scene
const std::string & observerViewsFile () const
 returns an name of the observer view file associate to the current terrain opened in the scene
void setObserverViewsFile (const std::string &val)
 set an name of the observer view file associate to the current terrain opened in the scene
bool isDirty () const
 returns if the list has changes that needs to be saved or (re)associated
void setDirty (bool val)
 sets if the list has changes that needs to be saved
bool areDefaultsDirty () const
 returns if default views need to be (re)associated
void setDefaultsDirty (bool val)
 sets if default views need to be (re)associated
const std::string & terrainObserverViewRecordsFileName () const
 returns the file name of the observer view file associated to the terrain opened in scene
void setTerrainObserverViewRecordsFileName (const std::string &val)
 sets the file name of the observer view file associated to the terrain opened in scene
void setObserverViewRecordsFromIntializer ()
 read observer view records send through command line using bdnx file
bool findObserverViewByNameAndMode (const std::string &observerName, ViewProjection projection, makArchives::DtObserverStateRecord &record)
 find observer view by name and mode.
void setObserverViewByrecord (makArchives::DtObserverStateRecord &record, bool animate=false)
 sets the observer with the data in the given record

Protected Member Functions

 DtObserverViewsManager ()
 default CTOR
 DtObserverViewsManager (DtDe &myDe)
 CTOR.
virtual bool readObserverViewListFromFile (const DtUnicode &fileName, makArchives::DtObserverStateRecordsList &recordList)
 Reads and converts observer view records from a file to a DtObserverStateRecordsList.
virtual void slot_terrainCleared (bool reload)
 on terrain clear, clean up the observer view list, unless reload is true; then nothing needs to be done
virtual void slot_onApplicationQuit ()
 on terrain clear, clean up the observer view list
virtual void slot_closeConfirmationMessageToBeDisplayed ()
 slot receiving the signal before the close confirmation window pops up
virtual void processObserverViewRecordsList (makArchives::DtObserverStateRecordsList &incomingList, bool associated)
 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 DtObserverfindObserverToUse ()
 Determine which observer to apply a saved view to.

Protected Attributes

DtDemyDe
std::string myObserverView3DDefaultRecordName
 name of 3D default observer view record
std::string myObserverView2DDefaultRecordName
 name of 2D default observer view record
makArchives::DtObserverStateRecordsList myObserverViewList
 Observer Views List.
std::string myTerrainObserverViewRecordsFileName
 terrain osrx file name
std::string myRightClickedObserverViewName
ViewProjection myRightClickedObserverViewProjection
bool myRightClickedObserverViewIsAttached
bool myRightClickedObserverViewIsAssociated
std::string myObserverViewsFile
DtSignalConnectionManager myConnections
bool myHasSetupObserverRecords
bool myIsDirty
 tracks if any change in the saved view list needs to be saved
bool myDefaultsDirty
 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 myApplicationIsClosing

Friends

class DtObserverViewsManagerCreator

Detailed Description

Manager for the observer view records loaded in the application.

Member Enumeration Documentation

Enumerator:
Projection2D 
Projection3D 

Constructor & Destructor Documentation

virtual makVrv::DtObserverViewsManager::~DtObserverViewsManager ( )
virtual
makVrv::DtObserverViewsManager::DtObserverViewsManager ( )
protected

default CTOR

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

CTOR.

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 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.

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

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.

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

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

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

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

ViewProjection makVrv::DtObserverViewsManager::rightClickedObserverViewProjection ( ) const

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

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

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

bool makVrv::DtObserverViewsManager::rightClickedObserverViewIsAttached ( ) const

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

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

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

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

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

bool makVrv::DtObserverViewsManager::rightClickedObserverViewIsAssociated ( ) const

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

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

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

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

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

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

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

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

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

bool makVrv::DtObserverViewsManager::isDirty ( ) const

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

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

sets if the list has changes that needs to be saved

bool makVrv::DtObserverViewsManager::areDefaultsDirty ( ) const

returns if default views need to be (re)associated

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

sets if default views need to be (re)associated

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

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

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

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

void makVrv::DtObserverViewsManager::setObserverViewRecordsFromIntializer ( )

read observer view records send through command line using bdnx file

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

find observer view by name and mode.

returns true if the observer was found sets it in the state record parameter

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

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_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.

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

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

Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)