mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 04:59:00 +08:00
CURA-5330 Add typing to CuraSceneNode
This commit is contained in:
parent
8c2ba64f32
commit
7f34d7615e
@ -39,6 +39,9 @@ class CuraSceneNode(SceneNode):
|
|||||||
# TODO The best way to do it is by adding the setActiveExtruder decorator to every node when is loaded
|
# TODO The best way to do it is by adding the setActiveExtruder decorator to every node when is loaded
|
||||||
def getPrintingExtruder(self) -> Optional[ExtruderStack]:
|
def getPrintingExtruder(self) -> Optional[ExtruderStack]:
|
||||||
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
||||||
|
if global_container_stack is None:
|
||||||
|
return None
|
||||||
|
|
||||||
per_mesh_stack = self.callDecoration("getStack")
|
per_mesh_stack = self.callDecoration("getStack")
|
||||||
extruders = list(global_container_stack.extruders.values())
|
extruders = list(global_container_stack.extruders.values())
|
||||||
|
|
||||||
@ -85,7 +88,7 @@ class CuraSceneNode(SceneNode):
|
|||||||
## Return if the provided bbox collides with the bbox of this scene node
|
## Return if the provided bbox collides with the bbox of this scene node
|
||||||
def collidesWithBbox(self, check_bbox: AxisAlignedBox) -> bool:
|
def collidesWithBbox(self, check_bbox: AxisAlignedBox) -> bool:
|
||||||
bbox = self.getBoundingBox()
|
bbox = self.getBoundingBox()
|
||||||
|
if bbox is not None:
|
||||||
# Mark the node as outside the build volume if the bounding box test fails.
|
# Mark the node as outside the build volume if the bounding box test fails.
|
||||||
if check_bbox.intersectsBox(bbox) != AxisAlignedBox.IntersectionResult.FullIntersection:
|
if check_bbox.intersectsBox(bbox) != AxisAlignedBox.IntersectionResult.FullIntersection:
|
||||||
return True
|
return True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user