[bindings] remove redundant signatures. batch1

This commit is contained in:
Frank Martinez
2025-10-10 14:09:50 -05:00
parent d8b1a36e19
commit fc99a20a03
34 changed files with 194 additions and 668 deletions

View File

@@ -7,6 +7,7 @@ from typing import Any, Final
from Base.Metadata import constmethod, export
from App.Part import Part
from App.DocumentObject import DocumentObject
@export(Include="Mod/Assembly/App/AssemblyObject.h", Namespace="Assembly")
@@ -19,10 +20,9 @@ class AssemblyObject(Part):
"""
@constmethod
def solve(self) -> Any:
"""Solve the assembly and update part placements.
solve(enableRedo=False) -> int
def solve(self, enableUndo: bool = False, /) -> int:
"""
Solve the assembly and update part placements.
Args:
enableRedo: Whether the solve save the initial position of parts
@@ -38,14 +38,14 @@ class AssemblyObject(Part):
-3 if conflicting constraints,
-5 if malformed constraints
-1 if solver error,
-2 if redundant constraints."""
-2 if redundant constraints.
"""
...
@constmethod
def generateSimulation(self) -> Any:
"""Generate the simulation.
solve(simulationObject) -> int
def generateSimulation(self, simulationObject: DocumentObject, /) -> int:
"""
Generate the simulation.
Args:
simulationObject: The simulation Object.
@@ -58,111 +58,101 @@ class AssemblyObject(Part):
-3 if conflicting constraints,
-5 if malformed constraints
-1 if solver error,
-2 if redundant constraints."""
-2 if redundant constraints.
"""
...
@constmethod
def updateForFrame(self) -> Any:
"""Update entire assembly to frame number specified.
def updateForFrame(self, index: int, /) -> None:
"""
Update entire assembly to frame number specified.
updateForFrame(index)
Args:
index: index of frame.
Args: index of frame.
Returns: None"""
Returns: None
"""
...
@constmethod
def numberOfFrames(self) -> Any:
"""numberOfFrames()
Args: None
Returns: Number of frames"""
def numberOfFrames(self) -> int:
"""Return Number of frames"""
...
@constmethod
def undoSolve(self) -> Any:
"""Undo the last solve of the assembly and return part placements to their initial position.
undoSolve()
Returns: None"""
def undoSolve(self) -> None:
"""
Undo the last solve of the assembly and return part placements to their initial position.
"""
...
@constmethod
def ensureIdentityPlacements(self) -> Any:
"""Makes sure that LinkGroups or sub-assemblies have identity placements.
ensureIdentityPlacements()
Returns: None"""
def ensureIdentityPlacements(self) -> None:
"""
Makes sure that LinkGroups or sub-assemblies have identity placements.
"""
...
@constmethod
def clearUndo(self) -> Any:
"""Clear the registered undo positions.
clearUndo()
Returns: None"""
def clearUndo(self) -> None:
"""
Clear the registered undo positions.
"""
...
@constmethod
def isPartConnected(self) -> Any:
"""Check if a part is connected to the ground through joints.
isPartConnected(obj) -> bool
Args: document object to check.
Returns: True if part is connected to ground"""
def isPartConnected(self, obj: DocumentObject, /) -> bool:
"""
Check if a part is connected to the ground through joints.
Returns: True if part is connected to ground.
"""
...
@constmethod
def isJointConnectingPartToGround(self) -> Any:
"""Check if a joint is connecting a part to the ground.
isJointConnectingPartToGround(joint, propName) -> bool
def isJointConnectingPartToGround(self, joint: DocumentObject, prop_name: str, /) -> Any:
"""
Check if a joint is connecting a part to the ground.
Args:
- joint: document object of the joint to check.
- propName: string 'Part1' or 'Part2' of the joint.
- prop_name: string 'Part1' or 'Part2' of the joint.
Returns: True if part is connected to ground"""
Returns: True if part is connected to ground.
"""
...
@constmethod
def isPartGrounded(self) -> Any:
"""Check if a part has a grounded joint.
isPartGrounded(obj) -> bool
def isPartGrounded(self, obj: DocumentObject, /) -> Any:
"""
Check if a part has a grounded joint.
Args:
- obj: document object of the part to check.
Returns: True if part has grounded joint"""
Returns: True if part has grounded joint.
"""
...
@constmethod
def exportAsASMT(self) -> Any:
"""Export the assembly in a text format called ASMT.
exportAsASMT(fileName:str)
def exportAsASMT(self, file_name: str, /) -> None:
"""
Export the assembly in a text format called ASMT.
Args:
fileName: The name of the file where the ASMT will be exported."""
- fileName: The name of the file where the ASMT will be exported.
"""
...
@constmethod
def getDownstreamParts(self, start_part: "App.DocumentObject", joint_to_ignore: "App.DocumentObject",
/) -> list["App.DocumentObject"]:
def getDownstreamParts(
self,
start_part: DocumentObject,
joint_to_ignore: DocumentObject,
/) -> list[DocumentObject]:
"""
Finds all parts connected to a start_part that are not connected to ground
when a specific joint is ignored.
getDownstreamParts(start_part, joint_to_ignore) -> list
This is used to find the entire rigid group of unconstrained components that
should be moved together during a pre-solve operation or a drag.

View File

@@ -2,12 +2,13 @@
from __future__ import annotations
from typing import Any, List, Tuple
from typing import Any, List, Tuple, TypeAlias
from Base.Metadata import export
from App.DocumentObject import DocumentObject
from Gui.ViewProvider import ViewProvider
SoTransformDragger: TypeAlias = Any
@export(Include="Mod/Assembly/Gui/ViewProviderAssembly.h", Namespace="AssemblyGui")
class ViewProviderAssembly(ViewProvider):
@@ -21,17 +22,11 @@ class ViewProviderAssembly(ViewProvider):
def isInEditMode(self) -> Any:
"""
Return true if the assembly object is currently in edit mode.
isInEditMode() -> bool"""
"""
...
def getDragger(self) -> Any:
"""
Return the assembly dragger coin object.
getDragger() -> SoTransformDragger
Returns: dragger coin object of the assembly"""
def getDragger(self) -> SoTransformDragger:
"""Return the assembly dragger coin object."""
...
def isolateComponents(