Assembly: declare python methods const.

This commit is contained in:
Jacob Oursland
2025-04-16 20:33:08 -07:00
parent bd9907a06d
commit 5436ff85e7
2 changed files with 22 additions and 22 deletions

View File

@@ -13,7 +13,7 @@
<Author Licence="LGPL" Name="Ondsel" EMail="development@ondsel.com" />
<UserDocu>This class handles document objects in Assembly</UserDocu>
</Documentation>
<Methode Name="solve">
<Methode Name="solve" Const="true">
<Documentation>
<UserDocu>
Solve the assembly and update part placements.
@@ -38,7 +38,7 @@
</UserDocu>
</Documentation>
</Methode>
<Methode Name="generateSimulation">
<Methode Name="generateSimulation" Const="true">
<Documentation>
<UserDocu>
Generate the simulation.
@@ -60,7 +60,7 @@
</UserDocu>
</Documentation>
</Methode>
<Methode Name="updateForFrame">
<Methode Name="updateForFrame" Const="true">
<Documentation>
<UserDocu>
Update entire assembly to frame number specified.
@@ -73,7 +73,7 @@
</UserDocu>
</Documentation>
</Methode>
<Methode Name="numberOfFrames">
<Methode Name="numberOfFrames" Const="true">
<Documentation>
<UserDocu>
numberOfFrames()
@@ -84,7 +84,7 @@
</UserDocu>
</Documentation>
</Methode>
<Methode Name="undoSolve">
<Methode Name="undoSolve" Const="true">
<Documentation>
<UserDocu>
Undo the last solve of the assembly and return part placements to their initial position.
@@ -95,7 +95,7 @@
</UserDocu>
</Documentation>
</Methode>
<Methode Name="ensureIdentityPlacements">
<Methode Name="ensureIdentityPlacements" Const="true">
<Documentation>
<UserDocu>
Makes sure that LinkGroups or sub-assemblies have identity placements.
@@ -106,7 +106,7 @@
</UserDocu>
</Documentation>
</Methode>
<Methode Name="clearUndo">
<Methode Name="clearUndo" Const="true">
<Documentation>
<UserDocu>
Clear the registered undo positions.
@@ -117,7 +117,7 @@
</UserDocu>
</Documentation>
</Methode>
<Methode Name="isPartConnected">
<Methode Name="isPartConnected" Const="true">
<Documentation>
<UserDocu>
Check if a part is connected to the ground through joints.
@@ -130,7 +130,7 @@
</UserDocu>
</Documentation>
</Methode>
<Methode Name="isJointConnectingPartToGround">
<Methode Name="isJointConnectingPartToGround" Const="true">
<Documentation>
<UserDocu>
Check if a joint is connecting a part to the ground.
@@ -145,7 +145,7 @@
</UserDocu>
</Documentation>
</Methode>
<Methode Name="isPartGrounded">
<Methode Name="isPartGrounded" Const="true">
<Documentation>
<UserDocu>
Check if a part has a grounded joint.
@@ -159,7 +159,7 @@
</UserDocu>
</Documentation>
</Methode>
<Methode Name="exportAsASMT">
<Methode Name="exportAsASMT" Const="true">
<Documentation>
<UserDocu>
Export the assembly in a text format called ASMT.

View File

@@ -46,7 +46,7 @@ int AssemblyObjectPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*
return 0;
}
PyObject* AssemblyObjectPy::solve(PyObject* args)
PyObject* AssemblyObjectPy::solve(PyObject* args) const
{
PyObject* enableUndoPy;
bool enableUndo;
@@ -68,7 +68,7 @@ PyObject* AssemblyObjectPy::solve(PyObject* args)
return Py_BuildValue("i", ret);
}
PyObject* AssemblyObjectPy::generateSimulation(PyObject* args)
PyObject* AssemblyObjectPy::generateSimulation(PyObject* args) const
{
PyObject* pyobj;
@@ -80,7 +80,7 @@ PyObject* AssemblyObjectPy::generateSimulation(PyObject* args)
return Py_BuildValue("i", ret);
}
PyObject* AssemblyObjectPy::ensureIdentityPlacements(PyObject* args)
PyObject* AssemblyObjectPy::ensureIdentityPlacements(PyObject* args) const
{
if (!PyArg_ParseTuple(args, "")) {
return nullptr;
@@ -89,7 +89,7 @@ PyObject* AssemblyObjectPy::ensureIdentityPlacements(PyObject* args)
Py_Return;
}
PyObject* AssemblyObjectPy::updateForFrame(PyObject* args)
PyObject* AssemblyObjectPy::updateForFrame(PyObject* args) const
{
unsigned long index {};
@@ -105,7 +105,7 @@ PyObject* AssemblyObjectPy::updateForFrame(PyObject* args)
Py_Return;
}
PyObject* AssemblyObjectPy::numberOfFrames(PyObject* args)
PyObject* AssemblyObjectPy::numberOfFrames(PyObject* args) const
{
if (!PyArg_ParseTuple(args, "")) {
return nullptr;
@@ -114,7 +114,7 @@ PyObject* AssemblyObjectPy::numberOfFrames(PyObject* args)
return Py_BuildValue("k", ret);
}
PyObject* AssemblyObjectPy::undoSolve(PyObject* args)
PyObject* AssemblyObjectPy::undoSolve(PyObject* args) const
{
if (!PyArg_ParseTuple(args, "")) {
return nullptr;
@@ -123,7 +123,7 @@ PyObject* AssemblyObjectPy::undoSolve(PyObject* args)
Py_Return;
}
PyObject* AssemblyObjectPy::clearUndo(PyObject* args)
PyObject* AssemblyObjectPy::clearUndo(PyObject* args) const
{
if (!PyArg_ParseTuple(args, "")) {
return nullptr;
@@ -132,7 +132,7 @@ PyObject* AssemblyObjectPy::clearUndo(PyObject* args)
Py_Return;
}
PyObject* AssemblyObjectPy::isPartConnected(PyObject* args)
PyObject* AssemblyObjectPy::isPartConnected(PyObject* args) const
{
PyObject* pyobj;
@@ -144,7 +144,7 @@ PyObject* AssemblyObjectPy::isPartConnected(PyObject* args)
return Py_BuildValue("O", (ok ? Py_True : Py_False));
}
PyObject* AssemblyObjectPy::isPartGrounded(PyObject* args)
PyObject* AssemblyObjectPy::isPartGrounded(PyObject* args) const
{
PyObject* pyobj;
@@ -156,7 +156,7 @@ PyObject* AssemblyObjectPy::isPartGrounded(PyObject* args)
return Py_BuildValue("O", (ok ? Py_True : Py_False));
}
PyObject* AssemblyObjectPy::isJointConnectingPartToGround(PyObject* args)
PyObject* AssemblyObjectPy::isJointConnectingPartToGround(PyObject* args) const
{
PyObject* pyobj;
char* pname;
@@ -169,7 +169,7 @@ PyObject* AssemblyObjectPy::isJointConnectingPartToGround(PyObject* args)
return Py_BuildValue("O", (ok ? Py_True : Py_False));
}
PyObject* AssemblyObjectPy::exportAsASMT(PyObject* args)
PyObject* AssemblyObjectPy::exportAsASMT(PyObject* args) const
{
char* utf8Name;
if (!PyArg_ParseTuple(args, "et", "utf-8", &utf8Name)) {