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

Classes

struct  MovementFileLoader
 

Public Types

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

Public Member Functions

 DtMovementFile ()
 
virtual ~DtMovementFile ()
 
 DtMovementFile (const DtMovementFile &)
 
DtMovementFileoperator= (const DtMovementFile &)
 
virtual double simTime (int) const
 
virtual int numRows () const
 
virtual bool hasOffsetOrientation () const
 
virtual DtVector bodyOffsetVector (int row) const
 
virtual DtTaitBryan orientationOffset (int row) const
 
virtual bool isLoaded () const
 
virtual bool load (const DtFilename &file, const std::string &configuration, int rowsToLoad=-1)
 
virtual int movementRow (double) const
 
virtual void reset ()
 
virtual void setObjectOffsetLocation (int row, const DtVector &)
 
virtual void setObjectOffsetOrientation (int row, const DtTaitBryan &)
 
virtual void setTimeDelta (int forRow, double timeDelta)
 
virtual void removeRow (int)
 
virtual void setDefaultTimeScale (double)
 
virtual double defaultTimeScale () const
 
const
DtScriptedMovementFileConfiguration
configuration () const
 
DtScriptedMovementFileConfigurationconfiguration ()
 

Static Public Member Functions

static
DtScriptedMovementFileConfiguration 
defaultConfigurationForFile (const DtFilename &)
 
static std::vector< std::string > dialogStrings ()
 
static int addLoadableFileType (std::string extension, std::string displayString, MovementFileLoaderInterfaceCreator)
 
static std::vector< std::string > supportedExtensions ()
 
static void removeLoadableFileType (const DtString &extension)
 
static
DtMovementFileLoaderInterface
loader (const DtFilename &filename)
 
static std::vector< std::string > formatsForFile (const DtFilename &)
 
static MovementFileConfigurations loadMovementFileConfigurations (const DtFilename &directory)
 
static bool saveMovementFileConfigurations (const MovementFileConfigurations &configs, const DtFilename &file)
 

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
 

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 Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)