AGX Dynamics  2.37.3.2
agxMexDLLInterface.h File Reference
#include <agxMex/export.h>

Go to the source code of this file.

Functions

AGXMEX_EXPORT int AGXMEX_getInitInputSize ()
 Returns the size of the init input array for AGXMEX_stepAgx. More...
 
AGXMEX_EXPORT const char * AGXMEX_getInitInputValueName (unsigned int valueNr)
 Returns the name of a specific init input value for AGXMEX_stepAgx. More...
 
AGXMEX_EXPORT int AGXMEX_getInitOutputSize ()
 Returns the size of the init output array for AGXMEX_stepAgx. More...
 
AGXMEX_EXPORT const char * AGXMEX_getInitOutputValueName (unsigned int valueNr)
 Returns the name of a specific init output value for AGXMEX_stepAgx. More...
 
AGXMEX_EXPORT const char * AGXMEX_getLastErrorMessage ()
 Returns last error message. Empty if no error. More...
 
AGXMEX_EXPORT int AGXMEX_getStepInputSize ()
 Returns the size of the step input array for AGXMEX_stepAgx. More...
 
AGXMEX_EXPORT const char * AGXMEX_getStepInputValueName (unsigned int valueNr)
 Returns the name of a specific step input value for AGXMEX_stepAgx. More...
 
AGXMEX_EXPORT int AGXMEX_getStepOutputSize ()
 Returns the size of the step output array for AGXMEX_stepAgx. More...
 
AGXMEX_EXPORT const char * AGXMEX_getStepOutputValueName (unsigned int valueNr)
 Returns the name of a specific step output value for AGXMEX_stepAgx. More...
 
AGXMEX_EXPORT int AGXMEX_initAgx (const char *debugFile, const char *agxFilePath, const char *agxPluginPath, const char *osgFilePath)
 Initialize the "simulation", must be called prior to any of the other functions. More...
 
AGXMEX_EXPORT int AGXMEX_loadFileAgx (double *initInput, double *initOutput)
 Loads the scene specified int a .agxPy file into to the simulation. More...
 
AGXMEX_EXPORT int AGXMEX_preloadFileAgx (const char *file, int *initInputSize, int *initOutputSize, int *stepInputSize, int *stepOutputSize)
 Preloads the scene specified int a .agxPy file into to the simulation. More...
 
AGXMEX_EXPORT int AGXMEX_resetAgx ()
 Reset the "simulation". More...
 
AGXMEX_EXPORT int AGXMEX_setTimeStepAgx (double timeStep)
 
AGXMEX_EXPORT int AGXMEX_setUseCoSimulation (int flag)
 Sets if the simulation should use remote debugging. More...
 
AGXMEX_EXPORT int AGXMEX_stepAgx (const double *input, double *output)
 Step the "simulation". More...
 

Function Documentation

◆ AGXMEX_getInitInputSize()

AGXMEX_EXPORT int AGXMEX_getInitInputSize ( )

Returns the size of the init input array for AGXMEX_stepAgx.

◆ AGXMEX_getInitInputValueName()

AGXMEX_EXPORT const char* AGXMEX_getInitInputValueName ( unsigned int  valueNr)

Returns the name of a specific init input value for AGXMEX_stepAgx.

Parameters
valueNrThe number of the value. Must be smaller than the return value of AGXMEX_getInputSize().
Return values
Thename of the input value. 0 for invalid valueNr.

◆ AGXMEX_getInitOutputSize()

AGXMEX_EXPORT int AGXMEX_getInitOutputSize ( )

Returns the size of the init output array for AGXMEX_stepAgx.

◆ AGXMEX_getInitOutputValueName()

AGXMEX_EXPORT const char* AGXMEX_getInitOutputValueName ( unsigned int  valueNr)

Returns the name of a specific init output value for AGXMEX_stepAgx.

Parameters
valueNrThe number of the value. Must be smaller than the return value of AGXMEX_getOutputSize().
Return values
Thename of the output value. 0 for invalid valueNr.

◆ AGXMEX_getLastErrorMessage()

AGXMEX_EXPORT const char* AGXMEX_getLastErrorMessage ( )

Returns last error message. Empty if no error.

◆ AGXMEX_getStepInputSize()

AGXMEX_EXPORT int AGXMEX_getStepInputSize ( )

Returns the size of the step input array for AGXMEX_stepAgx.

◆ AGXMEX_getStepInputValueName()

AGXMEX_EXPORT const char* AGXMEX_getStepInputValueName ( unsigned int  valueNr)

Returns the name of a specific step input value for AGXMEX_stepAgx.

Parameters
valueNrThe number of the value. Must be smaller than the return value of AGXMEX_getInputSize().
Return values
Thename of the input value. 0 for invalid valueNr.

◆ AGXMEX_getStepOutputSize()

AGXMEX_EXPORT int AGXMEX_getStepOutputSize ( )

Returns the size of the step output array for AGXMEX_stepAgx.

◆ AGXMEX_getStepOutputValueName()

AGXMEX_EXPORT const char* AGXMEX_getStepOutputValueName ( unsigned int  valueNr)

Returns the name of a specific step output value for AGXMEX_stepAgx.

Parameters
valueNrThe number of the value. Must be smaller than the return value of AGXMEX_getOutputSize().
Return values
Thename of the output value. 0 for invalid valueNr.

◆ AGXMEX_initAgx()

AGXMEX_EXPORT int AGXMEX_initAgx ( const char *  debugFile,
const char *  agxFilePath,
const char *  agxPluginPath,
const char *  osgFilePath 
)

Initialize the "simulation", must be called prior to any of the other functions.

Can only be called once.

Parameters
debugFileWhich file should debug information be written to? 0 means stdout.
agxFilePathThe agx file path. Only needed in mixed OS-environments.
agxPluginPathThe agx plugin path. Only needed in mixed OS-environments.
osgFilePathThe osg file path. Only needed in mixed OS-environments.
Returns
0 on success, non-zero on failure.

◆ AGXMEX_loadFileAgx()

AGXMEX_EXPORT int AGXMEX_loadFileAgx ( double *  initInput,
double *  initOutput 
)

Loads the scene specified int a .agxPy file into to the simulation.

Parameters
initInputThe input to the init function. Should be of size initInputSize as given from the function AGXMEX_preloadFileAgx.
initOutputThe output from the init function. Should be of size initOutputSize as given from the function AGXMEX_preloadFileAgx.
Returns
0 on success, non-zero on failure.

◆ AGXMEX_preloadFileAgx()

AGXMEX_EXPORT int AGXMEX_preloadFileAgx ( const char *  file,
int *  initInputSize,
int *  initOutputSize,
int *  stepInputSize,
int *  stepOutputSize 
)

Preloads the scene specified int a .agxPy file into to the simulation.

Parameters
file- path to a configuration file specifying the simulation content
initInputSizeNumber of elements in input array of doubles used in init function
initOutputSizeNumber of elements in output array of doubles used in init function
stepInputSizeNumber of elements in input array of doubles used in step function
stepOutputSizeNumber of elements in output array of doubles used in step function
Returns
0 on success, non-zero on failure.

◆ AGXMEX_resetAgx()

AGXMEX_EXPORT int AGXMEX_resetAgx ( )

Reset the "simulation".

◆ AGXMEX_setTimeStepAgx()

AGXMEX_EXPORT int AGXMEX_setTimeStepAgx ( double  timeStep)
Parameters
timeStepThe simulation time step. E.g. 0.01 for a 100Hz simulation.
Returns
0 on success, non-zero on failure.

◆ AGXMEX_setUseCoSimulation()

AGXMEX_EXPORT int AGXMEX_setUseCoSimulation ( int  flag)

Sets if the simulation should use remote debugging.

This will have a quite high performance cost, since the whole simulation will be sent at 100Hz. Requirement: AGXMEX_initAgx must be called prior to this call.

Parameters
flag0 for false (deactivate remote debugger), 1 true (activate remote debugger) 2 hidden (activate remote debugger, no graphics window)
Returns
0 on success, non-zero on failure.

◆ AGXMEX_stepAgx()

AGXMEX_EXPORT int AGXMEX_stepAgx ( const double *  input,
double *  output 
)

Step the "simulation".

Requirement: AGXMEX_initAgx and AGXMEX_loadFileAgx must be called prior to this call.

Parameters
input- a pointer to an array with doubles containing in-data, size is specified by input_size
output- a pointer to an array with doubles containing out-data, size is specified by output_size
Returns
0 on success, non-zero on failure.