cee::ug::DataSourceReader

class DataSourceReader : public DataSourceInterface

This class implements a data source that will use a DataReader to populate the data source with geometry and results data.

The class derives from DataSourceInterface and implements the loadState() method which is used by UnstructGridModel to load data not currently present in the DataSource during a call to UnstructGridModel::updateVisualization(). loadState() will use the provided reader to get the requested geometry and results.

This class is mostly used to implement a data source using your own DataReader. There is no need to call loadState() unless you would like to load data into the DataSource without showing it in a UnstructGridModel.

Example of usage: DataReaderExample

Public Functions

DataSourceReader(int dataSourceId, DataReader *reader)

Constructs a DataSource with the specified reader.

You must create a reader by sub-classing the DataReader class and implement the reading of your own analysis results.

See also

DataReader

virtual bool open(const Str &filename, Error *error = NULL)

Opens the given file in the associated DataReader and prepare the DataSource for use.

Will call initializeDirectory() in the DataReader. Upon return, the DataSourceDirectory of the DataSource will be updated with the contents of the file.

virtual void close()

Closes the data source.

Will call close() on the DataReader.

virtual bool reload(bool force, Error *error = NULL)

Reloads the data source.

Will close and reopen the file reader, and then query for database directory

virtual bool loadState(int stateId, const DataStateSpec &stateSpec, Error *error)

Loads the state at the given stateId.

Will only load the state and the corresponding data if not already present in the DataSource.

The stateSpec describes which results to load for the given state.

Returns true if the state was successfully loaded.

See also

DataStateSpec

virtual bool scalarRange(int stateId, int resultId, double *min, double *max)

Gets the range of the given scalar result for the given state.

The result does not need to be loaded. The it returns the global min max of the state, not taking any current filtering into account.

This will fetch the result from the reader if not already loaded, and is more efficient than loading the result into the data model if you only need the min/max. If the result is already present in the data model it will be used without loading the data.

virtual bool vectorRange(int stateId, int resultId, double *min, double *max)

Gets the range of the given vector result for the given state.

The result does not need to be loaded. The it returns the global min max of the state, not taking any current filtering into account.

This will fetch the result from the reader if not already loaded, and is more efficient than loading the result into the data model if you only need the min/max. If the result is already present in the data model it will be used without loading the data.