Mesh: Apply clang-format

This commit is contained in:
wmayer
2023-09-22 19:59:39 +02:00
committed by wwmayer
parent 70ba930230
commit 23db389a76
116 changed files with 15683 additions and 12447 deletions

View File

@@ -24,9 +24,11 @@
#include "MeshFeature.h"
// inclusion of the generated files (generated out of MeshFeaturePy.xml)
// clang-format off
#include <Mod/Mesh/App/MeshPy.h>
#include <Mod/Mesh/App/MeshFeaturePy.h>
#include <Mod/Mesh/App/MeshFeaturePy.cpp>
// clang-format on
using namespace Mesh;
@@ -41,51 +43,58 @@ std::string MeshFeaturePy::representation() const
return str.str();
}
PyObject* MeshFeaturePy::countPoints(PyObject * /*args*/)
PyObject* MeshFeaturePy::countPoints(PyObject* /*args*/)
{
return Py_BuildValue("i",getFeaturePtr()->Mesh.getValue().countPoints());
return Py_BuildValue("i", getFeaturePtr()->Mesh.getValue().countPoints());
}
PyObject* MeshFeaturePy::countFacets(PyObject * /*args*/)
PyObject* MeshFeaturePy::countFacets(PyObject* /*args*/)
{
return Py_BuildValue("i",getFeaturePtr()->Mesh.getValue().countFacets());
return Py_BuildValue("i", getFeaturePtr()->Mesh.getValue().countFacets());
}
PyObject* MeshFeaturePy::harmonizeNormals(PyObject *args)
PyObject* MeshFeaturePy::harmonizeNormals(PyObject* args)
{
if (!PyArg_ParseTuple(args, ""))
if (!PyArg_ParseTuple(args, "")) {
return nullptr;
}
PY_TRY {
Mesh::MeshObject *mesh = getFeaturePtr()->Mesh.startEditing();
PY_TRY
{
Mesh::MeshObject* mesh = getFeaturePtr()->Mesh.startEditing();
mesh->harmonizeNormals();
getFeaturePtr()->Mesh.finishEditing();
} PY_CATCH;
}
PY_CATCH;
Py_Return;
}
PyObject* MeshFeaturePy::smooth(PyObject *args)
PyObject* MeshFeaturePy::smooth(PyObject* args)
{
int iter=1;
float d_max=FLOAT_MAX;
if (!PyArg_ParseTuple(args, "|if", &iter,&d_max))
int iter = 1;
float d_max = FLOAT_MAX;
if (!PyArg_ParseTuple(args, "|if", &iter, &d_max)) {
return nullptr;
}
PY_TRY {
PY_TRY
{
Mesh::Feature* obj = getFeaturePtr();
MeshObject* kernel = obj->Mesh.startEditing();
kernel->smooth(iter, d_max);
obj->Mesh.finishEditing();
} PY_CATCH;
}
PY_CATCH;
Py_Return;
}
PyObject* MeshFeaturePy::removeNonManifolds(PyObject *args)
PyObject* MeshFeaturePy::removeNonManifolds(PyObject* args)
{
if (!PyArg_ParseTuple(args, ""))
if (!PyArg_ParseTuple(args, "")) {
return nullptr;
}
Mesh::Feature* obj = getFeaturePtr();
MeshObject* kernel = obj->Mesh.startEditing();
kernel->removeNonManifolds();
@@ -93,10 +102,11 @@ PyObject* MeshFeaturePy::removeNonManifolds(PyObject *args)
Py_Return;
}
PyObject* MeshFeaturePy::removeNonManifoldPoints(PyObject *args)
PyObject* MeshFeaturePy::removeNonManifoldPoints(PyObject* args)
{
if (!PyArg_ParseTuple(args, ""))
if (!PyArg_ParseTuple(args, "")) {
return nullptr;
}
Mesh::Feature* obj = getFeaturePtr();
MeshObject* kernel = obj->Mesh.startEditing();
kernel->removeNonManifoldPoints();
@@ -104,71 +114,84 @@ PyObject* MeshFeaturePy::removeNonManifoldPoints(PyObject *args)
Py_Return;
}
PyObject* MeshFeaturePy::fixIndices(PyObject *args)
PyObject* MeshFeaturePy::fixIndices(PyObject* args)
{
if (!PyArg_ParseTuple(args, ""))
if (!PyArg_ParseTuple(args, "")) {
return nullptr;
}
PY_TRY {
PY_TRY
{
Mesh::Feature* obj = getFeaturePtr();
MeshObject* kernel = obj->Mesh.startEditing();
kernel->validateIndices();
obj->Mesh.finishEditing();
} PY_CATCH;
}
PY_CATCH;
Py_Return;
}
PyObject* MeshFeaturePy::fixDegenerations(PyObject *args)
PyObject* MeshFeaturePy::fixDegenerations(PyObject* args)
{
float fEpsilon = MeshCore::MeshDefinitions::_fMinPointDistanceP2;
if (!PyArg_ParseTuple(args, "|f", &fEpsilon))
if (!PyArg_ParseTuple(args, "|f", &fEpsilon)) {
return nullptr;
}
PY_TRY {
PY_TRY
{
Mesh::Feature* obj = getFeaturePtr();
MeshObject* kernel = obj->Mesh.startEditing();
kernel->validateDegenerations(fEpsilon);
obj->Mesh.finishEditing();
} PY_CATCH;
}
PY_CATCH;
Py_Return;
}
PyObject* MeshFeaturePy::removeDuplicatedFacets(PyObject *args)
PyObject* MeshFeaturePy::removeDuplicatedFacets(PyObject* args)
{
if (!PyArg_ParseTuple(args, ""))
if (!PyArg_ParseTuple(args, "")) {
return nullptr;
}
PY_TRY {
PY_TRY
{
Mesh::Feature* obj = getFeaturePtr();
MeshObject* kernel = obj->Mesh.startEditing();
kernel->removeDuplicatedFacets();
obj->Mesh.finishEditing();
} PY_CATCH;
}
PY_CATCH;
Py_Return;
}
PyObject* MeshFeaturePy::removeDuplicatedPoints(PyObject *args)
PyObject* MeshFeaturePy::removeDuplicatedPoints(PyObject* args)
{
if (!PyArg_ParseTuple(args, ""))
if (!PyArg_ParseTuple(args, "")) {
return nullptr;
}
PY_TRY {
PY_TRY
{
Mesh::Feature* obj = getFeaturePtr();
MeshObject* kernel = obj->Mesh.startEditing();
kernel->removeDuplicatedPoints();
obj->Mesh.finishEditing();
} PY_CATCH;
}
PY_CATCH;
Py_Return;
}
PyObject* MeshFeaturePy::fixSelfIntersections(PyObject *args)
PyObject* MeshFeaturePy::fixSelfIntersections(PyObject* args)
{
if (!PyArg_ParseTuple(args, ""))
if (!PyArg_ParseTuple(args, "")) {
return nullptr;
}
try {
Mesh::Feature* obj = getFeaturePtr();
MeshObject* kernel = obj->Mesh.startEditing();
@@ -182,10 +205,11 @@ PyObject* MeshFeaturePy::fixSelfIntersections(PyObject *args)
Py_Return;
}
PyObject* MeshFeaturePy::removeFoldsOnSurface(PyObject *args)
PyObject* MeshFeaturePy::removeFoldsOnSurface(PyObject* args)
{
if (!PyArg_ParseTuple(args, ""))
if (!PyArg_ParseTuple(args, "")) {
return nullptr;
}
try {
Mesh::Feature* obj = getFeaturePtr();
MeshObject* kernel = obj->Mesh.startEditing();
@@ -199,10 +223,11 @@ PyObject* MeshFeaturePy::removeFoldsOnSurface(PyObject *args)
Py_Return;
}
PyObject* MeshFeaturePy::removeInvalidPoints(PyObject *args)
PyObject* MeshFeaturePy::removeInvalidPoints(PyObject* args)
{
if (!PyArg_ParseTuple(args, ""))
if (!PyArg_ParseTuple(args, "")) {
return nullptr;
}
try {
Mesh::Feature* obj = getFeaturePtr();
MeshObject* kernel = obj->Mesh.startEditing();
@@ -216,7 +241,7 @@ PyObject* MeshFeaturePy::removeInvalidPoints(PyObject *args)
Py_Return;
}
PyObject *MeshFeaturePy::getCustomAttributes(const char* /*attr*/) const
PyObject* MeshFeaturePy::getCustomAttributes(const char* /*attr*/) const
{
return nullptr;
}