> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SceneManager Class Reference

Part of [Graphics](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/group__graphics)

A manager class for 3D visualization of a structure.

## Public Types

| Type | Name |
| - | - |
| typedef std::list\< SceneListener \* > | [SceneListenerList](#aa3b0cd6ed770783df3ac9e302f5a0bfd) a list of |

## Public Member Functions

| Type | Name |
| - | - |
| | **activateElementValues** () |
| | **activateNodeValues** () |
| virtual [Scene](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_scene.md) | [activeScene](#a933ec67b1fb48fbae1b7297f14b83377) () |
| virtual [Scene](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_scene.md) | [activeSceneRef](#a922a65077df578203d04cb2ae0a92629) () |
| virtual | [addScene](#a428fd66163cef3883e58a2f41515a6c3) () Destructor. |
| | [clearSelection](#af4118d97778d34921f99be164489e7fe) () clearSelection unselect all nodes and elements in active scene. Does *not* perform an automatic redraw |
| | [eraseScene](#a5bc15e60767959409f53ae11ef620037) (number index) deletes a scene |
| | [eraseScenes](#a2c7b5615ec035363f860fa1f84060db9) (bool all=false) deletes all scenes |
| | [exportTNG](#a8dbe08127b637b3781091ce9adb23f36) (string [file](#a6d539fe45f6c81c7836e1f7295a25f02)) export scene data to slangTNG |
|  virtual | **extractMaximumScalarsFromSelectedElements** (bool, string user\_ident="") |
|  virtual | **extractMaximumScalarsFromSelectedNodes** (bool, string user\_ident="") |
|  virtual | **extractMinimumScalarsFromSelectedElements** (bool, string user\_ident="") |
|  virtual | **extractMinimumScalarsFromSelectedNodes** (bool, string user\_ident="") |
|  virtual | **extractScalarsFromSelectedElements** (bool) |
|  virtual | **extractScalarsFromSelectedNodes** (bool) |
| | [file](#a6d539fe45f6c81c7836e1f7295a25f02) (string filename) : Render the scene into a QImage |
| | **file** (string filename, number width, number height) |
| | [fit](#a6230c0a8c1d31cf921984317cbfa3aef) () Adjust scaling such that the entire structure fills the viewport when viewed from current angle. |
| virtual | [font](#a0c20b047e7c89c25e95ad212000a64d0) (QFont font) |
| int | [getActiveScene](#a72091f1f477aadf12ed7d72655d199dd) () |
| bool | [getAutoRedraw](#a3be486d81152d068143907738a8a06d7) () getAutoRedraw set automatic redraw mode |
|  bool | **getHiliteReferenceSet** () |
|  float | **getIsoSurfaceAlpha** () |
| virtual | [getPaletteRange](#ae98294e22da1a4dca1f23c41e15e6323) (number xmin, number xmax) Gets minimum and maximum values of palette. |
| | [getPan](#a7294b1b8f2ec69622fa1fad124726c55) (float x, float y) get the current pan values |
| | [getRotation](#a049f870422441eb05361fdd93df44c7f) (float angle, float x, float y, float z) get current rotation expressed in angle/axis form |
|  std::vector\< boost::shared\_ptr\< graphics::Scene > > | **getScenes** () |
|  float | **getStructureAlpha** () |
| | [getValueRange](#a8e935e225e0809604a0a816f333a0b33) (number xmin, number xmax) Gets minimum and maximum data values. |
| [Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) | [getVisibleCoordinates](#a7521972598ce04727dbf806ac7c4db83) () get coordinates of all vertices in the active scene |
| [Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) | [getVisibleTetCoordinates](#a47cbe0cbeac174b3ccfb1913fdf8ef30) () get coordinates of all tet vertices in the active scene |
| float | [getZoom](#ad59a25d25ca854989abdc81ce4c80f4b) () get current zoom factor |
| | [initSlice](#acd1504f6a3c038cffa4b004b7f794227) () Defines a slicing plane in the active scene, using the body coordinate system. The plane will be defined in Hessian normal form Only points with coordinates satisfying \$ax+by+cz+d > 0\$ are shown, the rest is suppressed. |
| bool | [isElementSelected](#a1da585eaeeb198d66ced3699565766b0) (number part\_idx, number element\_idx) isSelected |
| bool | [isGraphicsEnabled](#a0ee825f116bbe7229ede8d3e7767a97c) () |
| bool | [isGraphicsSlicingEnabled](#a18f3e9cc303d84ff6e1dfaa97bbb3883) () |
| bool | [isNodeSelected](#a7f215b949d6a778e50221c39393b2012) (number part\_idx, number node\_idx) isSelected |
| virtual std::vector\< string > | [listPaletteIDs](#a6e29794f75e21d9ed039a2403e5001ba) () Returns an order list of all known palette IDs including user defined ones. |
| | [redraw](#a7b9533aaa4a00f783a8f9cf1a381a63f) (bool sync) redraw the active scene |
| | [removeSlice](#a05abf562d065b7fd4657ade1385c8bca) () Removes the slicing plane of the active scene. |
| virtual string | [rendererInfo](#a17f23ce554308def6e946547e508dffa) () get the graphics renderer information creates its own openGL context locally, to call glGetString() |
| | [resetScene](#a2aa40a8e8e57d456d3e854172dd4f638) () applies an empty data set to the active scene (resetting it to structure plot) |
| | [scale](#aca4663e4ad297095c1c427dd138660f1) () Adjust scaling such that the entire structure fits into the viewport when viewed from any angle. |
| | [SceneManager](#a8d414be8137b229943717d955417ee80) (boost::shared\_ptr\< [Structure](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_structure) > dataBase, bool is\_graphics\_enabled=true) Initializes the manager and adds a first scene provided that the database has a reference mesh defined. Adds a first scene without any data -> calls addSene only. |
| [Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) | [selectedElementIndices](#af88c8a0e67db1ff2f23a38fde8e9e597) () |
| [Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) | [selectedNodeIndices](#ac5c0f9ec57947a75d8bafb6ce38d714a) () |
| | [selectElement](#a13c05f539b55985fe980d610883c4204) (number part\_idx, number element\_idx, number value, bool showLabel) select a single element in the active scene. Does *not* perform an automatic redraw |
| | [selectElements](#a39a643132d27da3b0e945c39cbe9032f) ([Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) indices) selects the given elements |
| | [selectMaximumValues](#aa4470f2f7d3ce20580e120701c73455d) (bool add\_selection, number max\_selectable) Selects max\_selectable largest data values of the active quantity among the whole FEM structure in the active scene. |
| | [selectMinimumValues](#a1bb71f2499c19c102156a39251cc0cf6) (bool add\_selection, number max\_selectable) Selects max\_selectable smallest data values of the active quantity among the whole FEM structure in the active scene. |
| | [selectNode](#a6e8979693f41ceec0214a046462a9ce5) (number part\_idx, number node\_idx, number value, bool showLabel) select a single node in the active scene. Does *not* perform an automatic redraw |
| | [selectNodes](#aed8d90a34a77ddb389d3c0547f7a6ab4) ([Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) indices) selects the given nodes |
| | [selectRelativeMaximumValues](#abb6b0894e25b4846b6bb167fd8c8cbe9) (bool add\_selection, number max\_selectable) Calls selectRelativeMaximumValuesWeak(...). Selects max\_selectable local maxima data values of the active quantity among the whole FEM structure in the active scene. |
| | [selectRelativeMaximumValuesStrict](#abd0a4a8d15e51aba759442af8807d2d6) (bool add\_selection, number max\_selectable) Selects max\_selectable local maxima data values of the active quantity among the whole FEM structure in the active scene Will only select nodes with all adjacent nodes having a SMALLER value. |
| | [selectRelativeMaximumValuesWeak](#a84e32eaaa46f6688f1461bf9e878b7c9) (bool add\_selection, number max\_selectable) Selects max\_selectable local maxima data values of the active quantity among the whole FEM structure in the active scene Will only select nodes with all adjacent nodes having a SMALLER OR EQUAL value. |
| | [selectRelativeMinimumValues](#af2818b2141eff95a92a5d345c3257cd1) (bool add\_selection, number max\_selectable) Calls selectRelativeMinimumValuesWeak(...). Selects max\_selectable local minima data values of the active quantity among the whole FEM structure in the active scene. |
| | [selectRelativeMinimumValuesStrict](#a523346a0f096b9bfa3fc27406968669e) (bool add\_selection, number max\_selectable) Selects max\_selectable local minima data values of the active quantity among the whole FEM structure in the active scene Will only select nodes with all adjacent nodes having a LARGER value. |
| | [selectRelativeMinimumValuesWeak](#a951530ae2d67c5cd87143fb4f508b9cf) (bool add\_selection, number max\_selectable) Selects max\_selectable local minima data values of the active quantity among the whole FEM structure in the active scene Will only select nodes with all adjacent nodes having a LARGER OR EQUAL value. |
| | [setActiveScene](#a1adc14ebabf7a6325d3215a96401f416) (number act) sets the active scene |
| | [setAutoRedraw](#ab064f09e8186276ca42a6de586d74b08) (bool t) setAutoRedraw set automatic redraw mode if scene settings are changed |
| | [setBackgroundBottom](#a8f5c4c7e02c082ab691b83ca76d8864f) (unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha) sets the bottom background color |
| | [setBackgroundTop](#ad167abbd8b83b916d33c6326fb730bcf) (unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha) sets the top background color |
| | [setClipBorder](#a5306f657c8705eb5afba78f6c316dbc0) (float border) set clip border rotation |
| | [setContour](#a965bacc782aea88a5c88c25b029a12c0) (number c) set single contour of contour plot |
| | [setContourType](#a47a78c85c989e936b293e2b27e06e0f9) (string cont="") setContourType define the type of contour plot |
| | [setCoordinateAxes](#ac1a58ea7960696a8ab3214792da855f9) (bool value) enable/disable coordinate axes |
| | [setCoordinateAxesLabels](#ad0b92d97141bfb67678abdab74c2b71c) (string x, string y, string z) labels coordinate axes |
| | [setCoordinates](#a78df8d6138ceca808b158b803876d02c) ([Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) coordinates) set coordinates of all vertices in the active scene |
| | [setCoorSystemPosition](#abca1445f8e8c55da3b3a941e33b2204e) (string pos="") setCoorSystemPosition |
| | [setDefaultCamera](#a0dc13f75162097aa006e9e7ca1b9da0c) () set default rotation/zoom/pan |
| | [setDefaultRotation](#aa4e566a3269e050325441ec3432cd3e9) () set default rotation |
| | [setDrawMissing](#aa96e3d9273fb478c393a501b10cdf239) (string how) define how to draw missing data |
| | [setFont](#aab96c1acd4894f2b6824eae49d509c29) (string [font](#a0c20b047e7c89c25e95ad212000a64d0), number fontsize) Sets the font for all text to be shown in the active scene. |
| | [setGeometricScaling](#a20169cf871cd649f68c5902ae1e4dee9) (number scaling, [Structure](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_structure) [database](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/group__data#gaebcac3a2836ec9fdf2e47bd812994b6b)) defines the scaling factor for geometric variations |
| | [setGeometricScaling](#a2a73be253648821a91cde547abed1e90) (number scaling) defines the scaling factor for geometric variations |
| | [setGeometricStabilization](#acd205c533e72d4deeae4f01f37f8632a) (bool enable, [Structure](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_structure) [database](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/group__data#gaebcac3a2836ec9fdf2e47bd812994b6b)) enables/disables mesh smoothening for geometric imperfections |
| | [setGeometricStabilization](#ae68cd46cae4d65b27d838b926bad5c80) (bool enable) enables/disables mesh smoothening for geometric imperfections |
| bool | [setGraphicsEnabled](#af4df8b71d8dd4312ce50b9522d1a0018) (bool enabled) Enables or disables graphics. |
| bool | [setGraphicsSlicingEnabled](#ae8a0a20707a463170eeabec71c67a7ae) (bool enabled) Enables or disables slicing in graphics (only relevant for volume elements) |
| | **setHiliteReferenceSet** (bool t) |
| | **setIsoSurfaceAlpha** (float [a](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/group__tmath#ga7e205066f67b9e3fd4c8cbd5859e8da3)) |
| | [setLegend](#a9e873fbad1329e0aa1a69a1dbbab2e40) (string text) set the legend in the active scene |
| | [setLegendPosition](#a749425bc47b9519f6793ea39ed742977) (string pos="") setLegendPosition |
| | [setMarkPosition](#a8ebff0555f34aa724952f8e557e007ff) (string pos="") setMarkPosition |
| | [setMeshFeature](#ad249d4cef881e4001bcc8b739d39a791) (string feat) set mesh features to be drawn |
|  virtual | **setPaletteColoringType** (string palette\_id) |
| | [setPalettePosition](#aa72299ee8a9ddf9e63bd71e6fd5dfeb3) (string pos="") setPalettePosition |
| virtual | [setPaletteRange](#a8350ad1dfe00dc97436b59ec6e8ea7aa) (string how) Sets minimum and maximum values of palette according to the algorithm defined by how. |
| | [setPaletteRange](#a7b357edfd6bc9d2589a6dbf7ab1aca9a) (number xmin, number xmax) Sets minimum and maximum values of palette. |
| | [setPan](#a9d6ddc181b0e414cfef555aba6f7a3f2) (float x, float y) set the current pan values |
| | [setPerspective](#a7aef90b83a24d2a1ea4d8729afc3cfc5) (bool persp) enable/disable perspective view |
| | [setPointSize](#a6724f50b4207f54aefbc744ef88ec0fd) (float [size](#abcd703e220fe34c4ff8364626470876d)) set the size of points relative to model size |
| | [setRotation](#a6329128a3b6e90f61aa4f24f46e17ec7) (float angle, float x, float y, float z) set current rotation expressed in angle/axis form |
| | [setRulerVisibility](#a57a9674604deb1b4f375df06fa2e0d32) (bool on) changes visibility of the ruler |
| | [setScale](#aaf4097a4a24e5a2172be248d2841a42b) (float z) set scale factor |
| | [setSceneData](#a757e1eda9c70aeefe7764241ec59bde3) ([RenderData::DataType](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_render_data.md#ad8ed01ff3ff33333d8e19db4d2818bb6) type, string design, string quantity) a convenience function which assigns a constant contour plot to the active scene |
| | [setSceneData](#aee87ccb88f3fa68588c12cf08ac442c5) ([AllRenderData](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_all_render_data.md) render\_data) assigns the visible data to the active scene |
| | [setSceneData](#ae204a414ac9bcd86c4b0540daaf040f8) ([Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) inputs) changes the data of the input parameters for the currently set field data model and assigns them to the active scene |
| | [setSceneScaleRelative](#a6f7af4dba2de8ab52494d821a1b19361) (float x, float y, float z) set different scaling for all three axes |
| virtual | [setSelection](#a52834e727b628c3890cbfe5b3999c66e) (int scene\_widht, int scene\_height, int x, int y, int width, int height, bool add\_selection, number max\_selectable, bool show\_label) Selects all elements of the active [Scene](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_scene.md) within the rectangle defined by x, y, width and height given. |
| | **setShowInvisibleLabels** (bool t) |
| | [setSize](#a8345f253d0b6278e435c44f19b680083) (number w, number h) setSize Sets the size of the active scene |
| | [setSlice](#a7aad11ffebbfb0b66c12f0a01afa24e4) (float [a](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/group__tmath#ga7e205066f67b9e3fd4c8cbd5859e8da3), float b, float c, float d) Defines a slicing plane in the active scene, using the body coordinate system. The plane will be defined in Hessian normal form by normalizing the paramters $a$, $b$, $c$, and $d$ given Only points with coordinates satisfying \$ax+by+cz+d > 0\$ are shown, the rest is suppressed. |
| | **setStructureAlpha** (float [a](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/group__tmath#ga7e205066f67b9e3fd4c8cbd5859e8da3)) |
| | [setSyncCamera](#a554e660f534f1bab2328fff34ea5a40c) (bool sync) defines if the scenes are synchronized in camera positioning |
| | [setTetCoordinates](#af6da645e07e19e7656e98d7e1f10ee02) ([Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) coordinates) set coordinates of all tet vertices in the active scene |
| | [setZoom](#a7abac5cfa30e846fb03429bb4e40dc3c) (float z) set current zoom factor |
| number | [size](#abcd703e220fe34c4ff8364626470876d) () |
|  bool | [syncCamera](#ab88781e860a597acc837e09f80b6b853) () const returns if the camera settings are synchronized for all scenes |
| virtual | [syncCamera](#a36172b6f1300b9a30ef0b5ff77d71d3e) () Sets the camera and slicing settings of the active scene to all other scenes. |
|  virtual | [syncDeco](#a2b8247d234169d15cfec25a40874301a) () Sets the decoration settings of the current, active view to all other views. |
|  virtual | [syncPalette](#ae3a368c0d3a6251d2e4092ec18704250) () Sets the palette settings of the active scene to all other scenes. |
|  virtual | [syncSelection](#a14974ed767112ef9dc8dd85f22c35ef4) () Mirrors the selection of the current view to all other views. |

## Detailed Description

A manager class for 3D visualization of a structure.

The [SceneManager](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_scene_manager.md) contains a [Structure](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_structure), extracts the reference-mesh and adds it as a first scene via addScene. Since there is no data selected in the beginning, this will result in a structure-plot without contour or palette. After the first call of addSceneData(...) contour or palette are added.

Qt separation: This class contains no functionality relying on Qt classes. All methods using Qt classes are virtual and have no implementation, calling DYNARDO\_LOG\_WARN instead. Their implementation is done in SceneManagerQt, part of the sos\_qt\_extensions module. Class [SceneManager](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_scene_manager.md) is NO QObject, but SceneManagerQt is. Instances of [SceneManager](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_scene_manager.md) or SceneManagerQt are created with application\_makeSceneManager(), implemented in the sos\_qt\_extensions or sos\_noqt\_extensions module respectively.

## Member Typedef Documentation

### SceneListenerList

```cpp theme={null}
typedef std::list<SceneListener*> SceneListenerList
```

a list of

**See also**

SceneListener pointers

## Constructor & Destructor Documentation

### SceneManager()

```cpp theme={null}
SceneManager(
    boost::shared_ptr< Structure > dataBase,
    bool is_graphics_enabled = true
)
```

Initializes the manager and adds a first scene provided that the database has a reference mesh defined. Adds a first scene without any data -> calls addSene only.

**Parameters**

| Name | Description |
| - | - |
| dataBase | The database |
| is\_graphics\_enabled | if true then the graphics will be enabled, else disabled |

## Member Function Documentation

### activeScene()

```cpp theme={null}
virtual Scene activeScene()
```

`virtual`

**Returns**

a const-reference to the currently active scene

### activeSceneRef()

```cpp theme={null}
virtual Scene activeSceneRef()
```

`virtual`

**Returns**

a reference to the currently active scene

### addScene()

```cpp theme={null}
virtual addScene()
```

`virtual`

Destructor.

Adds a default scene to the scene manager

Initializes a new scene without any data and sets its index active. Sets the title to '[Structure](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_structure)' and generates a legend displaying some structure related information (i.e. mesh type, number of parts/elements/nodes, ...) only. Finally calls on all manager known listeners the ...AddScene method.

### eraseScene()

```cpp theme={null}
eraseScene(number index)
```

deletes a scene

**Parameters**

| Name | Description |
| - | - |
| index | the index of the scene to be deleted. |

### eraseScenes()

```cpp theme={null}
eraseScenes(bool all = false)
```

deletes all scenes

**Parameters**

| Name | Description |
| - | - |
| all | if true, then all scenes are deleted, if false: the structural scene (index 0) is kept. |

### exportTNG()

```cpp theme={null}
exportTNG(string file)
```

export scene data to slangTNG

**Parameters**

| Name | Description |
| - | - |
| output | file (txt) |

### file()

```cpp theme={null}
file(string filename)
```

: Render the scene into a QImage

**Returns**

a QImage : Render the scene into a file.

**Parameters**

| Name | Description |
| - | - |
| filename | File name. File type is determined by its extension (.png, .jpg, etc.) |

### font()

```cpp theme={null}
virtual font(QFont font)
```

`virtual`

**Returns**

a reference to the font for all text to be shown in the active scene

### getActiveScene()

```cpp theme={null}
int getActiveScene()
```

**Returns**

the index of the active scene

### getAutoRedraw()

```cpp theme={null}
bool getAutoRedraw()
```

getAutoRedraw set automatic redraw mode

**Returns**

automatic redraw mode

### getPaletteRange()

```cpp theme={null}
virtual getPaletteRange(
    number xmin,
    number xmax
)
```

`virtual`

Gets minimum and maximum values of palette.

**Parameters**

| Name | Description |
| - | - |
| xmin | minimum value of palette |
| xmax | maximum value of palette |

### getPan()

```cpp theme={null}
getPan(
    float x,
    float y
)
```

get the current pan values

**Parameters**

| Name | Description |
| - | - |
| x | x value of pan |
| y | y value of pan |

### getRotation()

```cpp theme={null}
getRotation(
    float angle,
    float x,
    float y,
    float z
)
```

get current rotation expressed in angle/axis form

**Parameters**

| Name | Description |
| - | - |
| angle | Angle of rotation |
| x | x-component of rotation axis |
| y | y-component of rotation axis |
| z | z-component of rotation axis |

### getValueRange()

```cpp theme={null}
getValueRange(
    number xmin,
    number xmax
)
```

Gets minimum and maximum data values.

**Parameters**

| Name | Description |
| - | - |
| xmin | minimum data value |
| xmax | maximum data value |

### getVisibleCoordinates()

```cpp theme={null}
Matrix getVisibleCoordinates()
```

get coordinates of all vertices in the active scene

**Returns**

[Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) containing the coordinates of size (3,n) in which n is the number of vertices

### getVisibleTetCoordinates()

```cpp theme={null}
Matrix getVisibleTetCoordinates()
```

get coordinates of all tet vertices in the active scene

**Returns**

[Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) containing the coordinates of size (3,n) in which n is the number of vertices

### getZoom()

```cpp theme={null}
float getZoom()
```

get current zoom factor

**Returns**

current zoom factor

### initSlice()

```cpp theme={null}
initSlice()
```

Defines a slicing plane in the active scene, using the body coordinate system. The plane will be defined in Hessian normal form Only points with coordinates satisfying \$ax+by+cz+d > 0\$ are shown, the rest is suppressed.

> [!NOTE]
>
> Refer to [Wolfram: Plane](http://mathworld.wolfram.com/Plane.html) for an explanation of the plane definition

### isElementSelected()

```cpp theme={null}
bool isElementSelected(
    number part_idx,
    number element_idx
)
```

isSelected

**Parameters**

| Name | Description |
| - | - |
| part\_idx | the index of the part in FEM kernel |
| element\_idx | the index of the element in part of the FEM kernel |

**Returns**

bool indicating if chosen element is selected

### isGraphicsEnabled()

```cpp theme={null}
bool isGraphicsEnabled()
```

**Returns**

The current graphics enabled state

### isGraphicsSlicingEnabled()

```cpp theme={null}
bool isGraphicsSlicingEnabled()
```

**Returns**

The current graphics slicing enabled state

### isNodeSelected()

```cpp theme={null}
bool isNodeSelected(
    number part_idx,
    number node_idx
)
```

isSelected

**Parameters**

| Name | Description |
| - | - |
| part\_idx | the index of the part in FEM kernel |
| node\_idx | the index of the node in part of the FEM kernel |

**Returns**

bool indicating if chosen node is selected

### listPaletteIDs()

```cpp theme={null}
virtual std::vector< string > listPaletteIDs()
```

`virtual`

Returns an order list of all known palette IDs including user defined ones.

**Returns**

A vector of alphabetical ordered strings listing all palettes known by m\_palette\_manager

### rendererInfo()

```cpp theme={null}
virtual string rendererInfo()
```

`virtual`

get the graphics renderer information creates its own openGL context locally, to call glGetString()

**Returns**

text formated to print in about dialog

### selectedElementIndices()

```cpp theme={null}
Matrix selectedElementIndices()
```

**Returns**

a vector of indices of all selected elements (if any). The indices refer to the active index mapper

### selectedNodeIndices()

```cpp theme={null}
Matrix selectedNodeIndices()
```

**Returns**

a vector of indices of all selected nodes (if any). The indices refer to the active index mapper

### selectElement()

```cpp theme={null}
selectElement(
    number part_idx,
    number element_idx,
    number value,
    bool showLabel
)
```

select a single element in the active scene. Does *not* perform an automatic redraw

**Parameters**

| Name | Description |
| - | - |
| part\_idx | the index of the part in FEM kernel |
| element\_idx | the index of the element in part of the FEM kernel |

### selectElements()

```cpp theme={null}
selectElements(Matrix indices)
```

selects the given elements

**Parameters**

| Name | Description |
| - | - |
| indices | the global indices (with respect to index mapper) of the elements to be selected |

### selectMaximumValues()

```cpp theme={null}
selectMaximumValues(
    bool add_selection,
    number max_selectable
)
```

Selects max\_selectable largest data values of the active quantity among the whole FEM structure in the active scene.

**Parameters**

| Name | Description |
| - | - |
| add\_selection | True if the selection should be added to previously selected data. False otherwise. |
| max\_selectable | Limits the maximum amount of automatically selected data on the structure. |

### selectMinimumValues()

```cpp theme={null}
selectMinimumValues(
    bool add_selection,
    number max_selectable
)
```

Selects max\_selectable smallest data values of the active quantity among the whole FEM structure in the active scene.

**Parameters**

| Name | Description |
| - | - |
| add\_selection | True if the selection should be added to previously selected data. False otherwise. |
| max\_selectable | Limits the maximum amount of automatically selected data on the structure. |

### selectNode()

```cpp theme={null}
selectNode(
    number part_idx,
    number node_idx,
    number value,
    bool showLabel
)
```

select a single node in the active scene. Does *not* perform an automatic redraw

**Parameters**

| Name | Description |
| - | - |
| part\_idx | the index of the part in FEM kernel |
| node\_idx | the index of the node in part of the FEM kernel |

### selectNodes()

```cpp theme={null}
selectNodes(Matrix indices)
```

selects the given nodes

**Parameters**

| Name | Description |
| - | - |
| indices | the global indices (with respect to index mapper) of the nodes to be selected |

### selectRelativeMaximumValues()

```cpp theme={null}
selectRelativeMaximumValues(
    bool add_selection,
    number max_selectable
)
```

Calls selectRelativeMaximumValuesWeak(...). Selects max\_selectable local maxima data values of the active quantity among the whole FEM structure in the active scene.

**Parameters**

| Name | Description |
| - | - |
| add\_selection | True if the selection should be added to previously selected data. False otherwise. |
| max\_selectable | Limits the maximum amount of automatically selected data on the structure. |

### selectRelativeMaximumValuesStrict()

```cpp theme={null}
selectRelativeMaximumValuesStrict(
    bool add_selection,
    number max_selectable
)
```

Selects max\_selectable local maxima data values of the active quantity among the whole FEM structure in the active scene Will only select nodes with all adjacent nodes having a SMALLER value.

**Parameters**

| Name | Description |
| - | - |
| add\_selection | True if the selection should be added to previously selected data. False otherwise. |
| max\_selectable | Limits the maximum amount of automatically selected data on the structure. |

### selectRelativeMaximumValuesWeak()

```cpp theme={null}
selectRelativeMaximumValuesWeak(
    bool add_selection,
    number max_selectable
)
```

Selects max\_selectable local maxima data values of the active quantity among the whole FEM structure in the active scene Will only select nodes with all adjacent nodes having a SMALLER OR EQUAL value.

**Parameters**

| Name | Description |
| - | - |
| add\_selection | True if the selection should be added to previously selected data. False otherwise. |
| max\_selectable | Limits the maximum amount of automatically selected data on the structure. |

### selectRelativeMinimumValues()

```cpp theme={null}
selectRelativeMinimumValues(
    bool add_selection,
    number max_selectable
)
```

Calls selectRelativeMinimumValuesWeak(...). Selects max\_selectable local minima data values of the active quantity among the whole FEM structure in the active scene.

**Parameters**

| Name | Description |
| - | - |
| add\_selection | True if the selection should be added to previously selected data. False otherwise. |
| max\_selectable | Limits the maximum amount of automatically selected data on the structure. |

### selectRelativeMinimumValuesStrict()

```cpp theme={null}
selectRelativeMinimumValuesStrict(
    bool add_selection,
    number max_selectable
)
```

Selects max\_selectable local minima data values of the active quantity among the whole FEM structure in the active scene Will only select nodes with all adjacent nodes having a LARGER value.

**Parameters**

| Name | Description |
| - | - |
| add\_selection | True if the selection should be added to previously selected data. False otherwise. |
| max\_selectable | Limits the maximum amount of automatically selected data on the structure. |

### selectRelativeMinimumValuesWeak()

```cpp theme={null}
selectRelativeMinimumValuesWeak(
    bool add_selection,
    number max_selectable
)
```

Selects max\_selectable local minima data values of the active quantity among the whole FEM structure in the active scene Will only select nodes with all adjacent nodes having a LARGER OR EQUAL value.

**Parameters**

| Name | Description |
| - | - |
| add\_selection | True if the selection should be added to previously selected data. False otherwise. |
| max\_selectable | Limits the maximum amount of automatically selected data on the structure. |

### setActiveScene()

```cpp theme={null}
setActiveScene(number act)
```

sets the active scene

**Parameters**

| Name | Description |
| - | - |
| act | the index of the scene to become active |

### setAutoRedraw()

```cpp theme={null}
setAutoRedraw(bool t)
```

setAutoRedraw set automatic redraw mode if scene settings are changed

**Parameters**

| Name | Description |
| - | - |
| t | bool defining if automatic redraw should be done |

### setBackgroundBottom()

```cpp theme={null}
setBackgroundBottom(
    unsigned char red,
    unsigned char green,
    unsigned char blue,
    unsigned char alpha
)
```

sets the bottom background color

**Parameters**

| Name | Description |
| - | - |
| red | red channel (0..255) in RGB color mode |
| green | green channel (0..255) in RGB color mode |
| blue | blue channel (0..255) in RGB color mode |
| alpha | alpha channel; 0 = transparent, 1 = opaque |

### setBackgroundTop()

```cpp theme={null}
setBackgroundTop(
    unsigned char red,
    unsigned char green,
    unsigned char blue,
    unsigned char alpha
)
```

sets the top background color

**Parameters**

| Name | Description |
| - | - |
| red | red channel (0..255) in RGB color mode |
| green | green channel (0..255) in RGB color mode |
| blue | blue channel (0..255) in RGB color mode |
| alpha | alpha channel; 0 = transparent, 1 = opaque |

### setContour()

```cpp theme={null}
setContour(number c)
```

set single contour of contour plot

**Parameters**

| Name | Description |
| - | - |
| c | number defining the |

### setContourType()

```cpp theme={null}
setContourType(string cont = "")
```

setContourType define the type of contour plot

**Parameters**

| Name | Description |
| - | - |
| cont | string defining the type of plot. Permissible values are "NONE", "LINE", and "SURFACE" |

### setCoordinateAxes()

```cpp theme={null}
setCoordinateAxes(bool value)
```

enable/disable coordinate axes

**Parameters**

| Name | Description |
| - | - |
| axes | bool defining if perspective is enabled |

### setCoordinateAxesLabels()

```cpp theme={null}
setCoordinateAxesLabels(
    string x,
    string y,
    string z
)
```

labels coordinate axes

**Parameters**

| Name | Description |
| - | - |
| x | string labels defining |
| y | string labels defining |
| z | string labels defining |

### setCoordinates()

```cpp theme={null}
setCoordinates(Matrix coordinates)
```

set coordinates of all vertices in the active scene

**Parameters**

| Name | Description |
| - | - |
| coordinates | [Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) containing the coordinates, must have size (3,n) in which n is the number of vertices |

### setCoorSystemPosition()

```cpp theme={null}
setCoorSystemPosition(string pos = "")
```

setCoorSystemPosition

**Parameters**

| Name | Description |
| - | - |
| pos | defines the position of the coordinate system, recognized values are "", "NE", "SE", "SW", and "NW" |

### setDrawMissing()

```cpp theme={null}
setDrawMissing(string how)
```

define how to draw missing data

**Parameters**

| Name | Description |
| - | - |
| draw | definition how to draw missing data |

### setFont()

```cpp theme={null}
setFont(
    string font,
    number fontsize
)
```

Sets the font for all text to be shown in the active scene.

**Parameters**

| Name | Description |
| - | - |
| font | the font name |
| fontsize | the size of the font in points |

### setGeometricScaling() \[1/2]

```cpp theme={null}
setGeometricScaling(
    number scaling,
    Structure database
)
```

defines the scaling factor for geometric variations

**Parameters**

| Name | Description |
| - | - |
| scaling | the scaling factor |
| database | the database with mesh |

### setGeometricScaling() \[2/2]

```cpp theme={null}
setGeometricScaling(number scaling)
```

defines the scaling factor for geometric variations

**Parameters**

| Name | Description |
| - | - |
| scaling | the scaling factor |

### setGeometricStabilization() \[1/2]

```cpp theme={null}
setGeometricStabilization(
    bool enable,
    Structure database
)
```

enables/disables mesh smoothening for geometric imperfections

**Parameters**

| Name | Description |
| - | - |
| enable | the enable state |
| database | the database with mesh |

### setGeometricStabilization() \[2/2]

```cpp theme={null}
setGeometricStabilization(bool enable)
```

enables/disables mesh smoothening for geometric imperfections

**Parameters**

| Name | Description |
| - | - |
| enable | the enable state |

### setGraphicsEnabled()

```cpp theme={null}
bool setGraphicsEnabled(bool enabled)
```

Enables or disables graphics.

**Parameters**

| Name | Description |
| - | - |
| enabled | if true then the graphics will be enabled, else disabled |

**Returns**

the previous state

> [!NOTE]
>
> This function can only be called if the database has no mesh.

> [!NOTE]
>
> The intention of this method is to reduce CPU time while loading FEM meshes in SIMULATION mode and other batch applications.

### setGraphicsSlicingEnabled()

```cpp theme={null}
bool setGraphicsSlicingEnabled(bool enabled)
```

Enables or disables slicing in graphics (only relevant for volume elements)

**Parameters**

| Name | Description |
| - | - |
| enabled | if true then the slicing will be enabled, else disabled |

**Returns**

the previous state

> [!NOTE]
>
> This function can only be called if the database has no mesh.

> [!NOTE]
>
> The intention of this method is to reduce CPU time while loading FEM meshes and speed up visualization.

### setLegend()

```cpp theme={null}
setLegend(string text)
```

set the legend in the active scene

**Parameters**

| Name | Description |
| - | - |
| text | defines the legend text (rich text coded as html) |

### setLegendPosition()

```cpp theme={null}
setLegendPosition(string pos = "")
```

setLegendPosition

**Parameters**

| Name | Description |
| - | - |
| pos | defines the position of the legend, recognized values are "", "NE", "SE", "SW", and "NW" |

### setMarkPosition()

```cpp theme={null}
setMarkPosition(string pos = "")
```

setMarkPosition

**Parameters**

| Name | Description |
| - | - |
| pos | defines the position of the watermark recognized values are "NE", "SE", "SW", and "NW" |

### setMeshFeature()

```cpp theme={null}
setMeshFeature(string feat)
```

set mesh features to be drawn

**Parameters**

| Name | Description |
| - | - |
| feat | describes the features. Admissible values are "ALL", "SURFACES", "OUTLINE" |

### setPalettePosition()

```cpp theme={null}
setPalettePosition(string pos = "")
```

setPalettePosition

**Parameters**

| Name | Description |
| - | - |
| pos | defines palette position, recognized values are "", "NE", "SE", "SW", and "NW" |

### setPaletteRange() \[1/2]

```cpp theme={null}
virtual setPaletteRange(string how)
```

`virtual`

Sets minimum and maximum values of palette according to the algorithm defined by how.

**Parameters**

| Name | Description |
| - | - |
| how | The string determining the algorithm for choosing the palette ranges. Accepted values are: - CURRENT - RANGE |

### setPaletteRange() \[2/2]

```cpp theme={null}
setPaletteRange(
    number xmin,
    number xmax
)
```

Sets minimum and maximum values of palette.

**Parameters**

| Name | Description |
| - | - |
| xmin | Minimum value of palette |
| xmax | Maximum value of palette |

### setPan()

```cpp theme={null}
setPan(
    float x,
    float y
)
```

set the current pan values

**Parameters**

| Name | Description |
| - | - |
| x | x value of pan |
| y | y value of pan |

### setPerspective()

```cpp theme={null}
setPerspective(bool persp)
```

enable/disable perspective view

**Parameters**

| Name | Description |
| - | - |
| persp | bool defining if perspective is enabled |

### setPointSize()

```cpp theme={null}
setPointSize(float size)
```

set the size of points relative to model size

**Parameters**

| Name | Description |
| - | - |
| size | the size of points |

### setRotation()

```cpp theme={null}
setRotation(
    float angle,
    float x,
    float y,
    float z
)
```

set current rotation expressed in angle/axis form

**Parameters**

| Name | Description |
| - | - |
| angle | Angle of rotation |
| x | x-component of rotation axis |
| y | y-component of rotation axis |
| z | z-component of rotation axis |

### setRulerVisibility()

```cpp theme={null}
setRulerVisibility(bool on)
```

changes visibility of the ruler

**Parameters**

| Name | Description |
| - | - |
| on | if true, the the ruler will be shown |

### setScale()

```cpp theme={null}
setScale(float z)
```

set scale factor

**Parameters**

| Name | Description |
| - | - |
| scale | factor |

### setSceneData() \[1/3]

```cpp theme={null}
setSceneData(
    RenderData::DataType type,
    string design,
    string quantity
)
```

a convenience function which assigns a constant contour plot to the active scene

**Parameters**

| Name | Description |
| - | - |
| type | data type |
| design | design ident |
| quantity | quantity ident |

### setSceneData() \[2/3]

```cpp theme={null}
setSceneData(AllRenderData render_data)
```

assigns the visible data to the active scene

**Parameters**

| Name | Description |
| - | - |
| render\_data | the definition of the data to be rendered |

### setSceneData() \[3/3]

```cpp theme={null}
setSceneData(Matrix inputs)
```

changes the data of the input parameters for the currently set field data model and assigns them to the active scene

**Parameters**

| Name | Description |
| - | - |
| inputs | the new values of the field data model. |

### setSelection()

```cpp theme={null}
virtual setSelection(
    int scene_widht,
    int scene_height,
    int x,
    int y,
    int width,
    int height,
    bool add_selection,
    number max_selectable,
    bool show_label
)
```

`virtual`

Selects all elements of the active [Scene](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_scene.md) within the rectangle defined by x, y, width and height given.

**Parameters**

| Name | Description |
| - | - |
| scene\_widht | The scene width the rectangle definition is based on. |
| scene\_height | The scene height the rectangle definition is based on. |
| x | The x coordinate of the top-left rectangle corner wihthin the scene given. |
| y | The y coordinate of the top-left rectangle corner wihthin the scene given. |
| width | The width of the rectangle corner. |
| height | The height of the rectangle corner. |
| add\_selection | True if the selection should be added to previously selected elements. False otherwise. |
| max\_selectable | Limits the maximum amount of automatically selected entities within the rectangle given. |
| show\_label | If set to true, selected items will be label. Otherwise selected items will be only highlighted by color |

### setSize()

```cpp theme={null}
setSize(
    number w,
    number h
)
```

setSize Sets the size of the active scene

**Parameters**

| Name | Description |
| - | - |
| w | new width of the scene |
| h | new height of the scene |

### setSlice()

```cpp theme={null}
setSlice(
    float a,
    float b,
    float c,
    float d
)
```

Defines a slicing plane in the active scene, using the body coordinate system. The plane will be defined in Hessian normal form by normalizing the paramters $a$, $b$, $c$, and $d$ given Only points with coordinates satisfying \$ax+by+cz+d > 0\$ are shown, the rest is suppressed.

**Parameters**

| Name | Description |
| - | - |
| a | coeffcient $a$ in the plane equation |
| b | coeffcient $b$ in the plane equation |
| c | coeffcient $c$ in the plane equation |
| d | coeffcient $d$ in the plane equation |

> [!NOTE]
>
> Refer to [Wolfram: Plane](http://mathworld.wolfram.com/Plane.html) for an explanation of the plane definition

### setSyncCamera()

```cpp theme={null}
setSyncCamera(bool sync)
```

defines if the scenes are synchronized in camera positioning

**Parameters**

| Name | Description |
| - | - |
| sync | if true then the camera settings apply to all scenes, else only to the active scene |

### setTetCoordinates()

```cpp theme={null}
setTetCoordinates(Matrix coordinates)
```

set coordinates of all tet vertices in the active scene

**Parameters**

| Name | Description |
| - | - |
| coordinates | [Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) containing the coordinates, must have size (3,n) in which n is the number of vertices |

### setZoom()

```cpp theme={null}
setZoom(float z)
```

set current zoom factor

**Parameters**

| Name | Description |
| - | - |
| current | zoom factor |

### size()

```cpp theme={null}
number size()
```

**Returns**

the number of scenes

### syncCamera()

```cpp theme={null}
virtual syncCamera()
```

`virtual`

Sets the camera and slicing settings of the active scene to all other scenes.

> [!NOTE]
>
> An empty slicing plane means that the slicing plane shall be removed
