Mark unsafe enums #5673

This commit is contained in:
Andrej730
2024-11-01 13:41:57 +05:00
parent f3019e4d7a
commit 3debf62ca6
12 changed files with 24 additions and 0 deletions
+1
View File
@@ -184,6 +184,7 @@ class BcfTopic(PropertyGroup):
is_editable: BoolProperty(name="Edit Topic Attributes", default=False, update=updateBcfTopicIsEditable)
# TODO: unsafe?
def get_related_topics(self: "BCFProperties", context: bpy.types.Context) -> list[tuple[str, str, str]]:
props = self
active_topic = props.active_topic
@@ -45,19 +45,23 @@ def get_libraries(self, context):
return BrickschemaReferencesData.data["libraries"]
# TODO: unsafe?
def get_namespaces(self, context):
return [(uri, f"{alias}: {uri}", "") for alias, uri in BrickStore.namespaces]
# TODO: unsafe?
def get_brick_entity_classes(self, context):
entity = self.brick_entity_create_type
return [(uri, uri.split("#")[-1], "") for uri in BrickStore.entity_classes[entity]]
# TODO: unsafe?
def get_brick_roots(self, context):
return [(root, root, "") for root in BrickStore.root_classes]
# TODO: unsafe?
def get_brick_relations(self, context):
relations = [(uri, uri.split("#")[-1], "") for uri in BrickStore.relationships]
for relation in BrickschemaData.data["active_relations"]:
@@ -33,6 +33,7 @@ from bpy.props import (
)
# TODO: unsafe?
def get_available_constraint_types(self, context):
version = tool.Ifc.get_schema()
return [(c, c, get_entity_doc(version, c).get("description", "")) for c in ["IfcObjective"]]
@@ -115,6 +115,7 @@ def get_schedule_predefined_types(self, context):
return CostSchedulesData.data["predefined_types"]
# TODO: unsafe?
def get_currencies(self, context):
return [
("USD", "USD", "Dollar"),
+1
View File
@@ -22,6 +22,7 @@ from bonsai.bim.prop import StrProperty
class BIMCityJsonProperties(PropertyGroup):
# TODO: unsafe?
def get_lods(self, context):
return [(item.name, "LOD" + item.name, "Level of Detail " + item.name) for item in self.lods]
@@ -270,6 +270,7 @@ class RadianceExporterProperties(PropertyGroup):
items=categories, name="Category", description="Material category", update=update_material_mapping
)
# TODO: unsafe?
def get_subcategories(self, context):
if self.category in spectraldb:
return [(k, k, "") for k in spectraldb[self.category].keys()]
@@ -48,6 +48,7 @@ def purge():
parameterizedprofileclasses_enum = []
# TODO: unsafe?
def get_profile_classes(self, context):
global profileclasses_enum
if len(profileclasses_enum) == 0 and IfcStore.get_schema():
@@ -60,6 +61,7 @@ def get_profile_classes(self, context):
return profileclasses_enum
# TODO: unsafe?
def get_parameterized_profile_classes(self, context):
global parameterizedprofileclasses_enum
if len(parameterizedprofileclasses_enum) == 0 and IfcStore.get_schema():
@@ -66,6 +66,7 @@ def update_actor_class(self, context):
ActorData.data["actors"] = ActorData.actors()
# TODO: unsafe?
def get_actor_class_enum(self, context):
version = tool.Ifc.get_schema()
return [
@@ -74,6 +75,7 @@ def get_actor_class_enum(self, context):
]
# TODO: unsafe?
def get_actor_type_enum(self, context):
version = tool.Ifc.get_schema()
return [
@@ -61,6 +61,7 @@ def blender_formatted_enum_from_psets(psets: list[ifcopenshell.entity_instance])
return enum_items
# TODO: unsafe?
def get_pset_name(self, context):
pset_type = repr(self)
prop_type = pset_type.split(".")[-1]
@@ -190,6 +191,7 @@ def get_work_schedule_pset_names(self, context):
return psetnames[ifc_class]
# TODO: unsafe?
def get_qto_name(self, context):
pset_type = repr(self)
prop_type = pset_type.split(".")[-1]
@@ -211,12 +213,14 @@ def get_object_qto_name(self, context):
return ObjectPsetsData.data["qto_name"]
# TODO: unsafe?
def get_template_type(self, context):
version = tool.Ifc.get_schema()
for t in ("IfcPropertySingleValue", "IfcPropertyEnumeratedValue"):
yield (t, t, ifcopenshell.util.doc.get_entity_doc(version, t).get("description", ""))
# TODO: unsafe?
def get_primary_measure_type(self, context):
if not AddEditCustomPropertiesData.is_loaded:
AddEditCustomPropertiesData.load()
@@ -79,6 +79,7 @@ def get_property_template_type(self, context):
return PsetTemplatesData.data["property_template_type"]
# TODO: unsafe?
def get_template_type(self, context):
return [
(
+3
View File
@@ -32,6 +32,7 @@ from bpy.props import (
)
# TODO: unsafe?
def get_qto_rule(self, context):
results = []
for rule_id, rule in ifc5d.qto.rules.items():
@@ -39,6 +40,7 @@ def get_qto_rule(self, context):
return results
# TODO: unsafe?
def get_calculator(self, context):
results = []
for name, calculator in ifc5d.qto.calculators.items():
@@ -46,6 +48,7 @@ def get_calculator(self, context):
return results
# TODO: unsafe?
def get_calculator_function(self, context):
calculator = ifc5d.qto.calculators[self.calculator]
results = []
@@ -82,10 +82,12 @@ def getTaskTimeColumns(self, context):
def getWorkSchedules(self, context):
# TODO: unsafe?
return [(str(k), v["Name"], "") for k, v in SequenceData.data["work_schedules"].items()]
def getWorkCalendars(self, context):
# TODO: unsafe?
return [(str(k), v["Name"], "") for k, v in SequenceData.data["work_calendars"].items()]
@@ -229,6 +231,7 @@ def updateTaskDuration(self, context):
tool.Sequence.refresh_task_resources()
# TODO: unsafe?
def get_schedule_predefined_types(self, context):
results = []
declaration = tool.Ifc().schema().declaration_by_name("IfcWorkSchedule")