basic infrastructure
This commit is contained in:
committed by
Stefan Tröger
parent
638cfcc2cf
commit
474fbbcb3e
@@ -6,6 +6,7 @@
|
||||
// inclusion of the generated files (generated out of ItemAssemblyPy.xml)
|
||||
#include "ItemAssemblyPy.h"
|
||||
#include "ItemAssemblyPy.cpp"
|
||||
#include <ItemPartPy.h>
|
||||
|
||||
using namespace Assembly;
|
||||
|
||||
@@ -16,9 +17,39 @@ std::string ItemAssemblyPy::representation(void) const
|
||||
}
|
||||
|
||||
|
||||
PyObject* ItemAssemblyPy::addPart(PyObject * args)
|
||||
{
|
||||
PyObject *pcObj;
|
||||
if (!PyArg_ParseTuple(args, "O", &pcObj)) {
|
||||
Base::Console().Message("Test 1 fails\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (PyObject_TypeCheck(pcObj, &(Assembly::ItemPartPy::Type))) {
|
||||
Assembly::ItemPart *c = static_cast<Assembly::ItemPartPy*>(pcObj)->getItemPartPtr();
|
||||
getItemAssemblyPtr()->addPart(c);
|
||||
Base::Console().Message("Add Part\n");
|
||||
}
|
||||
else Base::Console().Message("Test 2 fails\n");
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
PyObject* ItemAssemblyPy::addComponent(PyObject * args)
|
||||
{
|
||||
PyObject *pcObj;
|
||||
if (!PyArg_ParseTuple(args, "O", &pcObj)) {
|
||||
Base::Console().Message("Test 1 fails\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (PyObject_TypeCheck(pcObj, &(Assembly::ItemAssemblyPy::Type))) {
|
||||
Assembly::ItemAssembly *c = static_cast<Assembly::ItemAssemblyPy*>(pcObj)->getItemAssemblyPtr();
|
||||
getItemAssemblyPtr()->addComponent(c);
|
||||
Base::Console().Message("Add Component\n");
|
||||
}
|
||||
else Base::Console().Message("Test 2 fails\n");
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
|
||||
PyObject *ItemAssemblyPy::getCustomAttributes(const char* /*attr*/) const
|
||||
|
||||
Reference in New Issue
Block a user