mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-16 13:46:54 +00:00
Refactor BrickStore.root_classes
This commit is contained in:
@@ -47,13 +47,13 @@ def get_namespaces(self, context):
|
|||||||
|
|
||||||
|
|
||||||
def get_brick_entity_classes(self, context):
|
def get_brick_entity_classes(self, context):
|
||||||
entity = context.scene.BIMBrickProperties.brick_entity_create_type
|
entity = self.brick_entity_create_type
|
||||||
return BrickStore.entity_classes[entity]
|
return BrickStore.entity_classes[entity]
|
||||||
|
|
||||||
|
|
||||||
def get_brick_roots(self, context):
|
def get_brick_roots(self, context):
|
||||||
return BrickStore.root_classes
|
return [(root, root, "") for root in BrickStore.root_classes]
|
||||||
|
|
||||||
|
|
||||||
class Brick(PropertyGroup):
|
class Brick(PropertyGroup):
|
||||||
name: StringProperty(name="Name")
|
name: StringProperty(name="Name")
|
||||||
|
|||||||
@@ -345,7 +345,7 @@ class BrickStore:
|
|||||||
current_changesets = 0
|
current_changesets = 0
|
||||||
history_size = 64
|
history_size = 64
|
||||||
namespaces = []
|
namespaces = []
|
||||||
root_classes = [("Equipment", "Equipment", ""), ("Location", "Location", ""), ("System", "System", ""), ("Point", "Point", "")]
|
root_classes = ["Equipment", "Location", "System", "Point"]
|
||||||
entity_classes = {}
|
entity_classes = {}
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@@ -376,7 +376,7 @@ class BrickStore:
|
|||||||
@classmethod
|
@classmethod
|
||||||
def load_entity_classes(cls):
|
def load_entity_classes(cls):
|
||||||
|
|
||||||
for root_class, __, __ in BrickStore.root_classes:
|
for root_class in BrickStore.root_classes:
|
||||||
query = BrickStore.graph.query(
|
query = BrickStore.graph.query(
|
||||||
"""
|
"""
|
||||||
PREFIX brick: <https://brickschema.org/schema/Brick#>
|
PREFIX brick: <https://brickschema.org/schema/Brick#>
|
||||||
|
|||||||
Reference in New Issue
Block a user