Visualization

Visualization in Open CASCADE is based on the separation of modeling data you want to display and select, and on the graphical presentation of that data structure.

For visualizing data structures, Open CASCADE provides ready-to-use algorithms, which create graphic presentations from geometric models. These data structures may be used with the viewers supplied, and can be customized to take the specificity of your application into account.

Displaying is managed through presentation services, and selection in its turn is managed through selection services. With these services, data structures and algorithms are provided to display objects of an application, and to support graphical selection of these objects.

Application Interactive Services (AIS) are provided to manage displaying, detection and selection of graphical presentations.

These services associate data structures and interactive objects.

## Services Common to 2D and 3D

This library provides graphic data structures common to both 2D and 3D and processed by the 2D and 3D viewers respectively.

### 3D Graphics

3D Graphics supports three-dimensional manipulation of graphic primitives such as polylines, planar polygons with or without holes, text, and markers by controlling attributes such as color, transparency, reflection, line type, line width, and text font. These primitives can be displayed, zoomed, panned and rotated in a 3D viewer.

3D Graphics runs on OpenGL graphic library for all platforms.

### 2D Graphics

2D Graphics supports two-dimensional manipulation of graphic primitives such as straight lines, segments, polylines, curves, text, and markers by controlling attributes such as color, line type, line width, and text font. These primitives can be displayed, zoomed, panned, and rotated in a 2D viewer.

Plotter output is provided in PostScript, HPGL2, and CGM. Importation of bitmap images from xwd, gif, and bmp format is also supported.

Note that in 2D, Open CASCADE provides full internationalization. Text in Chinese and Japanese characters can be input and printed in plotter output.

## 3D Visualization

This library provides services for:

- Selection of 3D data structures

- Presentation of 3D data structures

Access to 3D presentation and selection is provided through AIS (Application Interactive Services). This package is a high-level interface that offers access to the lower-level presentation and selection services. AIS expand this underlying functionality with standard 3D selection attributes, presentation management, and standard 3D presentation attributes, and manages it in the definition of GUI viewers. To implement these services, AIS package includes the following:

- Interactive context

- Interactive objects

- A graphic attributes manager

- Selection filters

## The Interactive Context

The interactive context pilots 3D visualizations and selections. The interactive context allows you to manage, in a transparent way, graphic and "selectable" behavior of interactive objects which is not yet defined in the predefined types of these objects.

AIS have two operating context types. The default neutral point type allows you to easily visualize and select entire interactive objects, which have been loaded into the context. Opening a local context allows you to prepare and use a temporary selection environment to select a part of an interactive object.

### Interactive Objects

Entities which are visualized and selected in the AIS viewer are objects. They connect the underlying reference geometry of a model to its graphic representation in AIS. You can use Open CASCADE predefined classes of standard interactive objects for which all necessary functions have already been programmed, or, in case you are an advanced user, you can implement your own classes of interactive objects.

### Graphic Attributes Manager

Graphic attributes manager, or AIS Drawer, stores graphic attributes for specific interactive objects and for interactive objects controlled by interactive context.

Initially, all drawer’s attributes are filled out with the predefined values which will define the default 3D object appearance.

When an interactive object is visualized, the required graphic attributes are first taken from its own drawer if one exists, or from the context drawer if no specific drawer for that type of object exists.

### Selection Filters

An important aspect in selection is the filtering of entities you to select. Selection filters allow you to refine the dynamic detection context, which you want to put into effect. Some of these filters can be used at the Neutral Point, others in an open local context only. You can also program your own filters and load them into the context.

## 2D Visualization

This library provides services for:

- Presentation of 2D data structures

- Selection of 2D data structures

2D presentation is handled by presentation algorithms, which compute and display a graphic data structure from a shape. You can also write your own presentation algorithms. In Open CASCADE, display services are separated from the data they represent. This separation allows you to modify a geometric or topological model without modifying the services by means of which it is displayed.

The concept of selection consists in defining 2D bounding boxes capable to return an owner of any object presentation found within them. When an owner is found, presentation of a shape is highlighted according to display attributes for the shapes of that type. 2D selection is supported by an internal algorithm which allows selection of an object when the mouse cursor is positioned on that object.