mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-07 21:06:25 +00:00
Make Brick "root_classes" one source of truth
This commit is contained in:
@@ -52,11 +52,7 @@ def get_brick_entity_classes(self, context):
|
|||||||
|
|
||||||
|
|
||||||
def get_brick_roots(self, context):
|
def get_brick_roots(self, context):
|
||||||
return [("System", "System", ""),
|
return BrickStore.root_classes
|
||||||
("Location", "Location", ""),
|
|
||||||
("Equipment", "Equipment", ""),
|
|
||||||
("Point", "Point", "")
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
class Brick(PropertyGroup):
|
class Brick(PropertyGroup):
|
||||||
|
|||||||
@@ -345,6 +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", "")]
|
||||||
entity_classes = {}
|
entity_classes = {}
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@@ -374,8 +375,8 @@ class BrickStore:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def load_entity_classes(cls):
|
def load_entity_classes(cls):
|
||||||
root_classes = ["System", "Location", "Equipment", "Point"]
|
|
||||||
for root_class in 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