python: apply const method annotations to impls.

This commit is contained in:
Jacob Oursland
2025-04-16 20:29:19 -07:00
parent 7046f908f4
commit 5c251e73ac
69 changed files with 508 additions and 515 deletions

View File

@@ -90,7 +90,7 @@ int VectorPy::PyInit(PyObject* args, PyObject* /*kwd*/)
return -1;
}
PyObject* VectorPy::__reduce__(PyObject* args)
PyObject* VectorPy::__reduce__(PyObject* args) const
{
if (!PyArg_ParseTuple(args, "")) {
return nullptr;
@@ -277,7 +277,7 @@ PyObject* VectorPy::mapping_subscript(PyObject* self, PyObject* item)
return nullptr;
}
PyObject* VectorPy::add(PyObject* args)
PyObject* VectorPy::add(PyObject* args) const
{
PyObject* obj = nullptr;
if (!PyArg_ParseTuple(args, "O!", &(VectorPy::Type), &obj)) {
@@ -293,7 +293,7 @@ PyObject* VectorPy::add(PyObject* args)
return new VectorPy(v);
}
PyObject* VectorPy::sub(PyObject* args)
PyObject* VectorPy::sub(PyObject* args) const
{
PyObject* obj = nullptr;
if (!PyArg_ParseTuple(args, "O!", &(VectorPy::Type), &obj)) {
@@ -309,7 +309,7 @@ PyObject* VectorPy::sub(PyObject* args)
return new VectorPy(v);
}
PyObject* VectorPy::negative(PyObject* args)
PyObject* VectorPy::negative(PyObject* args) const
{
if (!PyArg_ParseTuple(args, "")) {
return nullptr;
@@ -345,7 +345,7 @@ PyObject* VectorPy::richCompare(PyObject* v, PyObject* w, int op)
return Py_NotImplemented;
}
PyObject* VectorPy::isEqual(PyObject* args)
PyObject* VectorPy::isEqual(PyObject* args) const
{
PyObject* obj = nullptr;
double tolerance = 0;
@@ -362,7 +362,7 @@ PyObject* VectorPy::isEqual(PyObject* args)
return Py::new_reference_to(eq);
}
PyObject* VectorPy::isParallel(PyObject* args)
PyObject* VectorPy::isParallel(PyObject* args) const
{
PyObject* obj = nullptr;
double tolerance = 0;
@@ -379,7 +379,7 @@ PyObject* VectorPy::isParallel(PyObject* args)
return Py::new_reference_to(parallel);
}
PyObject* VectorPy::isNormal(PyObject* args)
PyObject* VectorPy::isNormal(PyObject* args) const
{
PyObject* obj = nullptr;
double tolerance = 0;
@@ -422,7 +422,7 @@ PyObject* VectorPy::multiply(PyObject* args)
return Py::new_reference_to(this);
}
PyObject* VectorPy::dot(PyObject* args)
PyObject* VectorPy::dot(PyObject* args) const
{
PyObject* obj = nullptr;
if (!PyArg_ParseTuple(args, "O!", &(VectorPy::Type), &obj)) {
@@ -438,7 +438,7 @@ PyObject* VectorPy::dot(PyObject* args)
return Py::new_reference_to(mult);
}
PyObject* VectorPy::cross(PyObject* args)
PyObject* VectorPy::cross(PyObject* args) const
{
PyObject* obj = nullptr;
if (!PyArg_ParseTuple(args, "O!", &(VectorPy::Type), &obj)) {
@@ -454,7 +454,7 @@ PyObject* VectorPy::cross(PyObject* args)
return new VectorPy(v);
}
PyObject* VectorPy::isOnLineSegment(PyObject* args)
PyObject* VectorPy::isOnLineSegment(PyObject* args) const
{
PyObject* start = nullptr;
PyObject* end = nullptr;
@@ -482,7 +482,7 @@ PyObject* VectorPy::isOnLineSegment(PyObject* args)
return Py::new_reference_to(result);
}
PyObject* VectorPy::getAngle(PyObject* args)
PyObject* VectorPy::getAngle(PyObject* args) const
{
PyObject* obj = nullptr;
if (!PyArg_ParseTuple(args, "O!", &(VectorPy::Type), &obj)) {
@@ -570,7 +570,7 @@ PyObject* VectorPy::projectToPlane(PyObject* args)
return Py::new_reference_to(this);
}
PyObject* VectorPy::distanceToPoint(PyObject* args)
PyObject* VectorPy::distanceToPoint(PyObject* args) const
{
PyObject* pnt = nullptr;
if (!PyArg_ParseTuple(args, "O!", &(VectorPy::Type), &pnt)) {
@@ -585,7 +585,7 @@ PyObject* VectorPy::distanceToPoint(PyObject* args)
return Py::new_reference_to(dist);
}
PyObject* VectorPy::distanceToLine(PyObject* args)
PyObject* VectorPy::distanceToLine(PyObject* args) const
{
PyObject* base = nullptr;
PyObject* line = nullptr;
@@ -612,7 +612,7 @@ PyObject* VectorPy::distanceToLine(PyObject* args)
return Py::new_reference_to(dist);
}
PyObject* VectorPy::distanceToLineSegment(PyObject* args)
PyObject* VectorPy::distanceToLineSegment(PyObject* args) const
{
PyObject* base = nullptr;
PyObject* line = nullptr;
@@ -639,7 +639,7 @@ PyObject* VectorPy::distanceToLineSegment(PyObject* args)
return new VectorPy(v);
}
PyObject* VectorPy::distanceToPlane(PyObject* args)
PyObject* VectorPy::distanceToPlane(PyObject* args) const
{
PyObject* base = nullptr;
PyObject* line = nullptr;