AGXDynamics  2.31.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 .agxLua 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 .agxLua file into to 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...
 
AGXMEX_EXPORT int AGXMEX_terminateAgx ()
 Terminates the "simulation". More...
 

Function Documentation

AGXMEX_EXPORT int AGXMEX_getInitInputSize ( )

Returns the size of the init input array for AGXMEX_stepAgx.

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_EXPORT int AGXMEX_getInitOutputSize ( )

Returns the size of the init output array for AGXMEX_stepAgx.

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_EXPORT const char* AGXMEX_getLastErrorMessage ( )

Returns last error message. Empty if no error.

AGXMEX_EXPORT int AGXMEX_getStepInputSize ( )

Returns the size of the step input array for AGXMEX_stepAgx.

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_EXPORT int AGXMEX_getStepOutputSize ( )

Returns the size of the step output array for AGXMEX_stepAgx.

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_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_EXPORT int AGXMEX_loadFileAgx ( double *  initInput,
double *  initOutput 
)

Loads the scene specified int a .agxLua 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_EXPORT int AGXMEX_preloadFileAgx ( const char *  file,
int *  initInputSize,
int *  initOutputSize,
int *  stepInputSize,
int *  stepOutputSize 
)

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

Parameters
file- path to a configuration file specifying the simulation content
initInputSize,:Number of elements in input array of doubles used in init function
initOutputSize,:Number of elements in output array of doubles used in init function
stepInputSize,:Number of elements in input array of doubles used in step function
stepOutputSize,:Number of elements in output array of doubles used in step function
Returns
0 on success, non-zero on failure.
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_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
flag,:0 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_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.
AGXMEX_EXPORT int AGXMEX_terminateAgx ( )

Terminates the "simulation".

Must be called after all other functions. Can only be called once.