This example shows how to load a data source from a VTF file and set up the model specification.
This data source contains multiple states, scalar results, vector results and a displacement result. After opening the file, the available metadata can be queried through the data source directory. In this example you will set up the model specification to show the following:
- Set the last state id as current
- Set the first scalar result as fringes on the model
- Set the first vector result
- Set the first displacement result
Remember to toggle on result visibility in each part's PartSettings.
cee::Str vtfxFile = TutorialUtils::testDataDir() +
"contact.vtfx";
if (!source->
open(vtfxFile))
{
return;
}
if (stateInfos.size() > 0)
{
int lastStateId = stateInfos[stateInfos.size() - 1].id();
}
if (scalarResultInfos.size() > 0)
{
int scalarId = scalarResultInfos[0].id();
}
if (vectorResultInfos.size() > 0)
{
int vectorId = vectorResultInfos[0].id();
}
if (dispResultInfos.size() > 0)
{
int dispId = dispResultInfos[0].id();
}
while (it.hasNext())
{
}