Merge pull request #24262 from mnesarco/pyi-fixes-1
This commit is contained in:
@@ -1,38 +1,34 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.PyObjectBase import PyObjectBase
|
||||
from typing import List
|
||||
|
||||
|
||||
class ApplicationDirectories(PyObjectBase):
|
||||
"""
|
||||
App.ApplicationDirectories class.
|
||||
Provides access to the directory versioning methods of its C++ counterpart.
|
||||
|
||||
For the time being this class only provides access to the directory versioning methods of its
|
||||
C++ counterpart. These are all static methods, so no instance is needed. The main methods of
|
||||
These are all static methods, so no instance is needed. The main methods of
|
||||
this class are migrateAllPaths(), usingCurrentVersionConfig(), and versionStringForPath().
|
||||
|
||||
Author: Chris Hennes (chennes@pioneerlibrarysystem.org)
|
||||
Licence: LGPL-2.1-or-later
|
||||
DeveloperDocu: ApplicationDirectories
|
||||
"""
|
||||
|
||||
@staticmethod
|
||||
def usingCurrentVersionConfig(path:str) -> bool:
|
||||
def usingCurrentVersionConfig(path: str, /) -> bool:
|
||||
"""
|
||||
usingCurrentVersionConfig(path)
|
||||
Determine if a given config path is for the current version of the program.
|
||||
|
||||
Determine if a given config path is for the current version of the program
|
||||
|
||||
path : the path to check
|
||||
Args:
|
||||
path: The path to check.
|
||||
"""
|
||||
...
|
||||
|
||||
@staticmethod
|
||||
def migrateAllPaths(paths: List[str]) -> None:
|
||||
def migrateAllPaths(paths: list[str], /) -> None:
|
||||
"""
|
||||
migrateAllPaths(paths)
|
||||
Migrate a set of versionable configuration directories from the given paths to a new version.
|
||||
|
||||
Migrate a set of versionable configuration directories from the given paths to a new
|
||||
version. The new version's directories cannot exist yet, and the old ones *must* exist.
|
||||
The new version's directories cannot exist yet, and the old ones *must* exist.
|
||||
If the old paths are themselves versioned, then the new paths will be placed at the same
|
||||
level in the directory structure (e.g., they will be siblings of each entry in paths).
|
||||
If paths are NOT versioned, the new (versioned) copies will be placed *inside* the
|
||||
@@ -41,6 +37,9 @@ class ApplicationDirectories(PyObjectBase):
|
||||
If the list contains the same path multiple times, the duplicates are ignored, so it is safe
|
||||
to pass the same path multiple times.
|
||||
|
||||
Args:
|
||||
paths: List of paths to migrate from.
|
||||
|
||||
Examples:
|
||||
Running FreeCAD 1.1, /usr/share/FreeCAD/Config/ -> /usr/share/FreeCAD/Config/v1-1/
|
||||
Running FreeCAD 1.1, /usr/share/FreeCAD/Config/v1-1 -> raises exception, path exists
|
||||
@@ -49,60 +48,80 @@ class ApplicationDirectories(PyObjectBase):
|
||||
...
|
||||
|
||||
@staticmethod
|
||||
def versionStringForPath(major:int, minor:int) -> str:
|
||||
def versionStringForPath(major: int, minor: int, /) -> str:
|
||||
"""
|
||||
versionStringForPath(major, minor) -> str
|
||||
Given a major and minor version number, return the name for a versioned subdirectory.
|
||||
|
||||
Given a major and minor version number, return a string that can be used as the name for a
|
||||
versioned subdirectory. Only returns the version string, not the full path.
|
||||
Args:
|
||||
major: Major version number.
|
||||
minor: Minor version number.
|
||||
|
||||
Returns:
|
||||
A string that can be used as the name for a versioned subdirectory.
|
||||
Only returns the version string, not the full path.
|
||||
"""
|
||||
...
|
||||
|
||||
@staticmethod
|
||||
def isVersionedPath(startingPath:str) -> bool:
|
||||
def isVersionedPath(startingPath: str, /) -> bool:
|
||||
"""
|
||||
isVersionedPath(startingPath) -> bool
|
||||
Determine if a given path is versioned.
|
||||
|
||||
Determine if a given path is versioned (that is, if its last component contains
|
||||
something that this class would have created as a versioned subdirectory). Returns true
|
||||
for any path that the *current* version of FreeCAD would recognized as versioned, and false
|
||||
for either something that is not versioned, or something that is versioned but for a later
|
||||
version of FreeCAD.
|
||||
That is, if its last component contains something that this class would have
|
||||
created as a versioned subdirectory).
|
||||
|
||||
Args:
|
||||
startingPath: The path to check.
|
||||
|
||||
Returns:
|
||||
True for any path that the *current* version of FreeCAD would recognize as versioned,
|
||||
and False for either something that is not versioned, or something that is versioned
|
||||
but for a later version of FreeCAD.
|
||||
"""
|
||||
...
|
||||
|
||||
@staticmethod
|
||||
def mostRecentAvailableConfigVersion(startingPath:str) -> str:
|
||||
def mostRecentAvailableConfigVersion(startingPath: str, /) -> str:
|
||||
"""
|
||||
mostRecentAvailableConfigVersion(startingPath) -> str
|
||||
|
||||
Given a base path that is expected to contain versioned subdirectories, locate the
|
||||
directory name (*not* the path, only the final component, the version string itself)
|
||||
corresponding to the most recent version of the software, up to and including the current
|
||||
running version, but NOT exceeding it -- any *later* version whose directories exist
|
||||
in the path is ignored. See also mostRecentConfigFromBase().
|
||||
|
||||
Args:
|
||||
startingPath: The path to check.
|
||||
|
||||
Returns:
|
||||
Most recent available dir name (not path).
|
||||
"""
|
||||
...
|
||||
|
||||
@staticmethod
|
||||
def mostRecentConfigFromBase(startingPath: str) -> str:
|
||||
def mostRecentConfigFromBase(startingPath: str, /) -> str:
|
||||
"""
|
||||
mostRecentConfigFromBase(startingPath) -> str
|
||||
|
||||
Given a base path that is expected to contained versioned subdirectories, locate the
|
||||
directory corresponding to the most recent version of the software, up to and including
|
||||
the current version, but NOT exceeding it. Returns the complete path, not just the final
|
||||
component. See also mostRecentAvailableConfigVersion().
|
||||
|
||||
Args:
|
||||
startingPath: The base path to check.
|
||||
|
||||
Returns:
|
||||
Most recent available full path (not just dir name).
|
||||
"""
|
||||
...
|
||||
|
||||
@staticmethod
|
||||
def migrateConfig(oldPath: str, newPath: str) -> None:
|
||||
def migrateConfig(oldPath: str, newPath: str, /) -> None:
|
||||
"""
|
||||
migrateConfig(oldPath, newPath) -> None
|
||||
|
||||
A utility method to copy all files and directories from oldPath to newPath, handling the
|
||||
case where newPath might itself be a subdirectory of oldPath (and *not* attempting that
|
||||
otherwise-recursive copy).
|
||||
|
||||
Args:
|
||||
oldPath: Path from.
|
||||
newPath: Path to.
|
||||
"""
|
||||
...
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import export, constmethod
|
||||
from Base.Persistence import Persistence
|
||||
from Base.BoundBox import BoundBox as BoundBoxPy
|
||||
from Base.BoundBox import BoundBox
|
||||
from Base.Vector import Vector
|
||||
from Base.Placement import Placement as PlacementPy
|
||||
from Base.Placement import Placement
|
||||
from Base.Rotation import Rotation
|
||||
from Base.Matrix import Matrix
|
||||
from StringHasher import StringHasher
|
||||
from typing import Any, Final, List, Dict
|
||||
from typing import Any, Final
|
||||
|
||||
|
||||
@export(
|
||||
@@ -15,89 +19,94 @@ from typing import Any, Final, List, Dict
|
||||
)
|
||||
class ComplexGeoData(Persistence):
|
||||
"""
|
||||
Data.ComplexGeoData class.
|
||||
|
||||
Author: Juergen Riegel (Juergen.Riegel@web.de)
|
||||
Licence: LGPL
|
||||
UserDocu: Father of all complex geometric data types
|
||||
Father of all complex geometric data types.
|
||||
"""
|
||||
|
||||
@constmethod
|
||||
def getElementTypes(self) -> List[str]:
|
||||
def getElementTypes(self) -> list[str]:
|
||||
"""
|
||||
Return a list of element types present in the complex geometric data
|
||||
Return a list of element types present in the complex geometric data.
|
||||
"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def countSubElements(self) -> int:
|
||||
"""
|
||||
Return the number of elements of a type
|
||||
Return the number of elements of a type.
|
||||
"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def getFacesFromSubElement(self) -> Any:
|
||||
def getFacesFromSubElement(self, ) -> tuple[list[Vector], list[tuple[int, int, int]]]:
|
||||
"""
|
||||
Return vertexes and faces from a sub-element
|
||||
Return vertexes and faces from a sub-element.
|
||||
"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def getLinesFromSubElement(self) -> Any:
|
||||
def getLinesFromSubElement(self, ) -> tuple[list[Vector], list[tuple[int, int]]]:
|
||||
"""
|
||||
Return vertexes and lines from a sub-element
|
||||
Return vertexes and lines from a sub-element.
|
||||
"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def getPoints(self) -> Any:
|
||||
def getPoints(self) -> tuple[list[Vector], list[Vector]]:
|
||||
"""
|
||||
Return a tuple of points and normals with a given accuracy
|
||||
"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def getLines(self) -> Any:
|
||||
def getLines(self) -> tuple[list[Vector], list[tuple[int, int]]]:
|
||||
"""
|
||||
Return a tuple of points and lines with a given accuracy
|
||||
"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def getFaces(self) -> Any:
|
||||
def getFaces(self) -> tuple[list[Vector], list[tuple[int, int, int]]]:
|
||||
"""
|
||||
Return a tuple of points and triangles with a given accuracy
|
||||
"""
|
||||
...
|
||||
|
||||
def applyTranslation(self, translation: Vector) -> None:
|
||||
def applyTranslation(self, translation: Vector, /) -> None:
|
||||
"""
|
||||
Apply an additional translation to the placement
|
||||
"""
|
||||
...
|
||||
|
||||
def applyRotation(self, rotation: Rotation) -> None:
|
||||
def applyRotation(self, rotation: Rotation, /) -> None:
|
||||
"""
|
||||
Apply an additional rotation to the placement
|
||||
"""
|
||||
...
|
||||
|
||||
def transformGeometry(self, transformation: Matrix) -> None:
|
||||
def transformGeometry(self, transformation: Matrix, /) -> None:
|
||||
"""
|
||||
Apply a transformation to the underlying geometry
|
||||
"""
|
||||
...
|
||||
|
||||
def setElementName(self, *, element: str, name: str = None, postfix: str = None, overwrite: bool = False, sid: Any = None) -> None:
|
||||
def setElementName(
|
||||
self,
|
||||
*,
|
||||
element: str,
|
||||
name: str = None,
|
||||
postfix: str = None,
|
||||
overwrite: bool = False,
|
||||
sid: Any = None,
|
||||
) -> None:
|
||||
"""
|
||||
setElementName(element,name=None,postfix=None,overwrite=False,sid=None), Set an element name
|
||||
Set an element name.
|
||||
|
||||
element : the original element name, e.g. Edge1, Vertex2
|
||||
name : the new name for the element, None to remove the mapping
|
||||
postfix : postfix of the name that will not be hashed
|
||||
overwrite: if true, it will overwrite exiting name
|
||||
sid : to hash the name any way you want, provide your own string id(s) in this parameter
|
||||
Args:
|
||||
element : the original element name, e.g. Edge1, Vertex2
|
||||
name : the new name for the element, None to remove the mapping
|
||||
postfix : postfix of the name that will not be hashed
|
||||
overwrite: if true, it will overwrite exiting name
|
||||
sid : to hash the name any way you want, provide your own string id(s) in this parameter
|
||||
|
||||
An element can have multiple mapped names. However, a name can only be mapped
|
||||
to one element
|
||||
@@ -105,33 +114,33 @@ class ComplexGeoData(Persistence):
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def getElementName(self, name: str, direction: int = 0) -> Any:
|
||||
def getElementName(self, name: str, direction: int = 0, /) -> str:
|
||||
"""
|
||||
getElementName(name,direction=0) - Return a mapped element name or reverse
|
||||
Return a mapped element name or reverse.
|
||||
"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def getElementIndexedName(self, name: str) -> Any:
|
||||
def getElementIndexedName(self, name: str, /) -> str | tuple[str, list[int]]:
|
||||
"""
|
||||
getElementIndexedName(name) - Return the indexed element name
|
||||
Return the indexed element name.
|
||||
"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def getElementMappedName(self, name: str) -> Any:
|
||||
def getElementMappedName(self, name: str, /) -> str | tuple[str, list[int]]:
|
||||
"""
|
||||
getElementMappedName(name) - Return the mapped element name
|
||||
Return the mapped element name
|
||||
"""
|
||||
...
|
||||
|
||||
BoundBox: Final[BoundBoxPy] = ...
|
||||
BoundBox: Final[BoundBox] = ...
|
||||
"""Get the bounding box (BoundBox) of the complex geometric data."""
|
||||
|
||||
CenterOfGravity: Final[Vector] = ...
|
||||
"""Get the center of gravity"""
|
||||
|
||||
Placement: PlacementPy = ...
|
||||
Placement: Placement = ...
|
||||
"""Get the current transformation of the object as placement"""
|
||||
|
||||
Tag: int = 0
|
||||
@@ -143,10 +152,10 @@ class ComplexGeoData(Persistence):
|
||||
ElementMapSize: Final[int] = 0
|
||||
"""Get the current element map size"""
|
||||
|
||||
ElementMap: Dict[Any, Any] = {}
|
||||
ElementMap: dict[str, str] = {}
|
||||
"""Get/Set a dict of element mapping"""
|
||||
|
||||
ElementReverseMap: Final[Dict[Any, Any]] = {}
|
||||
ElementReverseMap: Final[dict[str, str | list[str]]] = {}
|
||||
"""Get a dict of element reverse mapping"""
|
||||
|
||||
ElementMapVersion: Final[str] = ""
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from PropertyContainer import PropertyContainer
|
||||
from DocumentObject import DocumentObject
|
||||
from typing import Final, List, Tuple, Sequence
|
||||
from typing import Final, Sequence
|
||||
|
||||
|
||||
class Document(PropertyContainer):
|
||||
"""
|
||||
This is a Document class
|
||||
Author: Juergen Riegel (FreeCAD@juergen-riegel.net)
|
||||
Licence: LGPL
|
||||
This is the Document class.
|
||||
"""
|
||||
|
||||
DependencyGraph: Final[str] = ""
|
||||
@@ -16,16 +18,16 @@ class Document(PropertyContainer):
|
||||
ActiveObject: Final[DocumentObject] = None
|
||||
"""The last created object in this document"""
|
||||
|
||||
Objects: Final[List[DocumentObject]] = []
|
||||
Objects: Final[list[DocumentObject]] = []
|
||||
"""The list of objects in this document"""
|
||||
|
||||
TopologicalSortedObjects: Final[List[DocumentObject]] = []
|
||||
TopologicalSortedObjects: Final[list[DocumentObject]] = []
|
||||
"""The list of objects in this document in topological sorted order"""
|
||||
|
||||
RootObjects: Final[List[DocumentObject]] = []
|
||||
RootObjects: Final[list[DocumentObject]] = []
|
||||
"""The list of root objects in this document"""
|
||||
|
||||
RootObjectsIgnoreLinks: Final[List[DocumentObject]] = []
|
||||
RootObjectsIgnoreLinks: Final[list[DocumentObject]] = []
|
||||
"""The list of root objects in this document ignoring references from links."""
|
||||
|
||||
UndoMode: int = 0
|
||||
@@ -40,10 +42,10 @@ class Document(PropertyContainer):
|
||||
RedoCount: Final[int] = 0
|
||||
"""Number of possible Redos"""
|
||||
|
||||
UndoNames: Final[List[str]] = []
|
||||
UndoNames: Final[list[str]] = []
|
||||
"""A list of Undo names"""
|
||||
|
||||
RedoNames: Final[List[str]] = []
|
||||
RedoNames: Final[list[str]] = []
|
||||
"""A List of Redo names"""
|
||||
|
||||
Name: Final[str] = ""
|
||||
@@ -55,10 +57,10 @@ class Document(PropertyContainer):
|
||||
HasPendingTransaction: Final[bool] = False
|
||||
"""Check if there is a pending transaction"""
|
||||
|
||||
InList: Final[List["Document"]] = []
|
||||
InList: Final[list[Document]] = []
|
||||
"""A list of all documents that link to this document."""
|
||||
|
||||
OutList: Final[List["Document"]] = []
|
||||
OutList: Final[list[Document]] = []
|
||||
"""A list of all documents that this document links to."""
|
||||
|
||||
Restoring: Final[bool] = False
|
||||
@@ -84,25 +86,25 @@ class Document(PropertyContainer):
|
||||
|
||||
def save(self) -> None:
|
||||
"""
|
||||
Save the document to disk
|
||||
Save the document to disk.
|
||||
"""
|
||||
...
|
||||
|
||||
def saveAs(self) -> None:
|
||||
def saveAs(self, path: str, /) -> None:
|
||||
"""
|
||||
Save the document under a new name to disk
|
||||
Save the document under a new name to disk.
|
||||
"""
|
||||
...
|
||||
|
||||
def saveCopy(self) -> None:
|
||||
def saveCopy(self, path: str, /) -> None:
|
||||
"""
|
||||
Save a copy of the document under a new name to disk
|
||||
Save a copy of the document under a new name to disk.
|
||||
"""
|
||||
...
|
||||
|
||||
def load(self) -> None:
|
||||
def load(self, path: str, /) -> None:
|
||||
"""
|
||||
Load the document from the given path
|
||||
Load the document from the given path.
|
||||
"""
|
||||
...
|
||||
|
||||
@@ -131,37 +133,40 @@ class Document(PropertyContainer):
|
||||
"""
|
||||
...
|
||||
|
||||
def getUniqueObjectName(self, objName: str) -> str:
|
||||
def getUniqueObjectName(self, objName: str, /) -> str:
|
||||
"""
|
||||
getUniqueObjectName(objName) -> objName
|
||||
|
||||
Return the same name, or the name made unique, for Example Box -> Box002 if there are conflicting name
|
||||
already in the document.
|
||||
|
||||
ObjName : str
|
||||
Object name.
|
||||
Args:
|
||||
objName: Object name candidate.
|
||||
|
||||
Returns:
|
||||
Unique object name based on objName.
|
||||
"""
|
||||
...
|
||||
|
||||
def mergeProject(self) -> None:
|
||||
def mergeProject(self, path: str, /) -> None:
|
||||
"""
|
||||
Merges this document with another project file
|
||||
Merges this document with another project file.
|
||||
"""
|
||||
...
|
||||
|
||||
def exportGraphviz(self) -> None:
|
||||
def exportGraphviz(self, path: str = None, /) -> str | None:
|
||||
"""
|
||||
Export the dependencies of the objects as graph
|
||||
Export the dependencies of the objects as graph.
|
||||
|
||||
If path is passed, graph is written to it. if not a string is returned.
|
||||
"""
|
||||
...
|
||||
|
||||
def openTransaction(self, name: str) -> None:
|
||||
def openTransaction(self, name: str, /) -> None:
|
||||
"""
|
||||
openTransaction(name) - Open a new Undo/Redo transaction.
|
||||
Open a new Undo/Redo transaction.
|
||||
|
||||
This function no long creates a new transaction, but calls
|
||||
FreeCAD.setActiveTransaction(name) instead, which will auto creates a
|
||||
transaction with the given name when any change happed in any opened document.
|
||||
transaction with the given name when any change happened in any opened document.
|
||||
If more than one document is changed, all newly created transactions will have
|
||||
the same internal ID and will be undo/redo together.
|
||||
"""
|
||||
@@ -181,7 +186,6 @@ class Document(PropertyContainer):
|
||||
|
||||
def addObject(
|
||||
self,
|
||||
*,
|
||||
type: str,
|
||||
name: str = None,
|
||||
objProxy: object = None,
|
||||
@@ -190,24 +194,22 @@ class Document(PropertyContainer):
|
||||
viewType: str = None,
|
||||
) -> DocumentObject:
|
||||
"""
|
||||
addObject(type, name=None, objProxy=None, viewProxy=None, attach=False, viewType=None)
|
||||
Add an object to document.
|
||||
|
||||
Add an object to document
|
||||
|
||||
type (String): the type of the document object to create.
|
||||
name (String): the optional name of the new object.
|
||||
objProxy (Object): the Python binding object to attach to the new document object.
|
||||
viewProxy (Object): the Python binding object to attach the view provider of this object.
|
||||
attach (Boolean): if True, then bind the document object first before adding to the document
|
||||
to allow Python code to override view provider type. Once bound, and before adding to
|
||||
the document, it will try to call Python binding object's attach(obj) method.
|
||||
viewType (String): override the view provider type directly, only effective when attach is False.
|
||||
Args:
|
||||
type: the type of the document object to create.
|
||||
name: the optional name of the new object.
|
||||
objProxy: the Python binding object to attach to the new document object.
|
||||
viewProxy: the Python binding object to attach the view provider of this object.
|
||||
attach: if True, then bind the document object first before adding to the document
|
||||
to allow Python code to override view provider type. Once bound, and before adding to
|
||||
the document, it will try to call Python binding object's attach(obj) method.
|
||||
viewType: override the view provider type directly, only effective when attach is False.
|
||||
"""
|
||||
...
|
||||
|
||||
def addProperty(
|
||||
self,
|
||||
*,
|
||||
type: str,
|
||||
name: str,
|
||||
group: str = "",
|
||||
@@ -216,22 +218,37 @@ class Document(PropertyContainer):
|
||||
read_only: bool = False,
|
||||
hidden: bool = False,
|
||||
locked: bool = False,
|
||||
) -> "Document":
|
||||
enum_vals: list[str] | None = None,
|
||||
) -> Document:
|
||||
"""
|
||||
addProperty(type: string, name: string, group="", doc="", attr=0, read_only=False, hidden=False, locked=False) -- Add a generic property.
|
||||
Add a generic property.
|
||||
|
||||
Args:
|
||||
type: The type of the property to add.
|
||||
name: The name of the property.
|
||||
group: The group to which the property belongs. Defaults to "".
|
||||
doc: The documentation string for the property. Defaults to "".
|
||||
attr: Attribute flags for the property. Defaults to 0.
|
||||
read_only: Whether the property is read-only. Defaults to False.
|
||||
hidden: Whether the property is hidden. Defaults to False.
|
||||
locked: Whether the property is locked. Defaults to False.
|
||||
|
||||
Returns:
|
||||
The document instance with the added property.
|
||||
"""
|
||||
...
|
||||
|
||||
def removeProperty(self, string: str) -> None:
|
||||
def removeProperty(self, name: str, /) -> None:
|
||||
"""
|
||||
removeProperty(string) -- Remove a generic property.
|
||||
Remove a generic property.
|
||||
|
||||
Note, you can only remove user-defined properties but not built-in ones.
|
||||
"""
|
||||
...
|
||||
|
||||
def removeObject(self) -> None:
|
||||
def removeObject(self, name: str, /) -> None:
|
||||
"""
|
||||
Remove an object from the document
|
||||
Remove an object from the document.
|
||||
"""
|
||||
...
|
||||
|
||||
@@ -241,34 +258,39 @@ class Document(PropertyContainer):
|
||||
*,
|
||||
recursive: bool = False,
|
||||
return_all: bool = False,
|
||||
) -> Tuple[DocumentObject, ...]:
|
||||
) -> tuple[DocumentObject, ...]:
|
||||
"""
|
||||
copyObject(object, recursive=False, return_all=False)
|
||||
Copy an object or objects from another document to this document.
|
||||
|
||||
object: can either be a single object or sequence of objects
|
||||
recursive: if True, also recursively copies internal objects
|
||||
return_all: if True, returns all copied objects, or else return only the copied
|
||||
object corresponding to the input objects.
|
||||
Args:
|
||||
object: can either be a single object or sequence of objects
|
||||
recursive: if True, also recursively copies internal objects
|
||||
return_all: if True, returns all copied objects, or else return only the copied
|
||||
object corresponding to the input objects.
|
||||
"""
|
||||
...
|
||||
|
||||
def moveObject(
|
||||
self, object: DocumentObject, with_dependencies: bool = False
|
||||
self,
|
||||
object: DocumentObject,
|
||||
with_dependencies: bool = False,
|
||||
/,
|
||||
) -> DocumentObject:
|
||||
"""
|
||||
moveObject(object, bool with_dependencies = False)
|
||||
Transfers an object from another document to this document.
|
||||
|
||||
object: can either a single object or sequence of objects
|
||||
with_dependencies: if True, all internal dependent objects are copied too.
|
||||
Args:
|
||||
object: can either a single object or sequence of objects
|
||||
with_dependencies: if True, all internal dependent objects are copied too.
|
||||
"""
|
||||
...
|
||||
|
||||
def importLinks(self, object: DocumentObject = None) -> Tuple[DocumentObject, ...]:
|
||||
def importLinks(
|
||||
self,
|
||||
object: DocumentObject = None,
|
||||
/,
|
||||
) -> tuple[DocumentObject, ...]:
|
||||
"""
|
||||
importLinks(object|[object...])
|
||||
|
||||
Import any externally linked object given a list of objects in
|
||||
this document. Any link type properties of the input objects
|
||||
will be automatically reassigned to the imported object
|
||||
@@ -302,7 +324,7 @@ class Document(PropertyContainer):
|
||||
"""
|
||||
...
|
||||
|
||||
def setClosable(self, closable: bool) -> None:
|
||||
def setClosable(self, closable: bool, /) -> None:
|
||||
"""
|
||||
Set a flag that allows or forbids to close a document
|
||||
"""
|
||||
@@ -314,7 +336,7 @@ class Document(PropertyContainer):
|
||||
"""
|
||||
...
|
||||
|
||||
def setAutoCreated(self, autoCreated: bool) -> None:
|
||||
def setAutoCreated(self, autoCreated: bool, /) -> None:
|
||||
"""
|
||||
Set a flag that indicates if a document is autoCreated
|
||||
"""
|
||||
@@ -326,9 +348,15 @@ class Document(PropertyContainer):
|
||||
"""
|
||||
...
|
||||
|
||||
def recompute(self, objs: Sequence[DocumentObject] = None) -> int:
|
||||
def recompute(
|
||||
self,
|
||||
objs: Sequence[DocumentObject] = None,
|
||||
force: bool = False,
|
||||
check_cycle: bool = False,
|
||||
/,
|
||||
) -> int:
|
||||
"""
|
||||
recompute(objs=None): Recompute the document and returns the amount of recomputed features
|
||||
Recompute the document and returns the amount of recomputed features.
|
||||
"""
|
||||
...
|
||||
|
||||
@@ -350,41 +378,55 @@ class Document(PropertyContainer):
|
||||
"""
|
||||
...
|
||||
|
||||
def getObject(self, name: str) -> DocumentObject:
|
||||
def getObject(self, name: str, /) -> DocumentObject:
|
||||
"""
|
||||
Return the object with the given name
|
||||
"""
|
||||
...
|
||||
|
||||
def getObjectsByLabel(self, label: str) -> List[DocumentObject]:
|
||||
def getObjectsByLabel(self, label: str, /) -> list[DocumentObject]:
|
||||
"""
|
||||
Return the objects with the given label name.
|
||||
|
||||
NOTE: It's possible that several objects have the same label name.
|
||||
"""
|
||||
...
|
||||
|
||||
def findObjects(
|
||||
self, *, Type: str = None, Name: str = None, Label: str = None
|
||||
) -> List[DocumentObject]:
|
||||
self,
|
||||
Type: str = None,
|
||||
Name: str = None,
|
||||
Label: str = None,
|
||||
) -> list[DocumentObject]:
|
||||
"""
|
||||
findObjects([Type=string], [Name=string], [Label=string]) -> list
|
||||
Return a list of objects that match the specified type, name or label.
|
||||
|
||||
Name and label support regular expressions. All parameters are optional.
|
||||
|
||||
Args:
|
||||
Type: Type of the feature.
|
||||
Name: Name
|
||||
Label: Label
|
||||
"""
|
||||
...
|
||||
|
||||
def getLinksTo(
|
||||
self, obj: DocumentObject, options: int = 0, maxCount: int = 0
|
||||
) -> Tuple[DocumentObject, ...]:
|
||||
self,
|
||||
obj: DocumentObject,
|
||||
options: int = 0,
|
||||
maxCount: int = 0,
|
||||
/,
|
||||
) -> tuple[DocumentObject, ...]:
|
||||
"""
|
||||
getLinksTo(obj, options=0, maxCount=0): return objects linked to 'obj'
|
||||
Return objects linked to 'obj'
|
||||
|
||||
options: 1: recursive, 2: check link array. Options can combine.
|
||||
maxCount: to limit the number of links returned
|
||||
Args:
|
||||
options: 1: recursive, 2: check link array. Options can combine.
|
||||
maxCount: to limit the number of links returned.
|
||||
"""
|
||||
...
|
||||
|
||||
def supportedTypes(self) -> List[str]:
|
||||
def supportedTypes(self) -> list[str]:
|
||||
"""
|
||||
A list of supported types of objects
|
||||
"""
|
||||
@@ -396,12 +438,11 @@ class Document(PropertyContainer):
|
||||
"""
|
||||
...
|
||||
|
||||
def getDependentDocuments(self, sort: bool = True) -> List[DocumentObject]:
|
||||
def getDependentDocuments(self, sort: bool = True, /) -> list[DocumentObject]:
|
||||
"""
|
||||
getDependentDocuments(sort=True)
|
||||
|
||||
Returns a list of documents that this document directly or indirectly links to including itself.
|
||||
|
||||
sort: whether to topologically sort the return list
|
||||
Args:
|
||||
sort: whether to topologically sort the return list
|
||||
"""
|
||||
...
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import constmethod
|
||||
from Base.Matrix import Matrix
|
||||
from Document import Document
|
||||
@@ -63,7 +67,6 @@ class DocumentObject(ExtensionContainer):
|
||||
|
||||
def addProperty(
|
||||
self,
|
||||
*,
|
||||
type: str,
|
||||
name: str,
|
||||
group: str = "",
|
||||
@@ -72,16 +75,16 @@ class DocumentObject(ExtensionContainer):
|
||||
read_only: bool = False,
|
||||
hidden: bool = False,
|
||||
locked: bool = False,
|
||||
enum_vals: list = []
|
||||
enum_vals: list = [],
|
||||
) -> "DocumentObject":
|
||||
"""
|
||||
addProperty(type: string, name: string, group="", doc="", attr=0, read_only=False, hidden=False, locked = False, enum_vals=[]) -- Add a generic property.
|
||||
Add a generic property.
|
||||
"""
|
||||
...
|
||||
|
||||
def removeProperty(self, string: str) -> None:
|
||||
def removeProperty(self, string: str, /) -> None:
|
||||
"""
|
||||
removeProperty(string) -- Remove a generic property.
|
||||
Remove a generic property.
|
||||
|
||||
Note, you can only remove user-defined properties but not built-in ones.
|
||||
"""
|
||||
@@ -111,28 +114,28 @@ class DocumentObject(ExtensionContainer):
|
||||
"""
|
||||
...
|
||||
|
||||
def setExpression(self, name: str, expression: str) -> None:
|
||||
def setExpression(self, name: str, expression: str, /) -> None:
|
||||
"""
|
||||
Register an expression for a property
|
||||
"""
|
||||
...
|
||||
|
||||
def clearExpression(self, name: str) -> None:
|
||||
def clearExpression(self, name: str, /) -> None:
|
||||
"""
|
||||
Clear the expression for a property
|
||||
"""
|
||||
...
|
||||
|
||||
@classmethod
|
||||
def evalExpression(cls, expression: str) -> Any:
|
||||
def evalExpression(cls, expression: str, /) -> Any:
|
||||
"""
|
||||
Evaluate an expression
|
||||
"""
|
||||
...
|
||||
|
||||
def recompute(self, recursive: bool = False) -> None:
|
||||
def recompute(self, recursive: bool = False, /) -> None:
|
||||
"""
|
||||
recompute(recursive=False): Recomputes this object
|
||||
Recomputes this object
|
||||
"""
|
||||
...
|
||||
|
||||
@@ -155,16 +158,14 @@ class DocumentObject(ExtensionContainer):
|
||||
|
||||
def getSubObject(
|
||||
self,
|
||||
*,
|
||||
subname: Union[str, List[str], Tuple[str, ...]],
|
||||
*,
|
||||
retType: int = 0,
|
||||
matrix: Matrix = None,
|
||||
transform: bool = True,
|
||||
depth: int = 0,
|
||||
) -> Any:
|
||||
"""
|
||||
getSubObject(subname, retType=0, matrix=None, transform=True, depth=0)
|
||||
|
||||
* subname(string|list|tuple): dot separated string or sequence of strings
|
||||
referencing subobject.
|
||||
|
||||
@@ -191,17 +192,15 @@ class DocumentObject(ExtensionContainer):
|
||||
"""
|
||||
...
|
||||
|
||||
def getSubObjectList(self, subname: str) -> list:
|
||||
def getSubObjectList(self, subname: str, /) -> list:
|
||||
"""
|
||||
getSubObjectList(subname)
|
||||
|
||||
Return a list of objects referenced by a given subname including this object
|
||||
"""
|
||||
...
|
||||
|
||||
def getSubObjects(self, reason: int = 0) -> list:
|
||||
def getSubObjects(self, reason: int = 0, /) -> list:
|
||||
"""
|
||||
getSubObjects(reason=0): Return subname reference of all sub-objects
|
||||
Return subname reference of all sub-objects
|
||||
"""
|
||||
...
|
||||
|
||||
@@ -214,7 +213,6 @@ class DocumentObject(ExtensionContainer):
|
||||
depth: int = 0,
|
||||
) -> Any:
|
||||
"""
|
||||
getLinkedObject(recursive=True, matrix=None, transform=True, depth=0)
|
||||
Returns the linked object if there is one, or else return itself
|
||||
|
||||
* recursive: whether to recursively resolve the links
|
||||
@@ -229,16 +227,16 @@ class DocumentObject(ExtensionContainer):
|
||||
"""
|
||||
...
|
||||
|
||||
def setElementVisible(self, element: str, visible: bool) -> int:
|
||||
def setElementVisible(self, element: str, visible: bool, /) -> int:
|
||||
"""
|
||||
setElementVisible(element,visible): Set the visibility of a child element
|
||||
Set the visibility of a child element
|
||||
Return -1 if element visibility is not supported, 0 if element not found, 1 if success
|
||||
"""
|
||||
...
|
||||
|
||||
def isElementVisible(self, element: str) -> int:
|
||||
def isElementVisible(self, element: str, /) -> int:
|
||||
"""
|
||||
isElementVisible(element): Check if a child element is visible
|
||||
Check if a child element is visible
|
||||
Return -1 if element visibility is not supported or element not found, 0 if invisible, or else 1
|
||||
"""
|
||||
...
|
||||
@@ -283,9 +281,9 @@ class DocumentObject(ExtensionContainer):
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def resolve(self, subname: str) -> tuple:
|
||||
def resolve(self, subname: str, /) -> tuple:
|
||||
"""
|
||||
resolve(subname) -- resolve the sub object
|
||||
resolve the sub object
|
||||
|
||||
Returns a tuple (subobj,parent,elementName,subElement), where 'subobj' is the
|
||||
last object referenced in 'subname', and 'parent' is the direct parent of
|
||||
@@ -296,9 +294,9 @@ class DocumentObject(ExtensionContainer):
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def resolveSubElement(self, subname: str, append: bool, type: int) -> tuple:
|
||||
def resolveSubElement(self, subname: str, append: bool, type: int, /) -> tuple:
|
||||
"""
|
||||
resolveSubElement(subname,append,type) -- resolve both new and old style sub element
|
||||
resolve both new and old style sub element
|
||||
|
||||
subname: subname reference containing object hierarchy
|
||||
append: Whether to append object hierarchy prefix inside subname to returned element name
|
||||
@@ -308,24 +306,22 @@ class DocumentObject(ExtensionContainer):
|
||||
"""
|
||||
...
|
||||
|
||||
def adjustRelativeLinks(self, parent: DocumentObject, recursive: bool = True) -> bool:
|
||||
def adjustRelativeLinks(self, parent: DocumentObject, recursive: bool = True, /) -> bool:
|
||||
"""
|
||||
adjustRelativeLinks(parent,recursive=True) -- auto correct potential cyclic dependencies
|
||||
auto correct potential cyclic dependencies
|
||||
"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def getElementMapVersion(self, property_name: str) -> str:
|
||||
def getElementMapVersion(self, property_name: str, /) -> str:
|
||||
"""
|
||||
getElementMapVersion(property_name): return element map version of a given geometry property
|
||||
return element map version of a given geometry property
|
||||
"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def isAttachedToDocument(self) -> bool:
|
||||
"""
|
||||
isAttachedToDocument() -> bool
|
||||
|
||||
Return true if the object is part of a document, false otherwise.
|
||||
"""
|
||||
...
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Extension import Extension
|
||||
|
||||
|
||||
@@ -7,4 +11,5 @@ class DocumentObjectExtension(Extension):
|
||||
Author: Stefan Troeger (stefantroeger@gmx.net)
|
||||
Licence: LGPL
|
||||
"""
|
||||
|
||||
...
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from DocumentObject import DocumentObject
|
||||
|
||||
|
||||
@@ -7,4 +11,5 @@ class DocumentObjectGroup(DocumentObject):
|
||||
Author: Werner Mayer (wmayer@users.sourceforge.net)
|
||||
Licence: LGPL
|
||||
"""
|
||||
|
||||
...
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Final, Any
|
||||
from Base.PyObjectBase import PyObjectBase
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import export, constmethod
|
||||
from PropertyContainer import PropertyContainer
|
||||
|
||||
@@ -13,14 +17,14 @@ class ExtensionContainer(PropertyContainer):
|
||||
Licence: LGPL
|
||||
"""
|
||||
|
||||
def addExtension(self, identifier: str) -> None:
|
||||
def addExtension(self, identifier: str, /) -> None:
|
||||
"""
|
||||
Adds an extension to the object. Requires the string identifier for the python extension as argument
|
||||
"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def hasExtension(self, identifier: str) -> bool:
|
||||
def hasExtension(self, identifier: str, /) -> bool:
|
||||
"""
|
||||
Returns if this object has the specified extension
|
||||
"""
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from DocumentObject import DocumentObject
|
||||
from Base import Placement
|
||||
from Base.Placement import Placement
|
||||
from typing import Any, Final, Optional
|
||||
|
||||
|
||||
@@ -19,8 +23,6 @@ class GeoFeature(DocumentObject):
|
||||
|
||||
def getPaths(self) -> Any:
|
||||
"""
|
||||
getPaths()
|
||||
|
||||
Returns all possible paths to the root of the document.
|
||||
Note: Not implemented.
|
||||
"""
|
||||
@@ -28,7 +30,6 @@ class GeoFeature(DocumentObject):
|
||||
|
||||
def getGlobalPlacement(self) -> Placement:
|
||||
"""
|
||||
getGlobalPlacement() -> Base.Placement
|
||||
Deprecated: This function does not handle Links correctly. Use getGlobalPlacementOf instead.
|
||||
|
||||
Returns the placement of the object in the global coordinate space, respecting all stacked
|
||||
@@ -39,16 +40,18 @@ class GeoFeature(DocumentObject):
|
||||
...
|
||||
|
||||
@staticmethod
|
||||
def getGlobalPlacementOf(targetObj: Any, rootObj: Any, subname: str) -> Placement:
|
||||
def getGlobalPlacementOf(targetObj: Any, rootObj: Any, subname: str, /) -> Placement:
|
||||
"""
|
||||
getGlobalPlacementOf(targetObj, rootObj, subname) -> Base.Placement
|
||||
Selection example: obj = "part1" sub = "linkToPart2.LinkToBody.Pad.face1"
|
||||
Examples:
|
||||
obj = "part1"
|
||||
sub = "linkToPart2.LinkToBody.Pad.face1"
|
||||
|
||||
Global placement of Pad in this context :
|
||||
getGlobalPlacementOf(pad, part1, "linkToPart2.LinkToBody.Pad.face1")
|
||||
Global placement of Pad in this context:
|
||||
getGlobalPlacementOf(pad, part1, "linkToPart2.LinkToBody.Pad.face1")
|
||||
|
||||
Global placement of linkToPart2 in this context :
|
||||
getGlobalPlacementOf(linkToPart2, part1, "linkToPart2.LinkToBody.Pad.face1")
|
||||
|
||||
Global placement of linkToPart2 in this context:
|
||||
getGlobalPlacementOf(linkToPart2, part1, "linkToPart2.LinkToBody.Pad.face1")
|
||||
|
||||
Returns the placement of the object in the global coordinate space, respecting all stacked
|
||||
relationships.
|
||||
@@ -57,8 +60,6 @@ class GeoFeature(DocumentObject):
|
||||
|
||||
def getPropertyNameOfGeometry(self) -> Optional[str]:
|
||||
"""
|
||||
getPropertyNameOfGeometry() -> str or None
|
||||
|
||||
Returns the property name of the actual geometry.
|
||||
For example for a Part feature it returns the value 'Shape', for a mesh feature the value
|
||||
'Mesh' and so on.
|
||||
@@ -68,8 +69,6 @@ class GeoFeature(DocumentObject):
|
||||
|
||||
def getPropertyOfGeometry(self) -> Optional[Any]:
|
||||
"""
|
||||
getPropertyOfGeometry() -> object or None
|
||||
|
||||
Returns the property of the actual geometry.
|
||||
For example for a Part feature it returns its Shape property, for a Mesh feature its
|
||||
Mesh property and so on.
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from GroupExtension import GroupExtension
|
||||
|
||||
|
||||
@@ -7,4 +11,5 @@ class GeoFeatureGroupExtension(GroupExtension):
|
||||
Licence: LGPL
|
||||
This class handles placeable group of document objects
|
||||
"""
|
||||
|
||||
...
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import export
|
||||
from DocumentObjectExtension import DocumentObjectExtension
|
||||
from typing import Any, List
|
||||
|
||||
|
||||
@export(
|
||||
Include="App/DocumentObjectGroup.h",
|
||||
)
|
||||
@export(Include="App/DocumentObjectGroup.h", )
|
||||
class GroupExtension(DocumentObjectExtension):
|
||||
"""
|
||||
Extension class which allows grouping of document objects
|
||||
@@ -13,37 +15,37 @@ class GroupExtension(DocumentObjectExtension):
|
||||
Licence: LGPL
|
||||
"""
|
||||
|
||||
def newObject(self, type: str, name: str) -> Any:
|
||||
def newObject(self, type: str, name: str, /) -> Any:
|
||||
"""
|
||||
Create and add an object with given type and name to the group
|
||||
"""
|
||||
...
|
||||
|
||||
def addObject(self, obj: Any) -> List[Any]:
|
||||
def addObject(self, obj: Any, /) -> List[Any]:
|
||||
"""
|
||||
Add an object to the group. Returns all objects that have been added.
|
||||
"""
|
||||
...
|
||||
|
||||
def addObjects(self, objects: List[Any]) -> List[Any]:
|
||||
def addObjects(self, objects: List[Any], /) -> List[Any]:
|
||||
"""
|
||||
Adds multiple objects to the group. Expects a list and returns all objects that have been added.
|
||||
"""
|
||||
...
|
||||
|
||||
def setObjects(self, objects: List[Any]) -> List[Any]:
|
||||
def setObjects(self, objects: List[Any], /) -> List[Any]:
|
||||
"""
|
||||
Sets the objects of the group. Expects a list and returns all objects that are now in the group.
|
||||
"""
|
||||
...
|
||||
|
||||
def removeObject(self, obj: Any) -> List[Any]:
|
||||
def removeObject(self, obj: Any, /) -> List[Any]:
|
||||
"""
|
||||
Remove an object from the group and returns all objects that have been removed.
|
||||
"""
|
||||
...
|
||||
|
||||
def removeObjects(self, objects: List[Any]) -> List[Any]:
|
||||
def removeObjects(self, objects: List[Any], /) -> List[Any]:
|
||||
"""
|
||||
Remove multiple objects from the group. Expects a list and returns all objects that have been removed.
|
||||
"""
|
||||
@@ -55,30 +57,28 @@ class GroupExtension(DocumentObjectExtension):
|
||||
"""
|
||||
...
|
||||
|
||||
def getObject(self, name: str) -> Any:
|
||||
def getObject(self, name: str, /) -> Any:
|
||||
"""
|
||||
Return the object with the given name
|
||||
"""
|
||||
...
|
||||
|
||||
def getObjectsOfType(self, typename: str) -> List[Any]:
|
||||
def getObjectsOfType(self, typename: str, /) -> List[Any]:
|
||||
"""
|
||||
Returns all object in the group of given type
|
||||
@param typename The Freecad type identifier
|
||||
"""
|
||||
...
|
||||
|
||||
def hasObject(self, obj: Any, recursive: bool = False) -> bool:
|
||||
def hasObject(self, obj: Any, recursive: bool = False, /) -> bool:
|
||||
"""
|
||||
hasObject(obj, recursive=false)
|
||||
|
||||
Checks if the group has a given object
|
||||
@param obj the object to check for.
|
||||
@param recursive if true check also if the obj is child of some sub group (default is false).
|
||||
"""
|
||||
...
|
||||
|
||||
def allowObject(self, obj: Any) -> bool:
|
||||
def allowObject(self, obj: Any, /) -> bool:
|
||||
"""
|
||||
Returns true if obj is allowed in the group extension.
|
||||
"""
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import export
|
||||
from DocumentObjectExtension import DocumentObjectExtension
|
||||
from typing import Any, Final, List, Tuple, Optional, Union, overload
|
||||
|
||||
|
||||
@export(
|
||||
Include="App/Link.h",
|
||||
)
|
||||
@export(Include="App/Link.h", )
|
||||
class LinkBaseExtension(DocumentObjectExtension):
|
||||
"""
|
||||
Link extension base class
|
||||
@@ -16,15 +18,18 @@ class LinkBaseExtension(DocumentObjectExtension):
|
||||
LinkedChildren: Final[List[Any]] = []
|
||||
"""Return a flattened (in case grouped by plain group) list of linked children"""
|
||||
|
||||
def configLinkProperty(self, **kwargs) -> Any:
|
||||
def configLinkProperty(self, *args, **kwargs) -> Any:
|
||||
"""
|
||||
configLinkProperty(key=val,...): property configuration
|
||||
configLinkProperty(key,...): property configuration with default name
|
||||
Examples:
|
||||
Called with default names:
|
||||
configLinkProperty(prop1, prop2, ..., propN)
|
||||
Called with custom names:
|
||||
configLinkProperty(prop1=val1, prop2=val2, ..., propN=valN)
|
||||
|
||||
This methode is here to implement what I called Property Design
|
||||
This method is here to implement what I called Property Design
|
||||
Pattern. The extension operates on a predefined set of properties,
|
||||
but it relies on the extended object to supply the actual property by
|
||||
calling this methode. You can choose a sub set of functionality of
|
||||
calling this method. You can choose a sub set of functionality of
|
||||
this extension by supplying only some of the supported properties.
|
||||
|
||||
The 'key' are names used to refer to properties supported by this
|
||||
@@ -41,48 +46,48 @@ class LinkBaseExtension(DocumentObjectExtension):
|
||||
"""
|
||||
...
|
||||
|
||||
def getLinkExtProperty(self, name: str) -> Any:
|
||||
def getLinkExtProperty(self, name: str, /) -> Any:
|
||||
"""
|
||||
getLinkExtProperty(name): return the property value by its predefined name
|
||||
return the property value by its predefined name
|
||||
"""
|
||||
...
|
||||
|
||||
def getLinkExtPropertyName(self, name: str) -> str:
|
||||
def getLinkExtPropertyName(self, name: str, /) -> str:
|
||||
"""
|
||||
getLinkExtPropertyName(name): lookup the property name by its predefined name
|
||||
lookup the property name by its predefined name
|
||||
"""
|
||||
...
|
||||
|
||||
@overload
|
||||
def getLinkPropertyInfo(self) -> tuple:
|
||||
def getLinkPropertyInfo(self, /) -> tuple[tuple[str, str, str]]:
|
||||
...
|
||||
|
||||
|
||||
@overload
|
||||
def getLinkPropertyInfo(self, index: int) -> tuple:
|
||||
def getLinkPropertyInfo(self, index: int, /) -> tuple[str, str, str]:
|
||||
...
|
||||
|
||||
|
||||
@overload
|
||||
def getLinkPropertyInfo(self, name: str) -> tuple:
|
||||
def getLinkPropertyInfo(self, name: str, /) -> tuple[str, str]:
|
||||
...
|
||||
|
||||
def getLinkPropertyInfo(self, arg: Any = None) -> tuple:
|
||||
|
||||
def getLinkPropertyInfo(self, arg: Any = None, /) -> tuple:
|
||||
"""
|
||||
getLinkPropertyInfo(): return a tuple of (name,type,doc) for all supported properties.
|
||||
|
||||
getLinkPropertyInfo(index): return (name,type,doc) of a specific property
|
||||
|
||||
getLinkPropertyInfo(name): return (type,doc) of a specific property
|
||||
Overloads:
|
||||
(): return (name,type,doc) for all supported properties.
|
||||
(index): return (name,type,doc) of a specific property
|
||||
(name): return (type,doc) of a specific property
|
||||
"""
|
||||
...
|
||||
|
||||
def setLink(self, obj: Any, subName: Optional[str] = None, subElements: Optional[Union[str, Tuple[str, ...]]] = None) -> None:
|
||||
def setLink(
|
||||
self,
|
||||
obj: Any,
|
||||
subName: Optional[str] = None,
|
||||
subElements: Optional[Union[str, Tuple[str, ...]]] = None,
|
||||
/,
|
||||
) -> None:
|
||||
"""
|
||||
setLink(obj,subName=None,subElements=None): Set link object.
|
||||
|
||||
setLink([obj,...]),
|
||||
setLink([(obj,subName,subElements),...]),
|
||||
setLink({index:obj,...}),
|
||||
setLink({index:(obj,subName,subElements),...}): set link element of a link group.
|
||||
Called with only obj, set link object, otherwise set link element of a link group.
|
||||
|
||||
obj (DocumentObject): the object to link to. If this is None, then the link is cleared
|
||||
|
||||
@@ -92,27 +97,23 @@ class LinkBaseExtension(DocumentObjectExtension):
|
||||
"""
|
||||
...
|
||||
|
||||
def cacheChildLabel(self, enable: bool = True) -> None:
|
||||
def cacheChildLabel(self, enable: bool = True, /) -> None:
|
||||
"""
|
||||
cacheChildLabel(enable=True): enable/disable child label cache
|
||||
enable/disable child label cache
|
||||
|
||||
The cache is not updated on child label change for performance reason. You must
|
||||
call this function on any child label change
|
||||
"""
|
||||
...
|
||||
|
||||
def flattenSubname(self, subname: str) -> str:
|
||||
def flattenSubname(self, subname: str, /) -> str:
|
||||
"""
|
||||
flattenSubname(subname) -> string
|
||||
|
||||
Return a flattened subname in case it references an object inside a linked plain group
|
||||
"""
|
||||
...
|
||||
|
||||
def expandSubname(self, subname: str) -> str:
|
||||
def expandSubname(self, subname: str, /) -> str:
|
||||
"""
|
||||
expandSubname(subname) -> string
|
||||
|
||||
Return an expanded subname in case it references an object inside a linked plain group
|
||||
"""
|
||||
...
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import export, class_declarations
|
||||
from Base.PyObjectBase import PyObjectBase
|
||||
from typing import Any, overload
|
||||
@@ -7,11 +11,9 @@ from typing import Any, overload
|
||||
Constructor=True,
|
||||
Delete=True,
|
||||
)
|
||||
@class_declarations(
|
||||
"""public:
|
||||
@class_declarations("""public:
|
||||
static Base::Color toColor(PyObject* value);
|
||||
"""
|
||||
)
|
||||
""")
|
||||
class Material(PyObjectBase):
|
||||
"""
|
||||
App.Material class.
|
||||
@@ -21,11 +23,7 @@ class Material(PyObjectBase):
|
||||
UserDocu: This is the Material class
|
||||
"""
|
||||
|
||||
@overload
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
||||
...
|
||||
|
||||
def set(self, string: str) -> None:
|
||||
def set(self, string: str, /) -> None:
|
||||
"""
|
||||
Set(string) -- Set the material.
|
||||
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import export, no_args
|
||||
from Base.PyObjectBase import PyObjectBase
|
||||
from typing import List, Tuple, TypeAlias
|
||||
|
||||
|
||||
MeasureType: TypeAlias = object
|
||||
|
||||
|
||||
@export(
|
||||
Constructor=False,
|
||||
Delete=True,
|
||||
)
|
||||
)
|
||||
class MeasureManager(PyObjectBase):
|
||||
"""
|
||||
MeasureManager class.
|
||||
@@ -21,10 +25,8 @@ class MeasureManager(PyObjectBase):
|
||||
"""
|
||||
|
||||
@staticmethod
|
||||
def addMeasureType(id: str, label: str, measureType: MeasureType) -> None:
|
||||
def addMeasureType(id: str, label: str, measureType: MeasureType, /) -> None:
|
||||
"""
|
||||
addMeasureType(id, label, measureType) -> None
|
||||
|
||||
Add a new measure type.
|
||||
|
||||
id : str
|
||||
@@ -40,8 +42,6 @@ class MeasureManager(PyObjectBase):
|
||||
@no_args
|
||||
def getMeasureTypes() -> List[Tuple[str, str, MeasureType]]:
|
||||
"""
|
||||
getMeasureTypes() -> List[(id, label, pythonMeasureType)]
|
||||
|
||||
Returns a list of all registered measure types.
|
||||
"""
|
||||
...
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import export, class_declarations
|
||||
from Base.PyObjectBase import PyObjectBase
|
||||
from typing import Any, List, Dict, overload, Optional
|
||||
@@ -8,7 +12,7 @@ from typing import Any, List, Dict, overload, Optional
|
||||
Delete=True,
|
||||
NumberProtocol=False,
|
||||
RichCompare=False,
|
||||
)
|
||||
)
|
||||
@class_declarations(
|
||||
"""public:
|
||||
MetadataPy(const Metadata & pla, PyTypeObject *T = &Type)
|
||||
@@ -49,16 +53,20 @@ class Metadata(PyObjectBase):
|
||||
"""
|
||||
|
||||
@overload
|
||||
def __init__(self) -> None: ...
|
||||
def __init__(self) -> None:
|
||||
...
|
||||
|
||||
@overload
|
||||
def __init__(self, metadata: "Metadata") -> None: ...
|
||||
def __init__(self, metadata: "Metadata") -> None:
|
||||
...
|
||||
|
||||
@overload
|
||||
def __init__(self, file: str) -> None: ...
|
||||
def __init__(self, file: str) -> None:
|
||||
...
|
||||
|
||||
@overload
|
||||
def __init__(self, bytes: bytes) -> None: ...
|
||||
def __init__(self, bytes: bytes) -> None:
|
||||
...
|
||||
|
||||
Name: str = ""
|
||||
"""String representing the name of this item."""
|
||||
@@ -183,8 +191,6 @@ class Metadata(PyObjectBase):
|
||||
|
||||
def getLastSupportedFreeCADVersion(self) -> Optional[str]:
|
||||
"""
|
||||
getLastSupportedFreeCADVersion() -> str or None
|
||||
|
||||
Search through all content package items, and determine if a maximum supported
|
||||
version of FreeCAD is set.
|
||||
Returns None if no maximum version is set, or if *any* content item fails to
|
||||
@@ -195,8 +201,6 @@ class Metadata(PyObjectBase):
|
||||
|
||||
def getFirstSupportedFreeCADVersion(self) -> Optional[str]:
|
||||
"""
|
||||
getFirstSupportedFreeCADVersion() -> str or None
|
||||
|
||||
Search through all content package items, and determine if a minimum supported
|
||||
version of FreeCAD is set.
|
||||
Returns 0.0 if no minimum version is set, or if *any* content item fails to
|
||||
@@ -208,8 +212,6 @@ class Metadata(PyObjectBase):
|
||||
|
||||
def supportsCurrentFreeCAD(self) -> bool:
|
||||
"""
|
||||
supportsCurrentFreeCAD() -> bool
|
||||
|
||||
Returns False if this metadata object directly indicates that it does not
|
||||
support the current version of FreeCAD, or True if it makes no indication, or
|
||||
specifically indicates that it does support the current version. Does not
|
||||
@@ -217,10 +219,8 @@ class Metadata(PyObjectBase):
|
||||
"""
|
||||
...
|
||||
|
||||
def getGenericMetadata(self, name: str) -> List[Any]:
|
||||
def getGenericMetadata(self, name: str, /) -> List[Any]:
|
||||
"""
|
||||
getGenericMetadata(name) -> list
|
||||
|
||||
Get the list of GenericMetadata objects with key 'name'.
|
||||
Generic metadata objects are Python objects with a string 'contents' and a
|
||||
dictionary of strings, 'attributes'. They represent unrecognized simple XML tags
|
||||
@@ -228,58 +228,44 @@ class Metadata(PyObjectBase):
|
||||
"""
|
||||
...
|
||||
|
||||
def addContentItem(self, content_type: str, metadata: "Metadata") -> None:
|
||||
def addContentItem(self, content_type: str, metadata: "Metadata", /) -> None:
|
||||
"""
|
||||
addContentItem(content_type,metadata)
|
||||
|
||||
Add a new content item of type 'content_type' with metadata 'metadata'.
|
||||
"""
|
||||
...
|
||||
|
||||
def removeContentItem(self, content_type: str, name: str) -> None:
|
||||
def removeContentItem(self, content_type: str, name: str, /) -> None:
|
||||
"""
|
||||
removeContentItem(content_type,name)
|
||||
|
||||
Remove the content item of type 'content_type' with name 'name'.
|
||||
"""
|
||||
...
|
||||
|
||||
def addMaintainer(self, name: str, email: str) -> None:
|
||||
def addMaintainer(self, name: str, email: str, /) -> None:
|
||||
"""
|
||||
addMaintainer(name, email)
|
||||
|
||||
Add a new Maintainer.
|
||||
"""
|
||||
...
|
||||
|
||||
def removeMaintainer(self, name: str, email: str) -> None:
|
||||
def removeMaintainer(self, name: str, email: str, /) -> None:
|
||||
"""
|
||||
removeMaintainer(name, email)
|
||||
|
||||
Remove the Maintainer.
|
||||
"""
|
||||
...
|
||||
|
||||
def addLicense(self, short_code: str, path: str) -> None:
|
||||
def addLicense(self, short_code: str, path: str, /) -> None:
|
||||
"""
|
||||
addLicense(short_code,path)
|
||||
|
||||
Add a new License.
|
||||
"""
|
||||
...
|
||||
|
||||
def removeLicense(self, short_code: str) -> None:
|
||||
def removeLicense(self, short_code: str, /) -> None:
|
||||
"""
|
||||
removeLicense(short_code)
|
||||
|
||||
Remove the License.
|
||||
"""
|
||||
...
|
||||
|
||||
def addUrl(self, url_type: str, url: str, branch: str) -> None:
|
||||
def addUrl(self, url_type: str, url: str, branch: str, /) -> None:
|
||||
"""
|
||||
addUrl(url_type,url,branch)
|
||||
|
||||
Add a new Url or type 'url_type' (which should be one of 'repository', 'readme',
|
||||
|
||||
'bugtracker', 'documentation', or 'webpage') If type is 'repository' you
|
||||
@@ -288,118 +274,90 @@ class Metadata(PyObjectBase):
|
||||
"""
|
||||
...
|
||||
|
||||
def removeUrl(self, url_type: str, url: str) -> None:
|
||||
def removeUrl(self, url_type: str, url: str, /) -> None:
|
||||
"""
|
||||
removeUrl(url_type,url)
|
||||
|
||||
Remove the Url.
|
||||
"""
|
||||
...
|
||||
|
||||
def addAuthor(self, name: str, email: str) -> None:
|
||||
def addAuthor(self, name: str, email: str, /) -> None:
|
||||
"""
|
||||
addAuthor(name, email)
|
||||
|
||||
Add a new Author with name 'name', and optionally email 'email'.
|
||||
"""
|
||||
...
|
||||
|
||||
def removeAuthor(self, name: str, email: str) -> None:
|
||||
def removeAuthor(self, name: str, email: str, /) -> None:
|
||||
"""
|
||||
removeAuthor(name, email)
|
||||
|
||||
Remove the Author.
|
||||
"""
|
||||
...
|
||||
|
||||
def addDepend(self, name: str, kind: str, optional: bool) -> None:
|
||||
def addDepend(self, name: str, kind: str, optional: bool, /) -> None:
|
||||
"""
|
||||
addDepend(name, kind, optional)
|
||||
|
||||
Add a new Dependency on package 'name' of kind 'kind' (optional, one of 'auto' (the default),
|
||||
|
||||
'internal', 'addon', or 'python').
|
||||
"""
|
||||
...
|
||||
|
||||
def removeDepend(self, name: str, kind: str) -> None:
|
||||
def removeDepend(self, name: str, kind: str, /) -> None:
|
||||
"""
|
||||
removeDepend(name, kind)
|
||||
|
||||
Remove the Dependency on package 'name' of kind 'kind' (optional - if unspecified any
|
||||
|
||||
matching name is removed).
|
||||
"""
|
||||
...
|
||||
|
||||
def addConflict(self, name: str, kind: str) -> None:
|
||||
def addConflict(self, name: str, kind: str, /) -> None:
|
||||
"""
|
||||
addConflict(name, kind)
|
||||
|
||||
Add a new Conflict. See documentation for addDepend().
|
||||
"""
|
||||
...
|
||||
|
||||
def removeConflict(self, name: str, kind: str) -> None:
|
||||
def removeConflict(self, name: str, kind: str, /) -> None:
|
||||
"""
|
||||
removeConflict(name, kind)
|
||||
|
||||
Remove the Conflict. See documentation for removeDepend().
|
||||
"""
|
||||
...
|
||||
|
||||
def addReplace(self, name: str) -> None:
|
||||
def addReplace(self, name: str, /) -> None:
|
||||
"""
|
||||
addReplace(name)
|
||||
|
||||
Add a new Replace.
|
||||
"""
|
||||
...
|
||||
|
||||
def removeReplace(self, name: str) -> None:
|
||||
def removeReplace(self, name: str, /) -> None:
|
||||
"""
|
||||
removeReplace(name)
|
||||
|
||||
Remove the Replace.
|
||||
"""
|
||||
...
|
||||
|
||||
def addTag(self, tag: str) -> None:
|
||||
def addTag(self, tag: str, /) -> None:
|
||||
"""
|
||||
addTag(tag)
|
||||
|
||||
Add a new Tag.
|
||||
"""
|
||||
...
|
||||
|
||||
def removeTag(self, tag: str) -> None:
|
||||
def removeTag(self, tag: str, /) -> None:
|
||||
"""
|
||||
removeTag(tag)
|
||||
|
||||
Remove the Tag.
|
||||
"""
|
||||
...
|
||||
|
||||
def addFile(self, filename: str) -> None:
|
||||
def addFile(self, filename: str, /) -> None:
|
||||
"""
|
||||
addFile(filename)
|
||||
|
||||
Add a new File.
|
||||
"""
|
||||
...
|
||||
|
||||
def removeFile(self, filename: str) -> None:
|
||||
def removeFile(self, filename: str, /) -> None:
|
||||
"""
|
||||
removeFile(filename)
|
||||
|
||||
Remove the File.
|
||||
"""
|
||||
...
|
||||
|
||||
def write(self, filename: str) -> None:
|
||||
def write(self, filename: str, /) -> None:
|
||||
"""
|
||||
write(filename)
|
||||
|
||||
Write the metadata to the given file as XML data.
|
||||
"""
|
||||
...
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from GeoFeatureGroupExtension import GeoFeatureGroupExtension
|
||||
|
||||
|
||||
@@ -7,4 +11,5 @@ class OriginGroupExtension(GeoFeatureGroupExtension):
|
||||
Licence: LGPL
|
||||
This class handles placable group of document objects with an Origin
|
||||
"""
|
||||
|
||||
...
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from GeoFeature import GeoFeature
|
||||
|
||||
|
||||
@@ -7,4 +11,5 @@ class Part(GeoFeature):
|
||||
Licence: LGPL
|
||||
This class handles document objects in Part
|
||||
"""
|
||||
|
||||
...
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import export, constmethod
|
||||
from Base.Persistence import Persistence
|
||||
from typing import Any, Final, Union, List, Optional
|
||||
|
||||
|
||||
@export(
|
||||
DisableNotify=True,
|
||||
)
|
||||
@export(DisableNotify=True, )
|
||||
class PropertyContainer(Persistence):
|
||||
"""
|
||||
App.PropertyContainer class.
|
||||
@@ -14,10 +16,8 @@ class PropertyContainer(Persistence):
|
||||
PropertiesList: Final[list] = []
|
||||
"""A list of all property names."""
|
||||
|
||||
def getPropertyByName(self, name: str, checkOwner: int = 0) -> Any:
|
||||
def getPropertyByName(self, name: str, checkOwner: int = 0, /) -> Any:
|
||||
"""
|
||||
getPropertyByName(name, checkOwner=0) -> object or Tuple
|
||||
|
||||
Returns the value of a named property. Note that the returned property may not
|
||||
always belong to this container (e.g. from a linked object).
|
||||
|
||||
@@ -30,10 +30,8 @@ class PropertyContainer(Persistence):
|
||||
"""
|
||||
...
|
||||
|
||||
def getPropertyTouchList(self, name: str) -> tuple:
|
||||
def getPropertyTouchList(self, name: str, /) -> tuple:
|
||||
"""
|
||||
getPropertyTouchList(name) -> tuple
|
||||
|
||||
Returns a list of index of touched values for list type properties.
|
||||
|
||||
name : str
|
||||
@@ -41,10 +39,8 @@ class PropertyContainer(Persistence):
|
||||
"""
|
||||
...
|
||||
|
||||
def getTypeOfProperty(self, name: str) -> list:
|
||||
def getTypeOfProperty(self, name: str, /) -> list:
|
||||
"""
|
||||
getTypeOfProperty(name) -> list
|
||||
|
||||
Returns the type of a named property. This can be a list conformed by elements in
|
||||
(Hidden, NoRecompute, NoPersist, Output, ReadOnly, Transient).
|
||||
|
||||
@@ -53,10 +49,8 @@ class PropertyContainer(Persistence):
|
||||
"""
|
||||
...
|
||||
|
||||
def getTypeIdOfProperty(self, name: str) -> str:
|
||||
def getTypeIdOfProperty(self, name: str, /) -> str:
|
||||
"""
|
||||
getTypeIdOfProperty(name) -> str
|
||||
|
||||
Returns the C++ class name of a named property.
|
||||
|
||||
name : str
|
||||
@@ -64,10 +58,8 @@ class PropertyContainer(Persistence):
|
||||
"""
|
||||
...
|
||||
|
||||
def setEditorMode(self, name: str, type: Union[int, List[str]]) -> None:
|
||||
def setEditorMode(self, name: str, type: Union[int, List[str]], /) -> None:
|
||||
"""
|
||||
setEditorMode(name, type) -> None
|
||||
|
||||
Set the behaviour of the property in the property editor.
|
||||
|
||||
name : str
|
||||
@@ -79,10 +71,8 @@ class PropertyContainer(Persistence):
|
||||
"""
|
||||
...
|
||||
|
||||
def getEditorMode(self, name: str) -> list:
|
||||
def getEditorMode(self, name: str, /) -> list:
|
||||
"""
|
||||
getEditorMode(name) -> list
|
||||
|
||||
Get the behaviour of the property in the property editor.
|
||||
It returns a list of strings with the current mode. If the list is empty there are no
|
||||
special restrictions.
|
||||
@@ -95,10 +85,8 @@ class PropertyContainer(Persistence):
|
||||
"""
|
||||
...
|
||||
|
||||
def getGroupOfProperty(self, name: str) -> str:
|
||||
def getGroupOfProperty(self, name: str, /) -> str:
|
||||
"""
|
||||
getGroupOfProperty(name) -> str
|
||||
|
||||
Returns the name of the group which the property belongs to in this class.
|
||||
The properties are sorted in different named groups for convenience.
|
||||
|
||||
@@ -107,10 +95,8 @@ class PropertyContainer(Persistence):
|
||||
"""
|
||||
...
|
||||
|
||||
def setGroupOfProperty(self, name: str, group: str) -> None:
|
||||
def setGroupOfProperty(self, name: str, group: str, /) -> None:
|
||||
"""
|
||||
setGroupOfProperty(name, group) -> None
|
||||
|
||||
Set the name of the group of a dynamic property.
|
||||
|
||||
name : str
|
||||
@@ -120,12 +106,8 @@ class PropertyContainer(Persistence):
|
||||
"""
|
||||
...
|
||||
|
||||
def setPropertyStatus(
|
||||
self, name: str, val: Union[int, str, List[Union[str, int]]]
|
||||
) -> None:
|
||||
def setPropertyStatus(self, name: str, val: Union[int, str, List[Union[str, int]]], /) -> None:
|
||||
"""
|
||||
setPropertyStatus(name, val) -> None
|
||||
|
||||
Set property status.
|
||||
|
||||
name : str
|
||||
@@ -136,10 +118,8 @@ class PropertyContainer(Persistence):
|
||||
"""
|
||||
...
|
||||
|
||||
def getPropertyStatus(self, name: str = "") -> list:
|
||||
def getPropertyStatus(self, name: str = "", /) -> list:
|
||||
"""
|
||||
getPropertyStatus(name='') -> list
|
||||
|
||||
Get property status.
|
||||
|
||||
name : str
|
||||
@@ -147,10 +127,8 @@ class PropertyContainer(Persistence):
|
||||
"""
|
||||
...
|
||||
|
||||
def getDocumentationOfProperty(self, name: str) -> str:
|
||||
def getDocumentationOfProperty(self, name: str, /) -> str:
|
||||
"""
|
||||
getDocumentationOfProperty(name) -> str
|
||||
|
||||
Returns the documentation string of the property of this class.
|
||||
|
||||
name : str
|
||||
@@ -158,10 +136,8 @@ class PropertyContainer(Persistence):
|
||||
"""
|
||||
...
|
||||
|
||||
def setDocumentationOfProperty(self, name: str, docstring: str) -> None:
|
||||
def setDocumentationOfProperty(self, name: str, docstring: str, /) -> None:
|
||||
"""
|
||||
setDocumentationOfProperty(name, docstring) -> None
|
||||
|
||||
Set the documentation string of a dynamic property of this class.
|
||||
|
||||
name : str
|
||||
@@ -171,10 +147,8 @@ class PropertyContainer(Persistence):
|
||||
"""
|
||||
...
|
||||
|
||||
def getEnumerationsOfProperty(self, name: str) -> Optional[list]:
|
||||
def getEnumerationsOfProperty(self, name: str, /) -> Optional[list]:
|
||||
"""
|
||||
getEnumerationsOfProperty(name) -> list or None
|
||||
|
||||
Return all enumeration strings of the property of this class or None if not a
|
||||
PropertyEnumeration.
|
||||
|
||||
@@ -186,8 +160,6 @@ class PropertyContainer(Persistence):
|
||||
@constmethod
|
||||
def dumpPropertyContent(self, Property: str, *, Compression: int = 3) -> bytearray:
|
||||
"""
|
||||
dumpPropertyContent(Property, Compression=3) -> bytearray
|
||||
|
||||
Dumps the content of the property, both the XML representation and the additional
|
||||
data files required, into a byte representation.
|
||||
|
||||
@@ -198,10 +170,8 @@ class PropertyContainer(Persistence):
|
||||
"""
|
||||
...
|
||||
|
||||
def restorePropertyContent(self, name: str, obj: object) -> None:
|
||||
def restorePropertyContent(self, name: str, obj: object, /) -> None:
|
||||
"""
|
||||
restorePropertyContent(name, obj) -> None
|
||||
|
||||
Restore the content of the object from a byte representation as stored by `dumpPropertyContent`.
|
||||
It could be restored from any Python object implementing the buffer protocol.
|
||||
|
||||
@@ -213,10 +183,8 @@ class PropertyContainer(Persistence):
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def renameProperty(self, oldName: str, newName: str) -> None:
|
||||
def renameProperty(self, oldName: str, newName: str, /) -> None:
|
||||
"""
|
||||
renameProperty(oldName, newName) -> None
|
||||
|
||||
Rename a property.
|
||||
|
||||
oldName : str
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import export, constmethod
|
||||
from Base.BaseClass import BaseClass
|
||||
from typing import Any, Final, overload, Dict
|
||||
@@ -16,13 +20,15 @@ class StringHasher(BaseClass):
|
||||
"""
|
||||
|
||||
@overload
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
||||
def getID(self, txt: str, base64: bool = False, /) -> Any:
|
||||
...
|
||||
|
||||
def getID(self, arg: Any, base64: bool = False) -> Any:
|
||||
"""
|
||||
getID(txt|id, base64=False) -> StringID
|
||||
@overload
|
||||
def getID(self, id: int, base64: bool = False, /) -> Any:
|
||||
...
|
||||
|
||||
def getID(self, arg: Any, base64: bool = False, /) -> Any:
|
||||
"""
|
||||
If the input is text, return a StringID object that is unique within this hasher. This
|
||||
StringID object is reference counted. The hasher may only save hash ID's that are used.
|
||||
|
||||
@@ -33,14 +39,8 @@ class StringHasher(BaseClass):
|
||||
"""
|
||||
...
|
||||
|
||||
@overload
|
||||
def getID(self, txt: str, base64: bool = False) -> Any: ...
|
||||
|
||||
@overload
|
||||
def getID(self, id: int, base64: bool = False) -> Any: ...
|
||||
|
||||
@constmethod
|
||||
def isSame(self, other: "StringHasher") -> bool:
|
||||
def isSame(self, other: "StringHasher", /) -> bool:
|
||||
"""
|
||||
Check if two hasher are the same
|
||||
"""
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import export, constmethod, class_declarations
|
||||
from Base.BaseClass import BaseClass
|
||||
from typing import Any, Final, List
|
||||
@@ -10,8 +14,7 @@ from typing import Any, Final, List
|
||||
@class_declarations("""private:
|
||||
friend class StringID;
|
||||
int _index = 0;
|
||||
"""
|
||||
)
|
||||
""")
|
||||
class StringID(BaseClass):
|
||||
"""
|
||||
This is the StringID class
|
||||
@@ -21,7 +24,7 @@ class StringID(BaseClass):
|
||||
"""
|
||||
|
||||
@constmethod
|
||||
def isSame(self, other: "StringID") -> bool:
|
||||
def isSame(self, other: "StringID", /) -> bool:
|
||||
"""
|
||||
Check if two StringIDs are the same
|
||||
"""
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from DocumentObjectExtension import DocumentObjectExtension
|
||||
|
||||
|
||||
@@ -7,4 +11,5 @@ class SuppressibleExtension(DocumentObjectExtension):
|
||||
Licence: LGPL
|
||||
Extension class which allows suppressing of document objects
|
||||
"""
|
||||
|
||||
...
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Metadata import export
|
||||
from PyObjectBase import PyObjectBase
|
||||
from Vector import Vector
|
||||
from Placement import Placement
|
||||
from Axis import Axis
|
||||
from typing import overload
|
||||
|
||||
@export(
|
||||
@@ -49,16 +50,12 @@ class Axis(PyObjectBase):
|
||||
|
||||
def copy(self) -> Axis:
|
||||
"""
|
||||
copy() -> Base.Axis
|
||||
|
||||
Returns a copy of this Axis.
|
||||
"""
|
||||
...
|
||||
|
||||
def move(self, vector: Vector) -> None:
|
||||
def move(self, vector: Vector, /) -> None:
|
||||
"""
|
||||
move(vector) -> None
|
||||
|
||||
Move the axis base along the given vector.
|
||||
|
||||
vector : Base.Vector
|
||||
@@ -66,10 +63,8 @@ class Axis(PyObjectBase):
|
||||
"""
|
||||
...
|
||||
|
||||
def multiply(self, placement: Placement) -> Axis:
|
||||
def multiply(self, placement: Placement, /) -> Axis:
|
||||
"""
|
||||
multiply(placement) -> Base.Axis
|
||||
|
||||
Multiply this axis by a placement.
|
||||
|
||||
placement : Base.Placement
|
||||
@@ -79,8 +74,6 @@ class Axis(PyObjectBase):
|
||||
|
||||
def reversed(self) -> Axis:
|
||||
"""
|
||||
reversed() -> Base.Axis
|
||||
|
||||
Compute the reversed axis. This returns a new Base.Axis with
|
||||
the original direction reversed.
|
||||
"""
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Metadata import constmethod
|
||||
from PyObjectBase import PyObjectBase
|
||||
from typing import List, Final
|
||||
@@ -19,7 +21,7 @@ class BaseClass(PyObjectBase):
|
||||
"""Module in which this class is defined"""
|
||||
|
||||
@constmethod
|
||||
def isDerivedFrom(self, typeName: str) -> bool:
|
||||
def isDerivedFrom(self, typeName: str, /) -> bool:
|
||||
"""
|
||||
Returns true if given type is a father
|
||||
"""
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Metadata import export, constmethod
|
||||
from PyObjectBase import PyObjectBase
|
||||
from Vector import Vector
|
||||
@@ -107,19 +109,17 @@ class BoundBox(PyObjectBase):
|
||||
xMax: float = 0,
|
||||
yMax: float = 0,
|
||||
zMax: float = 0,
|
||||
) -> None: ...
|
||||
) -> None: ...
|
||||
@overload
|
||||
def __init__(
|
||||
self,
|
||||
min: Union[Vector, Tuple[float, float, float]],
|
||||
max: Union[Vector, Tuple[float, float, float]],
|
||||
) -> None: ...
|
||||
) -> None: ...
|
||||
# fmt: on
|
||||
|
||||
def setVoid(self) -> None:
|
||||
"""
|
||||
setVoid() -> None
|
||||
|
||||
Invalidate the bounding box.
|
||||
"""
|
||||
...
|
||||
@@ -127,23 +127,18 @@ class BoundBox(PyObjectBase):
|
||||
@constmethod
|
||||
def isValid(self) -> bool:
|
||||
"""
|
||||
isValid() -> bool
|
||||
|
||||
Checks if the bounding box is valid.
|
||||
"""
|
||||
...
|
||||
|
||||
@overload
|
||||
def add(self, minMax: Vector) -> None: ...
|
||||
def add(self, minMax: Vector, /) -> None: ...
|
||||
@overload
|
||||
def add(self, minMax: Tuple[float, float, float]) -> None: ...
|
||||
def add(self, minMax: Tuple[float, float, float], /) -> None: ...
|
||||
@overload
|
||||
def add(self, x: float, y: float, z: float) -> None: ...
|
||||
def add(self, x: float, y: float, z: float, /) -> None: ...
|
||||
def add(self, *args: Any, **kwargs: Any) -> None:
|
||||
"""
|
||||
add(minMax) -> None
|
||||
add(x, y, z) -> None
|
||||
|
||||
Increase the maximum values or decrease the minimum values of this BoundBox by
|
||||
replacing the current values with the given values, so the bounding box can grow
|
||||
but not shrink.
|
||||
@@ -160,10 +155,8 @@ class BoundBox(PyObjectBase):
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def getPoint(self, index: int) -> Vector:
|
||||
def getPoint(self, index: int, /) -> Vector:
|
||||
"""
|
||||
getPoint(index) -> Base.Vector
|
||||
|
||||
Get the point of the given index.
|
||||
The index must be in the range of [0, 7].
|
||||
|
||||
@@ -172,10 +165,8 @@ class BoundBox(PyObjectBase):
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def getEdge(self, index: int) -> Tuple[Vector, ...]:
|
||||
def getEdge(self, index: int, /) -> Tuple[Vector, ...]:
|
||||
"""
|
||||
getEdge(index) -> tuple of Base.Vector
|
||||
|
||||
Get the edge points of the given index.
|
||||
The index must be in the range of [0, 11].
|
||||
|
||||
@@ -184,15 +175,12 @@ class BoundBox(PyObjectBase):
|
||||
...
|
||||
|
||||
@overload
|
||||
def closestPoint(self, point: Vector) -> Vector: ...
|
||||
def closestPoint(self, point: Vector, /) -> Vector: ...
|
||||
@overload
|
||||
def closestPoint(self, x: float, y: float, z: float) -> Vector: ...
|
||||
def closestPoint(self, x: float, y: float, z: float, /) -> Vector: ...
|
||||
@constmethod
|
||||
def closestPoint(self, *args: Any, **kwargs: Any) -> Vector:
|
||||
"""
|
||||
closestPoint(point) -> Base.Vector
|
||||
closestPoint(x, y, z) -> Base.Vector
|
||||
|
||||
Get the closest point of the bounding box to the given point.
|
||||
|
||||
point : Base.Vector, tuple
|
||||
@@ -207,18 +195,16 @@ class BoundBox(PyObjectBase):
|
||||
...
|
||||
|
||||
@overload
|
||||
def intersect(self, boundBox2: "BoundBox") -> bool: ...
|
||||
def intersect(self, boundBox2: "BoundBox", /) -> bool: ...
|
||||
@overload
|
||||
def intersect(
|
||||
self,
|
||||
base: Union[Vector, Tuple[float, float, float]],
|
||||
dir: Union[Vector, Tuple[float, float, float]],
|
||||
/,
|
||||
) -> bool: ...
|
||||
def intersect(self, *args: Any) -> bool:
|
||||
"""
|
||||
intersect(boundBox2) -> bool
|
||||
intersect(base, dir) -> bool
|
||||
|
||||
Checks if the given object intersects with this bounding box. That can be
|
||||
another bounding box or a line specified by base and direction.
|
||||
|
||||
@@ -228,30 +214,24 @@ class BoundBox(PyObjectBase):
|
||||
"""
|
||||
...
|
||||
|
||||
def intersected(self, boundBox2: "BoundBox") -> "BoundBox":
|
||||
def intersected(self, boundBox2: "BoundBox", /) -> "BoundBox":
|
||||
"""
|
||||
intersected(boundBox2) -> Base.BoundBox
|
||||
|
||||
Returns the intersection of this and the given bounding box.
|
||||
|
||||
boundBox2 : Base.BoundBox
|
||||
"""
|
||||
...
|
||||
|
||||
def united(self, boundBox2: "BoundBox") -> "BoundBox":
|
||||
def united(self, boundBox2: "BoundBox", /) -> "BoundBox":
|
||||
"""
|
||||
united(boundBox2) -> Base.BoundBox
|
||||
|
||||
Returns the union of this and the given bounding box.
|
||||
|
||||
boundBox2 : Base.BoundBox
|
||||
"""
|
||||
...
|
||||
|
||||
def enlarge(self, variation: float) -> None:
|
||||
def enlarge(self, variation: float, /) -> None:
|
||||
"""
|
||||
enlarge(variation) -> None
|
||||
|
||||
Decrease the minimum values and increase the maximum values by the given value.
|
||||
A negative value shrinks the bounding box.
|
||||
|
||||
@@ -259,10 +239,8 @@ class BoundBox(PyObjectBase):
|
||||
"""
|
||||
...
|
||||
|
||||
def getIntersectionPoint(self, base: Vector, dir: Vector, epsilon: float = 0.0001) -> Vector:
|
||||
def getIntersectionPoint(self, base: Vector, dir: Vector, epsilon: float = 0.0001, /) -> Vector:
|
||||
"""
|
||||
getIntersectionPoint(base, dir, epsilon=0.0001) -> Base.Vector
|
||||
|
||||
Calculate the intersection point of a line with the bounding box.
|
||||
The base point must lie inside the bounding box, if not an exception is thrown.
|
||||
|
||||
@@ -276,16 +254,13 @@ class BoundBox(PyObjectBase):
|
||||
...
|
||||
|
||||
@overload
|
||||
def move(self, displacement: Vector) -> None: ...
|
||||
def move(self, displacement: Vector, /) -> None: ...
|
||||
@overload
|
||||
def move(self, displacement: Tuple[float, float, float]) -> None: ...
|
||||
def move(self, displacement: Tuple[float, float, float], /) -> None: ...
|
||||
@overload
|
||||
def move(self, x: float, y: float, z: float) -> None: ...
|
||||
def move(self, x: float, y: float, z: float, /) -> None: ...
|
||||
def move(self, *args: Any, **kwargs: Any) -> None:
|
||||
"""
|
||||
move(displacement) -> None
|
||||
move(x, y, z) -> None
|
||||
|
||||
Move the bounding box by the given values.
|
||||
|
||||
displacement : Base.Vector, tuple
|
||||
@@ -300,16 +275,13 @@ class BoundBox(PyObjectBase):
|
||||
...
|
||||
|
||||
@overload
|
||||
def scale(self, factor: Vector) -> None: ...
|
||||
def scale(self, factor: Vector, /) -> None: ...
|
||||
@overload
|
||||
def scale(self, factor: Tuple[float, float, float]) -> None: ...
|
||||
def scale(self, factor: Tuple[float, float, float], /) -> None: ...
|
||||
@overload
|
||||
def scale(self, x: float, y: float, z: float) -> None: ...
|
||||
def scale(self, x: float, y: float, z: float, /) -> None: ...
|
||||
def scale(self, *args: Any, **kwargs: Any) -> None:
|
||||
"""
|
||||
scale(factor) -> None
|
||||
scale(x, y, z) -> None
|
||||
|
||||
Scale the bounding box by the given values.
|
||||
|
||||
factor : Base.Vector, tuple
|
||||
@@ -323,10 +295,8 @@ class BoundBox(PyObjectBase):
|
||||
"""
|
||||
...
|
||||
|
||||
def transformed(self, matrix: Matrix) -> "BoundBox":
|
||||
def transformed(self, matrix: Matrix, /) -> "BoundBox":
|
||||
"""
|
||||
transformed(matrix) -> Base.BoundBox
|
||||
|
||||
Returns a new BoundBox containing the transformed rectangular cuboid
|
||||
represented by this BoundBox.
|
||||
|
||||
@@ -335,10 +305,8 @@ class BoundBox(PyObjectBase):
|
||||
"""
|
||||
...
|
||||
|
||||
def isCutPlane(self, base: Vector, normal: Vector) -> bool:
|
||||
def isCutPlane(self, base: Vector, normal: Vector, /) -> bool:
|
||||
"""
|
||||
isCutPlane(base, normal) -> bool
|
||||
|
||||
Check if the plane specified by base and normal intersects (cuts) this bounding
|
||||
box.
|
||||
|
||||
@@ -348,16 +316,13 @@ class BoundBox(PyObjectBase):
|
||||
...
|
||||
|
||||
@overload
|
||||
def isInside(self, object: Vector) -> bool: ...
|
||||
def isInside(self, object: Vector, /) -> bool: ...
|
||||
@overload
|
||||
def isInside(self, object: "BoundBox") -> bool: ...
|
||||
def isInside(self, object: "BoundBox", /) -> bool: ...
|
||||
@overload
|
||||
def isInside(self, x: float, y: float, z: float) -> bool: ...
|
||||
def isInside(self, x: float, y: float, z: float, /) -> bool: ...
|
||||
def isInside(self, *args: Any) -> bool:
|
||||
"""
|
||||
isInside(object) -> bool
|
||||
isInside(x, y, z) -> bool
|
||||
|
||||
Check if a point or a bounding box is inside this bounding box.
|
||||
|
||||
object : Base.Vector, Base.BoundBox
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Metadata import export, constmethod
|
||||
from PyObjectBase import PyObjectBase
|
||||
from Axis import Axis as AxisPy
|
||||
@@ -40,10 +42,8 @@ class CoordinateSystem(PyObjectBase):
|
||||
Position: Vector = None
|
||||
"""Set or get position."""
|
||||
|
||||
def setAxes(self, axis: Union[AxisPy, Vector], xDir: Vector) -> None:
|
||||
def setAxes(self, axis: Union[AxisPy, Vector], xDir: Vector, /) -> None:
|
||||
"""
|
||||
setAxes(axis, xDir) -> None
|
||||
|
||||
Set axis or Z-direction, and X-direction.
|
||||
The X-direction is determined from the orthonormal compononent of `xDir`
|
||||
with respect to `axis` direction.
|
||||
@@ -54,40 +54,32 @@ class CoordinateSystem(PyObjectBase):
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def displacement(self, coordSystem2: "CoordinateSystem") -> Placement:
|
||||
def displacement(self, coordSystem2: "CoordinateSystem", /) -> Placement:
|
||||
"""
|
||||
displacement(coordSystem2) -> Base.Placement
|
||||
|
||||
Computes the placement from this to the passed coordinate system `coordSystem2`.
|
||||
|
||||
coordSystem2 : Base.CoordinateSystem
|
||||
"""
|
||||
...
|
||||
|
||||
def transformTo(self, vector: Vector) -> Vector:
|
||||
def transformTo(self, vector: Vector, /) -> Vector:
|
||||
"""
|
||||
transformTo(vector) -> Base.Vector
|
||||
|
||||
Computes the coordinates of the point in coordinates of this coordinate system.
|
||||
|
||||
vector : Base.Vector
|
||||
"""
|
||||
...
|
||||
|
||||
def transform(self, trans: Union[Rotation, Placement]) -> None:
|
||||
def transform(self, trans: Union[Rotation, Placement], /) -> None:
|
||||
"""
|
||||
transform(trans) -> None
|
||||
|
||||
Applies a transformation on this coordinate system.
|
||||
|
||||
trans : Base.Rotation, Base.Placement
|
||||
"""
|
||||
...
|
||||
|
||||
def setPlacement(self, placement: Placement) -> None:
|
||||
def setPlacement(self, placement: Placement, /) -> None:
|
||||
"""
|
||||
setPlacement(placement) -> None
|
||||
|
||||
Set placement to the coordinate system.
|
||||
|
||||
placement : Base.Placement
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Vector import Vector
|
||||
from Metadata import export, constmethod, class_declarations, no_args
|
||||
from PyObjectBase import PyObjectBase
|
||||
@@ -105,14 +107,11 @@ class Matrix(PyObjectBase):
|
||||
"""The matrix elements."""
|
||||
|
||||
@overload
|
||||
def move(self, vector: Vector) -> None: ...
|
||||
def move(self, vector: Vector, /) -> None: ...
|
||||
@overload
|
||||
def move(self, x: float, y: float, z: float) -> None: ...
|
||||
def move(self, x: float, y: float, z: float, /) -> None: ...
|
||||
def move(self, *args) -> None:
|
||||
"""
|
||||
move(vector) -> None
|
||||
move(x, y, z) -> None
|
||||
|
||||
Move the matrix along a vector, equivalent to left multiply the matrix
|
||||
by a pure translation transformation.
|
||||
|
||||
@@ -127,17 +126,13 @@ class Matrix(PyObjectBase):
|
||||
...
|
||||
|
||||
@overload
|
||||
def scale(self, vector: Vector) -> None: ...
|
||||
def scale(self, vector: Vector, /) -> None: ...
|
||||
@overload
|
||||
def scale(self, x: float, y: float, z: float) -> None: ...
|
||||
def scale(self, x: float, y: float, z: float, /) -> None: ...
|
||||
@overload
|
||||
def scale(self, factor: float) -> None: ...
|
||||
def scale(self, factor: float, /) -> None: ...
|
||||
def scale(self, *args) -> None:
|
||||
"""
|
||||
scale(vector) -> None
|
||||
scale(x, y, z) -> None
|
||||
scale(factor) -> None
|
||||
|
||||
Scale the first three rows of the matrix.
|
||||
|
||||
vector : Base.Vector
|
||||
@@ -153,10 +148,8 @@ class Matrix(PyObjectBase):
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def hasScale(self, tol: float = 0) -> ScaleType:
|
||||
def hasScale(self, tol: float = 0, /) -> ScaleType:
|
||||
"""
|
||||
hasScale(tol=0) -> ScaleType
|
||||
|
||||
Return an enum value of ScaleType. Possible values are:
|
||||
Uniform, NonUniformLeft, NonUniformRight, NoScaling or Other
|
||||
if it's not a scale matrix.
|
||||
@@ -168,8 +161,6 @@ class Matrix(PyObjectBase):
|
||||
@constmethod
|
||||
def decompose(self) -> Tuple["Matrix", "Matrix", "Matrix", "Matrix"]:
|
||||
"""
|
||||
decompose() -> Base.Matrix, Base.Matrix, Base.Matrix, Base.Matrix
|
||||
|
||||
Return a tuple of matrices representing shear, scale, rotation and move.
|
||||
So that matrix = move * rotation * scale * shear.
|
||||
"""
|
||||
@@ -178,8 +169,6 @@ class Matrix(PyObjectBase):
|
||||
@no_args
|
||||
def nullify(self) -> None:
|
||||
"""
|
||||
nullify() -> None
|
||||
|
||||
Make this the null matrix.
|
||||
"""
|
||||
...
|
||||
@@ -188,8 +177,6 @@ class Matrix(PyObjectBase):
|
||||
@constmethod
|
||||
def isNull(self) -> bool:
|
||||
"""
|
||||
isNull() -> bool
|
||||
|
||||
Check if this is the null matrix.
|
||||
"""
|
||||
...
|
||||
@@ -197,25 +184,19 @@ class Matrix(PyObjectBase):
|
||||
@no_args
|
||||
def unity(self) -> None:
|
||||
"""
|
||||
unity() -> None
|
||||
|
||||
Make this matrix to unity (4D identity matrix).
|
||||
"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def isUnity(self, tol: float = 0.0) -> bool:
|
||||
def isUnity(self, tol: float = 0.0, /) -> bool:
|
||||
"""
|
||||
isUnity([tol=0.0]) -> bool
|
||||
|
||||
Check if this is the unit matrix (4D identity matrix).
|
||||
"""
|
||||
...
|
||||
|
||||
def transform(self, vector: Vector, matrix2: "Matrix") -> None:
|
||||
def transform(self, vector: Vector, matrix2: "Matrix", /) -> None:
|
||||
"""
|
||||
transform(vector, matrix2) -> None
|
||||
|
||||
Transform the matrix around a given point.
|
||||
Equivalent to left multiply the matrix by T*M*T_inv, where M is `matrix2`, T the
|
||||
translation generated by `vector` and T_inv the inverse translation.
|
||||
@@ -228,10 +209,8 @@ class Matrix(PyObjectBase):
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def col(self, index: int) -> Vector:
|
||||
def col(self, index: int, /) -> Vector:
|
||||
"""
|
||||
col(index) -> Base.Vector
|
||||
|
||||
Return the vector of a column, that is, the vector generated by the three
|
||||
first elements of the specified column.
|
||||
|
||||
@@ -240,10 +219,8 @@ class Matrix(PyObjectBase):
|
||||
"""
|
||||
...
|
||||
|
||||
def setCol(self, index: int, vector: Vector) -> None:
|
||||
def setCol(self, index: int, vector: Vector, /) -> None:
|
||||
"""
|
||||
setCol(index, vector) -> None
|
||||
|
||||
Set the vector of a column, that is, the three first elements of the specified
|
||||
column by index.
|
||||
|
||||
@@ -254,10 +231,8 @@ class Matrix(PyObjectBase):
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def row(self, index: int) -> Vector:
|
||||
def row(self, index: int, /) -> Vector:
|
||||
"""
|
||||
row(index) -> Base.Vector
|
||||
|
||||
Return the vector of a row, that is, the vector generated by the three
|
||||
first elements of the specified row.
|
||||
|
||||
@@ -266,10 +241,8 @@ class Matrix(PyObjectBase):
|
||||
"""
|
||||
...
|
||||
|
||||
def setRow(self, index: int, vector: Vector) -> None:
|
||||
def setRow(self, index: int, vector: Vector, /) -> None:
|
||||
"""
|
||||
setRow(index, vector) -> None
|
||||
|
||||
Set the vector of a row, that is, the three first elements of the specified
|
||||
row by index.
|
||||
|
||||
@@ -283,26 +256,20 @@ class Matrix(PyObjectBase):
|
||||
@constmethod
|
||||
def diagonal(self) -> Vector:
|
||||
"""
|
||||
diagonal() -> Base.Vector
|
||||
|
||||
Return the diagonal of the 3x3 leading principal submatrix as vector.
|
||||
"""
|
||||
...
|
||||
|
||||
def setDiagonal(self, vector: Vector) -> None:
|
||||
def setDiagonal(self, vector: Vector, /) -> None:
|
||||
"""
|
||||
setDiagonal(vector) -> None
|
||||
|
||||
Set the diagonal of the 3x3 leading principal submatrix.
|
||||
|
||||
vector : Base.Vector
|
||||
"""
|
||||
...
|
||||
|
||||
def rotateX(self, angle: float) -> None:
|
||||
def rotateX(self, angle: float, /) -> None:
|
||||
"""
|
||||
rotateX(angle) -> None
|
||||
|
||||
Rotate around X axis.
|
||||
|
||||
angle : float
|
||||
@@ -310,10 +277,8 @@ class Matrix(PyObjectBase):
|
||||
"""
|
||||
...
|
||||
|
||||
def rotateY(self, angle: float) -> None:
|
||||
def rotateY(self, angle: float, /) -> None:
|
||||
"""
|
||||
rotateY(angle) -> None
|
||||
|
||||
Rotate around Y axis.
|
||||
|
||||
angle : float
|
||||
@@ -321,10 +286,8 @@ class Matrix(PyObjectBase):
|
||||
"""
|
||||
...
|
||||
|
||||
def rotateZ(self, angle: float) -> None:
|
||||
def rotateZ(self, angle: float, /) -> None:
|
||||
"""
|
||||
rotateZ(angle) -> None
|
||||
|
||||
Rotate around Z axis.
|
||||
|
||||
angle : float
|
||||
@@ -333,15 +296,12 @@ class Matrix(PyObjectBase):
|
||||
...
|
||||
|
||||
@overload
|
||||
def multiply(self, matrix: "Matrix") -> "Matrix": ...
|
||||
def multiply(self, matrix: "Matrix", /) -> "Matrix": ...
|
||||
@overload
|
||||
def multiply(self, vector: Vector) -> Vector: ...
|
||||
def multiply(self, vector: Vector, /) -> Vector: ...
|
||||
@constmethod
|
||||
def multiply(self, obj: Union["Matrix", Vector]) -> Union["Matrix", Vector]:
|
||||
def multiply(self, obj: Union["Matrix", Vector], /) -> Union["Matrix", Vector]:
|
||||
"""
|
||||
multiply(matrix) -> Base.Matrix
|
||||
multiply(vector) -> Base.Vector
|
||||
|
||||
Right multiply the matrix by the given object.
|
||||
If the argument is a vector, this is augmented to the 4D vector (`vector`, 1).
|
||||
|
||||
@@ -351,10 +311,8 @@ class Matrix(PyObjectBase):
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def multVec(self, vector: Vector) -> Vector:
|
||||
def multVec(self, vector: Vector, /) -> Vector:
|
||||
"""
|
||||
multVec(vector) -> Base.Vector
|
||||
|
||||
Compute the transformed vector using the matrix.
|
||||
|
||||
vector : Base.Vector
|
||||
@@ -364,8 +322,6 @@ class Matrix(PyObjectBase):
|
||||
@no_args
|
||||
def invert(self) -> None:
|
||||
"""
|
||||
invert() -> None
|
||||
|
||||
Compute the inverse matrix in-place, if possible.
|
||||
"""
|
||||
...
|
||||
@@ -374,8 +330,6 @@ class Matrix(PyObjectBase):
|
||||
@constmethod
|
||||
def inverse(self) -> "Matrix":
|
||||
"""
|
||||
inverse() -> Base.Matrix
|
||||
|
||||
Compute the inverse matrix, if possible.
|
||||
"""
|
||||
...
|
||||
@@ -383,8 +337,6 @@ class Matrix(PyObjectBase):
|
||||
@no_args
|
||||
def transpose(self) -> None:
|
||||
"""
|
||||
transpose() -> None
|
||||
|
||||
Transpose the matrix in-place.
|
||||
"""
|
||||
...
|
||||
@@ -393,8 +345,6 @@ class Matrix(PyObjectBase):
|
||||
@constmethod
|
||||
def transposed(self) -> "Matrix":
|
||||
"""
|
||||
transposed() -> Base.Matrix
|
||||
|
||||
Returns a transposed copy of this matrix.
|
||||
"""
|
||||
...
|
||||
@@ -403,17 +353,13 @@ class Matrix(PyObjectBase):
|
||||
@constmethod
|
||||
def determinant(self) -> float:
|
||||
"""
|
||||
determinant() -> float
|
||||
|
||||
Compute the determinant of the matrix.
|
||||
"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def isOrthogonal(self, tol: float = 1e-6) -> float:
|
||||
def isOrthogonal(self, tol: float = 1e-6, /) -> float:
|
||||
"""
|
||||
isOrthogonal(tol=1e-6) -> float
|
||||
|
||||
Checks if the matrix is orthogonal, i.e. M * M^T = k*I and returns
|
||||
the multiple of the identity matrix. If it's not orthogonal 0 is returned.
|
||||
|
||||
@@ -423,10 +369,8 @@ class Matrix(PyObjectBase):
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def submatrix(self, dim: int) -> "Matrix":
|
||||
def submatrix(self, dim: int, /) -> "Matrix":
|
||||
"""
|
||||
submatrix(dim) -> Base.Matrix
|
||||
|
||||
Get the leading principal submatrix of the given dimension.
|
||||
The (4 - `dim`) remaining dimensions are completed with the
|
||||
corresponding identity matrix.
|
||||
@@ -440,8 +384,6 @@ class Matrix(PyObjectBase):
|
||||
@constmethod
|
||||
def analyze(self) -> str:
|
||||
"""
|
||||
analyze() -> str
|
||||
|
||||
Analyzes the type of transformation.
|
||||
"""
|
||||
...
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
"""
|
||||
This file keeps auxiliary metadata to be used by the Python API stubs.
|
||||
"""
|
||||
@@ -10,8 +12,8 @@ def export(**kwargs):
|
||||
"""
|
||||
...
|
||||
|
||||
def constmethod(): ...
|
||||
def no_args(): ...
|
||||
def constmethod(method): ...
|
||||
def no_args(method): ...
|
||||
def forward_declarations(source_code):
|
||||
"""
|
||||
A decorator to attach forward declarations to a class.
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Metadata import constmethod
|
||||
from BaseClass import BaseClass
|
||||
from typing import Final
|
||||
@@ -21,10 +23,8 @@ class Persistence(BaseClass):
|
||||
"""Memory size of the object in bytes."""
|
||||
|
||||
@constmethod
|
||||
def dumpContent(self, *, Compression: int = 3) -> bytearray:
|
||||
def dumpContent(self, Compression: int = 3) -> bytearray:
|
||||
"""
|
||||
dumpContent(Compression=3) -> bytearray
|
||||
|
||||
Dumps the content of the object, both the XML representation and the additional
|
||||
data files required, into a byte representation.
|
||||
|
||||
@@ -33,11 +33,9 @@ class Persistence(BaseClass):
|
||||
"""
|
||||
...
|
||||
|
||||
def restoreContent(self, obj: object) -> None:
|
||||
def restoreContent(self, obj: object, /) -> None:
|
||||
# TODO: Starting with Python 3.12, collections.abc.Buffer can be used for type hinting
|
||||
"""
|
||||
restoreContent(obj) -> None
|
||||
|
||||
Restore the content of the object from a byte representation as stored by `dumpContent`.
|
||||
It could be restored from any Python object implementing the buffer protocol.
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Metadata import export, constmethod, class_declarations
|
||||
from PyObjectBase import PyObjectBase
|
||||
from Matrix import Matrix as MatrixPy
|
||||
@@ -86,16 +88,12 @@ class Placement(PyObjectBase):
|
||||
@constmethod
|
||||
def copy(self) -> "Placement":
|
||||
"""
|
||||
copy() -> Base.Placement
|
||||
|
||||
Returns a copy of this placement.
|
||||
"""
|
||||
...
|
||||
|
||||
def move(self, vector: Vector) -> None:
|
||||
def move(self, vector: Vector, /) -> None:
|
||||
"""
|
||||
move(vector) -> None
|
||||
|
||||
Move the placement along a vector.
|
||||
|
||||
vector : Base.Vector
|
||||
@@ -103,10 +101,8 @@ class Placement(PyObjectBase):
|
||||
"""
|
||||
...
|
||||
|
||||
def translate(self, vector: Vector) -> None:
|
||||
def translate(self, vector: Vector, /) -> None:
|
||||
"""
|
||||
translate(vector) -> None
|
||||
|
||||
Alias to move(), to be compatible with TopoShape.translate().
|
||||
|
||||
vector : Base.Vector
|
||||
@@ -118,10 +114,9 @@ class Placement(PyObjectBase):
|
||||
def rotate(
|
||||
self, center: Sequence[float], axis: Sequence[float], angle: float, *, comp: bool = False
|
||||
) -> None: ...
|
||||
@overload
|
||||
def rotate(self, center: Vector, axis: Vector, angle: float, *, comp: bool = False) -> None:
|
||||
"""
|
||||
rotate(center, axis, angle, comp) -> None
|
||||
|
||||
Rotate the current placement around center and axis with the given angle.
|
||||
This method is compatible with TopoShape.rotate() if the (optional) keyword
|
||||
argument comp is True (default=False).
|
||||
@@ -136,13 +131,11 @@ class Placement(PyObjectBase):
|
||||
optional keyword only argument, if True (default=False),
|
||||
behave like TopoShape.rotate() (i.e. the resulting placements are interchangeable).
|
||||
"""
|
||||
...
|
||||
|
||||
def rotate(self, *args, **kwargs) -> None: ...
|
||||
@constmethod
|
||||
def multiply(self, placement: "Placement") -> "Placement":
|
||||
def multiply(self, placement: "Placement", /) -> "Placement":
|
||||
"""
|
||||
multiply(placement) -> Base.Placement
|
||||
|
||||
Right multiply this placement with another placement.
|
||||
Also available as `*` operator.
|
||||
|
||||
@@ -152,10 +145,8 @@ class Placement(PyObjectBase):
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def multVec(self, vector: Vector) -> Vector:
|
||||
def multVec(self, vector: Vector, /) -> Vector:
|
||||
"""
|
||||
multVec(vector) -> Base.Vector
|
||||
|
||||
Compute the transformed vector using the placement.
|
||||
|
||||
vector : Base.Vector
|
||||
@@ -166,8 +157,6 @@ class Placement(PyObjectBase):
|
||||
@constmethod
|
||||
def toMatrix(self) -> MatrixPy:
|
||||
"""
|
||||
toMatrix() -> Base.Matrix
|
||||
|
||||
Compute the matrix representation of the placement.
|
||||
"""
|
||||
...
|
||||
@@ -175,17 +164,13 @@ class Placement(PyObjectBase):
|
||||
@constmethod
|
||||
def inverse(self) -> "Placement":
|
||||
"""
|
||||
inverse() -> Base.Placement
|
||||
|
||||
Compute the inverse placement.
|
||||
"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def pow(self, t: float, shorten: bool = True) -> "Placement":
|
||||
def pow(self, t: float, shorten: bool = True, /) -> "Placement":
|
||||
"""
|
||||
pow(t, shorten=True) -> Base.Placement
|
||||
|
||||
Raise this placement to real power using ScLERP interpolation.
|
||||
Also available as `**` operator.
|
||||
|
||||
@@ -198,10 +183,8 @@ class Placement(PyObjectBase):
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def sclerp(self, placement2: "Placement", t: float, shorten: bool = True) -> "Placement":
|
||||
def sclerp(self, placement2: "Placement", t: float, shorten: bool = True, /) -> "Placement":
|
||||
"""
|
||||
sclerp(placement2, t, shorten=True) -> Base.Placement
|
||||
|
||||
Screw Linear Interpolation (ScLERP) between this placement and `placement2`.
|
||||
Interpolation is a continuous motion along a helical path parametrized by `t`
|
||||
made of equal transforms if discretized.
|
||||
@@ -219,10 +202,8 @@ class Placement(PyObjectBase):
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def slerp(self, placement2: "Placement", t: float) -> "Placement":
|
||||
def slerp(self, placement2: "Placement", t: float, /) -> "Placement":
|
||||
"""
|
||||
slerp(placement2, t) -> Base.Placement
|
||||
|
||||
Spherical Linear Interpolation (SLERP) between this placement and `placement2`.
|
||||
This function performs independent interpolation of rotation and movement.
|
||||
Result of such interpolation might be not what application expects, thus this tool
|
||||
@@ -236,10 +217,8 @@ class Placement(PyObjectBase):
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def isIdentity(self, tol: float = 0.0) -> bool:
|
||||
def isIdentity(self, tol: float = 0.0, /) -> bool:
|
||||
"""
|
||||
isIdentity([tol=0.0]) -> bool
|
||||
|
||||
Returns True if the placement has no displacement and no rotation.
|
||||
Matrix representation is the 4D identity matrix.
|
||||
tol : float
|
||||
@@ -249,10 +228,8 @@ class Placement(PyObjectBase):
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def isSame(self, other: "Placement", tol: float = 0.0) -> bool:
|
||||
def isSame(self, other: "Placement", tol: float = 0.0, /) -> bool:
|
||||
"""
|
||||
isSame(Base.Placement, [tol=0.0]) -> bool
|
||||
|
||||
Checks whether this and the given placement are the same.
|
||||
The default tolerance is set to 0.0
|
||||
"""
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from PyObjectBase import PyObjectBase
|
||||
|
||||
class Precision(PyObjectBase):
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
class PyObjectBase:
|
||||
"""
|
||||
The most base class for Python bindings.
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Metadata import export, constmethod
|
||||
from PyObjectBase import PyObjectBase
|
||||
from typing import overload, Final, Tuple, Union
|
||||
@@ -52,20 +54,18 @@ class Quantity(PyObjectBase):
|
||||
def __init__(self, string: str) -> None: ...
|
||||
# fmt: on
|
||||
|
||||
@overload
|
||||
def toStr(self, /) -> str: ...
|
||||
@overload
|
||||
def toStr(self, decimals: int, /) -> str: ...
|
||||
@constmethod
|
||||
def toStr(self, decimals: int = ...) -> str:
|
||||
def toStr(self, decimals: int = ..., /) -> str:
|
||||
"""
|
||||
toStr([decimals])
|
||||
|
||||
Returns a string representation rounded to number of decimals. If no decimals are specified then
|
||||
the internal precision is used
|
||||
"""
|
||||
...
|
||||
|
||||
@overload
|
||||
def toStr(self) -> str: ...
|
||||
@overload
|
||||
def toStr(self, decimals: int) -> str: ...
|
||||
@constmethod
|
||||
def getUserPreferred(self) -> Tuple["Quantity", str]:
|
||||
"""
|
||||
@@ -74,13 +74,13 @@ class Quantity(PyObjectBase):
|
||||
...
|
||||
|
||||
@overload
|
||||
def getValueAs(self, unit: str) -> float: ...
|
||||
def getValueAs(self, unit: str, /) -> float: ...
|
||||
@overload
|
||||
def getValueAs(self, translation: float, unit_signature: int) -> float: ...
|
||||
def getValueAs(self, translation: float, unit_signature: int, /) -> float: ...
|
||||
@overload
|
||||
def getValueAs(self, unit: UnitPy) -> float: ...
|
||||
def getValueAs(self, unit: UnitPy, /) -> float: ...
|
||||
@overload
|
||||
def getValueAs(self, quantity: "Quantity") -> float: ...
|
||||
def getValueAs(self, quantity: "Quantity", /) -> float: ...
|
||||
@constmethod
|
||||
def getValueAs(self, *args) -> float:
|
||||
"""
|
||||
@@ -95,15 +95,14 @@ class Quantity(PyObjectBase):
|
||||
"""
|
||||
...
|
||||
|
||||
@overload
|
||||
def __round__(self, /) -> int: ...
|
||||
@overload
|
||||
def __round__(self, ndigits: int, /) -> float: ...
|
||||
@constmethod
|
||||
def __round__(self, ndigits: int = ...) -> Union[int, float]:
|
||||
def __round__(self, ndigits: int = ..., /) -> Union[int, float]:
|
||||
"""
|
||||
Returns the Integral closest to x, rounding half toward even.
|
||||
When an argument is passed, work like built-in round(x, ndigits).
|
||||
"""
|
||||
...
|
||||
|
||||
@overload
|
||||
def __round__(self) -> int: ...
|
||||
@overload
|
||||
def __round__(self, ndigits: int) -> float: ...
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Metadata import export, constmethod, class_declarations
|
||||
from PyObjectBase import PyObjectBase
|
||||
from Vector import Vector
|
||||
@@ -129,8 +131,6 @@ class Rotation(PyObjectBase):
|
||||
|
||||
def invert(self) -> None:
|
||||
"""
|
||||
invert() -> None
|
||||
|
||||
Sets the rotation to its inverse.
|
||||
"""
|
||||
...
|
||||
@@ -138,16 +138,12 @@ class Rotation(PyObjectBase):
|
||||
@constmethod
|
||||
def inverted(self) -> "Rotation":
|
||||
"""
|
||||
inverted() -> Base.Rotation
|
||||
|
||||
Returns the inverse of the rotation.
|
||||
"""
|
||||
...
|
||||
|
||||
def isSame(self, rotation: "Rotation", tol: float = 0) -> bool:
|
||||
def isSame(self, rotation: "Rotation", tol: float = 0, /) -> bool:
|
||||
"""
|
||||
isSame(rotation, tol=0) -> bool
|
||||
|
||||
Checks if `rotation` perform the same transformation as this rotation.
|
||||
|
||||
rotation : Base.Rotation
|
||||
@@ -158,10 +154,8 @@ class Rotation(PyObjectBase):
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def multiply(self, rotation: "Rotation") -> "Rotation":
|
||||
def multiply(self, rotation: "Rotation", /) -> "Rotation":
|
||||
"""
|
||||
multiply(rotation) -> Base.Rotation
|
||||
|
||||
Right multiply this rotation with another rotation.
|
||||
|
||||
rotation : Base.Rotation
|
||||
@@ -170,10 +164,8 @@ class Rotation(PyObjectBase):
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def multVec(self, vector: Vector) -> Vector:
|
||||
def multVec(self, vector: Vector, /) -> Vector:
|
||||
"""
|
||||
multVec(vector) -> Base.Vector
|
||||
|
||||
Compute the transformed vector using the rotation.
|
||||
|
||||
vector : Base.Vector
|
||||
@@ -182,10 +174,8 @@ class Rotation(PyObjectBase):
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def slerp(self, rotation2: "Rotation", t: float) -> "Rotation":
|
||||
def slerp(self, rotation2: "Rotation", t: float, /) -> "Rotation":
|
||||
"""
|
||||
slerp(rotation2, t) -> Base.Rotation
|
||||
|
||||
Spherical Linear Interpolation (SLERP) of this rotation and `rotation2`.
|
||||
|
||||
t : float
|
||||
@@ -193,10 +183,8 @@ class Rotation(PyObjectBase):
|
||||
"""
|
||||
...
|
||||
|
||||
def setYawPitchRoll(self, angle1: float, angle2: float, angle3: float) -> None:
|
||||
def setYawPitchRoll(self, angle1: float, angle2: float, angle3: float, /) -> None:
|
||||
"""
|
||||
setYawPitchRoll(angle1, angle2, angle3) -> None
|
||||
|
||||
Set the Euler angles of this rotation as yaw-pitch-roll in XY'Z'' convention.
|
||||
|
||||
angle1 : float
|
||||
@@ -211,17 +199,13 @@ class Rotation(PyObjectBase):
|
||||
@constmethod
|
||||
def getYawPitchRoll(self) -> Tuple[float, float, float]:
|
||||
"""
|
||||
getYawPitchRoll() -> tuple
|
||||
|
||||
Get the Euler angles of this rotation as yaw-pitch-roll in XY'Z'' convention.
|
||||
The angles are given in degrees.
|
||||
"""
|
||||
...
|
||||
|
||||
def setEulerAngles(self, seq: str, angle1: float, angle2: float, angle3: float) -> None:
|
||||
def setEulerAngles(self, seq: str, angle1: float, angle2: float, angle3: float, /) -> None:
|
||||
"""
|
||||
setEulerAngles(seq, angle1, angle2, angle3) -> None
|
||||
|
||||
Set the Euler angles in a given sequence for this rotation.
|
||||
The angles must be given in degrees.
|
||||
|
||||
@@ -234,10 +218,8 @@ class Rotation(PyObjectBase):
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def toEulerAngles(self, seq: str = "") -> List[float]:
|
||||
def toEulerAngles(self, seq: str = "", /) -> List[float]:
|
||||
"""
|
||||
toEulerAngles(seq) -> list
|
||||
|
||||
Get the Euler angles in a given sequence for this rotation.
|
||||
|
||||
seq : str
|
||||
@@ -249,8 +231,6 @@ class Rotation(PyObjectBase):
|
||||
@constmethod
|
||||
def toMatrix(self) -> Matrix:
|
||||
"""
|
||||
toMatrix() -> Base.Matrix
|
||||
|
||||
Convert the rotation to a 4D matrix representation.
|
||||
"""
|
||||
...
|
||||
@@ -258,17 +238,13 @@ class Rotation(PyObjectBase):
|
||||
@constmethod
|
||||
def isNull(self) -> bool:
|
||||
"""
|
||||
isNull() -> bool
|
||||
|
||||
Returns True if all values in the quaternion representation are zero.
|
||||
"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def isIdentity(self, tol: float = 0) -> bool:
|
||||
def isIdentity(self, tol: float = 0, /) -> bool:
|
||||
"""
|
||||
isIdentity(tol=0) -> bool
|
||||
|
||||
Returns True if the rotation equals the 4D identity matrix.
|
||||
tol : float
|
||||
Tolerance used to check for identity.
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Metadata import export, forward_declarations, constmethod
|
||||
from PyObjectBase import PyObjectBase
|
||||
from typing import List, Final
|
||||
@@ -35,10 +37,8 @@ class Type(PyObjectBase):
|
||||
"""Module in which this class is defined."""
|
||||
|
||||
@staticmethod
|
||||
def fromName(name: str) -> "Type":
|
||||
def fromName(name: str, /) -> "Type":
|
||||
"""
|
||||
fromName(name) -> Base.BaseType
|
||||
|
||||
Returns a type object by name.
|
||||
|
||||
name : str
|
||||
@@ -46,10 +46,8 @@ class Type(PyObjectBase):
|
||||
...
|
||||
|
||||
@staticmethod
|
||||
def fromKey(key: int) -> "Type":
|
||||
def fromKey(key: int, /) -> "Type":
|
||||
"""
|
||||
fromKey(key) -> Base.BaseType
|
||||
|
||||
Returns a type id object by key.
|
||||
|
||||
key : int
|
||||
@@ -59,8 +57,6 @@ class Type(PyObjectBase):
|
||||
@staticmethod
|
||||
def getNumTypes() -> int:
|
||||
"""
|
||||
getNumTypes() -> int
|
||||
|
||||
Returns the number of type ids created so far.
|
||||
"""
|
||||
...
|
||||
@@ -68,17 +64,13 @@ class Type(PyObjectBase):
|
||||
@staticmethod
|
||||
def getBadType() -> "Type":
|
||||
"""
|
||||
getBadType() -> Base.BaseType
|
||||
|
||||
Returns an invalid type id.
|
||||
"""
|
||||
...
|
||||
|
||||
@staticmethod
|
||||
def getAllDerivedFrom(type: str) -> List[str]:
|
||||
def getAllDerivedFrom(type: str, /) -> List[str]:
|
||||
"""
|
||||
getAllDerivedFrom(type) -> list
|
||||
|
||||
Returns all descendants from the given type id.
|
||||
|
||||
type : str, Base.BaseType
|
||||
@@ -88,8 +80,6 @@ class Type(PyObjectBase):
|
||||
@constmethod
|
||||
def getParent(self) -> "Type":
|
||||
"""
|
||||
getParent() -> Base.BaseType
|
||||
|
||||
Returns the parent type id.
|
||||
"""
|
||||
...
|
||||
@@ -97,17 +87,13 @@ class Type(PyObjectBase):
|
||||
@constmethod
|
||||
def isBad(self) -> bool:
|
||||
"""
|
||||
isBad() -> bool
|
||||
|
||||
Checks if the type id is invalid.
|
||||
"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def isDerivedFrom(self, type: str) -> bool:
|
||||
def isDerivedFrom(self, type: str, /) -> bool:
|
||||
"""
|
||||
isDerivedFrom(type) -> bool
|
||||
|
||||
Returns true if given type id is a father of this type id.
|
||||
|
||||
type : str, Base.BaseType
|
||||
@@ -117,25 +103,19 @@ class Type(PyObjectBase):
|
||||
@constmethod
|
||||
def getAllDerived(self) -> List[object]:
|
||||
"""
|
||||
getAllDerived() -> list
|
||||
|
||||
Returns all descendants from this type id.
|
||||
"""
|
||||
...
|
||||
|
||||
def createInstance(self) -> object:
|
||||
"""
|
||||
createInstance() -> object
|
||||
|
||||
Creates an instance of this type id.
|
||||
"""
|
||||
...
|
||||
|
||||
@staticmethod
|
||||
def createInstanceByName(name: str, load: bool = False) -> object:
|
||||
def createInstanceByName(name: str, load: bool = False, /) -> object:
|
||||
"""
|
||||
createInstanceByName(name, load=False) -> object
|
||||
|
||||
Creates an instance of the named type id.
|
||||
|
||||
name : str
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Metadata import export
|
||||
from PyObjectBase import PyObjectBase
|
||||
from Quantity import Quantity
|
||||
from Unit import Unit
|
||||
from typing import Final, Tuple, overload
|
||||
|
||||
@export(
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Metadata import export, constmethod, sequence_protocol, class_declarations
|
||||
from PyObjectBase import PyObjectBase
|
||||
from typing import overload, Sequence, TYPE_CHECKING
|
||||
from typing import overload, Sequence
|
||||
|
||||
@export(
|
||||
TwinPointer="Vector3d",
|
||||
@@ -76,7 +78,7 @@ class Vector(PyObjectBase):
|
||||
|
||||
# fmt: off
|
||||
@overload
|
||||
def __init__(self, *, x: float = 0, y: float = 0, z: float = 0) -> None: ...
|
||||
def __init__(self, x: float = 0, y: float = 0, z: float = 0) -> None: ...
|
||||
@overload
|
||||
def __init__(self, vector: "Vector") -> None: ...
|
||||
@overload
|
||||
@@ -86,17 +88,13 @@ class Vector(PyObjectBase):
|
||||
@constmethod
|
||||
def __reduce__(self) -> tuple:
|
||||
"""
|
||||
__reduce__() -> tuple
|
||||
|
||||
Serialization of Vector objects.
|
||||
"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def add(self, vector2: "Vector") -> "Vector":
|
||||
def add(self, vector2: "Vector", /) -> "Vector":
|
||||
"""
|
||||
add(vector2) -> Base.Vector
|
||||
|
||||
Returns the sum of this vector and `vector2`.
|
||||
|
||||
vector2 : Base.Vector
|
||||
@@ -104,10 +102,8 @@ class Vector(PyObjectBase):
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def sub(self, vector2: "Vector") -> "Vector":
|
||||
def sub(self, vector2: "Vector", /) -> "Vector":
|
||||
"""
|
||||
sub(vector2) -> Base.Vector
|
||||
|
||||
Returns the difference of this vector and `vector2`.
|
||||
|
||||
vector2 : Base.Vector
|
||||
@@ -117,16 +113,12 @@ class Vector(PyObjectBase):
|
||||
@constmethod
|
||||
def negative(self) -> "Vector":
|
||||
"""
|
||||
negative() -> Base.Vector
|
||||
|
||||
Returns the negative (opposite) of this vector.
|
||||
"""
|
||||
...
|
||||
|
||||
def scale(self, x: float, y: float, z: float) -> "Vector":
|
||||
def scale(self, x: float, y: float, z: float, /) -> "Vector":
|
||||
"""
|
||||
scale(x, y, z) -> Base.Vector
|
||||
|
||||
Scales in-place this vector by the given factor in each component.
|
||||
|
||||
x : float
|
||||
@@ -138,10 +130,8 @@ class Vector(PyObjectBase):
|
||||
"""
|
||||
...
|
||||
|
||||
def multiply(self, factor: float) -> "Vector":
|
||||
def multiply(self, factor: float, /) -> "Vector":
|
||||
"""
|
||||
multiply(factor) -> Base.Vector
|
||||
|
||||
Multiplies in-place each component of this vector by a single factor.
|
||||
Equivalent to scale(factor, factor, factor).
|
||||
|
||||
@@ -150,10 +140,8 @@ class Vector(PyObjectBase):
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def dot(self, vector2: "Vector") -> float:
|
||||
def dot(self, vector2: "Vector", /) -> float:
|
||||
"""
|
||||
dot(vector2) -> float
|
||||
|
||||
Returns the scalar product (dot product) between this vector and `vector2`.
|
||||
|
||||
vector2 : Base.Vector
|
||||
@@ -161,10 +149,8 @@ class Vector(PyObjectBase):
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def cross(self, vector2: "Vector") -> "Vector":
|
||||
def cross(self, vector2: "Vector", /) -> "Vector":
|
||||
"""
|
||||
cross(vector2) -> Base.Vector
|
||||
|
||||
Returns the vector product (cross product) between this vector and `vector2`.
|
||||
|
||||
vector2 : Base.Vector
|
||||
@@ -172,10 +158,8 @@ class Vector(PyObjectBase):
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def isOnLineSegment(self, vector1: "Vector", vector2: "Vector") -> bool:
|
||||
def isOnLineSegment(self, vector1: "Vector", vector2: "Vector", /) -> bool:
|
||||
"""
|
||||
isOnLineSegment(vector1, vector2) -> bool
|
||||
|
||||
Checks if this vector is on the line segment generated by `vector1` and `vector2`.
|
||||
|
||||
vector1 : Base.Vector
|
||||
@@ -184,10 +168,8 @@ class Vector(PyObjectBase):
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def getAngle(self, vector2: "Vector") -> float:
|
||||
def getAngle(self, vector2: "Vector", /) -> float:
|
||||
"""
|
||||
getAngle(vector2) -> float
|
||||
|
||||
Returns the angle in radians between this vector and `vector2`.
|
||||
|
||||
vector2 : Base.Vector
|
||||
@@ -196,17 +178,13 @@ class Vector(PyObjectBase):
|
||||
|
||||
def normalize(self) -> "Vector":
|
||||
"""
|
||||
normalize() -> Base.Vector
|
||||
|
||||
Normalizes in-place this vector to the length of 1.0.
|
||||
"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def isEqual(self, vector2: "Vector", tol: float = 0) -> bool:
|
||||
def isEqual(self, vector2: "Vector", tol: float = 0, /) -> bool:
|
||||
"""
|
||||
isEqual(vector2, tol=0) -> bool
|
||||
|
||||
Checks if the distance between the points represented by this vector
|
||||
and `vector2` is less or equal to the given tolerance.
|
||||
|
||||
@@ -216,10 +194,8 @@ class Vector(PyObjectBase):
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def isParallel(self, vector2: "Vector", tol: float = 0) -> bool:
|
||||
def isParallel(self, vector2: "Vector", tol: float = 0, /) -> bool:
|
||||
"""
|
||||
isParallel(vector2, tol=0) -> bool
|
||||
|
||||
Checks if this vector and `vector2` are
|
||||
parallel less or equal to the given tolerance.
|
||||
|
||||
@@ -229,10 +205,8 @@ class Vector(PyObjectBase):
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def isNormal(self, vector2: "Vector", tol: float = 0) -> bool:
|
||||
def isNormal(self, vector2: "Vector", tol: float = 0, /) -> bool:
|
||||
"""
|
||||
isNormal(vector2, tol=0) -> bool
|
||||
|
||||
Checks if this vector and `vector2` are
|
||||
normal less or equal to the given tolerance.
|
||||
|
||||
@@ -241,10 +215,8 @@ class Vector(PyObjectBase):
|
||||
"""
|
||||
...
|
||||
|
||||
def projectToLine(self, point: "Vector", dir: "Vector") -> "Vector":
|
||||
def projectToLine(self, point: "Vector", dir: "Vector", /) -> "Vector":
|
||||
"""
|
||||
projectToLine(point, dir) -> Base.Vector
|
||||
|
||||
Projects `point` on a line that goes through the origin with the direction `dir`.
|
||||
The result is the vector from `point` to the projected point.
|
||||
The operation is equivalent to dir_n.cross(dir_n.cross(point)), where `dir_n` is
|
||||
@@ -257,10 +229,8 @@ class Vector(PyObjectBase):
|
||||
"""
|
||||
...
|
||||
|
||||
def projectToPlane(self, base: "Vector", normal: "Vector") -> "Vector":
|
||||
def projectToPlane(self, base: "Vector", normal: "Vector", /) -> "Vector":
|
||||
"""
|
||||
projectToPlane(base, normal) -> Base.Vector
|
||||
|
||||
Projects in-place this vector on a plane defined by a base point
|
||||
represented by `base` and a normal defined by `normal`.
|
||||
|
||||
@@ -270,10 +240,8 @@ class Vector(PyObjectBase):
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def distanceToPoint(self, point2: "Vector") -> float:
|
||||
def distanceToPoint(self, point2: "Vector", /) -> float:
|
||||
"""
|
||||
distanceToPoint(point2) -> float
|
||||
|
||||
Returns the distance to another point represented by `point2`.
|
||||
.
|
||||
point : Base.Vector
|
||||
@@ -281,10 +249,8 @@ class Vector(PyObjectBase):
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def distanceToLine(self, base: "Vector", dir: "Vector") -> float:
|
||||
def distanceToLine(self, base: "Vector", dir: "Vector", /) -> float:
|
||||
"""
|
||||
distanceToLine(base, dir) -> float
|
||||
|
||||
Returns the distance between the point represented by this vector
|
||||
and a line defined by a base point represented by `base` and a
|
||||
direction `dir`.
|
||||
@@ -295,10 +261,8 @@ class Vector(PyObjectBase):
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def distanceToLineSegment(self, point1: "Vector", point2: "Vector") -> "Vector":
|
||||
def distanceToLineSegment(self, point1: "Vector", point2: "Vector", /) -> "Vector":
|
||||
"""
|
||||
distanceToLineSegment(point1, point2) -> Base.Vector
|
||||
|
||||
Returns the vector between the point represented by this vector and the point
|
||||
on the line segment with the shortest distance. The line segment is defined by
|
||||
`point1` and `point2`.
|
||||
@@ -309,10 +273,8 @@ class Vector(PyObjectBase):
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def distanceToPlane(self, base: "Vector", normal: "Vector") -> float:
|
||||
def distanceToPlane(self, base: "Vector", normal: "Vector", /) -> float:
|
||||
"""
|
||||
distanceToPlane(base, normal) -> float
|
||||
|
||||
Returns the distance between this vector and a plane defined by a
|
||||
base point represented by `base` and a normal defined by `normal`.
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import export, constmethod
|
||||
from Base.BaseClass import BaseClass
|
||||
from typing import Any, Final, Tuple, Dict
|
||||
@@ -17,10 +21,8 @@ class AxisOrigin(BaseClass):
|
||||
"""
|
||||
|
||||
@constmethod
|
||||
def getElementPicked(self, pickedPoint: Any) -> str:
|
||||
def getElementPicked(self, pickedPoint: Any, /) -> str:
|
||||
"""
|
||||
getElementPicked(pickedPoint) -> str
|
||||
|
||||
Returns the picked element name.
|
||||
|
||||
pickedPoint : coin.SoPickedPoint
|
||||
@@ -28,10 +30,8 @@ class AxisOrigin(BaseClass):
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def getDetailPath(self, subname: str, path: Any) -> Any:
|
||||
def getDetailPath(self, subname: str, path: Any, /) -> Any:
|
||||
"""
|
||||
getDetailPath(subname, path) -> coin.SoDetail or None
|
||||
|
||||
Returns Coin detail of a subelement.
|
||||
Note: Not fully implemented. Currently only returns None.
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import constmethod
|
||||
from Base.PyObjectBase import PyObjectBase
|
||||
from typing import Any, Dict, List, Optional
|
||||
@@ -11,10 +15,8 @@ class Command(PyObjectBase):
|
||||
"""
|
||||
|
||||
@staticmethod
|
||||
def get(name: str) -> Optional["Command"]:
|
||||
def get(name: str, /) -> Optional["Command"]:
|
||||
"""
|
||||
get(name) -> Gui.Command or None
|
||||
|
||||
Get a given command by name or None if it doesn't exist.
|
||||
|
||||
name : str
|
||||
@@ -25,8 +27,6 @@ class Command(PyObjectBase):
|
||||
@staticmethod
|
||||
def update() -> None:
|
||||
"""
|
||||
update() -> None
|
||||
|
||||
Update active status of all commands.
|
||||
"""
|
||||
...
|
||||
@@ -34,17 +34,13 @@ class Command(PyObjectBase):
|
||||
@staticmethod
|
||||
def listAll() -> List[str]:
|
||||
"""
|
||||
listAll() -> list of str
|
||||
|
||||
Returns the name of all commands.
|
||||
"""
|
||||
...
|
||||
|
||||
@staticmethod
|
||||
def listByShortcut(string: str, useRegExp: bool = False) -> List[str]:
|
||||
def listByShortcut(string: str, useRegExp: bool = False, /) -> List[str]:
|
||||
"""
|
||||
listByShortcut(string, useRegExp=False) -> list of str
|
||||
|
||||
Returns a list of all commands, filtered by shortcut.
|
||||
Shortcuts are converted to uppercase and spaces removed
|
||||
prior to comparison.
|
||||
@@ -56,10 +52,8 @@ class Command(PyObjectBase):
|
||||
"""
|
||||
...
|
||||
|
||||
def run(self, item: int = 0) -> None:
|
||||
def run(self, item: int = 0, /) -> None:
|
||||
"""
|
||||
run(item=0) -> None
|
||||
|
||||
Runs the given command.
|
||||
|
||||
item : int
|
||||
@@ -70,24 +64,18 @@ class Command(PyObjectBase):
|
||||
@constmethod
|
||||
def isActive(self) -> bool:
|
||||
"""
|
||||
isActive() -> bool
|
||||
|
||||
Returns True if the command is active, False otherwise.
|
||||
"""
|
||||
...
|
||||
|
||||
def getShortcut(self) -> str:
|
||||
"""
|
||||
getShortcut() -> str
|
||||
|
||||
Returns string representing shortcut key accelerator for command.
|
||||
"""
|
||||
...
|
||||
|
||||
def setShortcut(self, string: str) -> bool:
|
||||
def setShortcut(self, string: str, /) -> bool:
|
||||
"""
|
||||
setShortcut(string) -> bool
|
||||
|
||||
Sets shortcut for given command, returns True for success.
|
||||
|
||||
string : str
|
||||
@@ -97,24 +85,18 @@ class Command(PyObjectBase):
|
||||
|
||||
def resetShortcut(self) -> bool:
|
||||
"""
|
||||
resetShortcut() -> bool
|
||||
|
||||
Resets shortcut for given command back to the default, returns True for success.
|
||||
"""
|
||||
...
|
||||
|
||||
def getInfo(self) -> Dict[Any, Any]:
|
||||
"""
|
||||
getInfo() -> dict
|
||||
|
||||
Return information about this command.
|
||||
"""
|
||||
...
|
||||
|
||||
def getAction(self) -> List[Any]:
|
||||
"""
|
||||
getAction() -> list of QAction
|
||||
|
||||
Return the associated QAction object.
|
||||
"""
|
||||
...
|
||||
@@ -128,11 +110,9 @@ class Command(PyObjectBase):
|
||||
whatsThis: str,
|
||||
statusTip: str,
|
||||
pixmap: str,
|
||||
shortcut: str
|
||||
shortcut: str,
|
||||
) -> str:
|
||||
"""
|
||||
createCustomCommand(macroFile, menuText, toolTip, whatsThis, statusTip, pixmap, shortcut) -> str
|
||||
|
||||
Create a custom command for a macro. Returns name of the created command.
|
||||
|
||||
macroFile : str
|
||||
@@ -153,10 +133,8 @@ class Command(PyObjectBase):
|
||||
...
|
||||
|
||||
@staticmethod
|
||||
def removeCustomCommand(name: str) -> bool:
|
||||
def removeCustomCommand(name: str, /) -> bool:
|
||||
"""
|
||||
removeCustomCommand(name) -> bool
|
||||
|
||||
Remove the custom command if it exists.
|
||||
Given the name of a custom command, this removes that command.
|
||||
It is not an error to remove a non-existent command, the function
|
||||
@@ -169,10 +147,8 @@ class Command(PyObjectBase):
|
||||
...
|
||||
|
||||
@staticmethod
|
||||
def findCustomCommand(name: str) -> Optional[str]:
|
||||
def findCustomCommand(name: str, /) -> Optional[str]:
|
||||
"""
|
||||
findCustomCommand(name) -> str or None
|
||||
|
||||
Given the name of a macro, return the name of the custom command for that macro
|
||||
or None if there is no command matching that macro script name.
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import constmethod
|
||||
from Base.Persistence import Persistence
|
||||
from Base.Matrix import Matrix
|
||||
@@ -11,10 +15,8 @@ class Document(Persistence):
|
||||
Licence: LGPL
|
||||
"""
|
||||
|
||||
def show(self, objName: str) -> None:
|
||||
def show(self, objName: str, /) -> None:
|
||||
"""
|
||||
show(objName) -> None
|
||||
|
||||
Show an object.
|
||||
|
||||
objName : str
|
||||
@@ -22,10 +24,8 @@ class Document(Persistence):
|
||||
"""
|
||||
...
|
||||
|
||||
def hide(self, objName: str) -> None:
|
||||
def hide(self, objName: str, /) -> None:
|
||||
"""
|
||||
hide(objName) -> None
|
||||
|
||||
Hide an object.
|
||||
|
||||
objName : str
|
||||
@@ -33,10 +33,8 @@ class Document(Persistence):
|
||||
"""
|
||||
...
|
||||
|
||||
def setPos(self, objName: str, matrix: Matrix) -> None:
|
||||
def setPos(self, objName: str, matrix: Matrix, /) -> None:
|
||||
"""
|
||||
setPos(objName, matrix) -> None
|
||||
|
||||
Set the position of an object.
|
||||
|
||||
objName : str
|
||||
@@ -47,10 +45,8 @@ class Document(Persistence):
|
||||
"""
|
||||
...
|
||||
|
||||
def setEdit(self, obj: Any, mod: int = 0, subName: Optional[str] = None) -> bool:
|
||||
def setEdit(self, obj: Any, mod: int = 0, subName: Optional[str] = None, /) -> bool:
|
||||
"""
|
||||
setEdit(obj, mod=0, subName) -> bool
|
||||
|
||||
Set an object in edit mode.
|
||||
|
||||
obj : str, App.DocumentObject, Gui.ViewPrivider
|
||||
@@ -64,24 +60,18 @@ class Document(Persistence):
|
||||
|
||||
def getInEdit(self) -> Optional[Any]:
|
||||
"""
|
||||
getInEdit() -> Gui.ViewProviderDocumentObject or None
|
||||
|
||||
Returns the current object in edit mode or None if there is no such object.
|
||||
"""
|
||||
...
|
||||
|
||||
def resetEdit(self) -> None:
|
||||
"""
|
||||
resetEdit() -> None
|
||||
|
||||
End the current editing.
|
||||
"""
|
||||
...
|
||||
|
||||
def addAnnotation(self, annoName: str, fileName: str, modName: str) -> None:
|
||||
def addAnnotation(self, annoName: str, fileName: str, modName: str, /) -> None:
|
||||
"""
|
||||
addAnnotation(annoName, fileName, modName) -> None
|
||||
|
||||
Add an Inventor object from a file.
|
||||
|
||||
annoName : str
|
||||
@@ -95,16 +85,12 @@ class Document(Persistence):
|
||||
|
||||
def update(self) -> None:
|
||||
"""
|
||||
update() -> None
|
||||
|
||||
Update the view representations of all objects.
|
||||
"""
|
||||
...
|
||||
|
||||
def getObject(self, objName: str) -> Optional[Any]:
|
||||
def getObject(self, objName: str, /) -> Optional[Any]:
|
||||
"""
|
||||
getObject(objName) -> object or None
|
||||
|
||||
Return the object with the given name. If no one exists, return None.
|
||||
|
||||
ObjName : str
|
||||
@@ -114,24 +100,18 @@ class Document(Persistence):
|
||||
|
||||
def activeObject(self) -> Optional[Any]:
|
||||
"""
|
||||
activeObject() -> object or None
|
||||
|
||||
The active object of the document. Deprecated, use ActiveObject.
|
||||
"""
|
||||
...
|
||||
|
||||
def activeView(self) -> Optional[Any]:
|
||||
"""
|
||||
activeView() -> object or None
|
||||
|
||||
The active view of the document. Deprecated, use ActiveView.
|
||||
"""
|
||||
...
|
||||
|
||||
def createView(self, type: str) -> Optional[Any]:
|
||||
def createView(self, type: str, /) -> Optional[Any]:
|
||||
"""
|
||||
createView(type) -> object or None
|
||||
|
||||
Return a newly created view of a given type.
|
||||
|
||||
type : str
|
||||
@@ -140,10 +120,8 @@ class Document(Persistence):
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def mdiViewsOfType(self, type: str) -> List[Any]:
|
||||
def mdiViewsOfType(self, type: str, /) -> List[Any]:
|
||||
"""
|
||||
mdiViewsOfType(type) -> list of MDIView
|
||||
|
||||
Return a list of mdi views of a given type.
|
||||
|
||||
type : str
|
||||
@@ -153,34 +131,26 @@ class Document(Persistence):
|
||||
|
||||
def save(self) -> bool:
|
||||
"""
|
||||
save() -> bool
|
||||
|
||||
Attempts to save the document
|
||||
"""
|
||||
...
|
||||
|
||||
def saveAs(self) -> bool:
|
||||
"""
|
||||
saveAs() -> bool
|
||||
|
||||
Attempts to save the document under a new name
|
||||
"""
|
||||
...
|
||||
|
||||
def sendMsgToViews(self, msg: str) -> None:
|
||||
def sendMsgToViews(self, msg: str, /) -> None:
|
||||
"""
|
||||
sendMsgToViews(msg) -> None
|
||||
|
||||
Send a message to all views of the document.
|
||||
|
||||
msg : str
|
||||
"""
|
||||
...
|
||||
|
||||
def mergeProject(self, fileName: str) -> None:
|
||||
def mergeProject(self, fileName: str, /) -> None:
|
||||
"""
|
||||
mergeProject(fileName) -> None
|
||||
|
||||
Merges this document with another project file.
|
||||
|
||||
fileName : str
|
||||
@@ -188,10 +158,8 @@ class Document(Persistence):
|
||||
"""
|
||||
...
|
||||
|
||||
def toggleTreeItem(self, obj: Any, mod: int = 0, subName: Optional[str] = None) -> None:
|
||||
def toggleTreeItem(self, obj: Any, mod: int = 0, subName: Optional[str] = None, /) -> None:
|
||||
"""
|
||||
toggleTreeItem(obj, mod=0, subName) -> None
|
||||
|
||||
Change TreeItem of a document object.
|
||||
|
||||
obj : App.DocumentObject
|
||||
@@ -203,20 +171,16 @@ class Document(Persistence):
|
||||
"""
|
||||
...
|
||||
|
||||
def scrollToTreeItem(self, obj: Any) -> None:
|
||||
def scrollToTreeItem(self, obj: Any, /) -> None:
|
||||
"""
|
||||
scrollToTreeItem(obj) -> None
|
||||
|
||||
Scroll the tree view to the item of a view object.
|
||||
|
||||
obj : Gui.ViewProviderDocumentObject
|
||||
"""
|
||||
...
|
||||
|
||||
def toggleInSceneGraph(self, obj: Any) -> None:
|
||||
def toggleInSceneGraph(self, obj: Any, /) -> None:
|
||||
"""
|
||||
toggleInSceneGraph(obj) -> None
|
||||
|
||||
Add or remove view object from scene graph of all views depending
|
||||
on its canAddToSceneGraph().
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import export, constmethod
|
||||
from Base.BaseClass import BaseClass
|
||||
from typing import Any, Final, List, Dict, Tuple, overload
|
||||
@@ -21,7 +25,15 @@ class LinkView(BaseClass):
|
||||
"""
|
||||
...
|
||||
|
||||
def setMaterial(self, material: Any) -> None:
|
||||
@overload
|
||||
def setMaterial(self, material: None, /) -> None: ...
|
||||
@overload
|
||||
def setMaterial(self, material: Any, /) -> None: ...
|
||||
@overload
|
||||
def setMaterial(self, material: List[Any], /) -> None: ...
|
||||
@overload
|
||||
def setMaterial(self, material: Dict[int, Any], /) -> None: ...
|
||||
def setMaterial(self, material: Any, /) -> None:
|
||||
"""
|
||||
setMaterial(Material): set the override material of the entire linked object
|
||||
|
||||
@@ -38,16 +50,12 @@ class LinkView(BaseClass):
|
||||
...
|
||||
|
||||
@overload
|
||||
def setMaterial(self, material: None) -> None: ...
|
||||
def setType(self, type: int, /) -> None: ...
|
||||
@overload
|
||||
def setMaterial(self, material: Any) -> None: ...
|
||||
@overload
|
||||
def setMaterial(self, material: List[Any]) -> None: ...
|
||||
@overload
|
||||
def setMaterial(self, material: Dict[int, Any]) -> None: ...
|
||||
def setType(self, type: int, sublink: bool = True) -> None:
|
||||
def setType(self, type: int, sublink: bool, /) -> None: ...
|
||||
def setType(self, type: int, sublink: bool = True, /) -> None:
|
||||
"""
|
||||
setType(type, sublink=True): set the link type.
|
||||
set the link type.
|
||||
|
||||
type=0: override transformation and visibility
|
||||
type=1: override visibility
|
||||
@@ -61,30 +69,25 @@ class LinkView(BaseClass):
|
||||
...
|
||||
|
||||
@overload
|
||||
def setType(self, type: int) -> None: ...
|
||||
def setTransform(self, matrix: Any, /) -> None: ...
|
||||
@overload
|
||||
def setType(self, type: int, sublink: bool) -> None: ...
|
||||
def setTransform(self, matrix: Any) -> None:
|
||||
def setTransform(self, matrix: List[Any], /) -> None: ...
|
||||
@overload
|
||||
def setTransform(self, matrix: Dict[int, Any], /) -> None: ...
|
||||
def setTransform(self, matrix: Any, /) -> None:
|
||||
"""
|
||||
setTransform(matrix): set transformation of the linked object
|
||||
set transformation of the linked object
|
||||
|
||||
setTransform([matrix,...]): set transformation for the elements of the link
|
||||
set transformation for the elements of the link
|
||||
array/group
|
||||
|
||||
setTransform({index:matrix,...}): set transformation for elements of the link
|
||||
set transformation for elements of the link
|
||||
array/group by index
|
||||
"""
|
||||
...
|
||||
|
||||
@overload
|
||||
def setTransform(self, matrix: Any) -> None: ...
|
||||
@overload
|
||||
def setTransform(self, matrix: List[Any]) -> None: ...
|
||||
@overload
|
||||
def setTransform(self, matrix: Dict[int, Any]) -> None: ...
|
||||
def setChildren(self, children: List[Any], vis: List[Any] = [], type: int = 0) -> None:
|
||||
def setChildren(self, children: List[Any], vis: List[Any] = [], type: int = 0, /) -> None:
|
||||
"""
|
||||
setChildren([obj...],vis=[],type=0)
|
||||
Group a list of children objects. Note, this mode of operation is incompatible
|
||||
with link array. Calling this function will deactivate link array. And calling
|
||||
setSize() will reset all linked children.
|
||||
@@ -98,13 +101,19 @@ class LinkView(BaseClass):
|
||||
"""
|
||||
...
|
||||
|
||||
def setLink(self, obj: Any, subname: Any = None) -> None:
|
||||
@overload
|
||||
def setLink(self, obj: Any, /) -> None: ...
|
||||
@overload
|
||||
def setLink(self, obj: Any, subname: str, /) -> None: ...
|
||||
@overload
|
||||
def setLink(self, obj: Any, subname: List[str], /) -> None: ...
|
||||
def setLink(self, obj: Any, subname: Any = None, /) -> None:
|
||||
"""
|
||||
setLink(object): Set the link
|
||||
Set the link
|
||||
|
||||
setLink(object, subname): Set the link with a sub-object reference
|
||||
Set the link with a sub-object reference
|
||||
|
||||
setLink(object, [subname,...]): Set the link with a list of sub object references
|
||||
Set the link with a list of sub object references
|
||||
|
||||
object: The linked document object or its view object
|
||||
|
||||
@@ -115,29 +124,23 @@ class LinkView(BaseClass):
|
||||
"""
|
||||
...
|
||||
|
||||
@overload
|
||||
def setLink(self, obj: Any) -> None: ...
|
||||
@overload
|
||||
def setLink(self, obj: Any, subname: str) -> None: ...
|
||||
@overload
|
||||
def setLink(self, obj: Any, subname: List[str]) -> None: ...
|
||||
def getDetailPath(self, element: Any) -> Tuple[Any, Any]:
|
||||
def getDetailPath(self, element: Any, /) -> Tuple[Any, Any]:
|
||||
"""
|
||||
getDetailPath(element): get the 3d path an detail of an element.
|
||||
get the 3d path an detail of an element.
|
||||
|
||||
Return a tuple(path,detail) for the coin3D SoPath and SoDetail of the element
|
||||
"""
|
||||
...
|
||||
|
||||
def getElementPicked(self, pickPoint: Any) -> Any:
|
||||
def getElementPicked(self, pickPoint: Any, /) -> Any:
|
||||
"""
|
||||
getElementPicked(pickPoint): get the element under a 3d pick point.
|
||||
get the element under a 3d pick point.
|
||||
"""
|
||||
...
|
||||
|
||||
def getBoundBox(self, vobj: Any = None) -> Any:
|
||||
def getBoundBox(self, vobj: Any = None, /) -> Any:
|
||||
"""
|
||||
getBoundBox(vobj=None): get the bounding box.
|
||||
get the bounding box.
|
||||
"""
|
||||
...
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import export
|
||||
from Workbench import Workbench
|
||||
from warnings import deprecated
|
||||
|
||||
@@ -19,16 +19,15 @@ class SelectionObject(BaseClass):
|
||||
def remove(self) -> None:
|
||||
"""
|
||||
Remove this selection item from the selection.
|
||||
remove() -> None
|
||||
|
||||
--
|
||||
This object becomes invalid.
|
||||
"""
|
||||
...
|
||||
|
||||
def isObjectTypeOf(self, type: Any) -> bool:
|
||||
def isObjectTypeOf(self, type: Any, /) -> bool:
|
||||
"""
|
||||
Test for a certain father class.
|
||||
isObjectTypeOf(type) -> Bool
|
||||
"""
|
||||
...
|
||||
ObjectName: Final[str] = ""
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import constmethod
|
||||
from Base.BoundBox import BoundBox
|
||||
from App.ExtensionContainer import ExtensionContainer
|
||||
@@ -18,7 +22,6 @@ class ViewProvider(ExtensionContainer):
|
||||
|
||||
def addProperty(
|
||||
self,
|
||||
*,
|
||||
type: str,
|
||||
name: str,
|
||||
group: str,
|
||||
@@ -29,8 +32,6 @@ class ViewProvider(ExtensionContainer):
|
||||
locked: bool = False,
|
||||
) -> "ViewProvider":
|
||||
"""
|
||||
addProperty(type, name, group, doc, attr=0, read_only=False, hidden=False, locked=False) -> ViewProvider
|
||||
|
||||
Add a generic property.
|
||||
|
||||
type : str
|
||||
@@ -50,10 +51,8 @@ class ViewProvider(ExtensionContainer):
|
||||
"""
|
||||
...
|
||||
|
||||
def removeProperty(self, name: str) -> bool:
|
||||
def removeProperty(self, name: str, /) -> bool:
|
||||
"""
|
||||
removeProperty(name) -> bool
|
||||
|
||||
Remove a generic property.
|
||||
Only user-defined properties can be removed, not built-in ones.
|
||||
|
||||
@@ -64,40 +63,30 @@ class ViewProvider(ExtensionContainer):
|
||||
|
||||
def supportedProperties(self) -> list:
|
||||
"""
|
||||
supportedProperties() -> list
|
||||
|
||||
A list of supported property types.
|
||||
"""
|
||||
...
|
||||
|
||||
def show(self) -> None:
|
||||
"""
|
||||
show() -> None
|
||||
|
||||
Show the object.
|
||||
"""
|
||||
...
|
||||
|
||||
def hide(self) -> None:
|
||||
"""
|
||||
hide() -> None
|
||||
|
||||
Hide the object.
|
||||
"""
|
||||
...
|
||||
|
||||
def isVisible(self) -> bool:
|
||||
"""
|
||||
isVisible() -> bool
|
||||
|
||||
Check if the object is visible.
|
||||
"""
|
||||
...
|
||||
|
||||
def canDragObject(self, obj: Any = None) -> bool:
|
||||
def canDragObject(self, obj: Any = None, /) -> bool:
|
||||
"""
|
||||
canDragObject(obj=None) -> bool
|
||||
|
||||
Check whether the child object can be removed by dragging.
|
||||
If 'obj' is not given, check without filter by any particular object.
|
||||
|
||||
@@ -106,10 +95,8 @@ class ViewProvider(ExtensionContainer):
|
||||
"""
|
||||
...
|
||||
|
||||
def dragObject(self, obj: Any) -> None:
|
||||
def dragObject(self, obj: Any, /) -> None:
|
||||
"""
|
||||
dragObject(obj) -> None
|
||||
|
||||
Remove a child object by dropping.
|
||||
|
||||
obj : App.DocumentObject
|
||||
@@ -118,11 +105,9 @@ class ViewProvider(ExtensionContainer):
|
||||
...
|
||||
|
||||
def canDropObject(
|
||||
self, *, obj: Any = None, owner: Any = None, subname: str, elem: Optional[List[str]] = None
|
||||
self, obj: Any = None, *, owner: Any = None, subname: str, elem: Optional[List[str]] = None
|
||||
) -> bool:
|
||||
"""
|
||||
canDropObject(obj=None, owner=None, subname, elem=None) -> bool
|
||||
|
||||
Check whether the child object can be added by dropping.
|
||||
If 'obj' is not given, check without filter by any particular object.
|
||||
|
||||
@@ -139,11 +124,9 @@ class ViewProvider(ExtensionContainer):
|
||||
...
|
||||
|
||||
def dropObject(
|
||||
self, *, obj: Any, owner: Any = None, subname: str, elem: Optional[List[str]] = None
|
||||
self, obj: Any, *, owner: Any = None, subname: str, elem: Optional[List[str]] = None
|
||||
) -> str:
|
||||
"""
|
||||
dropObject(obj, owner=None, subname, elem=None) -> str
|
||||
|
||||
Add a child object by dropping.
|
||||
|
||||
obj : App.DocumentObject
|
||||
@@ -158,10 +141,8 @@ class ViewProvider(ExtensionContainer):
|
||||
"""
|
||||
...
|
||||
|
||||
def canDragAndDropObject(self, obj: Any) -> bool:
|
||||
def canDragAndDropObject(self, obj: Any, /) -> bool:
|
||||
"""
|
||||
canDragAndDropObject(obj) -> bool
|
||||
|
||||
Check whether the child object can be removed from
|
||||
other parent and added here by drag and drop.
|
||||
|
||||
@@ -170,10 +151,8 @@ class ViewProvider(ExtensionContainer):
|
||||
"""
|
||||
...
|
||||
|
||||
def replaceObject(self, oldObj: Any, newObj: Any) -> int:
|
||||
def replaceObject(self, oldObj: Any, newObj: Any, /) -> int:
|
||||
"""
|
||||
replaceObject(oldObj, newObj) -> int
|
||||
|
||||
Replace a child object.
|
||||
Returns 1 if succeeded, 0 if not found, -1 if not supported.
|
||||
|
||||
@@ -186,16 +165,12 @@ class ViewProvider(ExtensionContainer):
|
||||
|
||||
def doubleClicked(self) -> bool:
|
||||
"""
|
||||
doubleClicked() -> bool
|
||||
|
||||
Trigger double clicking the corresponding tree item of this view object.
|
||||
"""
|
||||
...
|
||||
|
||||
def addDisplayMode(self, obj: Any, mode: str) -> None:
|
||||
def addDisplayMode(self, obj: Any, mode: str, /) -> None:
|
||||
"""
|
||||
addDisplayMode(obj, mode) -> None
|
||||
|
||||
Add a new display mode to the view provider.
|
||||
|
||||
obj : coin.SoNode
|
||||
@@ -207,24 +182,18 @@ class ViewProvider(ExtensionContainer):
|
||||
|
||||
def listDisplayModes(self) -> list:
|
||||
"""
|
||||
listDisplayModes() -> list
|
||||
|
||||
Show a list of all display modes.
|
||||
"""
|
||||
...
|
||||
|
||||
def toString(self) -> str:
|
||||
"""
|
||||
toString() -> str
|
||||
|
||||
Return a string representation of the Inventor node.
|
||||
"""
|
||||
...
|
||||
|
||||
def setTransformation(self, trans: Any) -> None:
|
||||
def setTransformation(self, trans: Any, /) -> None:
|
||||
"""
|
||||
setTransformation(trans) -> None
|
||||
|
||||
Set a transformation on the Inventor node.
|
||||
|
||||
trans : Base.Placement, Base.Matrix
|
||||
@@ -234,8 +203,6 @@ class ViewProvider(ExtensionContainer):
|
||||
@constmethod
|
||||
def claimChildren(self) -> list:
|
||||
"""
|
||||
claimChildren() -> list
|
||||
|
||||
Returns list of objects that are to be grouped in tree under this object.
|
||||
"""
|
||||
...
|
||||
@@ -243,16 +210,12 @@ class ViewProvider(ExtensionContainer):
|
||||
@constmethod
|
||||
def claimChildrenRecursive(self) -> list:
|
||||
"""
|
||||
claimChildrenRecursive() -> list
|
||||
|
||||
Returns list of objects that are to be grouped in tree under this object recursively.
|
||||
"""
|
||||
...
|
||||
|
||||
def partialRender(self, sub: Any = None, clear: bool = False) -> int:
|
||||
def partialRender(self, sub: Any = None, clear: bool = False, /) -> int:
|
||||
"""
|
||||
partialRender(sub=None, clear=False) -> int
|
||||
|
||||
Render only part of the object.
|
||||
|
||||
sub: None, str, sequence of str
|
||||
@@ -262,10 +225,8 @@ class ViewProvider(ExtensionContainer):
|
||||
"""
|
||||
...
|
||||
|
||||
def getElementColors(self, elementName: Optional[str] = None) -> dict:
|
||||
def getElementColors(self, elementName: Optional[str] = None, /) -> dict:
|
||||
"""
|
||||
getElementColors(elementName) -> dict
|
||||
|
||||
Get a dictionary of the form {elementName : (r,g,b,a)}.
|
||||
If no element name is given a dictionary with all the elements is returned.
|
||||
|
||||
@@ -274,10 +235,8 @@ class ViewProvider(ExtensionContainer):
|
||||
"""
|
||||
...
|
||||
|
||||
def setElementColors(self, colors: dict) -> None:
|
||||
def setElementColors(self, colors: dict, /) -> None:
|
||||
"""
|
||||
setElementColors(colors) -> None
|
||||
|
||||
Set element colors.
|
||||
|
||||
colors: dict
|
||||
@@ -286,10 +245,8 @@ class ViewProvider(ExtensionContainer):
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def getElementPicked(self, pickPoint: Any) -> str:
|
||||
def getElementPicked(self, pickPoint: Any, /) -> str:
|
||||
"""
|
||||
getElementPicked(pickPoint) -> str
|
||||
|
||||
Return the picked subelement.
|
||||
|
||||
pickPoint : coin.SoPickedPoint
|
||||
@@ -297,10 +254,8 @@ class ViewProvider(ExtensionContainer):
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def getDetailPath(self, subelement: str, path: Any, append: bool = True) -> Any:
|
||||
def getDetailPath(self, subelement: str, path: Any, append: bool = True, /) -> Any:
|
||||
"""
|
||||
getDetailPath(subelement, path, append=True) -> coin.SoDetail or None
|
||||
|
||||
Return Coin detail and path of an subelement.
|
||||
|
||||
subname: str
|
||||
@@ -316,18 +271,14 @@ class ViewProvider(ExtensionContainer):
|
||||
@constmethod
|
||||
def signalChangeIcon(self) -> None:
|
||||
"""
|
||||
signalChangeIcon() -> None
|
||||
|
||||
Trigger icon changed signal.
|
||||
"""
|
||||
...
|
||||
|
||||
def getBoundingBox(
|
||||
self, subName: Optional[str] = None, transform: bool = True, view: Any = None
|
||||
self, subName: Optional[str] = None, transform: bool = True, view: Any = None, /
|
||||
) -> BoundBox:
|
||||
"""
|
||||
getBoundingBox(subName, transform=True, view) -> Base.BoundBox
|
||||
|
||||
Obtain the bounding box of this view object.
|
||||
|
||||
subName : str
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from ViewProvider import ViewProvider
|
||||
from typing import Any, Final
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import constmethod
|
||||
from App.Extension import Extension
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import no_args
|
||||
from ViewProviderDocumentObject import ViewProviderDocumentObject
|
||||
|
||||
@@ -13,8 +17,6 @@ class ViewProviderGeometryObject(ViewProviderDocumentObject):
|
||||
@no_args
|
||||
def getUserDefinedMaterial() -> object:
|
||||
"""
|
||||
getUserDefinedMaterial() -> object
|
||||
|
||||
Get a material object with the user-defined colors.
|
||||
"""
|
||||
...
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from ViewProviderDocumentObject import ViewProviderDocumentObject
|
||||
from typing import Any, Final
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import export
|
||||
from Base.BaseClass import BaseClass
|
||||
from typing import Any, List, Dict
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Final
|
||||
|
||||
from Base.Metadata import export
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
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")
|
||||
class AssemblyObject(Part):
|
||||
@@ -14,10 +19,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
|
||||
@@ -33,14 +37,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.
|
||||
@@ -53,112 +57,99 @@ 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"]:
|
||||
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.
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import export
|
||||
|
||||
from App.DocumentObjectGroup import DocumentObjectGroup
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import export
|
||||
from Spreadsheet.Sheet import Sheet
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import export
|
||||
|
||||
from App.DocumentObjectGroup import DocumentObjectGroup
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import export
|
||||
|
||||
from App.DocumentObjectGroup import DocumentObjectGroup
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import export
|
||||
|
||||
from App.DocumentObjectGroup import DocumentObjectGroup
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
from typing import Any
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
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):
|
||||
"""
|
||||
@@ -16,21 +22,15 @@ 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(
|
||||
self, components: List[DocumentObject] | Tuple[DocumentObject, ...], mode: int
|
||||
self, components: List[DocumentObject] | Tuple[DocumentObject, ...], mode: int, /
|
||||
) -> None:
|
||||
"""
|
||||
Temporarily isolates a given set of components in the 3D view.
|
||||
|
||||
@@ -28,24 +28,25 @@ class Area(BaseClass):
|
||||
""""""
|
||||
...
|
||||
|
||||
def setPlane(self) -> Any:
|
||||
"""setPlane(shape): Set the working plane.
|
||||
def setPlane(self) -> None:
|
||||
"""
|
||||
Set the working plane.
|
||||
|
||||
The supplied shape does not need to be planar. Area will try to find planar
|
||||
sub-shape (face, wire or edge). If more than one planar sub-shape is found, it
|
||||
will prefer the top plane parallel to XY0 plane. If no working plane are set,
|
||||
Area will try to find a working plane from the added children shape using the
|
||||
same algorithm"""
|
||||
same algorithm
|
||||
"""
|
||||
...
|
||||
|
||||
def getShape(self, **kwargs) -> Any:
|
||||
"""getShape(index=-1,rebuild=False): Return the resulting shape
|
||||
|
||||
"""
|
||||
Return the resulting shape
|
||||
|
||||
* index (-1): the index of the section. -1 means all sections. No effect on planar shape.
|
||||
|
||||
|
||||
* rebuild: clean the internal cache and rebuild"""
|
||||
* rebuild: clean the internal cache and rebuild
|
||||
"""
|
||||
...
|
||||
|
||||
def makeOffset(self, **kwargs) -> Any:
|
||||
|
||||
@@ -21,15 +21,15 @@ class Command(Persistence):
|
||||
|
||||
@constmethod
|
||||
def toGCode(self) -> str:
|
||||
"""toGCode(): returns a GCode representation of the command"""
|
||||
"""returns a GCode representation of the command"""
|
||||
...
|
||||
|
||||
def setFromGCode(self, gcode: str) -> None:
|
||||
"""setFromGCode(): sets the path from the contents of the given GCode string"""
|
||||
def setFromGCode(self, gcode: str, /) -> None:
|
||||
"""sets the path from the contents of the given GCode string"""
|
||||
...
|
||||
|
||||
def transform(self, placement: Placement) -> "CommandPy":
|
||||
"""transform(Placement): returns a copy of this command transformed by the given placement"""
|
||||
def transform(self, placement: Placement, /) -> Command:
|
||||
"""returns a copy of this command transformed by the given placement"""
|
||||
...
|
||||
|
||||
def addAnnotations(self, annotations) -> "Command":
|
||||
|
||||
@@ -23,7 +23,10 @@ class FeatureArea(DocumentObject):
|
||||
...
|
||||
|
||||
def setParams(self, **kwargs) -> Any:
|
||||
"""setParams(key=value...): Convenient function to configure this feature.
|
||||
"""
|
||||
Convenient function to configure this feature.
|
||||
|
||||
Call with keywords: setParams(key=value, ...)
|
||||
|
||||
Same usage as Path.Area.setParams(). This function stores the parameters in the properties.
|
||||
"""
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from typing import Any, Final
|
||||
from __future__ import annotations
|
||||
from typing import Any, Final, overload, Union
|
||||
|
||||
from Base.Metadata import constmethod, export
|
||||
from Base.Persistence import Persistence
|
||||
|
||||
from .Command import Command
|
||||
|
||||
@export(
|
||||
Include="Mod/CAM/App/Path.h",
|
||||
Twin="Toolpath",
|
||||
@@ -22,36 +25,44 @@ class Path(Persistence):
|
||||
License: LGPL-2.1-or-later
|
||||
"""
|
||||
|
||||
def addCommands(self) -> Any:
|
||||
@overload
|
||||
def addCommands(self, command: Command, /) -> Path: ...
|
||||
@overload
|
||||
def addCommands(self, commands: list[Command], /) -> Path: ...
|
||||
def addCommands(self, arg: Union[Command, list[Command]], /) -> Path:
|
||||
"""adds a command or a list of commands at the end of the path"""
|
||||
...
|
||||
|
||||
def insertCommand(self) -> Any:
|
||||
"""insertCommand(Command,[int]):
|
||||
adds a command at the given position or at the end of the path"""
|
||||
def insertCommand(self, command: Command, pos: int = -1, /) -> Path:
|
||||
"""
|
||||
adds a command at the given position or at the end of the path
|
||||
"""
|
||||
...
|
||||
|
||||
def deleteCommand(self) -> Any:
|
||||
"""deleteCommand([int]):
|
||||
deletes the command found at the given position or from the end of the path"""
|
||||
def deleteCommand(self, pos: int = -1, /) -> Path:
|
||||
"""
|
||||
deletes the command found at the given position or from the end of the path
|
||||
"""
|
||||
...
|
||||
|
||||
def setFromGCode(self) -> Any:
|
||||
def setFromGCode(self, gcode: str, /) -> None:
|
||||
"""sets the contents of the path from a gcode string"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def toGCode(self) -> Any:
|
||||
def toGCode(self) -> str:
|
||||
"""returns a gcode string representing the path"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def copy(self) -> Any:
|
||||
def copy(self) -> Path:
|
||||
"""returns a copy of this path"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def getCycleTime(self) -> Any:
|
||||
def getCycleTime(
|
||||
self, h_feed: float, v_feed: float, h_rapid: float, v_rapid: float, /
|
||||
) -> float:
|
||||
"""return the cycle time estimation for this path in s"""
|
||||
...
|
||||
Length: Final[float]
|
||||
|
||||
@@ -5,6 +5,8 @@ from typing import Any, Final
|
||||
from Base.BaseClass import BaseClass
|
||||
from Base.Metadata import constmethod, export
|
||||
|
||||
from Base.Vector import Vector
|
||||
|
||||
@export(
|
||||
Include="Mod/CAM/App/Voronoi.h",
|
||||
Namespace="Path",
|
||||
@@ -34,12 +36,12 @@ class Voronoi(BaseClass):
|
||||
"""Return number of vertices"""
|
||||
...
|
||||
|
||||
def addPoint(self) -> Any:
|
||||
"""addPoint(vector|vector2d) add given point to input collection"""
|
||||
def addPoint(self, point: Vector, /) -> None:
|
||||
"""add given point to input collection"""
|
||||
...
|
||||
|
||||
def addSegment(self) -> Any:
|
||||
"""addSegment(vector|vector2d, vector|vector2d) add given segment to input collection"""
|
||||
def addSegment(self, point1: Vector, point2: Vector, /) -> Any:
|
||||
"""add given segment to input collection"""
|
||||
...
|
||||
|
||||
def construct(self) -> Any:
|
||||
|
||||
@@ -1,7 +1,15 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Final
|
||||
|
||||
from Base.BaseClass import BaseClass
|
||||
from Base.Metadata import export
|
||||
from Base.Placement import Placement
|
||||
from Part.App.TopoShape import TopoShape
|
||||
from Mesh.App.Mesh import Mesh
|
||||
from CAM.App.Command import Command
|
||||
|
||||
@export(
|
||||
FatherInclude="Base/BaseClassPy.h",
|
||||
@@ -22,30 +30,28 @@ class PathSim(BaseClass):
|
||||
License: LGPL-2.1-or-later
|
||||
"""
|
||||
|
||||
def BeginSimulation(self, **kwargs) -> Any:
|
||||
"""BeginSimulation(stock, resolution):
|
||||
|
||||
Start a simulation process on a box shape stock with given resolution"""
|
||||
...
|
||||
|
||||
def SetToolShape(self) -> Any:
|
||||
"""SetToolShape(shape):
|
||||
|
||||
Set the shape of the tool to be used for simulation"""
|
||||
...
|
||||
|
||||
def GetResultMesh(self) -> Any:
|
||||
def BeginSimulation(self, stock: TopoShape, resolution: float) -> None:
|
||||
"""
|
||||
Start a simulation process on a box shape stock with given resolution
|
||||
"""
|
||||
GetResultMesh():
|
||||
|
||||
Return the current mesh result of the simulation."""
|
||||
...
|
||||
|
||||
def ApplyCommand(self, **kwargs) -> Any:
|
||||
def SetToolShape(self, tool: TopoShape, resolution: float, /) -> None:
|
||||
"""
|
||||
ApplyCommand(placement, command):
|
||||
Set the shape of the tool to be used for simulation
|
||||
"""
|
||||
...
|
||||
|
||||
Apply a single path command on the stock starting from placement."""
|
||||
def GetResultMesh(self) -> tuple[Mesh, Mesh]:
|
||||
"""
|
||||
Return the current mesh result of the simulation.
|
||||
"""
|
||||
...
|
||||
|
||||
def ApplyCommand(self, placement: Placement, command: Command) -> Placement:
|
||||
"""
|
||||
Apply a single path command on the stock starting from placement.
|
||||
"""
|
||||
...
|
||||
Tool: Final[Any]
|
||||
"""Return current simulation tool."""
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from Base.BaseClass import BaseClass
|
||||
from Base.Metadata import export
|
||||
from Metadata import no_args
|
||||
from Base.Metadata import export, no_args
|
||||
|
||||
from Part.App.TopoShape import TopoShape
|
||||
from CAM.App.Command import Command
|
||||
|
||||
@export(
|
||||
Include="Mod/CAM/PathSimulator/AppGL/CAMSim.h",
|
||||
@@ -23,38 +29,33 @@ class CAMSim(BaseClass):
|
||||
License: LGPL-2.1-or-later
|
||||
"""
|
||||
|
||||
def BeginSimulation(self, **kwargs) -> Any:
|
||||
def BeginSimulation(self, stock: TopoShape, resolution: float) -> None:
|
||||
"""
|
||||
Start a simulation process on a box shape stock with given resolution
|
||||
"""
|
||||
BeginSimulation(stock, resolution):
|
||||
|
||||
Start a simulation process on a box shape stock with given resolution"""
|
||||
...
|
||||
|
||||
@no_args
|
||||
def ResetSimulation(self) -> Any:
|
||||
def ResetSimulation(self) -> None:
|
||||
"""
|
||||
Clear the simulation and all gcode commands
|
||||
"""
|
||||
ResetSimulation():
|
||||
|
||||
Clear the simulation and all gcode commands"""
|
||||
...
|
||||
|
||||
def AddTool(self, **kwargs) -> Any:
|
||||
def AddTool(self, shape: TopoShape, toolnumber: int, diameter: float, resolution: float) -> Any:
|
||||
"""
|
||||
Set the shape of the tool to be used for simulation
|
||||
"""
|
||||
AddTool(shape, toolnumber, diameter, resolution):
|
||||
|
||||
Set the shape of the tool to be used for simulation"""
|
||||
...
|
||||
|
||||
def SetBaseShape(self, **kwargs) -> Any:
|
||||
def SetBaseShape(self, shape: TopoShape, resolution: float) -> None:
|
||||
"""
|
||||
Set the shape of the base object of the job
|
||||
"""
|
||||
SetBaseShape(shape, resolution):
|
||||
|
||||
Set the shape of the base object of the job"""
|
||||
...
|
||||
|
||||
def AddCommand(self) -> Any:
|
||||
def AddCommand(self, command: Command, /) -> Any:
|
||||
"""
|
||||
Add a path command to the simulation.
|
||||
"""
|
||||
AddCommand(command):
|
||||
|
||||
Add a path command to the simulation."""
|
||||
...
|
||||
|
||||
@@ -1,8 +1,18 @@
|
||||
from typing import Any, Final
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Final, overload
|
||||
|
||||
from Base.Metadata import constmethod, export
|
||||
|
||||
from Base.Vector import Vector
|
||||
from Base.Placement import Placement
|
||||
from App.ComplexGeoData import ComplexGeoData
|
||||
from Part.App.TopoShape import TopoShape
|
||||
from Part.App.TopoShapeFace import TopoShapeFace
|
||||
from Part.App.TopoShapeEdge import TopoShapeEdge
|
||||
from Part.App.TopoShapeSolid import TopoShapeSolid
|
||||
from Part.App.TopoShapeVertex import TopoShapeVertex
|
||||
|
||||
@export(
|
||||
Include="Mod/Fem/App/FemMesh.h",
|
||||
@@ -19,219 +29,243 @@ class FemMesh(ComplexGeoData):
|
||||
License: LGPL-2.1-or-later
|
||||
"""
|
||||
|
||||
def setShape(self) -> Any:
|
||||
def setShape(self, shape: TopoShape, /) -> None:
|
||||
"""Set the Part shape to mesh"""
|
||||
...
|
||||
|
||||
def compute(self) -> Any:
|
||||
def compute(self) -> None:
|
||||
"""Update the internal mesh structure"""
|
||||
...
|
||||
|
||||
def addHypothesis(self) -> Any:
|
||||
def addHypothesis(self, hypothesis: object, shape: TopoShape, /) -> None:
|
||||
"""Add hypothesis"""
|
||||
...
|
||||
|
||||
def setStandardHypotheses(self) -> Any:
|
||||
def setStandardHypotheses(self) -> None:
|
||||
"""Set some standard hypotheses for the whole shape"""
|
||||
...
|
||||
|
||||
def addNode(self) -> Any:
|
||||
def addNode(self, x: float, y: float, z: float, elem_id: int | None = None, /) -> int:
|
||||
"""Add a node by setting (x,y,z)."""
|
||||
...
|
||||
|
||||
def addEdge(self) -> Any:
|
||||
@overload
|
||||
def addEdge(self, n1: int, n2: int, /) -> int: ...
|
||||
@overload
|
||||
def addEdge(self, nodes: list[int], elem_id: int | None = None, /) -> int: ...
|
||||
def addEdge(self, *args) -> int:
|
||||
"""Add an edge by setting two node indices."""
|
||||
...
|
||||
|
||||
def addEdgeList(self) -> Any:
|
||||
def addEdgeList(self, nodes: list[int], np: list[int], /) -> list[int]:
|
||||
"""Add list of edges by list of node indices and list of nodes per edge."""
|
||||
...
|
||||
|
||||
@overload
|
||||
def addFace(self, n1: int, n2: int, n3: int, /) -> int: ...
|
||||
@overload
|
||||
def addFace(self, nodes: list[int], elem_id: int | None = None, /) -> int: ...
|
||||
def addFace(self) -> Any:
|
||||
"""Add a face by setting three node indices."""
|
||||
...
|
||||
|
||||
def addFaceList(self) -> Any:
|
||||
def addFaceList(self, nodes: list[int], np: list[int], /) -> list[int]:
|
||||
"""Add list of faces by list of node indices and list of nodes per face."""
|
||||
...
|
||||
|
||||
def addQuad(self) -> Any:
|
||||
def addQuad(self, n1: int, n2: int, n3: int, n4: int, /) -> int:
|
||||
"""Add a quad by setting four node indices."""
|
||||
...
|
||||
|
||||
def addVolume(self) -> Any:
|
||||
@overload
|
||||
def addVolume(self, n1: int, n2: int, n3: int, n4: int, /) -> int: ...
|
||||
@overload
|
||||
def addVolume(self, nodes: list[int], elem_id: int | None = None, /) -> int: ...
|
||||
def addVolume(self, *args) -> int:
|
||||
"""Add a volume by setting an arbitrary number of node indices."""
|
||||
...
|
||||
|
||||
def addVolumeList(self) -> Any:
|
||||
def addVolumeList(self, nodes: list[int], np: list[int], /) -> list[int]:
|
||||
"""Add list of volumes by list of node indices and list of nodes per volume."""
|
||||
...
|
||||
|
||||
def read(self) -> Any:
|
||||
def read(self, file_name: str, /) -> None:
|
||||
"""
|
||||
Read in a various FEM mesh file formats.
|
||||
read(file.endingToExportTo)
|
||||
supported formats: DAT, INP, MED, STL, UNV, VTK, Z88"""
|
||||
|
||||
|
||||
Supported formats: DAT, INP, MED, STL, UNV, VTK, Z88
|
||||
"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def write(self) -> Any:
|
||||
def write(self, file_name: str, /) -> None:
|
||||
"""
|
||||
Write out various FEM mesh file formats.
|
||||
write(file.endingToExportTo)
|
||||
supported formats: BDF, DAT, INP, MED, STL, UNV, VTK, Z88"""
|
||||
|
||||
Supported formats: BDF, DAT, INP, MED, STL, UNV, VTK, Z88
|
||||
"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def writeABAQUS(self, **kwargs) -> Any:
|
||||
def writeABAQUS(
|
||||
self,
|
||||
fileName: str,
|
||||
elemParam: int,
|
||||
groupParam: bool,
|
||||
volVariant: str = "standard",
|
||||
faceVariant: str = "shell",
|
||||
edgeVariant: str = "beam",
|
||||
) -> None:
|
||||
"""
|
||||
Write out as ABAQUS inp
|
||||
writeABAQUS(file, int elemParam, bool groupParam, str volVariant, str faceVariant, str edgeVariant)
|
||||
Write out as ABAQUS inp.
|
||||
|
||||
elemParam:
|
||||
0: All elements
|
||||
1: Highest elements only
|
||||
2: FEM elements only (only edges not belonging to faces and faces not belonging to volumes)
|
||||
elemParam:
|
||||
0: All elements
|
||||
1: Highest elements only
|
||||
2: FEM elements only (only edges not belonging to faces and faces not belonging to volumes)
|
||||
|
||||
groupParam:
|
||||
True: Write group data
|
||||
False: Do not write group data
|
||||
groupParam:
|
||||
True: Write group data
|
||||
False: Do not write group data
|
||||
|
||||
volVariant: Volume elements
|
||||
"standard": Tetra4 -> C3D4, Penta6 -> C3D6, Hexa8 -> C3D8, Tetra10 -> C3D10, Penta15 -> C3D15, Hexa20 -> C3D20
|
||||
"reduced": Hexa8 -> C3D8R, Hexa20 -> C3D20R
|
||||
"incompatible": Hexa8 -> C3D8I
|
||||
"modified": Tetra10 -> C3D10T
|
||||
"fluid": Tetra4 -> F3D4, Penta6 -> F3D6, Hexa8 -> F3D8
|
||||
volVariant: Volume elements
|
||||
"standard": Tetra4 -> C3D4, Penta6 -> C3D6, Hexa8 -> C3D8, Tetra10 -> C3D10, Penta15 -> C3D15, Hexa20 -> C3D20
|
||||
"reduced": Hexa8 -> C3D8R, Hexa20 -> C3D20R
|
||||
"incompatible": Hexa8 -> C3D8I
|
||||
"modified": Tetra10 -> C3D10T
|
||||
"fluid": Tetra4 -> F3D4, Penta6 -> F3D6, Hexa8 -> F3D8
|
||||
|
||||
faceVariant: Face elements
|
||||
"shell": Tria3 -> S3, Quad4 -> S4, Tria6 -> S6, Quad8 -> S8
|
||||
"shell reduced": Tria3 -> S3, Quad4 -> S4R, Tria6 -> S6, Quad8 -> S8R
|
||||
"membrane": Tria3 -> M3D3, Quad4 -> M3D4, Tria6 -> M3D6, Quad8 -> M3D8
|
||||
"membrane reduced": Tria3 -> M3D3, Quad4 -> M3D4R, Tria6 -> M3D6, Quad8 -> M3D8R
|
||||
"stress": Tria3 -> CPS3, Quad4 -> CPS4, Tria6 -> CPS6, Quad8 -> CPS8
|
||||
"stress reduced": Tria3 -> CPS3, Quad4 -> CPS4R, Tria6 -> CPS6, Quad8 -> CPS8R
|
||||
"strain": Tria3 -> CPE3, Quad4 -> CPE4, Tria6 -> CPE6, Quad8 -> CPE8
|
||||
"strain reduced": Tria3 -> CPE3, Quad4 -> CPE4R, Tria6 -> CPE6, Quad8 -> CPE8R
|
||||
"axisymmetric": Tria3 -> CAX3, Quad4 -> CAX4, Tria6 -> CAX6, Quad8 -> CAX8
|
||||
"axisymmetric reduced": Tria3 -> CAX3, Quad4 -> CAX4R, Tria6 -> CAX6, Quad8 -> CAX8R
|
||||
faceVariant: Face elements
|
||||
"shell": Tria3 -> S3, Quad4 -> S4, Tria6 -> S6, Quad8 -> S8
|
||||
"shell reduced": Tria3 -> S3, Quad4 -> S4R, Tria6 -> S6, Quad8 -> S8R
|
||||
"membrane": Tria3 -> M3D3, Quad4 -> M3D4, Tria6 -> M3D6, Quad8 -> M3D8
|
||||
"membrane reduced": Tria3 -> M3D3, Quad4 -> M3D4R, Tria6 -> M3D6, Quad8 -> M3D8R
|
||||
"stress": Tria3 -> CPS3, Quad4 -> CPS4, Tria6 -> CPS6, Quad8 -> CPS8
|
||||
"stress reduced": Tria3 -> CPS3, Quad4 -> CPS4R, Tria6 -> CPS6, Quad8 -> CPS8R
|
||||
"strain": Tria3 -> CPE3, Quad4 -> CPE4, Tria6 -> CPE6, Quad8 -> CPE8
|
||||
"strain reduced": Tria3 -> CPE3, Quad4 -> CPE4R, Tria6 -> CPE6, Quad8 -> CPE8R
|
||||
"axisymmetric": Tria3 -> CAX3, Quad4 -> CAX4, Tria6 -> CAX6, Quad8 -> CAX8
|
||||
"axisymmetric reduced": Tria3 -> CAX3, Quad4 -> CAX4R, Tria6 -> CAX6, Quad8 -> CAX8R
|
||||
|
||||
edgeVariant: Edge elements
|
||||
"beam": Seg2 -> B31, Seg3 -> B32
|
||||
"beam reduced": Seg2 -> B31R, Seg3 -> B32R
|
||||
"truss": Seg2 -> T3D2, eg3 -> T3D3
|
||||
"network": Seg3 -> D
|
||||
edgeVariant: Edge elements
|
||||
"beam": Seg2 -> B31, Seg3 -> B32
|
||||
"beam reduced": Seg2 -> B31R, Seg3 -> B32R
|
||||
"truss": Seg2 -> T3D2, eg3 -> T3D3
|
||||
"network": Seg3 -> D
|
||||
|
||||
Elements are selected according to CalculiX availability.
|
||||
For example if volume variant "modified" is selected, Tetra10 mesh
|
||||
elements are assigned to C3D10T and remain elements uses "standard".
|
||||
Axisymmetric, plane strain and plane stress elements expect nodes in the plane z=0.
|
||||
Elements are selected according to CalculiX availability.
|
||||
For example if volume variant "modified" is selected, Tetra10 mesh
|
||||
elements are assigned to C3D10T and remain elements uses "standard".
|
||||
Axisymmetric, plane strain and plane stress elements expect nodes in the plane z=0.
|
||||
"""
|
||||
...
|
||||
|
||||
def setTransform(self) -> Any:
|
||||
def setTransform(self, placement: Placement, /) -> None:
|
||||
"""Use a Placement object to perform a translation or rotation"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def copy(self) -> Any:
|
||||
def copy(self) -> FemMesh:
|
||||
"""Make a copy of this FEM mesh."""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def getFacesByFace(self) -> Any:
|
||||
def getFacesByFace(self, face: TopoShapeFace, /) -> list[int]:
|
||||
"""Return a list of face IDs which belong to a TopoFace"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def getEdgesByEdge(self) -> Any:
|
||||
def getEdgesByEdge(self, edge: TopoShapeEdge, /) -> list[int]:
|
||||
"""Return a list of edge IDs which belong to a TopoEdge"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def getVolumesByFace(self) -> Any:
|
||||
"""Return a dict of volume IDs and face IDs which belong to a TopoFace"""
|
||||
def getVolumesByFace(self, face: TopoShapeFace, /) -> list[tuple[int, int]]:
|
||||
"""Return a list of tuples of volume IDs and face IDs which belong to a TopoFace"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def getccxVolumesByFace(self) -> Any:
|
||||
"""Return a dict of volume IDs and ccx face numbers which belong to a TopoFace"""
|
||||
def getccxVolumesByFace(self, face: TopoShapeFace, /) -> list[tuple[int, int]]:
|
||||
"""Return a list of tuples of volume IDs and ccx face numbers which belong to a TopoFace"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def getNodeById(self) -> Any:
|
||||
def getNodeById(self, node_id: int, /) -> Vector:
|
||||
"""Get the node position vector by a Node-ID"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def getNodesBySolid(self) -> Any:
|
||||
def getNodesBySolid(self, shape: TopoShapeSolid, /) -> list[int]:
|
||||
"""Return a list of node IDs which belong to a TopoSolid"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def getNodesByFace(self) -> Any:
|
||||
def getNodesByFace(self, face: TopoShapeFace, /) -> list[int]:
|
||||
"""Return a list of node IDs which belong to a TopoFace"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def getNodesByEdge(self) -> Any:
|
||||
def getNodesByEdge(self, edge: TopoShapeEdge, /) -> list[int]:
|
||||
"""Return a list of node IDs which belong to a TopoEdge"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def getNodesByVertex(self) -> Any:
|
||||
def getNodesByVertex(self, vertex: TopoShapeVertex, /) -> list[int]:
|
||||
"""Return a list of node IDs which belong to a TopoVertex"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def getElementNodes(self) -> Any:
|
||||
def getElementNodes(self, elem_id: int, /) -> tuple[int, ...]:
|
||||
"""Return a tuple of node IDs to a given element ID"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def getNodeElements(self) -> Any:
|
||||
def getNodeElements(self, elem_id: int, elem_type: str = "All", /) -> tuple[int, ...]:
|
||||
"""Return a tuple of specific element IDs associated to a given node ID"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def getGroupName(self) -> Any:
|
||||
def getGroupName(self, elem_id: int, /) -> str:
|
||||
"""Return a string of group name to a given group ID"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def getGroupElementType(self) -> Any:
|
||||
def getGroupElementType(self, elem_id: int, /) -> str:
|
||||
"""Return a string of group element type to a given group ID"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def getGroupElements(self) -> Any:
|
||||
def getGroupElements(self, elem_id: int, /) -> tuple[int, ...]:
|
||||
"""Return a tuple of ElementIDs to a given group ID"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def addGroup(self) -> Any:
|
||||
def addGroup(self, name: str, group_type: str, group_id: int = -1, /) -> None:
|
||||
"""
|
||||
Add a group to mesh with specific name and type
|
||||
addGroup(name, typestring, [id])
|
||||
name: string
|
||||
typestring: "All", "Node", "Edge", "Face", "Volume", "0DElement", "Ball"
|
||||
id: int
|
||||
Optional id is used to force specific id for group, but does
|
||||
not work, yet."""
|
||||
|
||||
name: string
|
||||
group_type: "All", "Node", "Edge", "Face", "Volume", "0DElement", "Ball"
|
||||
group_id: int
|
||||
Optional group_id is used to force specific id for group, but does
|
||||
not work, yet.
|
||||
"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def addGroupElements(self) -> Any:
|
||||
def addGroupElements(self, group_id: int, elements: list[int], /) -> None:
|
||||
"""
|
||||
Add a tuple of ElementIDs to a given group ID
|
||||
addGroupElements(groupid, list_of_elements)
|
||||
groupid: int
|
||||
list_of_elements: list of int
|
||||
Notice that the elements have to be in the mesh."""
|
||||
|
||||
group_id: int
|
||||
elements: list of int
|
||||
Notice that the elements have to be in the mesh.
|
||||
"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def removeGroup(self) -> Any:
|
||||
def removeGroup(self, group_id: int, /) -> bool:
|
||||
"""
|
||||
Remove a group with a given group ID
|
||||
removeGroup(groupid)
|
||||
@@ -248,12 +282,12 @@ class FemMesh(ComplexGeoData):
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def getElementType(self) -> Any:
|
||||
def getElementType(self, elem_id: int, /) -> str:
|
||||
"""Return the element type of a given ID"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def getIdByElementType(self) -> Any:
|
||||
def getIdByElementType(self, elem_type: str, /) -> tuple[int, ...]:
|
||||
"""Return a tuple of IDs to a given element type"""
|
||||
...
|
||||
Nodes: Final[dict]
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from Base.Metadata import export
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
from typing import Any
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, TypeAlias
|
||||
|
||||
from Base.Metadata import export
|
||||
|
||||
from Fem.FemPostObject import FemPostObject
|
||||
|
||||
vtkAlgorithm: TypeAlias = object
|
||||
|
||||
@export(
|
||||
Include="Mod/Fem/App/FemPostFilter.h",
|
||||
Namespace="Fem",
|
||||
@@ -18,36 +23,39 @@ class FemPostFilter(FemPostObject):
|
||||
License: LGPL-2.1-or-later
|
||||
"""
|
||||
|
||||
def addFilterPipeline(self) -> Any:
|
||||
def addFilterPipeline(self, name: str, source: vtkAlgorithm, target: vtkAlgorithm, /) -> None:
|
||||
"""Registers a new vtk filter pipeline for data processing. Arguments are (name, source algorithm, target algorithm)."""
|
||||
...
|
||||
|
||||
def setActiveFilterPipeline(self) -> Any:
|
||||
def setActiveFilterPipeline(self, name: str, /) -> None:
|
||||
"""Sets the filter pipeline that shall be used for data processing. Argument is the name of the filter pipeline to activate."""
|
||||
...
|
||||
|
||||
def getParentPostGroup(self) -> Any:
|
||||
def getParentPostGroup(self) -> object:
|
||||
"""Returns the postprocessing group the filter is in (e.g. a pipeline or branch object). None is returned if not in any."""
|
||||
...
|
||||
|
||||
def getInputData(self) -> Any:
|
||||
"""Returns the dataset available at the filter's input.
|
||||
def getInputData(self) -> object:
|
||||
"""
|
||||
Returns the dataset available at the filter's input.
|
||||
Note: Can lead to a full recompute of the whole pipeline, hence best to call this only in "execute", where the user expects long calculation cycles.
|
||||
"""
|
||||
...
|
||||
|
||||
def getInputVectorFields(self) -> Any:
|
||||
"""Returns the names of all vector fields available on this filter's input.
|
||||
def getInputVectorFields(self) -> list[str]:
|
||||
"""
|
||||
Returns the names of all vector fields available on this filter's input.
|
||||
Note: Can lead to a full recompute of the whole pipeline, hence best to call this only in "execute", where the user expects long calculation cycles.
|
||||
"""
|
||||
...
|
||||
|
||||
def getInputScalarFields(self) -> Any:
|
||||
"""Returns the names of all scalar fields available on this filter's input.
|
||||
def getInputScalarFields(self) -> list[str]:
|
||||
"""
|
||||
Returns the names of all scalar fields available on this filter's input.
|
||||
Note: Can lead to a full recompute of the whole pipeline, hence best to call this only in "execute", where the user expects long calculation cycles.
|
||||
"""
|
||||
...
|
||||
|
||||
def getOutputAlgorithm(self) -> Any:
|
||||
def getOutputAlgorithm(self) -> vtkAlgorithm:
|
||||
"""Returns the filters vtk algorithm currently used as output (the one generating the Data field). Note that the output algorithm may change depending on filter settings."""
|
||||
...
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
from typing import Any
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import TypeAlias
|
||||
|
||||
from Base.Metadata import export
|
||||
|
||||
from App.GeoFeature import GeoFeature
|
||||
|
||||
vtkDataSet: TypeAlias = object
|
||||
|
||||
@export(
|
||||
Include="Mod/Fem/App/FemPostObject.h",
|
||||
Namespace="Fem",
|
||||
@@ -18,18 +23,25 @@ class FemPostObject(GeoFeature):
|
||||
License: LGPL-2.1-or-later
|
||||
"""
|
||||
|
||||
def writeVTK(self) -> Any:
|
||||
"""writeVTK(filename) -> None
|
||||
|
||||
def writeVTK(self, file_name: str, /) -> None:
|
||||
"""
|
||||
Write data object to VTK file.
|
||||
|
||||
filename: str
|
||||
File extension is automatically detected from data type."""
|
||||
...
|
||||
|
||||
def getDataSet(self) -> Any:
|
||||
"""getDataset() -> vtkDataSet
|
||||
|
||||
Returns the current output dataset. For normal filters this is equal to the objects Data property output. However, a pipelines Data property could store multiple frames, and hence Data can be of type vtkCompositeData, which is not a vtkDataset. To simplify implementations this function always returns a vtkDataSet, and for a pipeline it will be the dataset of the currently selected frame. Note that the returned value could be None, if no data is set at all.
|
||||
File extension is automatically detected from data type.
|
||||
"""
|
||||
...
|
||||
|
||||
def getDataSet(self) -> vtkDataSet:
|
||||
"""
|
||||
Returns the current output dataset.
|
||||
For normal filters this is equal to the objects Data property output.
|
||||
However, a pipelines Data property could store multiple frames, and hence
|
||||
Data can be of type vtkCompositeData, which is not a vtkDataset.
|
||||
|
||||
To simplify implementations this function always returns a vtkDataSet,
|
||||
and for a pipeline it will be the dataset of the currently selected frame.
|
||||
|
||||
Note that the returned value could be None, if no data is set at all.
|
||||
"""
|
||||
...
|
||||
|
||||
@@ -1,8 +1,15 @@
|
||||
from typing import Any
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, overload, TypeAlias
|
||||
|
||||
from Base.Metadata import export
|
||||
|
||||
from Base.Unit import Unit
|
||||
from Fem.FemPostObject import FemPostObject
|
||||
from App.DocumentObject import DocumentObject
|
||||
|
||||
vtkAlgorithm: TypeAlias = object
|
||||
|
||||
@export(
|
||||
Include="Mod/Fem/App/FemPostPipeline.h",
|
||||
@@ -18,52 +25,79 @@ class FemPostPipeline(FemPostObject):
|
||||
License: LGPL-2.1-or-later
|
||||
"""
|
||||
|
||||
def read(self) -> Any:
|
||||
"""read(filepath)
|
||||
read([filepaths], [values], unit, frame_type)
|
||||
@overload
|
||||
def read(self, file_name: str, /) -> None: ...
|
||||
@overload
|
||||
def read(
|
||||
self,
|
||||
files: list[str] | tuple[str],
|
||||
values: list[int] | tuple[int],
|
||||
unit: Unit,
|
||||
frame_type: str,
|
||||
/,
|
||||
) -> None: ...
|
||||
def read(self, *args) -> None:
|
||||
"""
|
||||
Reads in a single vtk file or creates a multiframe result by reading in multiple result files.
|
||||
|
||||
Reads in a single vtk file or creates a multiframe result by reading in multiple result files. If multiframe is wanted, 4 argumenhts are needed:
|
||||
If multiframe is wanted, 4 argumenhts are needed:
|
||||
1. List of result files each being one frame,
|
||||
2. List of values valid for each frame (e.g. [s] if time data),
|
||||
3. the unit of the value as FreeCAD.Units.Unit,
|
||||
4. the Description of the frame type"""
|
||||
4. the Description of the frame type
|
||||
"""
|
||||
...
|
||||
|
||||
def scale(self) -> Any:
|
||||
def scale(self, scale: float, /) -> None:
|
||||
"""scale the points of a loaded vtk file"""
|
||||
...
|
||||
|
||||
def load(self) -> Any:
|
||||
"""load(result_object)
|
||||
load([result_objects], [values], unit, frame_type)
|
||||
@overload
|
||||
def load(self, obj: DocumentObject, /) -> None: ...
|
||||
@overload
|
||||
def load(
|
||||
self,
|
||||
result: list[DocumentObject] | tuple[DocumentObject],
|
||||
values: list[float] | tuple[float],
|
||||
unit: Unit,
|
||||
frame_type: str,
|
||||
/,
|
||||
) -> None: ...
|
||||
def load(self, *args) -> Any:
|
||||
"""
|
||||
Load a single result object or create a multiframe result by loading multiple result frames.
|
||||
|
||||
Load a single result object or create a multiframe result by loading multiple result frames. If multiframe is wanted, 4 argumenhts are needed:
|
||||
1. List of result files each being one frame,
|
||||
If multiframe is wanted, 4 argumenhts are needed:
|
||||
1. List of result objects each being one frame,
|
||||
2. List of values valid for each frame (e.g. [s] if time data),
|
||||
3. the unit of the value as FreeCAD.Units.Unit,
|
||||
4. the Description of the frame type"""
|
||||
4. the Description of the frame type
|
||||
"""
|
||||
...
|
||||
|
||||
def getFilter(self) -> Any:
|
||||
def getFilter(self) -> list[object]:
|
||||
"""Returns all filters, that this pipeline uses (non recursive, result does not contain branch child filters)"""
|
||||
...
|
||||
|
||||
def recomputeChildren(self) -> Any:
|
||||
def recomputeChildren(self) -> None:
|
||||
"""Recomputes all children of the pipeline"""
|
||||
...
|
||||
|
||||
def getLastPostObject(self) -> Any:
|
||||
def getLastPostObject(self) -> DocumentObject | None:
|
||||
"""Get the last post-processing object"""
|
||||
...
|
||||
|
||||
def holdsPostObject(self) -> Any:
|
||||
def holdsPostObject(self, obj: DocumentObject, /) -> bool:
|
||||
"""Check if this pipeline holds a given post-processing object"""
|
||||
...
|
||||
|
||||
def renameArrays(self) -> Any:
|
||||
def renameArrays(self, names: dict[str, str], /) -> None:
|
||||
"""Change name of data arrays"""
|
||||
...
|
||||
|
||||
def getOutputAlgorithm(self) -> Any:
|
||||
"""Returns the pipeline vtk algorithm, which generates the data passed to the pipelines filters. Note that the output algorithm may change depending on pipeline settings."""
|
||||
def getOutputAlgorithm(self) -> vtkAlgorithm:
|
||||
"""Returns the pipeline vtk algorithm, which generates the data passed to the pipelines filters.
|
||||
|
||||
Note that the output algorithm may change depending on pipeline settings.
|
||||
"""
|
||||
...
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Final
|
||||
|
||||
from Base.Metadata import export
|
||||
@@ -16,17 +20,17 @@ class ViewProviderFemConstraint(ViewProviderGeometryObject):
|
||||
License: LGPL-2.1-or-later
|
||||
"""
|
||||
|
||||
def loadSymbol(self) -> Any:
|
||||
"""loadSymbol(filename) -> None
|
||||
|
||||
def loadSymbol(self, file_name: str, /) -> Any:
|
||||
"""
|
||||
Load constraint symbol from Open Inventor file.
|
||||
The file structure should be as follows:
|
||||
A separator containing a separator with the symbol used in
|
||||
multiple copies at points on the surface and an optional
|
||||
separator with a symbol excluded from multiple copies.
|
||||
|
||||
filename : str
|
||||
Open Inventor file."""
|
||||
file_name : str
|
||||
Open Inventor file.
|
||||
"""
|
||||
...
|
||||
SymbolNode: Final[Any]
|
||||
"""A pivy SoSeparator with the nodes of the constraint symbols"""
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Final
|
||||
|
||||
from Base.Metadata import export
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from Base.Metadata import export
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from Base.Metadata import export
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from Base.Metadata import export
|
||||
@@ -19,6 +23,7 @@ class StepShape(PyObjectBase):
|
||||
"""
|
||||
|
||||
def read(self) -> Any:
|
||||
"""method read()
|
||||
Read a STEP file into memory and make it accessible"""
|
||||
"""
|
||||
Read a STEP file into memory and make it accessible
|
||||
"""
|
||||
...
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import export
|
||||
from Base.BaseClass import BaseClass
|
||||
from Base.Metadata import constmethod
|
||||
@@ -10,7 +14,7 @@ from typing import Final, List, Any
|
||||
Namespace="Materials",
|
||||
Include="Mod/Material/App/MaterialValue.h",
|
||||
Delete=True,
|
||||
Constructor=True
|
||||
Constructor=True,
|
||||
)
|
||||
class Array2D(BaseClass):
|
||||
"""
|
||||
@@ -33,20 +37,20 @@ class Array2D(BaseClass):
|
||||
"""The number of columns in the array."""
|
||||
|
||||
@constmethod
|
||||
def getRow(self, value: Any) -> Any:
|
||||
def getRow(self, value: Any, /) -> Any:
|
||||
"""
|
||||
Get the row given the first column value
|
||||
"""
|
||||
...
|
||||
|
||||
@constmethod
|
||||
def getValue(self, row: int, column: int) -> Any:
|
||||
def getValue(self, row: int, column: int, /) -> Any:
|
||||
"""
|
||||
Get the value at the given row and column
|
||||
"""
|
||||
...
|
||||
|
||||
def setValue(self, row: int, column: int, value: Any):
|
||||
def setValue(self, row: int, column: int, value: Any, /):
|
||||
"""
|
||||
Set the value at the given row and column
|
||||
"""
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import export, constmethod
|
||||
from Base.BaseClass import BaseClass
|
||||
from typing import Any, Final, List
|
||||
@@ -9,7 +13,7 @@ from typing import Any, Final, List
|
||||
Namespace="Materials",
|
||||
Include="Mod/Material/App/MaterialValue.h",
|
||||
Delete=True,
|
||||
Constructor=True
|
||||
Constructor=True,
|
||||
)
|
||||
class Array3D(BaseClass):
|
||||
"""
|
||||
@@ -52,19 +56,19 @@ class Array3D(BaseClass):
|
||||
"""
|
||||
...
|
||||
|
||||
def setDepthValue(self, value: Any):
|
||||
def setDepthValue(self, value: Any, /):
|
||||
"""
|
||||
Set the column value at the given depth
|
||||
"""
|
||||
...
|
||||
|
||||
def setValue(self, depth: int, row: int, column: int, value: Any):
|
||||
def setValue(self, depth: int, row: int, column: int, value: Any, /):
|
||||
"""
|
||||
Set the value at the given depth, row, and column
|
||||
"""
|
||||
...
|
||||
|
||||
def setRows(self, depth: int, value: int):
|
||||
def setRows(self, depth: int, value: int, /):
|
||||
"""
|
||||
Set the number of rows at the given depth
|
||||
"""
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import export, no_args, sequence_protocol
|
||||
from Base.BaseClass import BaseClass
|
||||
from typing import Final, Dict
|
||||
from typing import Final
|
||||
|
||||
|
||||
@export(
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
from Base.Metadata import export, constmethod
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import export
|
||||
from Base.BaseClass import BaseClass
|
||||
from typing import List
|
||||
|
||||
@@ -24,4 +28,4 @@ class MaterialFilter(BaseClass):
|
||||
"""Materials must include the specified models."""
|
||||
|
||||
RequiredCompleteModels: List = ...
|
||||
"""Materials must have complete versions of the specified models."""
|
||||
"""Materials must have complete versions of the specified models."""
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import export
|
||||
from Base.BaseClass import BaseClass
|
||||
|
||||
@@ -6,7 +10,7 @@ from Base.BaseClass import BaseClass
|
||||
Include="Mod/Material/App/MaterialFilter.h",
|
||||
Namespace="Materials",
|
||||
Constructor=True,
|
||||
Delete=True
|
||||
Delete=True,
|
||||
)
|
||||
class MaterialFilterOptions(BaseClass):
|
||||
"""
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
from Base.Metadata import export, constmethod
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import export
|
||||
from Base.BaseClass import BaseClass
|
||||
from typing import Final
|
||||
|
||||
|
||||
@export(
|
||||
Include="Mod/Material/App/MaterialLibrary.h",
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
from Base.Metadata import export, constmethod
|
||||
from Base.BaseClass import BaseClass
|
||||
from typing import Final, List, Dict, overload
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
@export(
|
||||
Include="Mod/Material/App/MaterialManager.h",
|
||||
Namespace="Materials",
|
||||
Constructor=True
|
||||
)
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import export
|
||||
from Base.BaseClass import BaseClass
|
||||
from typing import Final, List, Dict
|
||||
|
||||
|
||||
@export(Include="Mod/Material/App/MaterialManager.h", Namespace="Materials", Constructor=True)
|
||||
class MaterialManager(BaseClass):
|
||||
"""
|
||||
Material descriptions.
|
||||
|
||||
|
||||
Author: DavidCarter (dcarter@davidcarter.ca)
|
||||
Licence: LGPL
|
||||
"""
|
||||
@@ -67,4 +68,4 @@ class MaterialManager(BaseClass):
|
||||
"""
|
||||
Refreshes the material tree. Use sparingly as this is an expensive operation.
|
||||
"""
|
||||
...
|
||||
...
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import export
|
||||
from ModelProperty import ModelProperty
|
||||
from typing import Final
|
||||
|
||||
|
||||
@export(
|
||||
Include="Mod/Material/App/Materials.h",
|
||||
Namespace="Materials",
|
||||
@@ -13,7 +18,7 @@ from typing import Final
|
||||
class MaterialProperty(ModelProperty):
|
||||
"""
|
||||
Material property descriptions.
|
||||
|
||||
|
||||
Author: DavidCarter (dcarter@davidcarter.ca)
|
||||
Licence: LGPL
|
||||
"""
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
from Base.Metadata import export, constmethod
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import export
|
||||
from Base.BaseClass import BaseClass
|
||||
from typing import Final, List, Dict, overload
|
||||
from typing import Final, List, Dict
|
||||
|
||||
|
||||
@export(
|
||||
Include="Mod/Material/App/Model.h",
|
||||
@@ -15,49 +20,49 @@ class Model(BaseClass):
|
||||
Author: DavidCarter (dcarter@davidcarter.ca)
|
||||
Licence: LGPL
|
||||
"""
|
||||
|
||||
|
||||
LibraryName: Final[str] = ""
|
||||
"""Model library name."""
|
||||
|
||||
|
||||
LibraryRoot: Final[str] = ""
|
||||
"""Model library path."""
|
||||
|
||||
|
||||
LibraryIcon: Final[bytes] = ""
|
||||
"""Model icon."""
|
||||
|
||||
|
||||
Name: str = ""
|
||||
"""Model name."""
|
||||
|
||||
|
||||
Type: str = ""
|
||||
"""Model type."""
|
||||
|
||||
|
||||
Directory: str = ""
|
||||
"""Model directory."""
|
||||
|
||||
|
||||
UUID: Final[str] = ""
|
||||
"""Unique model identifier."""
|
||||
|
||||
|
||||
Description: str = ""
|
||||
"""Description of the model."""
|
||||
|
||||
|
||||
URL: str = ""
|
||||
"""URL to a detailed description of the model."""
|
||||
|
||||
|
||||
DOI: str = ""
|
||||
"""Digital Object Identifier (see https://doi.org/)"""
|
||||
|
||||
|
||||
Inherited: Final[List[str]] = []
|
||||
"""List of inherited models identified by UUID."""
|
||||
|
||||
|
||||
Properties: Final[Dict[str, str]] = {}
|
||||
"""Dictionary of model properties."""
|
||||
|
||||
|
||||
def addInheritance(self) -> None:
|
||||
"""
|
||||
Add an inherited model.
|
||||
"""
|
||||
...
|
||||
|
||||
|
||||
def addProperty(self) -> None:
|
||||
"""
|
||||
Add a model property.
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
from Base.Metadata import export, constmethod
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import export
|
||||
from Base.BaseClass import BaseClass
|
||||
from typing import Final, List, Dict
|
||||
|
||||
@export(
|
||||
Include="Mod/Material/App/ModelManager.h",
|
||||
Namespace="Materials",
|
||||
Constructor=True
|
||||
)
|
||||
|
||||
@export(Include="Mod/Material/App/ModelManager.h", Namespace="Materials", Constructor=True)
|
||||
class ModelManager(BaseClass):
|
||||
"""
|
||||
Material model descriptions.
|
||||
@@ -24,13 +25,13 @@ class ModelManager(BaseClass):
|
||||
Models: Final[Dict] = ...
|
||||
"""List of model libraries."""
|
||||
|
||||
def getModel(self) -> ...:
|
||||
def getModel(self) ->...:
|
||||
"""
|
||||
Get a model object by specifying its UUID
|
||||
"""
|
||||
...
|
||||
|
||||
def getModelByPath(self) -> ...:
|
||||
def getModelByPath(self) ->...:
|
||||
"""
|
||||
Get a model object by specifying its path
|
||||
"""
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
from Base.Metadata import export, constmethod
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import export
|
||||
from Base.BaseClass import BaseClass
|
||||
from typing import Final
|
||||
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
from Base.Metadata import export, constmethod
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import export
|
||||
from Base.BaseClass import BaseClass
|
||||
from typing import Final
|
||||
|
||||
|
||||
@export(
|
||||
PythonName="Material.UUIDs",
|
||||
Twin="ModelUUIDs",
|
||||
@@ -14,7 +19,7 @@ from typing import Final
|
||||
class UUIDs(BaseClass):
|
||||
"""
|
||||
Material model UUID identifiers.
|
||||
|
||||
|
||||
Author: DavidCarter (dcarter@davidcarter.ca)
|
||||
Licence: LGPL
|
||||
"""
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
from Metadata import export, constmethod, forward_declarations, class_declarations, sequence_protocol
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Metadata import (
|
||||
export,
|
||||
)
|
||||
from Base.BaseClass import BaseClass
|
||||
from typing import Final, overload
|
||||
|
||||
|
||||
@export(
|
||||
Twin="MaterialTreeWidget",
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import export
|
||||
|
||||
from App.DocumentObject import DocumentObject
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from Base.BaseClass import BaseClass
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import export
|
||||
from Base.PyObjectBase import PyObjectBase
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
from typing import Final
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Final, Any
|
||||
|
||||
from Base.Metadata import export
|
||||
from Base.PyObjectBase import PyObjectBase
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Final
|
||||
|
||||
from Base.Metadata import export
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Final
|
||||
|
||||
from Base.Metadata import constmethod, export
|
||||
from Base.Metadata import constmethod, export, class_declarations
|
||||
|
||||
from App.ComplexGeoData import ComplexGeoData
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from Base.Metadata import export
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Final
|
||||
|
||||
from Base.Metadata import export
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
from Gui.ViewProviderGeometryObject import ViewProviderGeometryObject
|
||||
from Base.Metadata import export
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import export
|
||||
from TrimmedCurve import TrimmedCurve
|
||||
from Geometry import Geom_Circle, Geom_Ellipse
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import export
|
||||
from ArcOfConic import ArcOfConic
|
||||
from typing import Final
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import export
|
||||
from Base.Vector import Vector
|
||||
from TrimmedCurve import TrimmedCurve
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import export
|
||||
from ArcOfConic import ArcOfConic
|
||||
from typing import Final
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from Base.Metadata import export
|
||||
from Part.ArcOfConic import ArcOfConic
|
||||
from typing import Final
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user