Base: apply clang format

This commit is contained in:
wmayer
2023-11-10 18:27:44 +01:00
committed by WandererFan
parent 41528339e4
commit e85c383bff
154 changed files with 11874 additions and 9872 deletions

View File

@@ -39,14 +39,15 @@ std::string AxisPy::representation() const
AxisPy::PointerType ptr = getAxisPtr();
std::stringstream str;
str << "Axis [Base=(";
str << ptr->getBase().x << ","<< ptr->getBase().y << "," << ptr->getBase().z;
str << ptr->getBase().x << "," << ptr->getBase().y << "," << ptr->getBase().z;
str << "), Direction=(";
str << ptr->getDirection().x << ","<< ptr->getDirection().y << "," << ptr->getDirection().z << ")]";
str << ptr->getDirection().x << "," << ptr->getDirection().y << "," << ptr->getDirection().z
<< ")]";
return str.str();
}
PyObject *AxisPy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Python wrapper
PyObject* AxisPy::PyMake(struct _typeobject*, PyObject*, PyObject*) // Python wrapper
{
// create a new instance of AxisPy and the Twin object
return new AxisPy(new Axis);
@@ -55,22 +56,21 @@ PyObject *AxisPy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Pytho
// constructor method
int AxisPy::PyInit(PyObject* args, PyObject* /*kwd*/)
{
PyObject* o{};
PyObject* o {};
if (PyArg_ParseTuple(args, "")) {
return 0;
}
PyErr_Clear();
if (PyArg_ParseTuple(args, "O!", &(Base::AxisPy::Type), &o)) {
Base::Axis *a = static_cast<Base::AxisPy*>(o)->getAxisPtr();
Base::Axis* a = static_cast<Base::AxisPy*>(o)->getAxisPtr();
*(getAxisPtr()) = *a;
return 0;
}
PyErr_Clear();
PyObject* d{};
if (PyArg_ParseTuple(args, "O!O!", &(Base::VectorPy::Type), &o,
&(Base::VectorPy::Type), &d)) {
PyObject* d {};
if (PyArg_ParseTuple(args, "O!O!", &(Base::VectorPy::Type), &o, &(Base::VectorPy::Type), &d)) {
// NOTE: The first parameter defines the base (origin) and the second the direction.
*getAxisPtr() = Base::Axis(static_cast<Base::VectorPy*>(o)->value(),
static_cast<Base::VectorPy*>(d)->value());
@@ -81,42 +81,46 @@ int AxisPy::PyInit(PyObject* args, PyObject* /*kwd*/)
return -1;
}
PyObject* AxisPy::move(PyObject * args)
PyObject* AxisPy::move(PyObject* args)
{
PyObject *vec{};
if (!PyArg_ParseTuple(args, "O!", &(VectorPy::Type), &vec))
PyObject* vec {};
if (!PyArg_ParseTuple(args, "O!", &(VectorPy::Type), &vec)) {
return nullptr;
}
getAxisPtr()->move(static_cast<VectorPy*>(vec)->value());
Py_Return;
}
PyObject* AxisPy::multiply(PyObject * args)
PyObject* AxisPy::multiply(PyObject* args)
{
PyObject *plm{};
if (!PyArg_ParseTuple(args, "O!", &(PlacementPy::Type), &plm))
PyObject* plm {};
if (!PyArg_ParseTuple(args, "O!", &(PlacementPy::Type), &plm)) {
return nullptr;
}
Axis mult = (*getAxisPtr()) * (*static_cast<PlacementPy*>(plm)->getPlacementPtr());
return new AxisPy(new Axis(mult));
}
PyObject* AxisPy::copy(PyObject * args)
PyObject* AxisPy::copy(PyObject* args)
{
if (!PyArg_ParseTuple(args, ""))
if (!PyArg_ParseTuple(args, "")) {
return nullptr;
}
return new AxisPy(new Axis(*getAxisPtr()));
}
PyObject* AxisPy::reversed(PyObject * args)
PyObject* AxisPy::reversed(PyObject* args)
{
if (!PyArg_ParseTuple(args, ""))
if (!PyArg_ParseTuple(args, "")) {
return nullptr;
}
Base::Axis a = getAxisPtr()->reversed();
return new AxisPy(new Axis(a));
}
Py::Object AxisPy::getBase() const
{
return Py::Vector(getAxisPtr()->getBase()); // NOLINT
return Py::Vector(getAxisPtr()->getBase()); // NOLINT
}
void AxisPy::setBase(Py::Object arg)
@@ -126,7 +130,7 @@ void AxisPy::setBase(Py::Object arg)
Py::Object AxisPy::getDirection() const
{
return Py::Vector(getAxisPtr()->getDirection()); // NOLINT
return Py::Vector(getAxisPtr()->getDirection()); // NOLINT
}
void AxisPy::setDirection(Py::Object arg)
@@ -134,7 +138,7 @@ void AxisPy::setDirection(Py::Object arg)
getAxisPtr()->setDirection(Py::Vector(arg).toVector());
}
PyObject *AxisPy::getCustomAttributes(const char* /*attr*/) const
PyObject* AxisPy::getCustomAttributes(const char* /*attr*/) const
{
return nullptr;
}
@@ -143,4 +147,3 @@ int AxisPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
{
return 0;
}