Skip to main content

oSP3D Script API 2024 R1

Scene Class Reference

Last update: 16.07.2025

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 is NO QObject, but SceneQt is. Instances of Scene or SceneQt are created with application_makeScene(), implemented in the sos_qt_extensions or sos_noqt_extensions module respectively. More...

Public Types

enum  contourType { noContourPlot = 0, lineContourPlot, surfaceContourPlot, singleSurfaceContourPlot }
 

Public Member Functions

 addVal2String (float value, string the_string)
 adds a value pair to the container storing information on mapping discrete number values into strings More...
 
 clearVal2String ()
 clears the container storing information on mapping discrete number values into strings
 
unsigned char * getContourColors ()
 
char * getContourNormals ()
 
short * getContourVertices ()
 
bool getDrawToFile ()
 get info if drawing to file
 
bool getHiliteReferenceSet ()
 
int getNumContours ()
 
int getNumOutlines ()
 
virtual int getNumSelectedVertices ()
 
int getNumSlices ()
 
int getNumTriangles ()
 
short * getOutlineVertices ()
 
int getScaleDeco ()
 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 (bool b)
 set info if drawing to file
 
 setHiliteReferenceSet (bool t)
 
 setScaleDeco (int scale)
 set scale factor for deco elements
 
 setZBuffer (MatrixXhf buf)
 
 Scene (graphics::VerticesNormalsVisibility vnv, Structure database)
 Constructor, requires the description of the structure in terms of a VerticesNormalsVisibility object. Initializes some defaults. More...
 
 setShading (bool t)
 
bool getShading ()
 
 SetTitle (string title)
 
string GetTitle ()
 
dataobject_types getDataType ()
 
DataObjectKey getDataIdent ()
 
bool hasData ()
 
bool hasNodeData ()
 
virtual databaseImage (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! More...
 
Control OpenGL

Methods controlling the OpenGL context

 setUninitializedGL ()
 Tells the Scene that its associated GL context needs to reload all Vertex Buffer Objects (VBOs)
 
bool initializedGL ()
 
virtual Prepare ()
 Clears all OpenGL Vertex Buffers first and re-initializes them afterwards. More...
 
virtual UnPrepare ()
 
 SetMode (graphics::renderMode mode)
 
graphics::renderMode GetMode ()
 
RENDER

Methods controlling the rendering

float getStructureAlpha ()
 
float getIsoSurfaceAlpha ()
 
 setStructureAlpha (float a)
 
 setIsoSurfaceAlpha (float a)
 
 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 (string filename)
 Renders the scene into a QImage of current size. More...
 
virtual File (string filename, int ww, int hh)
 Renders the contents of the scene to an image file of given size. More...
 
 ActivateNodeValues ()
 Render the scene into a QPaintDevice. More...
 
 ActivateElementValues ()
 
 AssignValues (AllRenderData p_render_data, Structure database, SceneManager *scene_manager)
 defines data to be rendered More...
 
virtual SetValues (Eigen::VectorXd inputs, Structure database, bool reset_scene_options, SceneManager *scene_manager)
 Assign values to the vertices of the structure which are then used for coloring. More...
 
 SetGeometricStabilization (bool enable_flag, Structure database, SceneManager *scene_manager)
 enables/disables mesh smoothening for gemetric imperfections More...
 
 SetGeometricScaling (number scaling, Structure database, SceneManager *scene_manager)
 defines the scaling factor for geometric variations More...
 
 recalculateAndApplyMorphedGeometry (Structure database)
 recalculates mesh morphing and applies result to triangle geometry and unconnected points.
 
 ClearMorphedCoordinates ()
 deletes all containers with morphed geometry forcing the system to use unmorphed geometry
 
graphics::VertexValues getValues ()
 Returns a reference to the original scene data. More...
 
 OriginalElementValues ()
 
 OriginalNodeValues ()
 
 SetContourType (graphics::Scene::contourType contourType)
 Set the type of contour to be shown. Can be none, line or surface type.
 
graphics::Scene::contourType GetContourType ()
 GetContourType. More...
 
number getContourSize ()
 get numnber of contour levels More...
 
Eigen::VectorXf getContours ()
 get contour levels More...
 
 SetContours (number c)
 Set single contour level, keep current type.
 
virtual SetContours (graphics::Scene::contourType ct)
 Set contour levels as defined in the current palette.
 
font

Substitute all white pixels from the margin with transparent ones

Parameters
aQImage with white pixels near the margins
Returns
a QImage
Methods controlling the font used in the scene to display text
virtual SetFont (string font, number fontsize)
 Sets the font for all text to be shown in the scene. More...
 
virtual SetFont (QFont font)
 Sets the font for all text to be shown in the scene. More...
 
virtual font (QFont font)
 
coloring

Methods controlling the coloring behaviour in the scene

 SetBackground (unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha)
 Sets the first background color for the scene. More...
 
 GetBackground (unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha)
 Gets the first background color for the scene. More...
 
 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. More...
 
 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. More...
 
 RemoveBackgrounds ()
 Clears all background coloring.
 
virtual bool palettePercentageRange ()
 
virtual setPaletteType (PaletteTypePtr palette)
 Assign a color/value palette to the scene. Only one palette can be assigned. More...
 
virtual setPalettePosition (graphics::Position pos)
 Sets the position for the current palette. More...
 
virtual setPaletteProperties (PaletteSceneProperties prop)
 
virtual setPalettePercentageRange (bool percentage_range=true)
 Sets a relative, percentage palette range. More...
 
virtual setPaletteRange (number xmin, number xmax)
 
virtual removePalette ()
 remove palette
 
virtual SetCoorAxesPosition (graphics::Position pos)
 Sets the position for the coordinate axes. More...
 
virtual graphics::Position GetCoorAxesPosition ()
 
virtual palette (Palette palette)
 Get current palette. More...
 
virtual graphics::Position GetPalettePosition ()
 
virtual SetCoorSystemPosition (graphics::Position pos)
 Sets the position for the coordinate system. More...
 
virtual graphics::Position GetCoorSystemPosition ()
 
virtual SetLegendPosition (graphics::Position pos)
 Sets the position for the legend. More...
 
virtual graphics::Position GetLegendPosition ()
 
 SetMarkPosition (graphics::Position pos)
 Sets the position for the watermark. More...
 
graphics::Position GetMarkPosition ()
 
virtual SetRichLabel (RichLabel richlabel)
 Assign a rich text label to the scene. Only one rich text label can be assigned.
 
virtual GetRichLabel (RichLabel richlabel)
 GetRichLabel. More...
 
virtual AddLabel (float x, float y, float z, string text, bool alVis=false)
 
virtual RemoveLabels ()
 
ruler

Methods controlling the ruler

 setRuler (bool on)
 Sets visibility of ruler. More...
 
bool showRuler ()
 
VIEW

Methods controlling the scene view

 setPerspective (bool persp)
 
 setCoordinateAxes (bool persp)
 
 setCoordinateAxesLabels (string x, string y, string z)
 
bool getPerspective ()
 
bool getCoordinateAxes ()
 
 SetRotation (float angle, float x, float y, float z)
 Resetting all rotatation information to its origin setting the new definition afterwards. More...
 
 AddRotation (float angle)
 Adds the given angle to the actual rotation The rotation axis is determined by GetRotation. More...
 
 AddRotation (float angle, float x, float y, float z)
 Adds the given angle to the actual rotation. More...
 
 GetRotation (float angle, float x, float y, float z)
 get current rotation expressed in angle/axis form More...
 
 RemoveRotations ()
 
 SetPan (float x, float y)
 Set the current pan values in (pixel, coordinate system?) More...
 
 AddPan (float x, float y)
 Moves the scene in x and y direction.
 
 GetPan (float x, float y)
 get the current pan values More...
 
 SetScale (float z)
 Sets current length scale and zoom factor accordingly. More...
 
float GetScale ()
 Gets current length scale and zoom factor accordingly, see SetScale()
 
 SetZoom (float z)
 Sets current zoom factor. More...
 
 AddZoom (float x)
 AddZoom.
 
float GetZoom ()
 get current zoom factor More...
 
float getScale () const
 
float getRealScale () const
 
 Autoscale ()
 Adjust scaling such that the entire structure is visible when be viewed from all angles.
 
 Fit ()
 Adjust scaling such that the entire structure fills the viewport when viewed from current angle.
 
Eigen::Vector3f mappedVector (Eigen::Vector3f orig)
 Maps actual position vector into view space (-32767 - 32767) More...
 
SLICING

Methods controlling the slice

 initSlice ()
 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 (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. More...
 
 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. More...
 
bool isSliced ()
 
 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$. More...
 
 removeSlice ()
 
virtual currentMatrix (QMatrix4x4 mat)
 
virtual projectPoint (number x, number y, number z, number u, numberv, number w, QMatrix4x4 mat)
 
Eigen::Quaternionf rotQuaternion () const
 
SELECTION

Methods controlling the selection

virtual int select (Structure database, Element *element, number value, bool showLabel)
 Tests if the given element is in FEM set and if so marks it with value given as selected. More...
 
virtual int select (Structure database, 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. More...
 
virtual selectEntitiesInRect (Structure database, 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. More...
 
virtual markVerticesAsSelected ()
 Marks all vertices of the scene belonging to selected points as selected (used for visualization only)
 
virtual markTrianglesAsSelected ()
 Marks all triangles of the scene belonging to selected elements as selected (used for visualization only)
 
virtual bool isSelected (Element *element)
 isSelected More...
 
virtual number getNumSelectedTriangles ()
 
virtual bool isSelected (Point *node)
 isSelected More...
 
virtual number getNumSelectedVertices ()
 
virtual clearSelection ()
 Resets all selection markers. Resets all selection markers including: Vertices, Triangles, Nodes, Elements, Labels. Does not perform an automatic redraw.
 
virtual Matrix getSelectedElementIndices (Structure database)
 
virtual Matrix getSelectedNodeIndices (Structure database)
 
virtual printSelectionInfo (Structure database)
 prints some limited information on the current selection More...
 
virtual selectNodesFromVertices ()
 Runs through all selected vertices and selects their node counterparts as well.
 
virtual float getNodeDistance (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. More...
 
virtual float getNodeDistance (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. More...
 
virtual float getElementDistance (Element *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. More...
 
virtual printSelectedNodes ()
 
virtual printSelectedElements ()
 
graphics::VerticesNormalsVisibility getvnv ()
 

Miscellaneous

MatrixXhf m_current_scene_tet_coordinates
 Currently used coordinates for the tet vertices. Is empty if the undeformed coordinates are used.
 
bool m_have_current_coordinates
 Do we have changed coordinates?
 
MatrixXhf m_current_scene_coordinates
 Currently used coordinates for the vertices. Is empty, if the undeformed coordinates are used.
 
MatrixXhf m_current_unconnected_point_coordinates
 Currently used coordinates for the vertices. Is empty, if the undeformed coordinates are used.
 
MatrixXhf m_current_scene_normals
 Currently used normals for the vertices. Is empty if the undeformed coordinates are used.
 
MatrixXhf m_current_scene_outline_coordinates
 Currently used coordinates for the outline vertices. Is empty if the undeformed coordinates are used.
 
MatrixXhf currentTetCoordinates () const
 
bool haveCurrentCoordinates ()
 
MatrixXhf currentCoordinates () const
 
MatrixXhf getCurrentUnconnectedPointCoordinates ()
 returns either the raw unconnected point coordinates or the (hacked) morphed point coordinates if mesh morphing was enabled
 
 SetUnconnectedPointCoordinates (Matrix coor)
 Sets morphed coordinates of unconnected points. More...
 
MatrixXhf getRawUnconnectedPointCoordinates ()
 returns the coordinates of all points without modification
 
float getRawModelScaleWithoutTheStrangeTransformations ()
 returns the value that is probably the model space scale
 
MatrixXhf currentNormals () const
 
MatrixXhf currentOutlineCoordinates () const
 
Eigen::MatrixXf getSphereVertices ()
 get vertices of a unit sphere More...
 
 setPointSize (float size)
 set the size of points relative to model size More...
 
float getPointSize ()
 set the size of points relative to model size More...
 
Eigen::MatrixXf getSphereNormals ()
 get normals of a unit sphere More...
 
number getNumPoints ()
 get the number points More...
 
VectorXuc getPointColors ()
 get the colors of all points More...
 
virtual PrepareVBOSelected ()
 prepare vertices/normals for selected entities
 
 getModelCenter (float x, float y, float z)
 writes the center coordinates to input coordinates x,y and z
 
MatrixXhf getVisibleTetCoordinates ()
 get the coordinates of all visible tet vertices More...
 
MatrixXhf getVisibleCoordinates ()
 get the coordinates of all visible vertices More...
 
virtual bool isVertexSelected (int i)
 determine if a given vertex is currently selected More...
 
virtual ImageMargins (int leftm, int rightm, int topm, int bottomm)
 get margins of structure rendering for current settings using image
 
 exportTNG (string file)
 export to Matrix for use in slangTNG More...
 
 exportIsosurface_STL (string file, bool replace_files=false)
 exports the curent isosurface to STL file More...
 
virtual importTNG (string file)
 import from Matrix as used in slangTNG More...
 
number getMinValue ()
 Returns the the minimum data value of m_val_[node,element].dataobject_value. More...
 
number getMaxValue ()
 Returns the the maximum data value of m_val_[node,element].dataobject_value. More...
 
 SetTetCoordinates (Matrix coor)
 Sets all coordinates of tet vertices. More...
 
 SetCoordinates (Matrix coor)
 Sets all coordinates of vertices. More...
 
 ComputeCurrentNormals ()
 Compute the normals for the current visible vertex coordinates.
 
 ComputeCurrentOutlines ()
 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 (float x, float y, float z)
 set different scaling for all three axes
 
 getSceneScaleRelative (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 is NO QObject, but SceneQt is. Instances of Scene or SceneQt are created with application_makeScene(), implemented in the sos_qt_extensions or sos_noqt_extensions module respectively.

Constructor & Destructor Documentation

◆ Scene()

Scene ( graphics::VerticesNormalsVisibility  vnv,
Structure  database 
)

Constructor, requires the description of the structure in terms of a VerticesNormalsVisibility object. Initializes some defaults.

Parameters
vnvThe description of the structure in terms of a VerticesNormalsVisibility object

Member Function Documentation

◆ ActivateNodeValues()

ActivateNodeValues ( )

Render the scene into a QPaintDevice.

Parameters
deviceQPaintDevice used for rendering

◆ AddRotation() [1/2]

AddRotation ( float  angle)

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

Parameters
angleThe angle in grad to add

◆ AddRotation() [2/2]

AddRotation ( float  angle,
float  x,
float  y,
float  z 
)

Adds the given angle to the actual rotation.

Parameters
xx-component of rotation axis
yy-component of rotation axis
zz-component of rotation axis

◆ addVal2String()

addVal2String ( float  value,
string  the_string 
)

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

Parameters
valuethe number value to be translated
the_stringthe string to be shown in the label instead of the number value

◆ AssignValues()

AssignValues ( AllRenderData  p_render_data,
Structure  database,
SceneManager scene_manager 
)

defines data to be rendered

Parameters
p_render_datathe render data
databasethe database we refer to

◆ currentCoordinates()

MatrixXhf currentCoordinates ( ) const
Returns
a const-reference to m_current_scene_coordinates

◆ currentNormals()

MatrixXhf currentNormals ( ) const
Returns
a const-reference to m_current_scene_normals

◆ currentOutlineCoordinates()

MatrixXhf currentOutlineCoordinates ( ) const
Returns
a const-reference to m_current_scene_outline_coordinates

◆ currentTetCoordinates()

MatrixXhf currentTetCoordinates ( ) const
Returns
a const-reference to m_current_scene_tet_coordinates

◆ databaseImage()

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
vecbyte array, pass by reference, will be modified to contain the QImage in a QByteArray format.
image_resolution_xresolution in pixel
image_resolution_yresolution in pixel

◆ exportIsosurface_STL()

exportIsosurface_STL ( string  file,
bool  replace_files = false 
)

exports the curent isosurface to STL file

Parameters
filename of text file for export
replace_filesif true, then existing files will be replace, else an error occurs

◆ exportTNG()

exportTNG ( string  file)

export to Matrix for use in slangTNG

Parameters
filename of text file for export

◆ File() [1/2]

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
widthThe width of the requested QImage
heightThe height of the requested QImage
Returns
a QImage Renders the finite element model of a scene into a QImage of given size
a QImage
Renders the contents of the scene to an image file using current size of the scene
Parameters
filenamethe file name (including extension defining type of image)

◆ File() [2/2]

virtual File ( string  filename,
int  ww,
int  hh 
)
virtual

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

Parameters
filenamethe file name (including extension defining type of image)
wwidth of image
hheight of image

◆ font()

virtual font ( QFont  font)
virtual
Returns
a reference to
See also
m_font

◆ GetBackground()

GetBackground ( unsigned char  red,
unsigned char  green,
unsigned char  blue,
unsigned char  alpha 
)

Gets the first background color for the scene.

Parameters
redred color component (0 to 255)
greengreen color component (0 to 255)
blueblue color component (0 to 255)
alphaalpha color component (0 to 255)

◆ GetBackground2()

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
redred color component (0 to 255)
greengreen color component (0 to 255)
blueblue color component (0 to 255)
alphaalpha color component (0 to 255)

◆ getContours()

Eigen::VectorXf getContours ( )

get contour levels

Returns
contour levels

◆ getContourSize()

number getContourSize ( )

get numnber of contour levels

Returns
number of contour levels

◆ GetContourType()

graphics::Scene::contourType GetContourType ( )

GetContourType.

Returns
contour type of scene

◆ getCoordinateAxes()

bool getCoordinateAxes ( )

Returns the state of rendering coordinate axes

Returns
True if drawing of axes is activated, false otherwise

◆ getElementDistance()

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
elementAn element of the displayed structure
rectThe 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()

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()

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]

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
coorThe coordinates of a point of the displayed structure
rectThe 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]

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
nodeA point of the displayed structure
rectThe 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()

number getNumPoints ( )

get the number points

Returns
number of points

◆ GetPan()

GetPan ( float  x,
float  y 
)

get the current pan values

Parameters
[in,out]xx value of pan
[in,out]yy value of pan

◆ getPointColors()

VectorXuc getPointColors ( )

get the colors of all points

Returns
colors

◆ getPointSize()

float getPointSize ( )

set the size of points relative to model size

Returns
point size

◆ GetRichLabel()

virtual GetRichLabel ( RichLabel  richlabel)
virtual

GetRichLabel.

Returns
the current rich label (legend) from the scene

◆ GetRotation()

GetRotation ( float  angle,
float  x,
float  y,
float  z 
)

get current rotation expressed in angle/axis form

Parameters
angleAngle of rotation
xx-component of rotation axis
yy-component of rotation axis
zz-component of rotation axis

◆ getSelectedElementIndices()

virtual Matrix getSelectedElementIndices ( Structure  database)
virtual
Returns
the indices in index mapper of selected elements as column vector
Parameters
database,thedatabase of this scene

◆ getSelectedNodeIndices()

virtual Matrix getSelectedNodeIndices ( Structure  database)
virtual
Returns
the indices in index mapper of selected nodes as column vector
Parameters
database,thedatabase of this scene

◆ getSlice()

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

Parameters
acoeffcient $n_x$ in the plane equation
bcoeffcient $n_y$ in the plane equation
ccoeffcient $n_z$ in the plane equation
dcoeffcient $p$ in the plane equation

◆ getSphereNormals()

Eigen::MatrixXf getSphereNormals ( )

get normals of a unit sphere

Returns
normals

◆ getSphereVertices()

Eigen::MatrixXf getSphereVertices ( )

get vertices of a unit sphere

Returns
vertices

◆ getValues()

graphics::VertexValues getValues ( )

Returns a reference to the original scene data.

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

◆ getVisibleCoordinates()

MatrixXhf getVisibleCoordinates ( )

get the coordinates of all visible vertices

Returns
coordinates

◆ getVisibleTetCoordinates()

MatrixXhf getVisibleTetCoordinates ( )

get the coordinates of all visible tet vertices

Returns
coordinates

◆ GetZoom()

float GetZoom ( )

get current zoom factor

Returns
current zoom factor

◆ haveCurrentCoordinates()

bool haveCurrentCoordinates ( )
Returns
bool to indicated deformed coordinates

◆ importTNG()

virtual importTNG ( string  file)
virtual

import from Matrix as used in slangTNG

Parameters
filename of text file for export

◆ isSelected() [1/2]

virtual bool isSelected ( Element element)
virtual

isSelected

Parameters
elementPointer to the chosen element
Returns
bool indicating if chosen element is selected

◆ isSelected() [2/2]

virtual bool isSelected ( Point *  node)
virtual

isSelected

Parameters
nodePointer to the chosen node
Returns
bool indicating if chosen node is selected

◆ isSliced()

bool isSliced ( )
Returns
true if a slice area is defined

◆ isVertexSelected()

virtual bool isVertexSelected ( int  i)
virtual

determine if a given vertex is currently selected

Parameters
iindex of vertex
Returns
boolean idicating if selected

◆ mappedVector()

Eigen::Vector3f mappedVector ( Eigen::Vector3f  orig)

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

Parameters
origOrigianl position vector
Returns
Mapped vector

◆ palette()

virtual palette ( Palette  palette)
virtual

Get current palette.

Returns
palette object containing the definition of the palette.

◆ palettePercentageRange()

virtual bool palettePercentageRange ( )
virtual
Returns
Returns true if the palette has set relative values. Otherwise false

◆ Prepare()

virtual Prepare ( )
virtual

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

Parameters
fastIf 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()

virtual printSelectionInfo ( Structure  database)
virtual

prints some limited information on the current selection

Parameters
database,thedatabase of this scene

◆ removeSlice()

removeSlice ( )

Remove the slicing plane

◆ select() [1/2]

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
databaseThe Structure database containing all the information about the FEM structure
nodeThe element to be tested and selected
valueThe 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]

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
databaseThe Structure database containing all the information about the FEM structure
nodeThe node to be tested and selected
valueThe 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()

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
databaseThe Structure database containing all the information about the FEM structure
rectQRect describing the selection area
keep_selectionTrue if existing selection should be kept
max_selectableLimits the selection to a maximum number of selected entities(?).

◆ SetBackground()

SetBackground ( unsigned char  red,
unsigned char  green,
unsigned char  blue,
unsigned char  alpha 
)

Sets the first background color for the scene.

Parameters
redred color component (0 to 255)
greengreen color component (0 to 255)
blueblue color component (0 to 255)
alphaalpha color component (0 to 255)

◆ SetBackground2()

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
redred color component (0 to 255)
greengreen color component (0 to 255)
blueblue color component (0 to 255)
alphaalpha color component (0 to 255)

◆ SetCoorAxesPosition()

virtual SetCoorAxesPosition ( graphics::Position  pos)
virtual

Sets the position for the coordinate axes.

Parameters
poscontains the position of the coordinate system.

◆ setCoordinateAxes()

setCoordinateAxes ( bool  persp)

Enable/Disable rendering of coordinate axes

Parameters
perspif true, enable; if false disable

◆ setCoordinateAxesLabels()

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()

SetCoordinates ( Matrix  coor)

Sets all coordinates of vertices.

Parameters
coorMatrix containing the coordinates

◆ SetCoorSystemPosition()

virtual SetCoorSystemPosition ( graphics::Position  pos)
virtual

Sets the position for the coordinate system.

Parameters
poscontains the position of the coordinate system.

◆ SetFont() [1/2]

virtual SetFont ( string  font,
number  fontsize 
)
virtual

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

Parameters
fontthe font name
fontsizethe size of the font in points

◆ SetFont() [2/2]

virtual SetFont ( QFont  font)
virtual

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

Parameters
fontthe font

◆ SetGeometricScaling()

SetGeometricScaling ( number  scaling,
Structure  database,
SceneManager scene_manager 
)

defines the scaling factor for geometric variations

Parameters
scalingthe scaling factor

◆ SetGeometricStabilization()

SetGeometricStabilization ( bool  enable_flag,
Structure  database,
SceneManager scene_manager 
)

enables/disables mesh smoothening for gemetric imperfections

Parameters
enablethe enable state

◆ SetLegendPosition()

virtual SetLegendPosition ( graphics::Position  pos)
virtual

Sets the position for the legend.

Parameters
poscontains the position of the legend.

◆ SetMarkPosition()

SetMarkPosition ( graphics::Position  pos)

Sets the position for the watermark.

Parameters
poscontains the position of the water mark.

◆ setPalettePercentageRange()

virtual setPalettePercentageRange ( bool  percentage_range = true)
virtual

Sets a relative, percentage palette range.

Parameters
percentage_rangeIf set to true, the palette range will be scaled to the maximum palette value

◆ setPalettePosition()

virtual setPalettePosition ( graphics::Position  pos)
virtual

Sets the position for the current palette.

Parameters
poscontains the position of the palette.

◆ setPaletteType()

virtual setPaletteType ( PaletteTypePtr  palette)
virtual

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

Parameters
palettecontains the definition of the palette.

◆ SetPan()

SetPan ( float  x,
float  y 
)

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

Parameters
xx value of pan
yy value of pan

◆ setPerspective()

setPerspective ( bool  persp)

Enable/Disable use of perspective in rendering scene

Parameters
perspif true, enable use of perspective, if false disable perspective

◆ setPointSize()

setPointSize ( float  size)

set the size of points relative to model size

Parameters
sizethe size of points

◆ SetRotation()

SetRotation ( float  angle,
float  x,
float  y,
float  z 
)

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

Parameters
angleThe rotation angle in [°]
xx-component of rotation axis
yy-component of rotation axis
zz-component of rotation axis

◆ setRuler()

setRuler ( bool  on)

Sets visibility of ruler.

Parameters
onthe visibility of the ruler

◆ SetScale()

SetScale ( float  z)

Sets current length scale and zoom factor accordingly.

Parameters
Lengthscale

◆ SetSlice() [1/2]

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
ptpoint through which the slicing plane passes
dirdirection 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.
Refer to Wolfram: Plane for an explanation of the plane definition

◆ SetSlice() [2/2]

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
acoeffcient $a$ in the plane equation
bcoeffcient $b$ in the plane equation
ccoeffcient $c$ in the plane equation
dcoeffcient $d$ in the plane equation
Note
Refer to Wolfram: Plane for an explanation of the plane definition

◆ SetTetCoordinates()

SetTetCoordinates ( Matrix  coor)

Sets all coordinates of tet vertices.

Parameters
coorMatrix containing the coordinates

◆ SetUnconnectedPointCoordinates()

SetUnconnectedPointCoordinates ( Matrix  coor)

Sets morphed coordinates of unconnected points.

Parameters
coorMatrix containing the coordinates

◆ SetValues()

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
inputsthe given random field amplitudes or FMOP inputs
databasethe database we refer to

◆ SetZoom()

SetZoom ( float  z)

Sets current zoom factor.

Parameters
Currentzoom factor

◆ showRuler()

bool showRuler ( )
Returns
m_show_ruler

Connect with Ansys