cee::ug::DataSourceVTFx Class Reference

Data source interface for VTFx model files. More...

Public Member Functions

 DataSourceVTFx (int dataSourceId)
 Creates a data source with specified unique id. More...
 
bool isOpen () const
 Returns true if file already open. More...
 
bool openCase (const Str &fileName, size_t caseIndex, Error *error=NULL)
 Opens the VTFx file model given by fileName and a case index. More...
 
bool openCase (const VTFxMemoryFile *vtfxMemFile, size_t caseIndex, Error *error=NULL)
 Opens the VTFx file model given by fileName and a case index. More...
 
bool openCaseById (const Str &fileName, int caseId, Error *error=NULL)
 Opens the VTFx file model given by fileName and case id. More...
 
bool caseProperties (PropertySetCollection *propSetCollection, ImageResources *resources)
 Gets the properties. More...
 
bool isDisplayModelOnly ()
 Returns true if this model contains display model only and not the full model. More...
 
int caseId () const
 Returns the id of the current VTFx case. More...
 
Str caseName () const
 Returns the name of the current VTFx case. More...
 
Str caseDescription () const
 Returns the html description of the current vtfx case. More...
 
void setReadShellsOnly (bool readSurfaceElementOnly)
 Configure the data source to only read shell elements. More...
 
void setPassword (const Str &password)
 Sets the password for this data source. More...
 
size_t plotDataCount () const
 Returns the number of plot data objects found for this database. More...
 
Str plotDataName (size_t plotIndex)
 Returns the name of the plot data. More...
 
size_t plotDataVariableCount (size_t plotIndex)
 Returns the number of available plot data variables for this plot data index. More...
 
Str plotDataVariableName (size_t plotIndex, size_t plotVariableIndex)
 Returns the name of the plot data variable. More...
 
std::vector< double > plotDataVariableValues (size_t plotIndex, size_t plotVariableIndex)
 Returns the values of the specified plot data variable. More...
 
virtual bool open (const Str &filename, Error *error=NULL)
 Opens the first case in the VTFx file model given by fileName. More...
 
virtual void close ()
 Closed data source. More...
 
- Public Member Functions inherited from cee::ug::DataSourceInterface
 DataSourceInterface (int dataSourceId)
 Constructs an empty data source with the given id. More...
 
virtual bool loadState (int stateId, const DataStateSpec &stateSpec, Error *error)
 Loads the state at the given stateId. Only loads the state if not already present in the DataSource. More...
 
virtual void discardState (int stateId)
 Deletes the state with the given id from the data source. More...
 
virtual bool loadCustomResultBaseDependencies (int stateId, const DataStateSpec &stateSpec)
 Loads custom result bare dependencies. Returns true if success. More...
 
bool createResultCalculator (const Str &calculatorId, const Str &resultIdString, const Str &initString, Str *errorMessage)
 Creates a new result with the given 'resultIdString' by using the result calculator 'calculatorId' configured with the given 'initString'. More...
 
bool recreateResultCalculator (const Str &calculatorId, const Str &resultIdString, const Str &initString, Str *errorMessage)
 Recreates a result calculator with a modified initString. More...
 
bool deleteResultCalculator (const Str &calculatorId, const Str &resultIdString)
 Deletes the result calculator with the given calculatorId and resultIdString. More...
 
bool setResultCalculatorParams (const Str &calculatorId, const Str &resultIdString, const ResultCalculatorParams &calcParams)
 Sets the parameters for the given result calculator instance. More...
 
void getResultCalculatorParams (const Str &calculatorId, const Str &resultIdString, ResultCalculatorParams *calcParams) const
 Gets the current parameters exposed by the given result calculator instance. More...
 
Str primaryFilename () const
 Returns the primary filename for this data source. More...
 
Str description () const
 Returns the description for this data source. More...
 
virtual bool scalarRange (int stateId, int resultId, double *min, double *max)
 Gets the range of the given scalar result for the given state. More...
 
virtual bool vectorRange (int stateId, int resultId, double *min, double *max)
 Gets the range of the given vector result for the given state. More...
 
virtual bool displacementRange (int stateId, int resultId, double *min, double *max)
 Gets the range of the given displacement result for the given state. More...
 
- Public Member Functions inherited from cee::ug::DataSource
int id () const
 Returns the id of the data source. More...
 
size_t stateCount () const
 Returns number of states for the data source. More...
 
size_t stateIndex (int stateId) const
 Returns the index of the state with id stateId. More...
 
size_t geometryCountPerState () const
 Returns the number of geometries (per state) in the Datasource. More...
 
const DataStatestate (size_t stateIndex) const
 Returns the state at the given state index. More...
 
DataStatestate (size_t stateIndex)
 Returns the state at the given state index. More...
 
const DataStatecurrentState (const UnstructGridModel *model) const
 Returns the current state (the state in the current frame) in the given model. More...
 
DataStatecurrentState (const UnstructGridModel *model)
 Returns the current state (the state in the current frame) in the given model. More...
 
const DataSourceDirectorydirectory () const
 Returns the data directory of the data source. More...
 
DataSourceDirectorydirectory ()
 Returns the data directory of the data source. More...
 
const DataElementSetelementSet (size_t setIndex) const
 Returns a const ptr to the element set at the given index. More...
 
DataElementSetelementSet (size_t setIndex)
 Returns the element set at the given index. More...
 
size_t elementSetCount () const
 Returns the number of DataElementSets in this data source. More...
 
size_t elementSetIndex (int setId) const
 Returns the index of the element set with the given id. More...
 
void addElementSet (DataElementSet *elementSet)
 Adds an element set to this data source. More...
 
void removeElementSet (const DataElementSet *elementSet)
 Removes an element set from this data source. More...
 
void removeAllElementSets ()
 Removes all element sets from the data source. More...
 
bool isDataSourceValid (Str *failReason) const
 Validates that the data source contents matches the metadata. More...
 
int defaultDispacementResultId () const
 Returns the current state (the state in the current frame) in the given model. More...
 
bool computeCustomResults (int stateId, const DataStateSpec &stateSpec)
 Computes custom results. More...
 
- Public Member Functions inherited from cee::RefCountedObject
void addRef () const
 Increments the reference count for this object. More...
 
void release () const
 Decrements the reference count for this object. More...
 
int refCount () const
 Returns the reference count for this object. More...
 
void setRefCountZero () const
 Sets the ref count to zero, but DOES NOT delete the object. More...
 

Static Public Member Functions

static bool isVTFxFile (const Str &filename)
 Helper to test if a given file is a VTFx file. More...
 
- Static Public Member Functions inherited from cee::ug::DataSourceInterface
static bool supportsResultCalculatorPlugins ()
 Gets if result calculator plugins are supported or not. More...
 
static bool loadResultCalculatorPlugin (const Str &baseFileName)
 Loads the specified result calculator plugin. More...
 

Additional Inherited Members

- Protected Member Functions inherited from cee::ug::DataSourceInterface
void updateDirectoryFromDatabase ()
 Updates the directory with synthetic metadata from all states, parts and results in the geometries. More...
 
Inheritance diagram for cee::ug::DataSourceVTFx:
cee::ug::DataSourceInterface cee::ug::DataSource cee::RefCountedObject

Detailed Description

Data source interface for VTFx model files.

The data source contains a collection of all states for one analysis. Each state groups together geometries and results for one time step, load case, frequency etc.

Each unstructured grid model owns one data source.

The DataSourceVTFx is a subclass of DataSource. See DataSource on general functionality such as how to get states and metadata directory.

The VTF and VTFx file formats are Ceetron's own formats tailored specifically to carry structural mechanics and fluid dynamics data in a very compact form. By utilizing XML and zip compression, the VTFx format expands the functionality and usefulness of the well established VTF format by adding features for security, adaptability and the ability to carry multiple cases in one file - without compromising on the file size. VTFx files can be viewed in several products from Ceetron. For instance the free viewers, Ceetron 3D Viewer and Ceetron 3D Plugin for Microsoft Office. For a thorough description of the VTFx file format, see the reference guide.

Use open() to open a VTFx file.

The VTFx file format supports multiple cases within the same file. Id the file has many cases, specify the case index when opening.

See also
VTFxFileBrowser

Constructor & Destructor Documentation

cee::ug::DataSourceVTFx::DataSourceVTFx ( int  dataSourceId)

Creates a data source with specified unique id.

Member Function Documentation

Str cee::ug::DataSourceVTFx::caseDescription ( ) const

Returns the html description of the current vtfx case.

int cee::ug::DataSourceVTFx::caseId ( ) const

Returns the id of the current VTFx case.

Str cee::ug::DataSourceVTFx::caseName ( ) const

Returns the name of the current VTFx case.

bool cee::ug::DataSourceVTFx::caseProperties ( PropertySetCollection propSetCollection,
ImageResources resources 
)

Gets the properties.

void cee::ug::DataSourceVTFx::close ( )
virtual

Closed data source.

Implements cee::ug::DataSourceInterface.

bool cee::ug::DataSourceVTFx::isDisplayModelOnly ( )

Returns true if this model contains display model only and not the full model.

bool cee::ug::DataSourceVTFx::isOpen ( ) const

Returns true if file already open.

bool cee::ug::DataSourceVTFx::isVTFxFile ( const Str filename)
static

Helper to test if a given file is a VTFx file.

bool cee::ug::DataSourceVTFx::open ( const Str filename,
Error error = NULL 
)
virtual

Opens the first case in the VTFx file model given by fileName.

Equivalent to openCase(filename, 0, error)

Implements cee::ug::DataSourceInterface.

bool cee::ug::DataSourceVTFx::openCase ( const Str fileName,
size_t  caseIndex,
Error error = NULL 
)

Opens the VTFx file model given by fileName and a case index.

The VTFx file format supports multiple cases within the same file. If the file has many cases, specify the case index when opening. A caseIndex of 0 is always legal.

Returns true if file was read successfully.

bool cee::ug::DataSourceVTFx::openCase ( const VTFxMemoryFile vtfxMemFile,
size_t  caseIndex,
Error error = NULL 
)

Opens the VTFx file model given by fileName and a case index.

The VTFx file format supports multiple cases within the same file. If the file has many cases, specify the case index when opening. A caseIndex of 0 is always legal.

Returns true if file was read successfully.

bool cee::ug::DataSourceVTFx::openCaseById ( const Str fileName,
int  caseId,
Error error = NULL 
)

Opens the VTFx file model given by fileName and case id.

Returns true if file was read successfully.

size_t cee::ug::DataSourceVTFx::plotDataCount ( ) const

Returns the number of plot data objects found for this database.

cee::Str cee::ug::DataSourceVTFx::plotDataName ( size_t  plotIndex)

Returns the name of the plot data.

size_t cee::ug::DataSourceVTFx::plotDataVariableCount ( size_t  plotIndex)

Returns the number of available plot data variables for this plot data index.

cee::Str cee::ug::DataSourceVTFx::plotDataVariableName ( size_t  plotIndex,
size_t  plotVariableIndex 
)

Returns the name of the plot data variable.

std::vector< double > cee::ug::DataSourceVTFx::plotDataVariableValues ( size_t  plotIndex,
size_t  plotVariableIndex 
)

Returns the values of the specified plot data variable.

void cee::ug::DataSourceVTFx::setPassword ( const Str password)

Sets the password for this data source.

void cee::ug::DataSourceVTFx::setReadShellsOnly ( bool  readShellsOnly)

Configure the data source to only read shell elements.

Under this configuration sets are not supported