cee::ug::DataStateSpec
-
class DataStateSpec
Specification of data to load for a state.
The data state spec describes the data to load when using DataSourceInterface::loadState(). Loading a state manually is useful to get access to result data without loading the results into the data model. For instance, UnstructGridModel::scalarRange() will not return a valid minimum and maximum if the scalar has not been loaded.
Available results for a data source is found by querying the metadata directory found in the data source. DataSource::directory().
Example
This example loads a single scalar result for a given state.
Define the state and result id to load
int scalarId = 4; int stateId = 1;
Create an array of the scalar id(s) to load
std::vector<int> scalarIds(1);
Create a data state spec object and set the scalar id array.
cee::ug::DataStateSpec stateSpec; stateSpec.setScalarResultIds(scalarIds);
Load the state at the given state id and defined data state spec
source->loadState(stateId, stateSpec, NULL);
See also
Public Functions
-
DataStateSpec()
Constructs an empty object.
-
std::vector<int> scalarResultIds() const
Returns an array of all scalar result ids in the spec.
-
void setScalarResultIds(const std::vector<int> &scalarIds)
Sets all scalar results to load.
-
std::vector<int> vectorResultIds() const
Returns an array of all vector result ids in the spec.
-
void setVectorResultIds(const std::vector<int> &vectorIds)
Sets all vector result to load.
-
std::vector<int> displacementResultIds() const
Returns an array of all displacement result ids in the spec.
-
void setDisplacementResultIds(const std::vector<int> &displacementIds)
Sets all displacement results to load.
-
std::vector<int> symmetricTensorResultIds() const
Returns an array of all symmetric tensor result ids in the spec.
-
void setSymmetricTensorResultIds(const std::vector<int> &symmetricTensorIds)
Sets all the symmetric tensor results to load.
-
void setResultIds(const std::vector<ResultInfo> &resultInfos)
Sets the results to load using ResultInfos.
-
bool loadTransformationResult() const
Returns true if the transformation result is set to be loaded.
-
void setLoadTransformationResult(bool load)
Toggles loading of the transformation result.
-
bool loadVisibilityResult() const
Returns true if the visibility result is set to be loaded.
-
void setLoadVisibilityResult(bool load)
Toggles loading of the visibility result.
-
std::vector<int> setIds() const
Returns an array of all set ids in the spec.
-
void setSetIds(const std::vector<int> &setIds)
Sets all the sets to load.
-
DataStateSpec()