VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Attributes | Static Protected Attributes
DtMovementFile Class Reference

This class will load in and return data from a movement file. More...

Classes

struct  MovementFileLoader

Public Types

typedef boost::function
< DtMovementFileLoaderInterface *()> 
MovementFileLoaderInterfaceCreator
typedef std::vector
< DtScriptedMovementFileConfiguration
MovementFileConfigurations

Public Member Functions

 DtMovementFile ()
 CTOR.
virtual ~DtMovementFile ()
 DTOR.
 DtMovementFile (const DtMovementFile &)
 Copy constructor.
DtMovementFileoperator= (const DtMovementFile &)
 Assignemtn operator.
virtual double simTime (int) const
 Returns the simTime at the given offset, or 0 if greater than current number of rows loaded or there is no configuration.
virtual int numRows () const
 Returns the number of rows currently read in.
virtual bool hasOffsetOrientation () const
 Returns true if there is an offset orientation defined in this file.
virtual DtVector bodyOffsetVector (int row) const
 Returns the body offset at the given row, or zero if the row is greater than the number of rows read or there is no configuration.
virtual DtTaitBryan orientationOffset (int row) const
 Returns the orientation offset for a given row.
virtual bool isLoaded () const
 Returns true if there are more than 0 rows read in.
virtual bool load (const DtFilename &file, const std::string &configuration, int rowsToLoad=-1)
 Loads from the specified file, given the configuration and the number of rows to load.
virtual int movementRow (double) const
 Returns the row that matches the given sim time. If not loaded returns -1.
virtual void reset ()
 Clears out data.
virtual void setObjectOffsetLocation (int row, const DtVector &)
 If the row is -1 or > than the number of rows will add to the end, else will replace current value.
virtual void setObjectOffsetOrientation (int row, const DtTaitBryan &)
 If the row is -1 or > than the number of rows will add to the end, else will replace current value.
virtual void setTimeDelta (int forRow, double timeDelta)
 Sets the time delta for the current row from the previous row. Does not effect any other row.
virtual void removeRow (int)
 Removes the current row.
virtual void setDefaultTimeScale (double)
 Adjusts all the rows and sets a default timescale for each row.
virtual double defaultTimeScale () const
const
DtScriptedMovementFileConfiguration
configuration () const
 Returns the configuration for the file.
DtScriptedMovementFileConfigurationconfiguration ()

Static Public Member Functions

static
DtScriptedMovementFileConfiguration 
defaultConfigurationForFile (const DtFilename &)
 Given a file, look at its extension and have the loader for that file (if registered) return the default configuration for that file type.
static std::vector< std::string > dialogStrings ()
 Returns a filter list of strings that can be put into a file dialog to choose amongst existing loadable file types.
static int addLoadableFileType (std::string extension, std::string displayString, MovementFileLoaderInterfaceCreator)
 Adds a new loadable file type and the creator for that file. Returns the number of items now in the list.
static std::vector< std::string > supportedExtensions ()
 Returns a list of the supported extensions.
static void removeLoadableFileType (const DtString &extension)
 Removes a loadable type.
static
DtMovementFileLoaderInterface
loader (const DtFilename &filename)
 Returns a new loader given the filename, or null if extension for the file does not exist.
static std::vector< std::string > formatsForFile (const DtFilename &)
 Queries the appropriate file loader interface to see what the available formattings are for the particular file.
static MovementFileConfigurations loadMovementFileConfigurations (const DtFilename &directory)
 Loads up the movement file configurations from the given directory and returns the list of items.
static bool saveMovementFileConfigurations (const MovementFileConfigurations &configs, const DtFilename &file)
 Saves the list of movement file configurations to the given filename.

Protected Types

typedef std::map< std::string,
MovementFileLoader
MovementFileLoaders

Protected Attributes

DtScriptedMovementFileConfiguration myConfiguration
double myDefaultTimeScale
DtMovementFileData myMovementFileData
boost::shared_ptr
< DtMovementFileLoaderInterface
myMovementFileInterface

Static Protected Attributes

static MovementFileLoaderstheMovementFileLoaders

Detailed Description

This class will load in and return data from a movement file.

Member Typedef Documentation

typedef std::map<std::string, MovementFileLoader> DtMovementFile::MovementFileLoaders
protected

Constructor & Destructor Documentation

DtMovementFile::DtMovementFile ( )

CTOR.

virtual DtMovementFile::~DtMovementFile ( )
virtual

DTOR.

DtMovementFile::DtMovementFile ( const DtMovementFile )

Copy constructor.

Member Function Documentation

DtMovementFile& DtMovementFile::operator= ( const DtMovementFile )

Assignemtn operator.

virtual double DtMovementFile::simTime ( int  ) const
virtual

Returns the simTime at the given offset, or 0 if greater than current number of rows loaded or there is no configuration.

virtual int DtMovementFile::numRows ( ) const
virtual

Returns the number of rows currently read in.

virtual bool DtMovementFile::hasOffsetOrientation ( ) const
virtual

Returns true if there is an offset orientation defined in this file.

virtual DtVector DtMovementFile::bodyOffsetVector ( int  row) const
virtual

Returns the body offset at the given row, or zero if the row is greater than the number of rows read or there is no configuration.

virtual DtTaitBryan DtMovementFile::orientationOffset ( int  row) const
virtual

Returns the orientation offset for a given row.

Assumed to be offset from current orientation. The orientation returned is in topographic projection

virtual bool DtMovementFile::isLoaded ( ) const
virtual

Returns true if there are more than 0 rows read in.

virtual bool DtMovementFile::load ( const DtFilename &  file,
const std::string &  configuration,
int  rowsToLoad = -1 
)
virtual

Loads from the specified file, given the configuration and the number of rows to load.

If -1 reads all available rows

virtual int DtMovementFile::movementRow ( double  ) const
virtual

Returns the row that matches the given sim time. If not loaded returns -1.

virtual void DtMovementFile::reset ( )
virtual

Clears out data.

virtual void DtMovementFile::setObjectOffsetLocation ( int  row,
const DtVector  
)
virtual

If the row is -1 or > than the number of rows will add to the end, else will replace current value.

Value is in body coordinates

virtual void DtMovementFile::setObjectOffsetOrientation ( int  row,
const DtTaitBryan &   
)
virtual

If the row is -1 or > than the number of rows will add to the end, else will replace current value.

virtual void DtMovementFile::setTimeDelta ( int  forRow,
double  timeDelta 
)
virtual

Sets the time delta for the current row from the previous row. Does not effect any other row.

virtual void DtMovementFile::removeRow ( int  )
virtual

Removes the current row.

virtual void DtMovementFile::setDefaultTimeScale ( double  )
virtual

Adjusts all the rows and sets a default timescale for each row.

Will also apply this timescale to any future rows added

virtual double DtMovementFile::defaultTimeScale ( ) const
virtual
static DtScriptedMovementFileConfiguration DtMovementFile::defaultConfigurationForFile ( const DtFilename &  )
static

Given a file, look at its extension and have the loader for that file (if registered) return the default configuration for that file type.

If not registered returns default precision movement configruation

static std::vector<std::string> DtMovementFile::dialogStrings ( )
static

Returns a filter list of strings that can be put into a file dialog to choose amongst existing loadable file types.

static int DtMovementFile::addLoadableFileType ( std::string  extension,
std::string  displayString,
MovementFileLoaderInterfaceCreator   
)
static

Adds a new loadable file type and the creator for that file. Returns the number of items now in the list.

Referenced by DtMovementFileAutoRegister::DtMovementFileAutoRegister().

static std::vector<std::string> DtMovementFile::supportedExtensions ( )
static

Returns a list of the supported extensions.

static void DtMovementFile::removeLoadableFileType ( const DtString extension)
static

Removes a loadable type.

Referenced by DtMovementFileAutoRegister::~DtMovementFileAutoRegister().

static DtMovementFileLoaderInterface* DtMovementFile::loader ( const DtFilename &  filename)
static

Returns a new loader given the filename, or null if extension for the file does not exist.

The return pointer must be freed by caller

static std::vector<std::string> DtMovementFile::formatsForFile ( const DtFilename &  )
static

Queries the appropriate file loader interface to see what the available formattings are for the particular file.

static MovementFileConfigurations DtMovementFile::loadMovementFileConfigurations ( const DtFilename &  directory)
static

Loads up the movement file configurations from the given directory and returns the list of items.

static bool DtMovementFile::saveMovementFileConfigurations ( const MovementFileConfigurations configs,
const DtFilename &  file 
)
static

Saves the list of movement file configurations to the given filename.

const DtScriptedMovementFileConfiguration& DtMovementFile::configuration ( ) const
inline

Returns the configuration for the file.

DtScriptedMovementFileConfiguration& DtMovementFile::configuration ( )
inline

Member Data Documentation

DtScriptedMovementFileConfiguration DtMovementFile::myConfiguration
protected
double DtMovementFile::myDefaultTimeScale
protected
DtMovementFileData DtMovementFile::myMovementFileData
protected
MovementFileLoaders* DtMovementFile::theMovementFileLoaders
staticprotected
boost::shared_ptr<DtMovementFileLoaderInterface> DtMovementFile::myMovementFileInterface
protected

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

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)