Skip to content

Commit e9ca763

Browse files
committed
feat(isActive): adds is_active mesh_components objects
1 parent a03653d commit e9ca763

7 files changed

Lines changed: 17 additions & 4 deletions

File tree

requirements.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
opengeode-core==16.2.0
1+
opengeode-core==16.3.1-rc.2
22
opengeode-io==7.4.9
33
opengeode-inspector==6.8.18
4-
opengeode-geosciences==9.5.10
4+
opengeode-geosciences==9.5.11
55
opengeode-geosciencesio==5.8.11
66
geode-common==33.19.1
77
geode-viewables==3.3.5

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ markupsafe>=3
3131
# flask
3232
# jinja2
3333
# werkzeug
34-
opengeode-core==16.2.0
34+
opengeode-core==16.3.1-rc.2
3535
# via
3636
# -r requirements.in
3737
# geode-common
@@ -40,7 +40,7 @@ opengeode-core==16.2.0
4040
# opengeode-geosciencesio
4141
# opengeode-inspector
4242
# opengeode-io
43-
opengeode-geosciences==9.5.10
43+
opengeode-geosciences==9.5.11
4444
# via
4545
# -r requirements.in
4646
# geode-viewables

src/opengeodeweb_back/geode_objects/geode_brep.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ def items(self, id: og.uuid) -> list[og.ComponentID]:
9191
def component_name(self, id: og.uuid) -> str:
9292
return self.brep.brep_component(id).name() or ""
9393

94+
def is_active(self, id: og.uuid) -> bool:
95+
return self.brep.brep_component(id).is_active()
96+
9497
def inspect(self) -> og_inspector.BRepInspectionResult:
9598
return og_inspector.inspect_brep(self.brep)
9699

src/opengeodeweb_back/geode_objects/geode_model.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,6 @@ def items(self, id: og.uuid) -> list[og.ComponentID]: ...
3838

3939
@abstractmethod
4040
def component_name(self, id: og.uuid) -> str: ...
41+
42+
@abstractmethod
43+
def is_active(self, id: og.uuid) -> bool: ...

src/opengeodeweb_back/geode_objects/geode_section.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ def items(self, id: og.uuid) -> list[og.ComponentID]:
9393
def component_name(self, id: og.uuid) -> str:
9494
return self.section.section_component(id).name() or ""
9595

96+
def is_active(self, id: og.uuid) -> bool:
97+
return self.section.section_component(id).is_active()
98+
9699
def inspect(self) -> og_inspector.SectionInspectionResult:
97100
return og_inspector.inspect_section(self.section)
98101

src/opengeodeweb_back/utils_functions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ def model_components(
229229
"type": component_type,
230230
"boundaries": boundaries_uuid,
231231
"internals": internals_uuid,
232+
"is_active": model.is_active(id),
232233
}
233234
mesh_components.append(mesh_component_object)
234235

@@ -248,6 +249,7 @@ def model_components(
248249
"name": component_name,
249250
"type": component_type,
250251
"items": items_uuid,
252+
"is_active": model.is_active(id),
251253
}
252254
collection_components.append(collection_component_object)
253255
return {

tests/test_routes.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,7 @@ def test_model_components(client: FlaskClient) -> None:
456456
assert isinstance(mesh_component["internals"], list)
457457
for internal_uuid in mesh_component["internals"]:
458458
assert isinstance(internal_uuid, str)
459+
assert isinstance(mesh_component["is_active"], bool)
459460
assert name_is_uuid is True
460461
assert name_is_not_uuid is True
461462
assert "collection_components" in response.get_json()
@@ -468,6 +469,7 @@ def test_model_components(client: FlaskClient) -> None:
468469
assert isinstance(collection_component["items"], list)
469470
for item_uuid in collection_component["items"]:
470471
assert isinstance(item_uuid, str)
472+
assert isinstance(collection_component["is_active"], bool)
471473

472474

473475
def test_export_project_route(client: FlaskClient, tmp_path: Path) -> None:

0 commit comments

Comments
 (0)