Adding homogeneous medium methods

parent 9beb3033
......@@ -112,6 +112,19 @@ static struct PyMethodDef va_methods[] =
{ "get_sound_portal_enabled", ( PyCFunction ) get_sound_portal_enabled, METH_FASTCALL, no_doc },
{ "set_sound_portal_enabled", ( PyCFunction ) set_sound_portal_enabled, METH_FASTCALL, no_doc },
{ "get_homogeneous_medium_sound_speed", ( PyCFunction ) get_homogeneous_medium_sound_speed, METH_FASTCALL, no_doc },
{ "set_homogeneous_medium_sound_speed", ( PyCFunction ) set_homogeneous_medium_sound_speed, METH_FASTCALL, no_doc },
{ "get_homogeneous_medium_temperature", ( PyCFunction ) get_homogeneous_medium_temperature, METH_FASTCALL, no_doc },
{ "set_homogeneous_medium_temperature", ( PyCFunction ) set_homogeneous_medium_temperature, METH_FASTCALL, no_doc },
{ "get_homogeneous_medium_static_pressure", ( PyCFunction ) get_homogeneous_medium_static_pressure, METH_FASTCALL, no_doc },
{ "get_homogeneous_medium_static_pressure", ( PyCFunction ) get_homogeneous_medium_static_pressure, METH_FASTCALL, no_doc },
{ "get_homogeneous_medium_relative_humidity", ( PyCFunction ) get_homogeneous_medium_relative_humidity, METH_FASTCALL, no_doc },
{ "set_homogeneous_medium_relative_humidity", ( PyCFunction ) set_homogeneous_medium_relative_humidity, METH_FASTCALL, no_doc },
{ "get_homogeneous_medium_shift_speed", ( PyCFunction ) get_homogeneous_medium_shift_speed, METH_FASTCALL, no_doc },
{ "set_homogeneous_medium_shift_speed", ( PyCFunction ) set_homogeneous_medium_shift_speed, METH_FASTCALL, no_doc },
{ "get_homogeneous_medium_parameters", ( PyCFunction ) get_homogeneous_medium_parameters, METH_FASTCALL, no_doc },
{ "set_homogeneous_medium_parameters", ( PyCFunction ) set_homogeneous_medium_parameters, METH_FASTCALL, no_doc },
{ "get_rendering_modules", ( PyCFunction ) get_rendering_modules, METH_FASTCALL, no_doc },
{ "set_rendering_module_muted", ( PyCFunction ) set_rendering_module_muted, METH_FASTCALL, no_doc },
{ "get_rendering_module_muted", ( PyCFunction ) get_rendering_module_muted, METH_FASTCALL, no_doc },
......
......@@ -271,9 +271,7 @@ static PyObject* call_module( PyObject*, PyObject** ppArgs, Py_ssize_t nArgs, Py
std::string sModuleName = std::string( pcModuleName );
CVAStruct oInArgs = ConvertPythonDictToVAStruct( pArgumentsDict );
CVAStruct oOutArgs;
oOutArgs = g_pVANetClient->GetCoreInstance()->CallModule( sModuleName, oInArgs );
CVAStruct oOutArgs = g_pVANetClient->GetCoreInstance()->CallModule( sModuleName, oInArgs );
return ConvertVAStructToPythonDict( oOutArgs );
......@@ -1742,6 +1740,164 @@ static PyObject* set_sound_portal_enabled( PyObject*, PyObject** ppArgs, Py_ssiz
VAPY_CATCH_RETURN;
};
static PyObject* get_homogeneous_medium_sound_speed( PyObject*, PyObject**, Py_ssize_t, PyObject* )
{
VAPY_REQUIRE_CONN_TRY;
return PyFloat_FromDouble( g_pVANetClient->GetCoreInstance()->GetHomogeneousMediumSoundSpeed() );
VAPY_CATCH_RETURN;
};
static PyObject* set_homogeneous_medium_sound_speed( PyObject*, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames )
{
VAPY_REQUIRE_CONN_TRY;
static const char * const _keywords[] = { "sound_speed", NULL };
static _PyArg_Parser _parser = { "d:set_homogeneous_medium_sound_speed", _keywords, 0 };
double dSoundSpeed = -1;
if( !_PyArg_ParseStack( ppArgs, nArgs, pKeywordNames, &_parser, &dSoundSpeed ) )
return NULL;
g_pVANetClient->GetCoreInstance()->SetHomogeneousMediumSoundSpeed( dSoundSpeed );
return Py_None;
VAPY_CATCH_RETURN;
};
static PyObject* get_homogeneous_medium_temperature( PyObject*, PyObject**, Py_ssize_t, PyObject* )
{
VAPY_REQUIRE_CONN_TRY;
return PyFloat_FromDouble( g_pVANetClient->GetCoreInstance()->GetHomogeneousMediumTemperature() );
VAPY_CATCH_RETURN;
};
static PyObject* set_homogeneous_medium_temperature( PyObject*, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames )
{
VAPY_REQUIRE_CONN_TRY;
static const char * const _keywords[] = { "temperature", NULL };
static _PyArg_Parser _parser = { "d:set_homogeneous_medium_temperature", _keywords, 0 };
double dTemperature = -1;
if( !_PyArg_ParseStack( ppArgs, nArgs, pKeywordNames, &_parser, &dTemperature ) )
return NULL;
g_pVANetClient->GetCoreInstance()->SetHomogeneousMediumTemperature( dTemperature );
return Py_None;
VAPY_CATCH_RETURN;
};
static PyObject* get_homogeneous_medium_static_pressure( PyObject*, PyObject**, Py_ssize_t, PyObject* )
{
VAPY_REQUIRE_CONN_TRY;
return PyFloat_FromDouble( g_pVANetClient->GetCoreInstance()->GetHomogeneousMediumStaticPressure() );
VAPY_CATCH_RETURN;
};
static PyObject* set_homogeneous_medium_static_pressure( PyObject*, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames )
{
VAPY_REQUIRE_CONN_TRY;
static const char * const _keywords[] = { "static_pressure", NULL };
static _PyArg_Parser _parser = { "d:set_homogeneous_medium_static_pressure", _keywords, 0 };
double dStaticPressure = -1;
if( !_PyArg_ParseStack( ppArgs, nArgs, pKeywordNames, &_parser, &dStaticPressure ) )
return NULL;
g_pVANetClient->GetCoreInstance()->SetHomogeneousMediumStaticPressure( dStaticPressure );
return Py_None;
VAPY_CATCH_RETURN;
};
static PyObject* get_homogeneous_medium_relative_humidity( PyObject*, PyObject**, Py_ssize_t, PyObject* )
{
VAPY_REQUIRE_CONN_TRY;
return PyFloat_FromDouble( g_pVANetClient->GetCoreInstance()->GetHomogeneousMediumRelativeHumidity() );
VAPY_CATCH_RETURN;
};
static PyObject* set_homogeneous_medium_relative_humidity( PyObject*, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames )
{
VAPY_REQUIRE_CONN_TRY;
static const char * const _keywords[] = { "relative_humidity", NULL };
static _PyArg_Parser _parser = { "d:set_homogeneous_medium_relative_humidity", _keywords, 0 };
double dRelativeHumidity = -1;
if( !_PyArg_ParseStack( ppArgs, nArgs, pKeywordNames, &_parser, &dRelativeHumidity ) )
return NULL;
g_pVANetClient->GetCoreInstance()->SetHomogeneousMediumRelativeHumidity( dRelativeHumidity );
return Py_None;
VAPY_CATCH_RETURN;
};
static PyObject* get_homogeneous_medium_shift_speed( PyObject*, PyObject**, Py_ssize_t, PyObject* )
{
VAPY_REQUIRE_CONN_TRY;
VAVec3 v3ShiftSpeed = g_pVANetClient->GetCoreInstance()->GetHomogeneousMediumShiftSpeed();
PyObject* pList = PyList_New( 3 );
PyList_SetItem( pList, 0, PyFloat_FromDouble( v3ShiftSpeed.x ) );
PyList_SetItem( pList, 1, PyFloat_FromDouble( v3ShiftSpeed.y ) );
PyList_SetItem( pList, 2, PyFloat_FromDouble( v3ShiftSpeed.z ) );
return pList;
VAPY_CATCH_RETURN;
};
static PyObject* set_homogeneous_medium_shift_speed( PyObject*, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames )
{
VAPY_REQUIRE_CONN_TRY;
static const char * const _keywords[] = { "shift_speed", NULL };
static _PyArg_Parser _parser = { "(ddd):set_homogeneous_medium_shift_speed", _keywords, 0 };
VAVec3 v3ShiftSpeed;
if( !_PyArg_ParseStack( ppArgs, nArgs, pKeywordNames, &_parser, &v3ShiftSpeed.x, &v3ShiftSpeed.y, &v3ShiftSpeed.z ) )
return NULL;
g_pVANetClient->GetCoreInstance()->SetHomogeneousMediumShiftSpeed( v3ShiftSpeed );
return Py_None;
VAPY_CATCH_RETURN;
};
static PyObject* get_homogeneous_medium_parameters( PyObject*, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames )
{
VAPY_REQUIRE_CONN_TRY;
static const char * const _keywords[] = { "arguments", NULL };
static _PyArg_Parser _parser = { "|O!:get_homogeneous_medium_parameters", _keywords, 0 };
PyObject* pParamArgs = nullptr;
if( !_PyArg_ParseStack( ppArgs, nArgs, pKeywordNames, &_parser, pParamArgs ) )
return NULL;
CVAStruct oArgs = ConvertPythonDictToVAStruct( pParamArgs );
CVAStruct oParameters = g_pVANetClient->GetCoreInstance()->GetHomogeneousMediumParameters( oArgs );
return ConvertVAStructToPythonDict( oParameters );
VAPY_CATCH_RETURN;
};
static PyObject* set_homogeneous_medium_parameters( PyObject*, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames )
{
VAPY_REQUIRE_CONN_TRY;
static const char * const _keywords[] = { "parameters", NULL };
static _PyArg_Parser _parser = { "O!:set_homogeneous_medium_parameters", _keywords, 0 };
PyObject* pParameters = nullptr;
if( !_PyArg_ParseStack( ppArgs, nArgs, pKeywordNames, &_parser, &pParameters ) )
return NULL;
CVAStruct oParameters = ConvertPythonDictToVAStruct( pParameters );
g_pVANetClient->GetCoreInstance()->SetHomogeneousMediumParameters( oParameters );
return Py_None;
VAPY_CATCH_RETURN;
};
static PyObject* get_rendering_modules( PyObject*, PyObject* )
{
VAPY_REQUIRE_CONN_TRY;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment