Metadata directory for a data source. More...
Public Member Functions | |
void | clear () |
Clears the data source directory. Remove all result infos. More... | |
size_t | geometryCountPerState () const |
Returns the number of geometries per state. More... | |
SimulationInfo | simulationInfo () const |
Returns the ModelInfo of the DataSource. More... | |
std::vector< StateInfo > | stateInfos () const |
Returns an array of state info from the Data Source Directory. More... | |
std::vector< StateGroupInfo > | stateGroupInfos () const |
Returns an array of state group info from the Data Source Directory. More... | |
std::vector< StateInfo > | ungroupedStateInfos () const |
Returns the state infos that are not in any state group from the Data Source Directory. More... | |
std::vector< ResultInfo > | scalarResultInfos () const |
Returns an array of scalar result info (ResultInfo) from metadata. More... | |
std::vector< ResultInfo > | vectorResultInfos () const |
Returns an array of vector result info (ResultInfo) from metadata. More... | |
std::vector< ResultInfo > | displacementResultInfos () const |
Returns an array of displacement result info (ResultInfo) from metadata. More... | |
std::vector< ResultInfo > | symmetricTensorResultInfos () const |
Returns an array of the available symmetric tensor result info (ResultInfo) in the data source. More... | |
std::vector< PartInfo > | partInfos (size_t globalGeometryIndex) const |
Returns an array of part info (PartInfo) from metadata. More... | |
bool | transformationResult () const |
Returns true if a transformation result exists. More... | |
bool | visibilityResult () const |
Returns true if a visibility result exists. More... | |
std::vector< SetInfo > | setInfos () const |
Returns an array of sets from metadata. More... | |
std::vector< SectionInfo > | sectionInfos () const |
Returns an array of section infos from the Data Source Directory. More... | |
std::vector< SectionCategoryInfo > | sectionCategoryInfos () const |
Returns an array of section category infos from the Data Source Directory. More... | |
std::vector< SectionGroupInfo > | sectionGroupInfos () const |
Returns an array of reference section infos from the Data Source Directory. More... | |
std::vector< ResultInfo > | resultInfos (ResultType resultType) const |
Returns all the results of a given type. More... | |
std::vector< Str > | resultNatures (ResultType resultType) const |
Returns a vector of unique result natures found for the given resultType. More... | |
StateInfo | findStateInfo (int stateId) const |
Returns the state info for the state with id stateId. More... | |
StateGroupInfo | findStateGroupInfo (int stateGroupId) const |
Returns the state group info for the state with id stateGroupId. More... | |
ResultInfo | findResultInfo (ResultType resultType, int resultId) const |
Returns the result info for the given result type and that has id resultId. More... | |
ResultInfo | findScalarResultInfo (int resultId) const |
Returns the result info for the scalar result with id resultId. More... | |
ResultInfo | findVectorResultInfo (int resultId) const |
Returns the result info for the vector result with id resultId. More... | |
ResultInfo | findDisplacementResultInfo (int resultId) const |
Returns the result info for the displacement result with id resultId. More... | |
ResultInfo | findSymmetricTensorResultInfo (int resultId) const |
Returns the result info of the specified symmetric tensor result. More... | |
ResultInfo | findResultInfo (ResultType resultType, const Str &resultIdString) const |
Returns the result info for the given result type and that has an id string equal to resultIdString. More... | |
ResultInfo | findScalarResultInfo (const Str &resultIdString) const |
Returns the result info for the scalar result that has an id string equal to resultIdString. More... | |
ResultInfo | findVectorResultInfo (const Str &resultIdString) const |
Returns the result info for the vector result that has an id string equal to resultIdString. More... | |
ResultInfo | findDisplacementResultInfo (const Str &resultIdString) const |
Returns the result info for the displacement result that has an id string equal to resultIdString. More... | |
ResultInfo | findSymmetricTensorResultInfo (const Str &resultIdString) const |
Returns the result info of the symmetric tensor result that has an id string equal to resultIdString. More... | |
PartInfo | findPartInfo (size_t globalGeometryIndex, int partId) const |
Returns the part info for the part with id partId at geometry index globalGeometryIndex. More... | |
SetInfo | findSetInfo (int setId) const |
Returns the set info for the set with id setId. More... | |
SectionInfo | findSectionInfo (int sectiondId) const |
Returns the section info for the section with id sectionId. More... | |
SectionCategoryInfo | findSectionCategoryInfo (int categoryId) const |
Returns the section category info given its id. More... | |
SectionGroupInfo | findSectionGroupInfo (int sectiondGroupId) const |
Returns the section info for the section with id sectionId. More... | |
std::vector< ResultInfo > | derivedScalarResultInfos (int resultId) const |
Returns the list of scalar results that derive from the given result id. More... | |
std::vector< ResultInfo > | derivedVectorResultInfos (int resultId) const |
Returns the list of vector results that derive from the given result id. More... | |
bool | hasResult (int stateId, ResultInfo info) const |
Returns true if the given result exists for the given state stateId. More... | |
bool | hasScalarResult (int stateId, int resultId) const |
Returns true if the scalar result resultId exists for the given state stateId. More... | |
bool | hasVectorResult (int stateId, int resultId) const |
Returns true if the vector result resultId exists for the given state stateId. More... | |
bool | hasSymmetricTensorResult (int stateId, int resultId) const |
Returns true if the symmetric tensor result resultId exists for the given state stateId. More... | |
bool | hasDisplacementResult (int stateId, int resultId) const |
Returns true if the displacement result resultId exists for the given state stateId. More... | |
void | setStateGroupInfo (StateGroupInfo info) |
Sets or adds the given group info. Assumes group's states are valid ones. More... | |
void | removeAllStateGroupInfos () |
Removes all state info groups. More... | |
void | setStateInfo (StateInfo info) |
Updates/adds state info. More... | |
void | addStateInfo (StateInfo info) |
Adds state info. More... | |
void | removeAllStateInfos () |
Removes all state infos. More... | |
void | setResultInfo (ResultInfo resultInfo) |
Updates/adds a result info to the list of the result infos of the same type. More... | |
void | removeAllResultInfos (ResultType resultType) |
Removes all result infos of the given type. More... | |
void | setScalarResultInfo (ResultInfo resultInfo) |
Updates/adds scalar result info. More... | |
void | removeAllScalarResultInfos () |
Removes all scalar result infos. More... | |
void | setVectorResultInfo (ResultInfo resultInfo) |
Updates/adds vector result info. More... | |
void | removeAllVectorResultInfos () |
Removes all vector result infos. More... | |
void | setDisplacementResultInfo (ResultInfo resultInfo) |
Updates/adds displacement result info. More... | |
void | removeAllDisplacementResultInfos () |
Removes all displacement result infos. More... | |
void | setSymmetricTensorResultInfo (ResultInfo resultInfo) |
Set the result info for the given symmetric tensor result. More... | |
void | removeAllSymmetricTensorResultInfos () |
Remove all symmetric tensor results from the directory. More... | |
void | setPartInfo (size_t globalGeometryIndex, PartInfo partInfo) |
Updates/adds part info. More... | |
void | removeAllPartInfos (size_t globalGeometryIndex) |
Removes all part infos. More... | |
void | setSetInfo (SetInfo setInfo) |
Updates/adds set info. More... | |
void | removeSetInfo (int setId) |
Removes set info with given id. More... | |
void | removeAllSetInfos () |
Removes all set infos. More... | |
void | setTransformationResult (bool hasTransformationResult) |
Sets a transformation result. More... | |
void | setVisibilityResult (bool hasVisibilityResult) |
Sets a visibility result. More... | |
std::vector< ResultInfo > | customResultInfos () const |
Returns an array of custom result infos. More... | |
void | setCustomResultInfo (ResultInfo resultInfo) |
Sets custom result info. More... | |
void | removeCustomResultInfo (ResultInfo resultInfo) |
Removes a custom result info. More... | |
std::vector< ResultInfo > | customResultBaseDependencies (ResultInfo resultInfo) const |
Returns an array of custom result infos. More... | |
![]() | |
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... | |
Metadata directory for a data source.
The data source directory contains metadata all available results (scalar, vector, displacement, transformation and visibility), geometries and parts for a data source. Each data source owns a directory object containing the metadata for the given part.
The directory contains metadata for:
In addition, the data source directory also applies a query for number of geometries per state, geometryCountPerState().
Example on setting model specification based on metadata. The test model is read from a VTF file and contains multiple states, scalar results, vector results and a displacement result.
Create the model and VTFx file interface data source.
Give the data source a unique id.
Open the test file (contact.vtfx) included in the tutorial data files. The open() function will return true if the file was opened successfully.
Set the data source in the model.
After opening the file, the metadata will be available through the data source's directory.
Get metadata for all states and set the last state as current in the model specification.
Get metadata for all available scalar results and set the first scalar to show as fringes in the model specification.
Get metadata for all available vector results and set the first vector in the model specification.
Get metadata for all available displacement results and set the first displacement in the model specification.
Toggle on result visibility for all parts for the selected result types.
See the complete source code at: UnstructGrid: Load model from file and set up model specification
void cee::ug::DataSourceDirectory::addStateInfo | ( | StateInfo | info | ) |
Adds state info.
Ensure that the state id is unique before using this function.
This function skips the check for if the state already exists to provide increased performance when adding a large number of states. If the state id is not guaranteed unique, you must use the normal setStateInfo() function!
void cee::ug::DataSourceDirectory::clear | ( | ) |
Clears the data source directory. Remove all result infos.
std::vector< ResultInfo > cee::ug::DataSourceDirectory::customResultBaseDependencies | ( | ResultInfo | resultInfo | ) | const |
Returns an array of custom result infos.
std::vector< ResultInfo > cee::ug::DataSourceDirectory::customResultInfos | ( | ) | const |
Returns an array of custom result infos.
std::vector< ResultInfo > cee::ug::DataSourceDirectory::derivedScalarResultInfos | ( | int | resultId | ) | const |
Returns the list of scalar results that derive from the given result id.
std::vector< ResultInfo > cee::ug::DataSourceDirectory::derivedVectorResultInfos | ( | int | resultId | ) | const |
Returns the list of vector results that derive from the given result id.
std::vector< ResultInfo > cee::ug::DataSourceDirectory::displacementResultInfos | ( | ) | const |
Returns an array of displacement result info (ResultInfo) from metadata.
ResultInfo cee::ug::DataSourceDirectory::findDisplacementResultInfo | ( | int | resultId | ) | const |
Returns the result info for the displacement result with id resultId.
If not found, will return an ResultInfo object with id == -1
ResultInfo cee::ug::DataSourceDirectory::findDisplacementResultInfo | ( | const Str & | resultIdString | ) | const |
Returns the result info for the displacement result that has an id string equal to resultIdString.
If not found, will return an ResultInfo object with id == -1
PartInfo cee::ug::DataSourceDirectory::findPartInfo | ( | size_t | globalGeometryIndex, |
int | partId | ||
) | const |
Returns the part info for the part with id partId at geometry index globalGeometryIndex.
If not found, returns a PartInfo object with id == -1.
ResultInfo cee::ug::DataSourceDirectory::findResultInfo | ( | ResultType | resultType, |
int | resultId | ||
) | const |
Returns the result info for the given result type and that has id resultId.
If not found, will return an invalid ResultInfo object with id == -1
ResultInfo cee::ug::DataSourceDirectory::findResultInfo | ( | ResultType | resultType, |
const Str & | resultIdString | ||
) | const |
Returns the result info for the given result type and that has an id string equal to resultIdString.
If not found, will return an invalid ResultInfo object with id == -1
ResultInfo cee::ug::DataSourceDirectory::findScalarResultInfo | ( | int | resultId | ) | const |
Returns the result info for the scalar result with id resultId.
If not found, will return an ResultInfo object with id == -1
ResultInfo cee::ug::DataSourceDirectory::findScalarResultInfo | ( | const Str & | resultIdString | ) | const |
Returns the result info for the scalar result that has an id string equal to resultIdString.
If not found, will return an ResultInfo object with id == -1
cee::ug::SectionCategoryInfo cee::ug::DataSourceDirectory::findSectionCategoryInfo | ( | int | categoryId | ) | const |
Returns the section category info given its id.
If not found, returns a SectionCategoryInfo object with id == -1.
cee::ug::SectionGroupInfo cee::ug::DataSourceDirectory::findSectionGroupInfo | ( | int | sectionGroupId | ) | const |
Returns the section info for the section with id sectionId.
If not found, returns a SectionInfo object with id == -1.
cee::ug::SectionInfo cee::ug::DataSourceDirectory::findSectionInfo | ( | int | sectionId | ) | const |
Returns the section info for the section with id sectionId.
If not found, returns a SectionInfo object with id == -1.
cee::ug::SetInfo cee::ug::DataSourceDirectory::findSetInfo | ( | int | setId | ) | const |
Returns the set info for the set with id setId.
If not found, returns a SetInfo object with id == -1.
StateGroupInfo cee::ug::DataSourceDirectory::findStateGroupInfo | ( | int | stateGroupId | ) | const |
Returns the state group info for the state with id stateGroupId.
If not found, will return an StateInfo object with id == -1
StateInfo cee::ug::DataSourceDirectory::findStateInfo | ( | int | stateId | ) | const |
Returns the state info for the state with id stateId.
If not found, will return an StateInfo object with id == -1
cee::ug::ResultInfo cee::ug::DataSourceDirectory::findSymmetricTensorResultInfo | ( | int | resultId | ) | const |
Returns the result info of the specified symmetric tensor result.
Returns a result info with id = -1 if not found.
cee::ug::ResultInfo cee::ug::DataSourceDirectory::findSymmetricTensorResultInfo | ( | const Str & | resultIdString | ) | const |
Returns the result info of the symmetric tensor result that has an id string equal to resultIdString.
Returns a result info with id = -1 if not found.
ResultInfo cee::ug::DataSourceDirectory::findVectorResultInfo | ( | int | resultId | ) | const |
Returns the result info for the vector result with id resultId.
If not found, will return an ResultInfo object with id == -1
ResultInfo cee::ug::DataSourceDirectory::findVectorResultInfo | ( | const Str & | resultIdString | ) | const |
Returns the result info for the vector result that has an id string equal to resultIdString.
If not found, will return an ResultInfo object with id == -1
size_t cee::ug::DataSourceDirectory::geometryCountPerState | ( | ) | const |
Returns the number of geometries per state.
bool cee::ug::DataSourceDirectory::hasDisplacementResult | ( | int | stateId, |
int | resultId | ||
) | const |
Returns true if the displacement result resultId exists for the given state stateId.
bool cee::ug::DataSourceDirectory::hasResult | ( | int | stateId, |
ResultInfo | info | ||
) | const |
Returns true if the given result exists for the given state stateId.
bool cee::ug::DataSourceDirectory::hasScalarResult | ( | int | stateId, |
int | resultId | ||
) | const |
Returns true if the scalar result resultId exists for the given state stateId.
bool cee::ug::DataSourceDirectory::hasSymmetricTensorResult | ( | int | stateId, |
int | resultId | ||
) | const |
Returns true if the symmetric tensor result resultId exists for the given state stateId.
bool cee::ug::DataSourceDirectory::hasVectorResult | ( | int | stateId, |
int | resultId | ||
) | const |
Returns true if the vector result resultId exists for the given state stateId.
std::vector< PartInfo > cee::ug::DataSourceDirectory::partInfos | ( | size_t | globalGeometryIndex | ) | const |
Returns an array of part info (PartInfo) from metadata.
void cee::ug::DataSourceDirectory::removeAllDisplacementResultInfos | ( | ) |
Removes all displacement result infos.
void cee::ug::DataSourceDirectory::removeAllPartInfos | ( | size_t | globalGeometryIndex | ) |
Removes all part infos.
void cee::ug::DataSourceDirectory::removeAllResultInfos | ( | ResultType | resultType | ) |
Removes all result infos of the given type.
void cee::ug::DataSourceDirectory::removeAllScalarResultInfos | ( | ) |
Removes all scalar result infos.
void cee::ug::DataSourceDirectory::removeAllSetInfos | ( | ) |
Removes all set infos.
void cee::ug::DataSourceDirectory::removeAllStateGroupInfos | ( | ) |
Removes all state info groups.
void cee::ug::DataSourceDirectory::removeAllStateInfos | ( | ) |
Removes all state infos.
void cee::ug::DataSourceDirectory::removeAllSymmetricTensorResultInfos | ( | ) |
Remove all symmetric tensor results from the directory.
void cee::ug::DataSourceDirectory::removeAllVectorResultInfos | ( | ) |
Removes all vector result infos.
void cee::ug::DataSourceDirectory::removeCustomResultInfo | ( | ResultInfo | resultInfo | ) |
Removes a custom result info.
void cee::ug::DataSourceDirectory::removeSetInfo | ( | int | setId | ) |
Removes set info with given id.
std::vector< ResultInfo > cee::ug::DataSourceDirectory::resultInfos | ( | ResultType | resultType | ) | const |
Returns all the results of a given type.
std::vector< Str > cee::ug::DataSourceDirectory::resultNatures | ( | ResultType | resultType | ) | const |
Returns a vector of unique result natures found for the given resultType.
std::vector< ResultInfo > cee::ug::DataSourceDirectory::scalarResultInfos | ( | ) | const |
Returns an array of scalar result info (ResultInfo) from metadata.
std::vector< SectionCategoryInfo > cee::ug::DataSourceDirectory::sectionCategoryInfos | ( | ) | const |
Returns an array of section category infos from the Data Source Directory.
std::vector< SectionGroupInfo > cee::ug::DataSourceDirectory::sectionGroupInfos | ( | ) | const |
Returns an array of reference section infos from the Data Source Directory.
std::vector< SectionInfo > cee::ug::DataSourceDirectory::sectionInfos | ( | ) | const |
Returns an array of section infos from the Data Source Directory.
void cee::ug::DataSourceDirectory::setCustomResultInfo | ( | ResultInfo | resultInfo | ) |
Sets custom result info.
void cee::ug::DataSourceDirectory::setDisplacementResultInfo | ( | ResultInfo | resultInfo | ) |
Updates/adds displacement result info.
Sets or adds depending on the id of the result info.
If the id of resultInfo already exists in the displacement result info array, the corresponding result info will be updated. Otherwise, a new result info will be added.
std::vector< SetInfo > cee::ug::DataSourceDirectory::setInfos | ( | ) | const |
Returns an array of sets from metadata.
void cee::ug::DataSourceDirectory::setPartInfo | ( | size_t | globalGeometryIndex, |
PartInfo | partInfo | ||
) |
Updates/adds part info.
Sets or adds depending on the id of the part info.
If the id of partInfo for the geometry given by globalGeometryIndex already exists in the part info array, the corresponding part info will be updated. Otherwise, a new part info will be added.
void cee::ug::DataSourceDirectory::setResultInfo | ( | ResultInfo | resultInfo | ) |
Updates/adds a result info to the list of the result infos of the same type.
Sets or adds depending on the id of the result info. This is the preferred way to add a result info. Type-specific methods setScalarResultInfo(), setVectorResultInfo(), .. are deprecated.
If the id of resultInfo already exists in the info array of the same type, the corresponding result info will be updated. Otherwise, a new result info will be added.
void cee::ug::DataSourceDirectory::setScalarResultInfo | ( | ResultInfo | resultInfo | ) |
Updates/adds scalar result info.
Sets or adds depending on the id of the result info.
If the id of resultInfo already exists in the scalar result info array, the corresponding result info will be updated. Otherwise, a new result info will be added.
void cee::ug::DataSourceDirectory::setSetInfo | ( | SetInfo | setInfo | ) |
Updates/adds set info.
Sets or adds depending on the id of the set info.
If the id of setInfo exists in the set info array, the corresponding set info will be updated. Otherwise, a new set info will be added.
void cee::ug::DataSourceDirectory::setStateGroupInfo | ( | StateGroupInfo | info | ) |
Sets or adds the given group info. Assumes group's states are valid ones.
void cee::ug::DataSourceDirectory::setStateInfo | ( | StateInfo | info | ) |
Updates/adds state info.
Sets or adds depending on the id of the state info.
If the id of info already exists in the state info array, the corresponding state info will be updated. Otherwise, a new state info will be added.
void cee::ug::DataSourceDirectory::setSymmetricTensorResultInfo | ( | ResultInfo | resultInfo | ) |
Set the result info for the given symmetric tensor result.
void cee::ug::DataSourceDirectory::setTransformationResult | ( | bool | hasTransformationResult | ) |
Sets a transformation result.
void cee::ug::DataSourceDirectory::setVectorResultInfo | ( | ResultInfo | resultInfo | ) |
Updates/adds vector result info.
Sets or adds depending on the id of the result info.
If the id of resultInfo already exists in the vector result info array, the corresponding result info will be updated. Otherwise, a new result info will be added.
void cee::ug::DataSourceDirectory::setVisibilityResult | ( | bool | hasVisibilityResult | ) |
Sets a visibility result.
SimulationInfo cee::ug::DataSourceDirectory::simulationInfo | ( | ) | const |
Returns the ModelInfo of the DataSource.
std::vector< StateGroupInfo > cee::ug::DataSourceDirectory::stateGroupInfos | ( | ) | const |
Returns an array of state group info from the Data Source Directory.
std::vector< StateInfo > cee::ug::DataSourceDirectory::stateInfos | ( | ) | const |
Returns an array of state info from the Data Source Directory.
std::vector< ResultInfo > cee::ug::DataSourceDirectory::symmetricTensorResultInfos | ( | ) | const |
Returns an array of the available symmetric tensor result info (ResultInfo) in the data source.
bool cee::ug::DataSourceDirectory::transformationResult | ( | ) | const |
Returns true if a transformation result exists.
std::vector< StateInfo > cee::ug::DataSourceDirectory::ungroupedStateInfos | ( | ) | const |
Returns the state infos that are not in any state group from the Data Source Directory.
std::vector< ResultInfo > cee::ug::DataSourceDirectory::vectorResultInfos | ( | ) | const |
Returns an array of vector result info (ResultInfo) from metadata.
bool cee::ug::DataSourceDirectory::visibilityResult | ( | ) | const |
Returns true if a visibility result exists.