cee::imp::cae::DataSourceCae Class Reference

The data source interface for commercial CAE file formats. More...

Public Types

enum  PollChangeResult {
  NONE = 0x00000000, RESULT_MODIFIED = 0x00000001, GEOMETRY_MODIFIED = 0x00000002, META_DATA_CHANGED = 0x00000004,
  TRANSFORMATIONS_MODIFIED = 0x00000008
}
 Poll change results description. More...
 
typedef int PollChangeResults
 Poll change results. More...
 

Public Member Functions

 DataSourceCae (int dataSourceId)
 Creates a data source with specified unique id. More...
 
virtual bool open (const Str &fileName, cee::ug::Error *error=NULL)
 Opens the data source from the specified file name. More...
 
virtual bool open (const std::vector< Str > &fileNameArr, cee::ug::Error *error=NULL)
 Opens the data source from the specified array of file names. More...
 
virtual bool openSecondary (const Str &fileName, cee::ug::Error *error=NULL)
 Opens the a secondary file and append to this data source. More...
 
virtual void close ()
 Closes the data source. More...
 
bool isSupported (const Str &fileName) const
 Returns true if the specified file is of a supported interface format. More...
 
PollChangeResults pollForChanges ()
 Polls the reader for changes. If you are using a data provider, this will end up calling pollForChanges() on the data provider and preform any updates flaged by the data provider. More...
 
bool executeRequest (const Str &message, const Str &data, Str *response, PollChangeResults *changeResults)
 Send a request to the reader. If using a data provider, this will call the handleClientRequest() method in the data provider and return the response. More...
 
void enableResultCaching (bool enable)
 Enables caching of results: when on, read results will be kept in memory for future use. More...
 
void clearCachedResults ()
 Releases memory used by result caching. More...
 
Str vdmVersion () const
 Returns the version of VdmTools used for file interfaces towards CAE models. 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 ReaderSettingsreaderSettings ()
 Gets the reader settings to customize reader behavior. More...
 
static std::vector< ReaderInfosupportedFormats ()
 Returns a list of supported file interface formats. More...
 
static bool supportsDataProviderPlugins ()
 Gets if data provider plugins are supported or not. More...
 
static bool loadDataProviderPlugin (const Str &baseFileName)
 Loads data provider plugin. More...
 
static std::vector< cee::StrloadDataProviderPluginsFromWildcard (const Str &wildcardString)
 Loads all data provider plugins matching the wildcard. 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::imp::cae::DataSourceCae:
cee::ug::DataSourceInterface cee::ug::DataSource cee::RefCountedObject

Detailed Description

The data source interface for commercial CAE file formats.

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

Member Typedef Documentation

Poll change results.

Member Enumeration Documentation

Poll change results description.

Enumerator
NONE 

None.

RESULT_MODIFIED 

Result has been modified.

GEOMETRY_MODIFIED 

Geometry has been modified.

META_DATA_CHANGED 

Metadata has been modified.

TRANSFORMATIONS_MODIFIED 

Transformations has been modified.

Constructor & Destructor Documentation

cee::imp::cae::DataSourceCae::DataSourceCae ( int  dataSourceId)

Creates a data source with specified unique id.

Member Function Documentation

void cee::imp::cae::DataSourceCae::clearCachedResults ( )

Releases memory used by result caching.

void cee::imp::cae::DataSourceCae::close ( )
virtual

Closes the data source.

Implements cee::ug::DataSourceInterface.

void cee::imp::cae::DataSourceCae::enableResultCaching ( bool  enable)

Enables caching of results: when on, read results will be kept in memory for future use.

bool cee::imp::cae::DataSourceCae::executeRequest ( const Str message,
const Str data,
Str response,
PollChangeResults changeResults 
)

Send a request to the reader. If using a data provider, this will call the handleClientRequest() method in the data provider and return the response.

If any changes to the data have been done the changes will be communicated in the changeResults variable in the similar fasion as with pollForChanges().

bool cee::imp::cae::DataSourceCae::isSupported ( const Str fileName) const

Returns true if the specified file is of a supported interface format.

bool cee::imp::cae::DataSourceCae::loadDataProviderPlugin ( const Str baseFileName)
static

Loads data provider plugin.

std::vector< cee::Str > cee::imp::cae::DataSourceCae::loadDataProviderPluginsFromWildcard ( const Str wildcardString)
static

Loads all data provider plugins matching the wildcard.

The wildcard string must include extension to look for, e.g.: /Users/nn/DP/cdp_*.so

Returns a list of full filename for all providers loaded

bool cee::imp::cae::DataSourceCae::open ( const Str fileName,
cee::ug::Error error = NULL 
)
virtual

Opens the data source from the specified file name.

Note regarding Abaqus ODB files

The Abaqus ODB reader can only read the latest version of Abaqus. If an old file is opened the following will happen.

  1. The file will be converted. The new filename will be: {old_file_name_base}_upg.odb.
  2. The converted file will be opened.
  3. A warning about this conversion will be added to the Logger.
  4. Open will return true if opening the converted file is successful, but error will be set to cee::ug::Error::ERR_FILE_INVALID_FORMAT. This can be trapped by the app and used to inform the user. See the DemoApp example for an example on how to do this.

Implements cee::ug::DataSourceInterface.

bool cee::imp::cae::DataSourceCae::open ( const std::vector< Str > &  fileNameArr,
cee::ug::Error error = NULL 
)
virtual

Opens the data source from the specified array of file names.

This is useful for e.g. Fluent which has to open .cas for mesh and .dat for results.

Note regarding Abaqus ODB files

The Abaqus ODB reader can only read the latest version of Abaqus. If an old file is opened the following will happen.

  1. The file will be converted. The new filename will be: {old_file_name_base}_upg.odb.
  2. The converted file will be opened.
  3. A warning about this conversion will be added to the Logger.
  4. Open will return true if opening the converted file is successful, but error will be set to cee::ug::Error::ERR_FILE_INVALID_FORMAT. This can be trapped by the app and used to inform the user. See the DemoApp example for an example on how to do this.
bool cee::imp::cae::DataSourceCae::openSecondary ( const Str fileName,
cee::ug::Error error = NULL 
)
virtual

Opens the a secondary file and append to this data source.

DataSourceCae::PollChangeResults cee::imp::cae::DataSourceCae::pollForChanges ( )

Polls the reader for changes. If you are using a data provider, this will end up calling pollForChanges() on the data provider and preform any updates flaged by the data provider.

ReaderSettings & cee::imp::cae::DataSourceCae::readerSettings ( )
static

Gets the reader settings to customize reader behavior.

std::vector< ReaderInfo > cee::imp::cae::DataSourceCae::supportedFormats ( )
static

Returns a list of supported file interface formats.

bool cee::imp::cae::DataSourceCae::supportsDataProviderPlugins ( )
static

Gets if data provider plugins are supported or not.

cee::Str cee::imp::cae::DataSourceCae::vdmVersion ( ) const

Returns the version of VdmTools used for file interfaces towards CAE models.