Mesh Visualization Services

MeshVS (Mesh Visualization Service) component extends 3D visualization capabilities of Open CASCADE Technology. It provides flexible means of displaying meshes along with associated pre- and post-processor data.

From a developer's point of view, it is easy to integrate the MeshVS component into any mesh-related application with the help of the following guidelines:

1. Derive a data source class from the MeshVS_DataSource class. Re-implement its virtual methods, so as to give the MeshVS component access to the application data model. This is the most important part of the job, since visualization performance is affected by performance of data retrieval methods of your data source class.

2. Create an instance of the MeshVS_Mesh class.

3. Create an instance of your data source class and pass it to a MeshVS_Mesh object through the SetDataSource() method.

4. Create one or several objects of MeshVS_PrsBuilder-derived classes (either standard, included in the MeshVS package, or your custom ones). Each PrsBuilder is responsible for drawing a MeshVS_Mesh presentation in certain display mode(s) specified as a PrsBuilder constructor's argument. Display mode is treated by MeshVS classes as a combination of bit flags (two least significant bits are used to encode standard display modes: wireframe, shading and shrink). Pass these objects to the MeshVS_Mesh::AddBuilder() method. MeshVS_Mesh takes advantage of improved selection highlighting mechanism: it highlights its selected entities itself, with the help of so called "highlighter" object. You can set one of PrsBuilder objects to act as a highlighter with the help of a corresponding argument of the AddBuilder() method.

5. Visual attributes of the MeshVS_Mesh object (such as shading color, shrink coefficient and so on) are controlled through MeshVS_Drawer object. It maintains a map "Attribute ID --> attribute value" and can be easily extended with any number of custom attributes.

In all other respects, MeshVS_Mesh is very similar to any other AIS_InteractiveObject-derived class, and it should be used accordingly (refer to the description of AIS package in the documentation).