> ## 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.

# Scene Class Reference

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

A class for 3D visualization of a structure Additionally, it can display palettes and text annotations as well as rich text labels. Internally, a representation in terms of triangles only is used. 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 SceneQt, part of the sos\_qt\_extensions module. Class [Scene](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_scene.md) is NO QObject, but SceneQt is. Instances of [Scene](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_scene.md) or SceneQt are created with application\_makeScene(), implemented in the sos\_qt\_extensions or sos\_noqt\_extensions module respectively.

## Public Types

| Type | Name |
| - | - |
| enum | **contourType** \{ **noContourPlot** = 0, **lineContourPlot**, **surfaceContourPlot**, **singleSurfaceContourPlot** } |

## Public Member Functions

| Type | Name |
| - | - |
| | [addVal2String](#a0c458cbcacccfd574f0c16bf306390fc) (float value, string the\_string) adds a value pair to the container storing information on mapping discrete number values into strings |
| | [clearVal2String](#a22aa99b9fa77bbba1697b4d8e56feb17) () clears the container storing information on mapping discrete number values into strings |
|  unsigned char \* | **getContourColors** () |
|  char \* | **getContourNormals** () |
|  short \* | **getContourVertices** () |
|  bool | [getDrawToFile](#a4b2761818729165f8534f1c03e701b8a) () get info if drawing to file |
|  bool | **getHiliteReferenceSet** () |
|  int | **getNumContours** () |
|  int | **getNumOutlines** () |
|  virtual int | **getNumSelectedVertices** () |
|  int | **getNumSlices** () |
|  int | **getNumTriangles** () |
|  short \* | **getOutlineVertices** () |
|  int | [getScaleDeco](#a93663a88ad977ec4a59b397251464e94) () get scale factor for deco elements |
|  virtual unsigned char \* | **getSelectedColors** () |
|  virtual char \* | **getSelectedNormals** () |
|  short \* | **getSelectedVertices** () |
|  unsigned char \* | **getSliceColors** () |
|  char \* | **getSliceNormals** () |
|  short \* | **getSliceVertices** () |
|  unsigned char \* | **getTriangleColors** () |
|  char \* | **getTriangleNormals** () |
|  short \* | **getTriangleVertices** () |
|  number | **getVBO\_ID** (boost::uint32\_t i) |
|  MatrixXhf | **getZBuffer** () |
|  bool | **hasVBO** () |
| | [setDrawToFile](#a76ba769d6afb6a1ada0f0663afd082dc) (bool b) set info if drawing to file |
| | **setHiliteReferenceSet** (bool t) |
| | [setScaleDeco](#a9cdb03542df7b59c4c5ae61a6a5a28a9) (int scale) set scale factor for deco elements |
| | **setZBuffer** (MatrixXhf buf) |
| | [Scene](#a44b8695185991dcda6a8d707f6342f70) (graphics::VerticesNormalsVisibility vnv, [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)) Constructor, requires the description of the structure in terms of a [VerticesNormalsVisibility](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/struct_vertices_normals_visibility.md) object. Initializes some defaults. |
| | **setShading** (bool t) |
|  bool | **getShading** () |
| | **SetTitle** (string title) |
|  string | **GetTitle** () |
| [dataobject\_types](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/group__data#ga1bebf1e22deb3cd41d7d99ddcdb15379) | **getDataType** () |
| [DataObjectKey](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_data_object_key.md) | **getDataIdent** () |
|  bool | **hasData** () |
|  bool | **hasNodeData** () |
| virtual | [databaseImage](#aedfcd60db2f81881828ddf066c08f2a4) (std::vector\< char > vec, int image\_resolution\_x, int image\_resolution\_y) Get the small mesh image to save with the database header, without Qt: returns empty image! |

### Control OpenGL

| Type | Name |
| - | - |
| | [setUninitializedGL](#a19cf736ac5a3d9c598653deaf643a1ba) () Tells the [Scene](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_scene.md) that its associated GL context needs to reload all Vertex Buffer Objects (VBOs) |
|  bool | **initializedGL** () |
| virtual | [Prepare](#a06d769b7b9a4271a48eb4774da7d82c8) () Clears all OpenGL Vertex Buffers first and re-initializes them afterwards. |
|  virtual | **UnPrepare** () |
| | **SetMode** (graphics::renderMode mode) |
|  graphics::renderMode | **GetMode** () |

### RENDER

| Type | Name |
| - | - |
|  float | **getStructureAlpha** () |
|  float | **getIsoSurfaceAlpha** () |
| | **setStructureAlpha** (float [a](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/group__tmath#ga7e205066f67b9e3fd4c8cbd5859e8da3)) |
| | **setIsoSurfaceAlpha** (float [a](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/group__tmath#ga7e205066f67b9e3fd4c8cbd5859e8da3)) |
| | **setClipBorder** (float border) |
|  float | **getClipBorder** () |
| | **setDrawOutline** (bool t) |
|  bool | **getDrawOutline** () |
| | **setDrawSurfaces** (bool t) |
|  bool | **getDrawSurfaces** () |
| | **setDrawWireframe** (bool t) |
|  bool | **getDrawWireframe** () |
|  bool | **getDrawEdges** () |
| | **setShowInvisibleLabels** (bool t) |
|  bool | **getShowInvisibleLabels** () |
| | **setNeedsUpdate** (bool t) |
|  bool | **getNeedsUpdate** () |
|  virtual | **RenderDeco** (number ww, number hh, QPainter m\_pt) |
|  virtual | **RenderCoorAxes** (number ww, number hh, QPainter m\_pt) |
| | [File](#ac12402e165f10a89aee0167f6d392564) (string filename) Renders the scene into a QImage of current size. |
| virtual | [File](#a5bd2e6ade908831beb8f828d9a5f2d4b) (string filename, int ww, int hh) Renders the contents of the scene to an image file of given size. |
| | [ActivateNodeValues](#a7ae6619ae28358041ab7261d57377bcb) () Render the scene into a QPaintDevice. |
| | **ActivateElementValues** () |
| | [AssignValues](#ac30a5c478071bddc29e58719b422171e) ([AllRenderData](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_all_render_data.md) p\_render\_data, [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), [SceneManager](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_scene_manager.md) \*scene\_manager) defines data to be rendered |
| virtual | [SetValues](#a19f2ead60d9392ab7ca45217412733e1) (Eigen::VectorXd inputs, [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), bool reset\_scene\_options, [SceneManager](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_scene_manager.md) \*scene\_manager) Assign values to the vertices of the structure which are then used for coloring. |
| | [SetGeometricStabilization](#a27c842466c304c3af705ef763e9d3227) (bool enable\_flag, [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), [SceneManager](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_scene_manager.md) \*scene\_manager) enables/disables mesh smoothening for gemetric imperfections |
| | [SetGeometricScaling](#a6b808aad5a0ae3633f3a8f7996fd54f4) (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), [SceneManager](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_scene_manager.md) \*scene\_manager) defines the scaling factor for geometric variations |
| | [recalculateAndApplyMorphedGeometry](#a5faf4e8d764eeca136784351140025cd) ([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)) recalculates mesh morphing and applies result to triangle geometry and unconnected points. |
| | [ClearMorphedCoordinates](#ad2371590e3c2ff4f94f97f63d6e263d9) () deletes all containers with morphed geometry forcing the system to use unmorphed geometry |
| graphics::VertexValues | [getValues](#af2dd43e7fcc9b0712604a7c65b8346b4) () Returns a reference to the original scene data. |
| | **OriginalElementValues** () |
| | **OriginalNodeValues** () |
| | [SetContourType](#a27b3a6ec5bcbe749801375a2b1db35e2) (graphics::Scene::contourType contourType) Set the type of contour to be shown. Can be none, line or surface type. |
| graphics::Scene::contourType | [GetContourType](#a1d561084bb7c615c3373c4403a164046) () GetContourType. |
| number | [getContourSize](#aad41fa1a2627ed00f1c0f139548772f8) () get numnber of contour levels |
| Eigen::VectorXf | [getContours](#aeac36bc4124c2674fcb3ecf2a783afab) () get contour levels |
| | [SetContours](#a3d16fb79739a2d07661a478102f3aa44) (number c) Set single contour level, keep current type. |
|  virtual | [SetContours](#ad62197df88c13e27549cb99635c33516) (graphics::Scene::contourType ct) Set contour levels as defined in the current palette. |

### font

| Type | Name |
| - | - |
| virtual | [SetFont](#addd456f71665ba4ffed7167e33b5e183) (string [font](#a0c20b047e7c89c25e95ad212000a64d0), number fontsize) Sets the font for all text to be shown in the scene. |
| virtual | [SetFont](#ababbd02caffc98e21bdd737de704e921) (QFont [font](#a0c20b047e7c89c25e95ad212000a64d0)) Sets the font for all text to be shown in the scene. |
| virtual | [font](#a0c20b047e7c89c25e95ad212000a64d0) (QFont font) |

### coloring

| Type | Name |
| - | - |
| | [SetBackground](#a5b89a1b148f14e71c185082060849d35) (unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha) Sets the first background color for the scene. |
| | [GetBackground](#a3eb860f4f2e9a8c1964064ba259beb82) (unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha) Gets the first background color for the scene. |
| | [SetBackground2](#a903ffdb01a728c442b01876f25d6dfba) (unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha) Sets the second background color for the scene. This defines a vertical color gradient together with the first background color. |
| | [GetBackground2](#a4254e5b8f8d3af416333fe1f7ba7cd90) (unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha) Gets the second background color for the scene. This defines a vertical color gradient together with the first background color. |
| | [RemoveBackgrounds](#a1dd9ff673aab54e78217089fc1517078) () Clears all background coloring. |
| virtual bool | [palettePercentageRange](#aab2df1ee76ffef04e39be521fe300522) () |
| virtual | [setPaletteType](#a45647fa73b7519f83aa151af826fdf77) (PaletteTypePtr [palette](#a181f4d63c649e319f7f6ac56a905554e)) Assign a color/value palette to the scene. Only one palette can be assigned. |
| virtual | [setPalettePosition](#aff517029b952bf157f2bf8bcc11a107e) (graphics::Position pos) Sets the position for the current palette. |
|  virtual | **setPaletteProperties** (PaletteSceneProperties prop) |
| virtual | [setPalettePercentageRange](#a64acf2cdfcf625cf407b9081f0410ce1) (bool percentage\_range=true) Sets a relative, percentage palette range. |
|  virtual | **setPaletteRange** (number xmin, number xmax) |
|  virtual | [removePalette](#a8df63a3e9d777471160a69e8e84baa06) () remove palette |
| virtual | [SetCoorAxesPosition](#a22c9ec48ade46ce4b5ac8ae2faca0c74) (graphics::Position pos) Sets the position for the coordinate axes. |
|  virtual graphics::Position | **GetCoorAxesPosition** () |
| virtual | [palette](#a181f4d63c649e319f7f6ac56a905554e) (Palette palette) Get current palette. |
|  virtual graphics::Position | **GetPalettePosition** () |
| virtual | [SetCoorSystemPosition](#aa14ba183af3e666e498c4e6c5fdbf3ae) (graphics::Position pos) Sets the position for the coordinate system. |
|  virtual graphics::Position | **GetCoorSystemPosition** () |
| virtual | [SetLegendPosition](#ae359d9f8147e0cfb7eb7565d2506348b) (graphics::Position pos) Sets the position for the legend. |
|  virtual graphics::Position | **GetLegendPosition** () |
| | [SetMarkPosition](#a2336f6b9901c23c398f9a29a7d031f41) (graphics::Position pos) Sets the position for the watermark. |
|  graphics::Position | **GetMarkPosition** () |
|  virtual | [SetRichLabel](#aaf4dfaefcc8bee887ae9b8018824c6d0) (RichLabel richlabel) Assign a rich text label to the scene. Only one rich text label can be assigned. |
| virtual | [GetRichLabel](#af87422e6ef851dcb428af7948c77d7e2) (RichLabel richlabel) GetRichLabel. |
|  virtual | **AddLabel** (float x, float y, float z, string text, bool alVis=false) |
|  virtual | **RemoveLabels** () |

### ruler

| Type | Name |
| - | - |
| | [setRuler](#a07454bde8fde4da8663bf1c11af4bfd2) (bool on) Sets visibility of ruler. |
| bool | [showRuler](#ae103953ef85891c75590ac14875409b8) () |

### VIEW

| Type | Name |
| - | - |
| | [setPerspective](#a7aef90b83a24d2a1ea4d8729afc3cfc5) (bool persp) |
| | [setCoordinateAxes](#a7c0815264ec971f6464513386bdf6245) (bool persp) |
| | [setCoordinateAxesLabels](#ad0b92d97141bfb67678abdab74c2b71c) (string x, string y, string z) |
|  bool | **getPerspective** () |
| bool | [getCoordinateAxes](#a5c2a32ef93b413945ed7fff804e1e76a) () |
| | [SetRotation](#aa129dfdc61a2fe7267b6c25b32009871) (float angle, float x, float y, float z) Resetting all rotatation information to its origin setting the new definition afterwards. |
| | [AddRotation](#a3188f4e6122602d4fe6379b9fdf99dd5) (float angle) Adds the given angle to the actual rotation The rotation axis is determined by GetRotation. |
| | [AddRotation](#a3ad20e2855d48cab373d7f054207f8cb) (float angle, float x, float y, float z) Adds the given angle to the actual rotation. |
| | [GetRotation](#acf7d622731c0777294b1ed09e7a610b5) (float angle, float x, float y, float z) get current rotation expressed in angle/axis form |
| | **RemoveRotations** () |
| | [SetPan](#ac7d59fffd8b830f1e34093328b47824c) (float x, float y) Set the current pan values in (pixel, coordinate system?) |
| | [AddPan](#abd72fcc9bd1a9d2defcb9f8f08a2bb14) (float x, float y) Moves the scene in x and y direction. |
| | [GetPan](#a67d1de4455103bb4997c22ba7a4c31eb) (float x, float y) get the current pan values |
| | [SetScale](#a10665bbab8fb55ce789916651c2656f4) (float z) Sets current length scale and zoom factor accordingly. |
|  float | [GetScale](#a68b37648d648187291cb2eee2001a725) () Gets current length scale and zoom factor accordingly, see [SetScale()](#a10665bbab8fb55ce789916651c2656f4) |
| | [SetZoom](#abc373e739b0f1a7a6e4ac8feff19f3c1) (float z) Sets current zoom factor. |
| | [AddZoom](#a2a8f15cdb6f9afa40bd41e056b18f288) (float x) AddZoom. |
| float | [GetZoom](#a3254afc12d576278d55c2d3d28f78189) () get current zoom factor |
|  float | **getScale** () const |
|  float | **getRealScale** () const |
| | [Autoscale](#a73a961c5973fd81d74b8dea9eaa4dca7) () Adjust scaling such that the entire structure is visible when be viewed from all angles. |
| | [Fit](#a1a33a471ea882fd9d56114b5b1c694f1) () Adjust scaling such that the entire structure fills the viewport when viewed from current angle. |
| Eigen::Vector3f | [mappedVector](#aaa30a3648e39044563841842c7e204ae) (Eigen::Vector3f orig) Maps actual position vector into view space (-32767 - 32767) |

### SLICING

| Type | Name |
| - | - |
| | [initSlice](#acd1504f6a3c038cffa4b004b7f794227) () Initializes a slicing plane in the half of the scene viewer widget in the viewing direction of the user Initializes a slicing plane in body coordinate system cutting through the half of the scene viewer widget. The normal vector is defined in the screen plane pointing in x-direction (from left to right) suppressing all body parts left to the slicing plane. |
| | [SetSlice](#acd45c2ddbf316f7650c7ff2817759d0c) (std::vector\< float > pt, std::vector\< float > dir) Defines a slicing plane in Hessian normal form in terms of a point and a direction vector. |
| | [SetSlice](#a38dd17334b3049e6973e3c90f373f970) (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 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. |
| bool | [isSliced](#aaa9bdea86739707baeafce9b104ebad5) () |
| | [getSlice](#a01f31efb33bd550d6e61d7698ecbefd5) (float [a](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/group__tmath#ga7e205066f67b9e3fd4c8cbd5859e8da3), float b, float c, float d) Get current slicing plane in Hessian normal form given by the equation ![\hat\{n}x = -p](https://mintcdn.com/synopsys-00a47cbc/Srh1_f--TdKCLyqD/docs/optislang/optislang-3d-postprocessing-script-api/form_2.png?fit=max\&auto=format\&n=Srh1_f--TdKCLyqD\&q=85\&s=9521f36cb13610c3f9456206eb6321af). |
| | [removeSlice](#a05abf562d065b7fd4657ade1385c8bca) () |
|  virtual | **currentMatrix** (QMatrix4x4 mat) |
|  virtual | **projectPoint** (number x, number y, number z, number u, numberv, number w, QMatrix4x4 mat) |
|  Eigen::Quaternionf | **rotQuaternion** () const |

### SELECTION

| Type | Name |
| - | - |
| virtual int | [select](#a287f51df5268007e4828159bcff3079c) ([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), [Element](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_element.md) \*element, number value, bool showLabel) Tests if the given element is in FEM set and if so marks it with value given as selected. |
| virtual int | [select](#a5798cbc7576fa42d09c369280a82c571) ([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), Point \*node, number value, bool isPoint, bool showLabel) Tests if the given node is in an active FEM set and if so marks it with value given as selected. |
| virtual | [selectEntitiesInRect](#a2c62fd0ee90f6a105651e10e8948c539) ([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), QRect rect, bool keep\_selection, number max\_selectable, bool showLabel) Calls the select method for all visible mapped vertices/nodes and triangles/elements in a selection rectangle on the screen The called select method ensures that only items within an active FEM set will be selectable. See select for further information. |
|  virtual | [markVerticesAsSelected](#a36515a6829bc53e9ecde031ee8b541e2) () Marks all vertices of the scene belonging to selected points as selected (used for visualization only) |
|  virtual | [markTrianglesAsSelected](#a3603df3ad7f023009963aa4da35d4d07) () Marks all triangles of the scene belonging to selected elements as selected (used for visualization only) |
| virtual bool | [isSelected](#ab4562daf9688f00502b7de9b2ae3d9b0) ([Element](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_element.md) \*element) isSelected |
|  virtual number | **getNumSelectedTriangles** () |
| virtual bool | [isSelected](#ab3bdf9b1987b1fb7cab665ce1c9d086a) (Point \*node) isSelected |
|  virtual number | **getNumSelectedVertices** () |
|  virtual | [clearSelection](#aca131179fa2863e4ef450a8af8128de6) () Resets all selection markers. Resets all selection markers including: Vertices, Triangles, Nodes, Elements, Labels. Does not perform an automatic redraw. |
| virtual [Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) | [getSelectedElementIndices](#a4a6db54dad5010ed5efc232966141ec5) ([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)) |
| virtual [Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) | [getSelectedNodeIndices](#ae604ebacbf443a780c7f3b08011c57ad) ([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)) |
| virtual | [printSelectionInfo](#af4f042c5b46694ad58ac461ff82d8f30) ([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)) prints some limited information on the current selection |
|  virtual | [selectNodesFromVertices](#acd5054f148dedb37797199c08f46f3c8) () Runs through all selected vertices and selects their node counterparts as well. |
| virtual float | [getNodeDistance](#a089be830d387c1aa3930bd8b00a5bbbe) (MatrixXhf coor, QRect rect, bool surfaceOnly, QMatrix4x4 mat) Returns the distance between the mapped nodal coordinates and the midpoint of the selection rectangle given. Maps the nodal coordinates given to window coordinates and returns the distance between this point and the midpoint of the window selection rectangle given. |
| virtual float | [getNodeDistance](#a0c2b6fa2fcf5d4c04a16bea9324bee98) (Point \*node, QRect rect, bool surfaceOnly, QMatrix4x4 mat) Returns the distance between the mapped nodal coordinates and the midpoint of the selection rectangle given. Maps the nodal coordinates given to window coordinates and returns the distance between this point and the midpoint of the window selection rectangle given. |
| virtual float | [getElementDistance](#a48b4d34cfd3c3176c6ebbc0f2dc4e2c3) ([Element](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_element.md) \*element, QRect rect, QMatrix4x4 mat) Returns the distance between the mapped mean value of the elements nodal coordinates and the midpoint of the selection rectangle given Maps the mean value of the elements nodal coordinates components given to window coordinates and returns the distance between this point and the midpoint of the window selection rectangle given. |
|  virtual | **printSelectedNodes** () |
|  virtual | **printSelectedElements** () |
|  graphics::VerticesNormalsVisibility | **getvnv** () |

## Miscellaneous

| Type | Name |
| - | - |
|  MatrixXhf | [m\_current\_scene\_tet\_coordinates](#ac12d16e763ecf92d27276b9790568dcb) Currently used coordinates for the tet vertices. Is empty if the undeformed coordinates are used. |
|  bool | [m\_have\_current\_coordinates](#a57944d6e68fa650994e96d8a926a2943) Do we have changed coordinates? |
|  MatrixXhf | [m\_current\_scene\_coordinates](#a9e44c68b6c09ba0ba8dded2e71fa86cb) Currently used coordinates for the vertices. Is empty, if the undeformed coordinates are used. |
|  MatrixXhf | [m\_current\_unconnected\_point\_coordinates](#a54e9c71fb5aba9c14aff6f23cc191231) Currently used coordinates for the vertices. Is empty, if the undeformed coordinates are used. |
|  MatrixXhf | [m\_current\_scene\_normals](#aebda26bb5fbe2afd6d73f6806347c837) Currently used normals for the vertices. Is empty if the undeformed coordinates are used. |
|  MatrixXhf | [m\_current\_scene\_outline\_coordinates](#a8192e2ef00396b79b33f94b20cb912b9) Currently used coordinates for the outline vertices. Is empty if the undeformed coordinates are used. |
| MatrixXhf | [currentTetCoordinates](#a4f7cd78b0ef0471105b44151e6e0868f) () const |
| bool | [haveCurrentCoordinates](#a7719777eeb3c9b36b8df97eb00975286) () |
| MatrixXhf | [currentCoordinates](#a187466469cfb07571f9f494a236d8466) () const |
|  MatrixXhf | [getCurrentUnconnectedPointCoordinates](#a743a4d711e53b93bbb253a9229a3c101) () returns either the raw unconnected point coordinates or the (hacked) morphed point coordinates if mesh morphing was enabled |
| | [SetUnconnectedPointCoordinates](#a7b325a6f280742d3b06a20196c57f01e) ([Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) coor) Sets morphed coordinates of unconnected points. |
|  MatrixXhf | [getRawUnconnectedPointCoordinates](#a15961a85b2b62c89830eb160d7948a64) () returns the coordinates of all points without modification |
|  float | [getRawModelScaleWithoutTheStrangeTransformations](#aef4c92104420ac579c07946e7bcf7564) () returns the value that is probably the model space scale |
| MatrixXhf | [currentNormals](#a324de892023edd0712d2c2d5d9a9645d) () const |
| MatrixXhf | [currentOutlineCoordinates](#a48d519bbc7d9edcff9ad8e3a16098fab) () const |
| Eigen::MatrixXf | [getSphereVertices](#acff3ea4a0700643aedfe199133e81084) () get vertices of a unit sphere |
| | [setPointSize](#a6724f50b4207f54aefbc744ef88ec0fd) (float size) set the size of points relative to model size |
| float | [getPointSize](#a43770b9c600b78afa660ac9d40c723cb) () set the size of points relative to model size |
| Eigen::MatrixXf | [getSphereNormals](#a1ee56e4b222eb79feb5fc73ce1528d10) () get normals of a unit sphere |
| number | [getNumPoints](#ac0b580012767de6b9cee6550fa1f1913) () get the number points |
| VectorXuc | [getPointColors](#a00fe2a48f2c8a282aada8a4c00914f45) () get the colors of all points |
|  virtual | [PrepareVBOSelected](#a7f2f412f1b1b00f95a58f28b6d231526) () prepare vertices/normals for selected entities |
| | [getModelCenter](#ab2719053695b348b09a0587debc6e4b4) (float x, float y, float z) writes the center coordinates to input coordinates x,y and z |
| MatrixXhf | [getVisibleTetCoordinates](#ae3807ab35d2750410be14663334ef944) () get the coordinates of all visible tet vertices |
| MatrixXhf | [getVisibleCoordinates](#a6a94ab4fe712f7c09489246cd5d476de) () get the coordinates of all visible vertices |
| virtual bool | [isVertexSelected](#a88a7807fd65fd5bf216310aaf1c74c10) (int i) determine if a given vertex is currently selected |
|  virtual | [ImageMargins](#a611fb42d6a8703d5e701b794db9d1848) (int leftm, int rightm, int topm, int bottomm) get margins of structure rendering for current settings using image |
| | [exportTNG](#a8dbe08127b637b3781091ce9adb23f36) (string file) export to [Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) for use in slangTNG |
| | [exportIsosurface\_STL](#ac73ebf9c7288c54301a0e6e1347cf641) (string file, bool replace\_files=false) exports the curent isosurface to STL file |
| virtual | [importTNG](#a15f408f0a7dce9bd2acd6936325aca48) (string file) import from [Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) as used in slangTNG |
| number | [getMinValue](#aa0675ad75eaeb98f423bf9acb486d912) () Returns the the minimum data value of m\_val\_\[node,element].dataobject\_value. |
| number | [getMaxValue](#af08e7d34c0d2c3885b2fd1279302adfe) () Returns the the maximum data value of m\_val\_\[node,element].dataobject\_value. |
| | [SetTetCoordinates](#ada72656221408e3a4e178f7d2be87d03) ([Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) coor) Sets all coordinates of tet vertices. |
| | [SetCoordinates](#a1b1f381d1e2ebb2299830502c5744a5f) ([Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) coor) Sets all coordinates of vertices. |
| | [ComputeCurrentNormals](#a544f8832a1a54cd179d61444be0c9273) () Compute the normals for the current visible vertex coordinates. |
| | [ComputeCurrentOutlines](#ad3554580ac57bae2fbad94162e999d38) () Compute the values for the current visible outline coordinates. |
| | **SetRange** (float xmin, float xmax, float ymin, float ymax, float zmin, float zmax) |
| | **GetSize** (int w, int h) |
|  virtual | **SetSize** (int w, int h) |
| | [setSceneScaleRelative](#a6f7af4dba2de8ab52494d821a1b19361) (float x, float y, float z) set different scaling for all three axes |
| | [getSceneScaleRelative](#a420ca3ea70a24860d44711a6b817265c) (float x, float y, float z) get different scaling for all three axes |

## Detailed Description

A class for 3D visualization of a structure Additionally, it can display palettes and text annotations as well as rich text labels. Internally, a representation in terms of triangles only is used. 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 SceneQt, part of the sos\_qt\_extensions module. Class [Scene](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_scene.md) is NO QObject, but SceneQt is. Instances of [Scene](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_scene.md) or SceneQt are created with application\_makeScene(), implemented in the sos\_qt\_extensions or sos\_noqt\_extensions module respectively.

## Constructor & Destructor Documentation

### Scene()

```cpp theme={null}
Scene(
    graphics::VerticesNormalsVisibility vnv,
    Structure database
)
```

Constructor, requires the description of the structure in terms of a [VerticesNormalsVisibility](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/struct_vertices_normals_visibility.md) object. Initializes some defaults.

**Parameters**

| Name | Description |
| - | - |
| vnv | The description of the structure in terms of a [VerticesNormalsVisibility](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/struct_vertices_normals_visibility.md) object |

## Member Function Documentation

### ActivateNodeValues()

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

Render the scene into a QPaintDevice.

**Parameters**

| Name | Description |
| - | - |
| device | QPaintDevice used for rendering |

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

```cpp theme={null}
AddRotation(float angle)
```

Adds the given angle to the actual rotation The rotation axis is determined by GetRotation.

**Parameters**

| Name | Description |
| - | - |
| angle | The angle in grad to add |

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

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

Adds the given angle to the actual rotation.

**Parameters**

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

### addVal2String()

```cpp theme={null}
addVal2String(
    float value,
    string the_string
)
```

adds a value pair to the container storing information on mapping discrete number values into strings

**Parameters**

| Name | Description |
| - | - |
| value | the number value to be translated |
| the\_string | the string to be shown in the label instead of the number value |

### AssignValues()

```cpp theme={null}
AssignValues(
    AllRenderData p_render_data,
    Structure database,
    SceneManager * scene_manager
)
```

defines data to be rendered

**Parameters**

| Name | Description |
| - | - |
| p\_render\_data | the render data |
| database | the database we refer to |

### currentCoordinates()

```cpp theme={null}
MatrixXhf currentCoordinates() const
```

**Returns**

a const-reference to m\_current\_scene\_coordinates

### currentNormals()

```cpp theme={null}
MatrixXhf currentNormals() const
```

**Returns**

a const-reference to m\_current\_scene\_normals

### currentOutlineCoordinates()

```cpp theme={null}
MatrixXhf currentOutlineCoordinates() const
```

**Returns**

a const-reference to m\_current\_scene\_outline\_coordinates

### currentTetCoordinates()

```cpp theme={null}
MatrixXhf currentTetCoordinates() const
```

**Returns**

a const-reference to m\_current\_scene\_tet\_coordinates

### databaseImage()

```cpp theme={null}
virtual databaseImage(
    std::vector< char > vec,
    int image_resolution_x,
    int image_resolution_y
)
```

`virtual`

Get the small mesh image to save with the database header, without Qt: returns empty image!

**Parameters**

| Name | Description |
| - | - |
| vec | byte array, pass by reference, will be modified to contain the QImage in a QByteArray format. |
| image\_resolution\_x | resolution in pixel |
| image\_resolution\_y | resolution in pixel |

### exportIsosurface\_STL()

```cpp theme={null}
exportIsosurface_STL(
    string file,
    bool replace_files = false
)
```

exports the curent isosurface to STL file

**Parameters**

| Name | Description |
| - | - |
| file | name of text file for export |
| replace\_files | if true, then existing files will be replace, else an error occurs |

### exportTNG()

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

export to [Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) for use in slangTNG

**Parameters**

| Name | Description |
| - | - |
| file | name of text file for export |

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

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

Renders the scene into a QImage of current size.

**Returns**

a QImage Renders the scene into a QImage of given size

**Parameters**

| Name | Description |
| - | - |
| width | The width of the requested QImage |
| height | The height of the requested QImage |

**Returns**

a QImage Renders the finite element model of a scene into a QImage of given size

a QImage \
&#x20;Renders the contents of the scene to an image file using current size of the scene

**Parameters**

| Name | Description |
| - | - |
| filename | the file name (including extension defining type of image) |

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

```cpp theme={null}
virtual File(
    string filename,
    int ww,
    int hh
)
```

`virtual`

Renders the contents of the scene to an image file of given size.

**Parameters**

| Name | Description |
| - | - |
| filename | the file name (including extension defining type of image) |
| w | width of image |
| h | height of image |

### font()

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

`virtual`

**Returns**

a reference to

**See also**

m\_font

### GetBackground()

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

Gets the first background color for the scene.

**Parameters**

| Name | Description |
| - | - |
| red | red color component (0 to 255) |
| green | green color component (0 to 255) |
| blue | blue color component (0 to 255) |
| alpha | alpha color component (0 to 255) |

### GetBackground2()

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

Gets the second background color for the scene. This defines a vertical color gradient together with the first background color.

**Parameters**

| Name | Description |
| - | - |
| red | red color component (0 to 255) |
| green | green color component (0 to 255) |
| blue | blue color component (0 to 255) |
| alpha | alpha color component (0 to 255) |

### getContours()

```cpp theme={null}
Eigen::VectorXf getContours()
```

get contour levels

**Returns**

contour levels

### getContourSize()

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

get numnber of contour levels

**Returns**

number of contour levels

### GetContourType()

```cpp theme={null}
graphics::Scene::contourType GetContourType()
```

GetContourType.

**Returns**

contour type of scene

### getCoordinateAxes()

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

Returns the state of rendering coordinate axes

**Returns**

True if drawing of axes is activated, false otherwise

### getElementDistance()

```cpp theme={null}
virtual float getElementDistance(
    Element * element,
    QRect rect,
    QMatrix4x4 mat
)
```

`virtual`

Returns the distance between the mapped mean value of the elements nodal coordinates and the midpoint of the selection rectangle given Maps the mean value of the elements nodal coordinates components given to window coordinates and returns the distance between this point and the midpoint of the window selection rectangle given.

**Parameters**

| Name | Description |
| - | - |
| element | An element of the displayed structure |
| rect | The selection rectangle |

**Returns**

The distance between the mapped mean value of the elements nodal coordinates given and the midpoint of the selection rectangle given if the mapped point is inside or on the edge of the selection rectangle given. 1e33 otherwise.

### getMaxValue()

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

Returns the the maximum data value of m\_val\_\[node,element].dataobject\_value.

**Returns**

The maximum data value of the total scene dataobject or 1 if m\_val\_\[node,element].dataobect\_value is empty

### getMinValue()

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

Returns the the minimum data value of m\_val\_\[node,element].dataobject\_value.

**Returns**

The minimum data value of the total scene dataobject or 0 if m\_val\_\[node,element].dataobect\_value is empty

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

```cpp theme={null}
virtual float getNodeDistance(
    MatrixXhf coor,
    QRect rect,
    bool surfaceOnly,
    QMatrix4x4 mat
)
```

`virtual`

Returns the distance between the mapped nodal coordinates and the midpoint of the selection rectangle given. Maps the nodal coordinates given to window coordinates and returns the distance between this point and the midpoint of the window selection rectangle given.

**Parameters**

| Name | Description |
| - | - |
| coor | The coordinates of a point of the displayed structure |
| rect | The selection rectangle |

**Returns**

The distance between the mapped nodal coordinates and the midpoint of the rectangle given if the mapped point is inside or on the edge of the selection rectangle given. 1e33 otherwise.

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

```cpp theme={null}
virtual float getNodeDistance(
    Point * node,
    QRect rect,
    bool surfaceOnly,
    QMatrix4x4 mat
)
```

`virtual`

Returns the distance between the mapped nodal coordinates and the midpoint of the selection rectangle given. Maps the nodal coordinates given to window coordinates and returns the distance between this point and the midpoint of the window selection rectangle given.

**Parameters**

| Name | Description |
| - | - |
| node | A point of the displayed structure |
| rect | The selection rectangle |

**Returns**

The distance between the mapped nodal coordinates and the midpoint of the rectangle given if the mapped point is inside or on the edge of the selection rectangle given. 1e33 otherwise.

### getNumPoints()

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

get the number points

**Returns**

number of points

### GetPan()

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

get the current pan values

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in,out] | x | x value of pan |
| \[in,out] | y | y value of pan |

### getPointColors()

```cpp theme={null}
VectorXuc getPointColors()
```

get the colors of all points

**Returns**

colors

### getPointSize()

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

set the size of points relative to model size

**Returns**

point size

### GetRichLabel()

```cpp theme={null}
virtual GetRichLabel(RichLabel richlabel)
```

`virtual`

GetRichLabel.

**Returns**

the current rich label (legend) from the scene

### 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 |

### getSelectedElementIndices()

```cpp theme={null}
virtual Matrix getSelectedElementIndices(Structure database)
```

`virtual`

**Returns**

the indices in index mapper of selected elements as column vector

**Parameters**

| Name | Description |
| - | - |
| database,the | database of this scene |

### getSelectedNodeIndices()

```cpp theme={null}
virtual Matrix getSelectedNodeIndices(Structure database)
```

`virtual`

**Returns**

the indices in index mapper of selected nodes as column vector

**Parameters**

| Name | Description |
| - | - |
| database,the | database of this scene |

### getSlice()

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

Get current slicing plane in Hessian normal form given by the equation ![\hat\{n}x = -p](https://mintcdn.com/synopsys-00a47cbc/Srh1_f--TdKCLyqD/docs/optislang/optislang-3d-postprocessing-script-api/form_2.png?fit=max\&auto=format\&n=Srh1_f--TdKCLyqD\&q=85\&s=9521f36cb13610c3f9456206eb6321af).

**Parameters**

| Name | Description |
| - | - |
| a | coeffcient \$n\_x\$ in the plane equation |
| b | coeffcient \$n\_y\$ in the plane equation |
| c | coeffcient \$n\_z\$ in the plane equation |
| d | coeffcient $p$ in the plane equation |

### getSphereNormals()

```cpp theme={null}
Eigen::MatrixXf getSphereNormals()
```

get normals of a unit sphere

**Returns**

normals

### getSphereVertices()

```cpp theme={null}
Eigen::MatrixXf getSphereVertices()
```

get vertices of a unit sphere

**Returns**

vertices

### getValues()

```cpp theme={null}
graphics::VertexValues getValues()
```

Returns a reference to the original scene data.

**Returns**

A reference to the original (node/element) scene data

### getVisibleCoordinates()

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

get the coordinates of all visible vertices

**Returns**

coordinates

### getVisibleTetCoordinates()

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

get the coordinates of all visible tet vertices

**Returns**

coordinates

### GetZoom()

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

get current zoom factor

**Returns**

current zoom factor

### haveCurrentCoordinates()

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

**Returns**

bool to indicated deformed coordinates

### importTNG()

```cpp theme={null}
virtual importTNG(string file)
```

`virtual`

import from [Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) as used in slangTNG

**Parameters**

| Name | Description |
| - | - |
| file | name of text file for export |

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

```cpp theme={null}
virtual bool isSelected(Element * element)
```

`virtual`

isSelected

**Parameters**

| Name | Description |
| - | - |
| element | Pointer to the chosen element |

**Returns**

bool indicating if chosen element is selected

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

```cpp theme={null}
virtual bool isSelected(Point * node)
```

`virtual`

isSelected

**Parameters**

| Name | Description |
| - | - |
| node | Pointer to the chosen node |

**Returns**

bool indicating if chosen node is selected

### isSliced()

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

**Returns**

true if a slice area is defined

### isVertexSelected()

```cpp theme={null}
virtual bool isVertexSelected(int i)
```

`virtual`

determine if a given vertex is currently selected

**Parameters**

| Name | Description |
| - | - |
| i | index of vertex |

**Returns**

boolean idicating if selected

### mappedVector()

```cpp theme={null}
Eigen::Vector3f mappedVector(Eigen::Vector3f orig)
```

Maps actual position vector into view space (-32767 - 32767)

**Parameters**

| Name | Description |
| - | - |
| orig | Origianl position vector |

**Returns**

Mapped vector

### palette()

```cpp theme={null}
virtual palette(Palette palette)
```

`virtual`

Get current palette.

**Returns**

palette object containing the definition of the palette.

### palettePercentageRange()

```cpp theme={null}
virtual bool palettePercentageRange()
```

`virtual`

**Returns**

Returns true if the palette has set relative values. Otherwise false

### Prepare()

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

`virtual`

Clears all OpenGL Vertex Buffers first and re-initializes them afterwards.

**Parameters**

| Name | Description |
| - | - |
| fast | If fast is set to true ( intended in GUI-Mode to move even big structures smoothly) then only the VBO's for outline vertices as well as for elements are prepared. Otherwise all VOB's neccessary to render the chosen contour type are prepared additionally. |

### printSelectionInfo()

```cpp theme={null}
virtual printSelectionInfo(Structure database)
```

`virtual`

prints some limited information on the current selection

**Parameters**

| Name | Description |
| - | - |
| database,the | database of this scene |

### removeSlice()

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

Remove the slicing plane

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

```cpp theme={null}
virtual int select(
    Structure database,
    Element * element,
    number value,
    bool showLabel
)
```

`virtual`

Tests if the given element is in FEM set and if so marks it with value given as selected.

**Parameters**

| Name | Description |
| - | - |
| database | The [Structure](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_structure) database containing all the information about the FEM structure |
| node | The element to be tested and selected |
| value | The data value associated with it |

**Returns**

Returns the number of new selected elements, which is at most 1, ignoring the original selection state

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

```cpp theme={null}
virtual int select(
    Structure database,
    Point * node,
    number value,
    bool isPoint,
    bool showLabel
)
```

`virtual`

Tests if the given node is in an active FEM set and if so marks it with value given as selected.

**Parameters**

| Name | Description |
| - | - |
| database | The [Structure](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_structure) database containing all the information about the FEM structure |
| node | The node to be tested and selected |
| value | The data value associated with it |
| isPoint | |

**Returns**

Returns the number of new selected nodes, which is at most 1, ignoring the original selection state

### selectEntitiesInRect()

```cpp theme={null}
virtual selectEntitiesInRect(
    Structure database,
    QRect rect,
    bool keep_selection,
    number max_selectable,
    bool showLabel
)
```

`virtual`

Calls the select method for all visible mapped vertices/nodes and triangles/elements in a selection rectangle on the screen The called select method ensures that only items within an active FEM set will be selectable. See select for further information.

**Parameters**

| Name | Description |
| - | - |
| database | The [Structure](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_structure) database containing all the information about the FEM structure |
| rect | QRect describing the selection area |
| keep\_selection | True if existing selection should be kept |
| max\_selectable | Limits the selection to a maximum number of selected entities(?). |

### SetBackground()

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

Sets the first background color for the scene.

**Parameters**

| Name | Description |
| - | - |
| red | red color component (0 to 255) |
| green | green color component (0 to 255) |
| blue | blue color component (0 to 255) |
| alpha | alpha color component (0 to 255) |

### SetBackground2()

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

Sets the second background color for the scene. This defines a vertical color gradient together with the first background color.

**Parameters**

| Name | Description |
| - | - |
| red | red color component (0 to 255) |
| green | green color component (0 to 255) |
| blue | blue color component (0 to 255) |
| alpha | alpha color component (0 to 255) |

### SetCoorAxesPosition()

```cpp theme={null}
virtual SetCoorAxesPosition(graphics::Position pos)
```

`virtual`

Sets the position for the coordinate axes.

**Parameters**

| Name | Description |
| - | - |
| pos | contains the position of the coordinate system. |

### setCoordinateAxes()

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

Enable/Disable rendering of coordinate axes

**Parameters**

| Name | Description |
| - | - |
| persp | if true, enable; if false disable |

### setCoordinateAxesLabels()

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

Returns the state of the perspective property in rendering scene

**Returns**

True if perspective is activated, false otherwise

### SetCoordinates()

```cpp theme={null}
SetCoordinates(Matrix coor)
```

Sets all coordinates of vertices.

**Parameters**

| Name | Description |
| - | - |
| coor | [Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) containing the coordinates |

### SetCoorSystemPosition()

```cpp theme={null}
virtual SetCoorSystemPosition(graphics::Position pos)
```

`virtual`

Sets the position for the coordinate system.

**Parameters**

| Name | Description |
| - | - |
| pos | contains the position of the coordinate system. |

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

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

`virtual`

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

**Parameters**

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

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

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

`virtual`

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

**Parameters**

| Name | Description |
| - | - |
| font | the font |

### SetGeometricScaling()

```cpp theme={null}
SetGeometricScaling(
    number scaling,
    Structure database,
    SceneManager * scene_manager
)
```

defines the scaling factor for geometric variations

**Parameters**

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

### SetGeometricStabilization()

```cpp theme={null}
SetGeometricStabilization(
    bool enable_flag,
    Structure database,
    SceneManager * scene_manager
)
```

enables/disables mesh smoothening for gemetric imperfections

**Parameters**

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

### SetLegendPosition()

```cpp theme={null}
virtual SetLegendPosition(graphics::Position pos)
```

`virtual`

Sets the position for the legend.

**Parameters**

| Name | Description |
| - | - |
| pos | contains the position of the legend. |

### SetMarkPosition()

```cpp theme={null}
SetMarkPosition(graphics::Position pos)
```

Sets the position for the watermark.

**Parameters**

| Name | Description |
| - | - |
| pos | contains the position of the water mark. |

### setPalettePercentageRange()

```cpp theme={null}
virtual setPalettePercentageRange(bool percentage_range = true)
```

`virtual`

Sets a relative, percentage palette range.

**Parameters**

| Name | Description |
| - | - |
| percentage\_range | If set to true, the palette range will be scaled to the maximum palette value |

### setPalettePosition()

```cpp theme={null}
virtual setPalettePosition(graphics::Position pos)
```

`virtual`

Sets the position for the current palette.

**Parameters**

| Name | Description |
| - | - |
| pos | contains the position of the palette. |

### setPaletteType()

```cpp theme={null}
virtual setPaletteType(PaletteTypePtr palette)
```

`virtual`

Assign a color/value palette to the scene. Only one palette can be assigned.

**Parameters**

| Name | Description |
| - | - |
| palette | contains the definition of the palette. |

### SetPan()

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

Set the current pan values in (pixel, coordinate system?)

**Parameters**

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

### setPerspective()

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

Enable/Disable use of perspective in rendering scene

**Parameters**

| Name | Description |
| - | - |
| persp | if true, enable use of perspective, if false disable perspective |

### 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
)
```

Resetting all rotatation information to its origin setting the new definition afterwards.

**Parameters**

| Name | Description |
| - | - |
| angle | The rotation angle in \[°] |
| x | x-component of rotation axis |
| y | y-component of rotation axis |
| z | z-component of rotation axis |

### setRuler()

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

Sets visibility of ruler.

**Parameters**

| Name | Description |
| - | - |
| on | the visibility of the ruler |

### SetScale()

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

Sets current length scale and zoom factor accordingly.

**Parameters**

| Name | Description |
| - | - |
| Length | scale |

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

```cpp theme={null}
SetSlice(
    std::vector< float > pt,
    std::vector< float > dir
)
```

Defines a slicing plane in Hessian normal form in terms of a point and a direction vector.

**Parameters**

| Name | Description |
| - | - |
| pt | point through which the slicing plane passes |
| dir | direction of visibility (normal of the slicing plane) |

> [!NOTE]
>
> This is just a convenience method computing the coefficients for the euclidean plane equation and calling the overloaded version afterwards.\
> &#x20;Refer to [Wolfram: Plane](http://mathworld.wolfram.com/Plane.html) for an explanation of the plane definition

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

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

Defines a slicing plane 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

### SetTetCoordinates()

```cpp theme={null}
SetTetCoordinates(Matrix coor)
```

Sets all coordinates of tet vertices.

**Parameters**

| Name | Description |
| - | - |
| coor | [Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) containing the coordinates |

### SetUnconnectedPointCoordinates()

```cpp theme={null}
SetUnconnectedPointCoordinates(Matrix coor)
```

Sets morphed coordinates of unconnected points.

**Parameters**

| Name | Description |
| - | - |
| coor | [Matrix](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_matrix.md) containing the coordinates |

### SetValues()

```cpp theme={null}
virtual SetValues(
    Eigen::VectorXd inputs,
    Structure database,
    bool reset_scene_options,
    SceneManager * scene_manager
)
```

`virtual`

Assign values to the vertices of the structure which are then used for coloring.

**Parameters**

| Name | Description |
| - | - |
| inputs | the given random field amplitudes or FMOP inputs |
| database | the database we refer to |

### SetZoom()

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

Sets current zoom factor.

**Parameters**

| Name | Description |
| - | - |
| Current | zoom factor |

### showRuler()

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

**Returns**

m\_show\_ruler
