mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
typing
This commit is contained in:
@@ -21,7 +21,10 @@ import math
|
||||
import bmesh
|
||||
import ifcopenshell.util.unit
|
||||
from mathutils import Vector, Matrix
|
||||
from typing import Union, Optional, Literal, Any
|
||||
from typing import Union, Optional, Literal, Any, TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from blenderbim.bim.module.geometry.helper import Helper
|
||||
|
||||
|
||||
Z_AXIS = Vector((0, 0, 1))
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import ifcopenshell
|
||||
from typing import Any
|
||||
|
||||
|
||||
def map_representation(
|
||||
@@ -29,7 +30,10 @@ def map_representation(
|
||||
|
||||
|
||||
class Usecase:
|
||||
def execute(self):
|
||||
file: ifcopenshell.file
|
||||
settings: dict[str, Any]
|
||||
|
||||
def execute(self) -> ifcopenshell.entity_instance:
|
||||
mapping_source = self.get_mapping_source()
|
||||
|
||||
zero = self.file.createIfcCartesianPoint((0.0, 0.0, 0.0))
|
||||
@@ -49,7 +53,7 @@ class Usecase:
|
||||
}
|
||||
)
|
||||
|
||||
def get_mapping_source(self):
|
||||
def get_mapping_source(self) -> ifcopenshell.entity_instance:
|
||||
for inverse in self.file.get_inverse(self.settings["representation"]):
|
||||
if inverse.is_a("IfcRepresentationMap"):
|
||||
return inverse
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import ifcopenshell
|
||||
import ifcopenshell.api
|
||||
import ifcopenshell.util.element
|
||||
|
||||
|
||||
|
||||
@@ -351,7 +351,7 @@ def get_direct_task_outputs(task: ifcopenshell.entity_instance) -> list[ifcopens
|
||||
]
|
||||
|
||||
|
||||
def get_task_outputs(task: ifcopenshell.entity_instance, is_deep=False):
|
||||
def get_task_outputs(task: ifcopenshell.entity_instance, is_deep: bool = False) -> list[ifcopenshell.entity_instance]:
|
||||
if not is_deep:
|
||||
return get_direct_task_outputs(task)
|
||||
else:
|
||||
@@ -362,7 +362,7 @@ def get_task_outputs(task: ifcopenshell.entity_instance, is_deep=False):
|
||||
]
|
||||
|
||||
|
||||
def get_task_inputs(task: ifcopenshell.entity_instance, is_deep=False):
|
||||
def get_task_inputs(task: ifcopenshell.entity_instance, is_deep: bool = False) -> list[ifcopenshell.entity_instance]:
|
||||
if not is_deep:
|
||||
return [
|
||||
object
|
||||
@@ -385,7 +385,7 @@ def get_task_inputs(task: ifcopenshell.entity_instance, is_deep=False):
|
||||
]
|
||||
|
||||
|
||||
def get_task_resources(task: ifcopenshell.entity_instance, is_deep=False):
|
||||
def get_task_resources(task: ifcopenshell.entity_instance, is_deep: bool = False) -> list[ifcopenshell.entity_instance]:
|
||||
if not is_deep:
|
||||
return [
|
||||
object
|
||||
|
||||
Reference in New Issue
Block a user