This tutorial shows how to create a data source by loading a VTFx file and drawing the models bounding box as a markup model.
After the unstructured grid model read from file is set up in the view, you can get the bounding box for this model with cee::vis::View::boundingBox(). Use the values from this bounding box to make a markup model for drawing a bounding box around the read model.
Load the file and setup the model specification to show the result. For a more thorough explanation on creating a data source from a file interface and setup the model specification, see the Load VFT tutorial: UnstructGrid: Load model from file and set up model specification
Create the model and a VTFx file interface data source. Open the file and set the created data source in the model.
Set the first state as current.
Set the first state as current in the model specification.
The model is ready to use and can be added to the view. Exactly where the view exists depends on the platform and solution. These examples uses Qt and the view is set up in a cee::qt::ViewerWidget.
Create the markup model object.
Get the bounding box from the view and get all vertices in the box.
Add all the lines of the bounding box to the model.
Add the markup model to the view
Update the view.