Base: apply clang format

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

View File

@@ -38,7 +38,7 @@ std::string CoordinateSystemPy::representation() const
return {"<CoordinateSystem object>"};
}
PyObject *CoordinateSystemPy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Python wrapper
PyObject* CoordinateSystemPy::PyMake(struct _typeobject*, PyObject*, PyObject*) // Python wrapper
{
// create a new instance of CoordinateSystemPy and the Twin object
return new CoordinateSystemPy(new CoordinateSystem);
@@ -50,9 +50,9 @@ int CoordinateSystemPy::PyInit(PyObject* /*args*/, PyObject* /*kwd*/)
return 0;
}
PyObject* CoordinateSystemPy::setAxes(PyObject * args)
PyObject* CoordinateSystemPy::setAxes(PyObject* args)
{
PyObject *axis{}, *xdir{};
PyObject *axis {}, *xdir {};
if (PyArg_ParseTuple(args, "O!O!", &(AxisPy::Type), &axis, &(VectorPy::Type), &xdir)) {
getCoordinateSystemPtr()->setAxes(*static_cast<AxisPy*>(axis)->getAxisPtr(),
*static_cast<VectorPy*>(xdir)->getVectorPtr());
@@ -70,29 +70,31 @@ PyObject* CoordinateSystemPy::setAxes(PyObject * args)
return nullptr;
}
PyObject* CoordinateSystemPy::displacement(PyObject * args)
PyObject* CoordinateSystemPy::displacement(PyObject* args)
{
PyObject *cs{};
if (!PyArg_ParseTuple(args, "O!", &(CoordinateSystemPy::Type), &cs))
PyObject* cs {};
if (!PyArg_ParseTuple(args, "O!", &(CoordinateSystemPy::Type), &cs)) {
return nullptr;
}
Placement p = getCoordinateSystemPtr()->displacement(
*static_cast<CoordinateSystemPy*>(cs)->getCoordinateSystemPtr());
return new PlacementPy(new Placement(p));
}
PyObject* CoordinateSystemPy::transformTo(PyObject * args)
PyObject* CoordinateSystemPy::transformTo(PyObject* args)
{
PyObject *vec{};
if (!PyArg_ParseTuple(args, "O!", &(VectorPy::Type), &vec))
PyObject* vec {};
if (!PyArg_ParseTuple(args, "O!", &(VectorPy::Type), &vec)) {
return nullptr;
}
Vector3d v = static_cast<VectorPy*>(vec)->value();
getCoordinateSystemPtr()->transformTo(v);
return new VectorPy(new Vector3d(v));
}
PyObject* CoordinateSystemPy::transform(PyObject * args)
PyObject* CoordinateSystemPy::transform(PyObject* args)
{
PyObject *plm{};
PyObject* plm {};
if (PyArg_ParseTuple(args, "O!", &(PlacementPy::Type), &plm)) {
getCoordinateSystemPtr()->transform(*static_cast<PlacementPy*>(plm)->getPlacementPtr());
Py_Return;
@@ -108,11 +110,12 @@ PyObject* CoordinateSystemPy::transform(PyObject * args)
return nullptr;
}
PyObject* CoordinateSystemPy::setPlacement(PyObject * args)
PyObject* CoordinateSystemPy::setPlacement(PyObject* args)
{
PyObject *plm{};
if (!PyArg_ParseTuple(args, "O!", &(PlacementPy::Type), &plm))
PyObject* plm {};
if (!PyArg_ParseTuple(args, "O!", &(PlacementPy::Type), &plm)) {
return nullptr;
}
getCoordinateSystemPtr()->setPlacement(*static_cast<PlacementPy*>(plm)->getPlacementPtr());
Py_Return;
}
@@ -126,7 +129,7 @@ Py::Object CoordinateSystemPy::getAxis() const
void CoordinateSystemPy::setAxis(Py::Object arg)
{
if (PyObject_TypeCheck(arg.ptr(), &(Base::AxisPy::Type))) {
AxisPy *axis = static_cast<AxisPy*>(arg.ptr());
AxisPy* axis = static_cast<AxisPy*>(arg.ptr());
getCoordinateSystemPtr()->setAxis(*axis->getAxisPtr());
return;
}
@@ -136,7 +139,7 @@ void CoordinateSystemPy::setAxis(Py::Object arg)
Py::Object CoordinateSystemPy::getXDirection() const
{
return Py::Vector(getCoordinateSystemPtr()->getXDirection()); // NOLINT
return Py::Vector(getCoordinateSystemPtr()->getXDirection()); // NOLINT
}
void CoordinateSystemPy::setXDirection(Py::Object arg)
@@ -146,7 +149,7 @@ void CoordinateSystemPy::setXDirection(Py::Object arg)
Py::Object CoordinateSystemPy::getYDirection() const
{
return Py::Vector(getCoordinateSystemPtr()->getYDirection()); // NOLINT
return Py::Vector(getCoordinateSystemPtr()->getYDirection()); // NOLINT
}
void CoordinateSystemPy::setYDirection(Py::Object arg)
@@ -156,7 +159,7 @@ void CoordinateSystemPy::setYDirection(Py::Object arg)
Py::Object CoordinateSystemPy::getZDirection() const
{
return Py::Vector(getCoordinateSystemPtr()->getZDirection()); // NOLINT
return Py::Vector(getCoordinateSystemPtr()->getZDirection()); // NOLINT
}
void CoordinateSystemPy::setZDirection(Py::Object arg)
@@ -166,7 +169,7 @@ void CoordinateSystemPy::setZDirection(Py::Object arg)
Py::Object CoordinateSystemPy::getPosition() const
{
return Py::Vector(getCoordinateSystemPtr()->getPosition()); // NOLINT
return Py::Vector(getCoordinateSystemPtr()->getPosition()); // NOLINT
}
void CoordinateSystemPy::setPosition(Py::Object arg)
@@ -174,7 +177,7 @@ void CoordinateSystemPy::setPosition(Py::Object arg)
getCoordinateSystemPtr()->setPosition(Py::Vector(arg).toVector());
}
PyObject *CoordinateSystemPy::getCustomAttributes(const char* /*attr*/) const
PyObject* CoordinateSystemPy::getCustomAttributes(const char* /*attr*/) const
{
return nullptr;
}