Skip to main content

optiSLang 3D Postprocessing Script API 2025 R1

CustomModelTester Class Reference

Last update: 16.07.2025

This class can be used in python context to check if all Interface functions of a custom model are implemented correctly. More...

Public Member Functions

virtual string __str__ ()
 Function to allow printing instances of this class in python. More...
 
 CustomModelTester ()
 Constructor.
 
virtual deserializeModel (string state)
 Function to deserializatize a model from its former state-string. More...
 
virtual string serializeModel ()
 Function to call the python models serialization function and return its state as a string. More...
 
virtual bool test (Matrix points)
 Tests the model by invoking all of its API functions. Does not perform correctness checks. Just checks if the Interface is callable. More...
 
virtual bool testSerialization ()
 Tests if the models serialization functions are working. More...
 

Public Attributes

apply SWIGTYPE * DISOWN
 Destructor. More...
 

Detailed Description

This class can be used in python context to check if all Interface functions of a custom model are implemented correctly.

Member Function Documentation

◆ __str__()

virtual string __str__ ( )
virtual

Function to allow printing instances of this class in python.

Returns
A string with information on the instance

◆ deserializeModel()

virtual deserializeModel ( string  state)
virtual

Function to deserializatize a model from its former state-string.

Parameters
stateEncoded state of the custom model

◆ serializeModel()

virtual string serializeModel ( )
virtual

Function to call the python models serialization function and return its state as a string.

Returns
Encoded state of the custom model

◆ test()

virtual bool test ( Matrix  points)
virtual

Tests the model by invoking all of its API functions. Does not perform correctness checks. Just checks if the Interface is callable.

Parameters
pointsThe points to call the models function with
Returns
True iff all API functions are present.

◆ testSerialization()

virtual bool testSerialization ( )
virtual

Tests if the models serialization functions are working.

Returns
True iff both serialization and deserialization is working

Member Data Documentation

◆ DISOWN

apply SWIGTYPE * DISOWN
Initial value:
virtual registerModel(CustomModelInterface * model)

Destructor.

Internal function for the python classes to interact with the underlying cpp model Should not be called by a user, needs to be public in SWIG context.

Register a custom model with the CustomModelTester Needs to be called from Python. Takes ownership of the pointer.

Parameters
modelThe model to use with the model tester
cpp_modelThe C++ wrapper model that can is used to manage the python model

Connect with Ansys