Skip to main content

optiSLang 3D Postprocessing Script API 2025 R1

Graphics

Last update: 16.07.2025

Display and manipulate 3D graphics. More...

Classes

class  AllRenderData
 collects all data source settings for all possible combinations: More...
 
struct  DataObjectToGraphicsIndices
 a class that collects data that is required to transfer the data from a DataObject to the vertices of the OpenGL scene. More...
 
class  RenderData
 defines the source of visible data More...
 
class  Scene
 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...
 
class  SceneManager
 A manager class for 3D visualization of a structure. More...
 
struct  VertexValues
 Data containing information about the field data in simplified form. More...
 
struct  VerticesNormalsVisibility
 Data containing information about the structure in simplified form. More...
 

Typedefs

typedef EntityValueTuple< Element *> ElementValueTuple
 
typedef std::pair< int, float > indexValuePair
 
typedef Eigen::MatrixXf MatrixXhf
 
typedef EntityValueTuple< Point *> NodeValueTuple
 
typedef boost::shared_ptr< PaletteType > PaletteTypePtr
 
typedef Eigen::VectorXf VectorXhf
 
typedef Eigen::Matrix< unsigned char, Eigen::Dynamic, 1 > VectorXuc
 

Enumerations

enum  contourType { lineContour =0, planeContour }
 
enum  Position {
  center = 0, west, east, north,
  south, southwest, northwest, northeast,
  southeast, none
}
 
enum  renderMode { drawFaces =0, drawLines, drawOutline }
 

Functions

graphics::VertexValues extract_data_object (Structure database, VerticesNormalsVisibility vnv, DataObject::ptr_type dataObject)
 Extract the field data into a simplified triangle representation for visualization. More...
 
graphics::VerticesNormalsVisibility extract_reference_mesh (Structure database, bool doTets)
 Extract the mesh into a simplified triangle representation for visualization. More...
 
template<dataobject_types SET_TYPE>
bool isPartOfReferenceSet (Element element, Point point_A, Point point_B, Point point_C, Structure database)
 determines if the given vertex belongs to the reference node or element set More...
 
graphics::SceneManager sceneManager ()
 gives access to the global scene manager object More...
 
std::vector< bool > validTriangles (Element *current_element, element::ETFace etface)
 Checks the validity of the triangles defining one face of an element. More...
 

Detailed Description

Display and manipulate 3D graphics.

Function Documentation

◆ extract_data_object()

graphics::VertexValues extract_data_object ( Structure  database,
VerticesNormalsVisibility  vnv,
DataObject::ptr_type  dataObject 
)

Extract the field data into a simplified triangle representation for visualization.

Parameters
databasereference mesh
vnvcontains the structural information
dataObjectfield data; the index space must be compatible eith database.indexMapper
Returns
simplified description

◆ extract_reference_mesh()

graphics::VerticesNormalsVisibility extract_reference_mesh ( Structure  database,
bool  doTets 
)

Extract the mesh into a simplified triangle representation for visualization.

Parameters
databasereference mesh
doTetsindicates if volume data should be handled
Returns
simplified description
Warning
This method shall be used to create a standalone Scene via script API only! It's currently used in test cases and in customer scripts. Therefor, do not remove it! In C++ use the overloaded extract_refernce_mesh ( Structure , graphics::VerticesNormalsVisibility , bool ) method.

◆ isPartOfReferenceSet()

bool isPartOfReferenceSet ( Element  element,
Point  point_A,
Point  point_B,
Point  point_C,
Structure  database 
)

determines if the given vertex belongs to the reference node or element set

The decision on chosing the element reference set or the node reference set is done trough the template parameter SET_TYPE

Template Parameters
SET_TYPEdefines if the reference set is the node set or the element set
Parameters
elementthe element to which the current graphics vertex belongs to. If an element set is used as reference, only the element is taken for test purposes
point_Athe 1st point of the current OpenGL triangle
point_Bthe 2nd point of the current OpenGL triangle
point_Cthe 3rd point of the current OpenGL triangle. If the reference set type is of type node, then all of the triangle vertices must be part of the reference node set in order to be visible.
Returns
true if the vertex is part of the reference set, false: if it is not part.

◆ sceneManager()

graphics::SceneManager sceneManager ( )

gives access to the global scene manager object

Returns
a reference to the object scenemanager_ptr (the object must be valid!), stored in
See also
application_data

◆ validTriangles()

std::vector<bool> validTriangles ( Element current_element,
element::ETFace  etface 
)

Checks the validity of the triangles defining one face of an element.

Parameters
current_elementthe element which should be checked
etfacethe face of the element which should be checked
Returns
a boolean vector defining the validity

Connect with Ansys