OpenGeodeWeb-Back 5.10.0rc22__py3-none-any.whl → 5.14.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- opengeodeweb_back/app.py +173 -0
- opengeodeweb_back/app_config.py +1 -10
- opengeodeweb_back/geode_functions.py +44 -283
- opengeodeweb_back/geode_objects/__init__.py +61 -0
- opengeodeweb_back/geode_objects/geode_brep.py +102 -0
- opengeodeweb_back/geode_objects/geode_cross_section.py +75 -0
- opengeodeweb_back/geode_objects/geode_edged_curve2d.py +107 -0
- opengeodeweb_back/geode_objects/geode_edged_curve3d.py +107 -0
- opengeodeweb_back/geode_objects/geode_graph.py +76 -0
- opengeodeweb_back/geode_objects/geode_grid2d.py +30 -0
- opengeodeweb_back/geode_objects/geode_grid3d.py +30 -0
- opengeodeweb_back/geode_objects/geode_hybrid_solid3d.py +71 -0
- opengeodeweb_back/geode_objects/geode_implicit_cross_section.py +81 -0
- opengeodeweb_back/geode_objects/geode_implicit_structural_model.py +85 -0
- opengeodeweb_back/geode_objects/geode_light_regular_grid2d.py +72 -0
- opengeodeweb_back/geode_objects/geode_light_regular_grid3d.py +72 -0
- opengeodeweb_back/geode_objects/geode_mesh.py +19 -0
- opengeodeweb_back/geode_objects/geode_model.py +22 -0
- opengeodeweb_back/geode_objects/geode_object.py +78 -0
- opengeodeweb_back/geode_objects/geode_point_set2d.py +105 -0
- opengeodeweb_back/geode_objects/geode_point_set3d.py +105 -0
- opengeodeweb_back/geode_objects/geode_polygonal_surface2d.py +73 -0
- opengeodeweb_back/geode_objects/geode_polygonal_surface3d.py +73 -0
- opengeodeweb_back/geode_objects/geode_polyhedral_solid3d.py +73 -0
- opengeodeweb_back/geode_objects/geode_raster_image2d.py +83 -0
- opengeodeweb_back/geode_objects/geode_raster_image3d.py +83 -0
- opengeodeweb_back/geode_objects/geode_regular_grid2d.py +78 -0
- opengeodeweb_back/geode_objects/geode_regular_grid3d.py +78 -0
- opengeodeweb_back/geode_objects/geode_section.py +106 -0
- opengeodeweb_back/geode_objects/geode_solid_mesh3d.py +61 -0
- opengeodeweb_back/geode_objects/geode_structural_model.py +78 -0
- opengeodeweb_back/geode_objects/geode_surface_mesh2d.py +66 -0
- opengeodeweb_back/geode_objects/geode_surface_mesh3d.py +66 -0
- opengeodeweb_back/geode_objects/geode_tetrahedral_solid3d.py +73 -0
- opengeodeweb_back/geode_objects/geode_triangulated_surface2d.py +77 -0
- opengeodeweb_back/geode_objects/geode_triangulated_surface3d.py +77 -0
- opengeodeweb_back/geode_objects/geode_vertex_set.py +81 -0
- opengeodeweb_back/geode_objects/types.py +75 -0
- opengeodeweb_back/routes/blueprint_routes.py +352 -231
- opengeodeweb_back/routes/create/blueprint_create.py +121 -0
- opengeodeweb_back/routes/create/schemas/__init__.py +3 -0
- opengeodeweb_back/routes/create/schemas/create_aoi.json +45 -0
- opengeodeweb_back/routes/create/schemas/create_aoi.py +25 -0
- opengeodeweb_back/routes/create/schemas/create_point.json +29 -0
- opengeodeweb_back/routes/create/schemas/create_point.py +13 -0
- opengeodeweb_back/routes/create/schemas/create_voi.json +36 -0
- opengeodeweb_back/routes/create/schemas/create_voi.py +24 -0
- opengeodeweb_back/routes/models/blueprint_models.py +27 -27
- opengeodeweb_back/routes/models/schemas/__init__.py +2 -0
- opengeodeweb_back/routes/models/schemas/mesh_components.py +10 -0
- opengeodeweb_back/routes/models/schemas/vtm_component_indices.py +10 -0
- opengeodeweb_back/routes/schemas/__init__.py +17 -0
- opengeodeweb_back/routes/schemas/allowed_files.json +6 -8
- opengeodeweb_back/routes/schemas/allowed_files.py +10 -0
- opengeodeweb_back/routes/schemas/allowed_objects.json +1 -8
- opengeodeweb_back/routes/schemas/allowed_objects.py +10 -0
- opengeodeweb_back/routes/schemas/cell_attribute_names.json +13 -0
- opengeodeweb_back/routes/schemas/cell_attribute_names.py +10 -0
- opengeodeweb_back/routes/schemas/export_project.json +21 -0
- opengeodeweb_back/routes/schemas/export_project.py +12 -0
- opengeodeweb_back/routes/schemas/geode_objects_and_output_extensions.json +2 -2
- opengeodeweb_back/routes/schemas/geode_objects_and_output_extensions.py +11 -0
- opengeodeweb_back/routes/schemas/geographic_coordinate_systems.json +2 -2
- opengeodeweb_back/routes/schemas/geographic_coordinate_systems.py +10 -0
- opengeodeweb_back/routes/schemas/import_project.json +10 -0
- opengeodeweb_back/routes/schemas/import_project.py +10 -0
- opengeodeweb_back/routes/schemas/inspect_file.json +2 -2
- opengeodeweb_back/routes/schemas/inspect_file.py +11 -0
- opengeodeweb_back/routes/schemas/kill.json +10 -0
- opengeodeweb_back/routes/schemas/kill.py +10 -0
- opengeodeweb_back/routes/schemas/missing_files.json +2 -2
- opengeodeweb_back/routes/schemas/missing_files.py +11 -0
- opengeodeweb_back/routes/schemas/ping.py +10 -0
- opengeodeweb_back/routes/schemas/polygon_attribute_names.py +10 -0
- opengeodeweb_back/routes/schemas/polyhedron_attribute_names.py +10 -0
- opengeodeweb_back/routes/schemas/save_viewable_file.json +2 -2
- opengeodeweb_back/routes/schemas/save_viewable_file.py +11 -0
- opengeodeweb_back/routes/schemas/texture_coordinates.py +10 -0
- opengeodeweb_back/routes/schemas/upload_file.py +11 -0
- opengeodeweb_back/routes/schemas/vertex_attribute_names.py +10 -0
- opengeodeweb_back/test_utils.py +9 -3
- opengeodeweb_back/utils_functions.py +93 -88
- {opengeodeweb_back-5.10.0rc22.dist-info → opengeodeweb_back-5.14.1.dist-info}/METADATA +17 -22
- opengeodeweb_back-5.14.1.dist-info/RECORD +98 -0
- opengeodeweb_back-5.14.1.dist-info/entry_points.txt +2 -0
- opengeodeweb_back/geode_objects.py +0 -570
- opengeodeweb_back/routes/schemas/create_point.json +0 -29
- opengeodeweb_back-5.10.0rc22.dist-info/RECORD +0 -30
- {opengeodeweb_back-5.10.0rc22.dist-info → opengeodeweb_back-5.14.1.dist-info}/WHEEL +0 -0
- {opengeodeweb_back-5.10.0rc22.dist-info → opengeodeweb_back-5.14.1.dist-info}/licenses/LICENSE +0 -0
- {opengeodeweb_back-5.10.0rc22.dist-info → opengeodeweb_back-5.14.1.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Standard library imports
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
# Third party imports
|
|
5
|
+
import opengeode as og
|
|
6
|
+
import opengeode_inspector as og_inspector
|
|
7
|
+
import geode_viewables as viewables
|
|
8
|
+
|
|
9
|
+
# Local application imports
|
|
10
|
+
from .types import GeodeMeshType
|
|
11
|
+
from .geode_surface_mesh3d import GeodeSurfaceMesh3D
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class GeodePolygonalSurface3D(GeodeSurfaceMesh3D):
|
|
15
|
+
polygonal_surface: og.PolygonalSurface3D
|
|
16
|
+
|
|
17
|
+
def __init__(self, polygonal_surface: og.PolygonalSurface3D | None = None) -> None:
|
|
18
|
+
self.polygonal_surface = (
|
|
19
|
+
polygonal_surface
|
|
20
|
+
if polygonal_surface is not None
|
|
21
|
+
else og.PolygonalSurface3D.create()
|
|
22
|
+
)
|
|
23
|
+
super().__init__(self.polygonal_surface)
|
|
24
|
+
|
|
25
|
+
@classmethod
|
|
26
|
+
def geode_object_type(cls) -> GeodeMeshType:
|
|
27
|
+
return "PolygonalSurface3D"
|
|
28
|
+
|
|
29
|
+
def native_extension(self) -> str:
|
|
30
|
+
return self.polygonal_surface.native_extension()
|
|
31
|
+
|
|
32
|
+
def builder(self) -> og.PolygonalSurfaceBuilder3D:
|
|
33
|
+
return og.PolygonalSurfaceBuilder3D.create(self.polygonal_surface)
|
|
34
|
+
|
|
35
|
+
@classmethod
|
|
36
|
+
def load(cls, filename: str) -> GeodePolygonalSurface3D:
|
|
37
|
+
return GeodePolygonalSurface3D(og.load_polygonal_surface3D(filename))
|
|
38
|
+
|
|
39
|
+
@classmethod
|
|
40
|
+
def additional_files(cls, filename: str) -> og.AdditionalFiles:
|
|
41
|
+
return og.polygonal_surface_additional_files3D(filename)
|
|
42
|
+
|
|
43
|
+
@classmethod
|
|
44
|
+
def is_loadable(cls, filename: str) -> og.Percentage:
|
|
45
|
+
return og.is_polygonal_surface_loadable3D(filename)
|
|
46
|
+
|
|
47
|
+
@classmethod
|
|
48
|
+
def input_extensions(cls) -> list[str]:
|
|
49
|
+
return og.PolygonalSurfaceInputFactory3D.list_creators()
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def output_extensions(cls) -> list[str]:
|
|
53
|
+
return og.PolygonalSurfaceOutputFactory3D.list_creators()
|
|
54
|
+
|
|
55
|
+
@classmethod
|
|
56
|
+
def object_priority(cls, filename: str) -> int:
|
|
57
|
+
return og.polygonal_surface_object_priority3D(filename)
|
|
58
|
+
|
|
59
|
+
def is_saveable(self, filename: str) -> bool:
|
|
60
|
+
return og.is_polygonal_surface_saveable3D(self.polygonal_surface, filename)
|
|
61
|
+
|
|
62
|
+
def save(self, filename: str) -> list[str]:
|
|
63
|
+
return og.save_polygonal_surface3D(self.polygonal_surface, filename)
|
|
64
|
+
|
|
65
|
+
def save_viewable(self, filename_without_extension: str) -> str:
|
|
66
|
+
return viewables.save_viewable_polygonal_surface3D(
|
|
67
|
+
self.polygonal_surface, filename_without_extension
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
def save_light_viewable(self, filename_without_extension: str) -> str:
|
|
71
|
+
return viewables.save_light_viewable_polygonal_surface3D(
|
|
72
|
+
self.polygonal_surface, filename_without_extension
|
|
73
|
+
)
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Standard library imports
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
# Third party imports
|
|
5
|
+
import opengeode as og
|
|
6
|
+
import opengeode_inspector as og_inspector
|
|
7
|
+
import geode_viewables as viewables
|
|
8
|
+
|
|
9
|
+
# Local application imports
|
|
10
|
+
from .types import GeodeMeshType
|
|
11
|
+
from .geode_solid_mesh3d import GeodeSolidMesh3D
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class GeodePolyhedralSolid3D(GeodeSolidMesh3D):
|
|
15
|
+
polyhedral_solid: og.PolyhedralSolid3D
|
|
16
|
+
|
|
17
|
+
def __init__(self, polyhedral_solid: og.PolyhedralSolid3D | None = None) -> None:
|
|
18
|
+
self.polyhedral_solid = (
|
|
19
|
+
polyhedral_solid
|
|
20
|
+
if polyhedral_solid is not None
|
|
21
|
+
else og.PolyhedralSolid3D.create()
|
|
22
|
+
)
|
|
23
|
+
super().__init__(self.polyhedral_solid)
|
|
24
|
+
|
|
25
|
+
@classmethod
|
|
26
|
+
def geode_object_type(cls) -> GeodeMeshType:
|
|
27
|
+
return "PolyhedralSolid3D"
|
|
28
|
+
|
|
29
|
+
def native_extension(self) -> str:
|
|
30
|
+
return self.polyhedral_solid.native_extension()
|
|
31
|
+
|
|
32
|
+
def builder(self) -> og.PolyhedralSolidBuilder3D:
|
|
33
|
+
return og.PolyhedralSolidBuilder3D.create(self.polyhedral_solid)
|
|
34
|
+
|
|
35
|
+
@classmethod
|
|
36
|
+
def load(cls, filename: str) -> GeodePolyhedralSolid3D:
|
|
37
|
+
return GeodePolyhedralSolid3D(og.load_polyhedral_solid3D(filename))
|
|
38
|
+
|
|
39
|
+
@classmethod
|
|
40
|
+
def additional_files(cls, filename: str) -> og.AdditionalFiles:
|
|
41
|
+
return og.polyhedral_solid_additional_files3D(filename)
|
|
42
|
+
|
|
43
|
+
@classmethod
|
|
44
|
+
def is_loadable(cls, filename: str) -> og.Percentage:
|
|
45
|
+
return og.is_polyhedral_solid_loadable3D(filename)
|
|
46
|
+
|
|
47
|
+
@classmethod
|
|
48
|
+
def input_extensions(cls) -> list[str]:
|
|
49
|
+
return og.PolyhedralSolidInputFactory3D.list_creators()
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def output_extensions(cls) -> list[str]:
|
|
53
|
+
return og.PolyhedralSolidOutputFactory3D.list_creators()
|
|
54
|
+
|
|
55
|
+
@classmethod
|
|
56
|
+
def object_priority(cls, filename: str) -> int:
|
|
57
|
+
return og.polyhedral_solid_object_priority3D(filename)
|
|
58
|
+
|
|
59
|
+
def is_saveable(self, filename: str) -> bool:
|
|
60
|
+
return og.is_polyhedral_solid_saveable3D(self.polyhedral_solid, filename)
|
|
61
|
+
|
|
62
|
+
def save(self, filename: str) -> list[str]:
|
|
63
|
+
return og.save_polyhedral_solid3D(self.polyhedral_solid, filename)
|
|
64
|
+
|
|
65
|
+
def save_viewable(self, filename_without_extension: str) -> str:
|
|
66
|
+
return viewables.save_viewable_polyhedral_solid3D(
|
|
67
|
+
self.polyhedral_solid, filename_without_extension
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
def save_light_viewable(self, filename_without_extension: str) -> str:
|
|
71
|
+
return viewables.save_light_viewable_polyhedral_solid3D(
|
|
72
|
+
self.polyhedral_solid, filename_without_extension
|
|
73
|
+
)
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Standard library imports
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
# Third party imports
|
|
5
|
+
import opengeode as og
|
|
6
|
+
import opengeode_inspector as og_inspector
|
|
7
|
+
import geode_viewables as viewables
|
|
8
|
+
|
|
9
|
+
# Local application imports
|
|
10
|
+
from .types import GeodeMeshType
|
|
11
|
+
from .geode_mesh import GeodeMesh
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class GeodeRasterImage2D(GeodeMesh):
|
|
15
|
+
raster_image: og.RasterImage2D
|
|
16
|
+
|
|
17
|
+
def __init__(self, raster_image: og.RasterImage2D) -> None:
|
|
18
|
+
self.raster_image = raster_image
|
|
19
|
+
super().__init__(self.raster_image)
|
|
20
|
+
|
|
21
|
+
@classmethod
|
|
22
|
+
def geode_object_type(cls) -> GeodeMeshType:
|
|
23
|
+
return "RasterImage2D"
|
|
24
|
+
|
|
25
|
+
def native_extension(self) -> str:
|
|
26
|
+
return self.raster_image.native_extension()
|
|
27
|
+
|
|
28
|
+
@classmethod
|
|
29
|
+
def is_3D(cls) -> bool:
|
|
30
|
+
return False
|
|
31
|
+
|
|
32
|
+
@classmethod
|
|
33
|
+
def is_viewable(cls) -> bool:
|
|
34
|
+
return True
|
|
35
|
+
|
|
36
|
+
def builder(self) -> None:
|
|
37
|
+
return None
|
|
38
|
+
|
|
39
|
+
@classmethod
|
|
40
|
+
def load(cls, filename: str) -> GeodeRasterImage2D:
|
|
41
|
+
return GeodeRasterImage2D(og.load_raster_image2D(filename))
|
|
42
|
+
|
|
43
|
+
@classmethod
|
|
44
|
+
def additional_files(cls, filename: str) -> og.AdditionalFiles:
|
|
45
|
+
return og.raster_image_additional_files2D(filename)
|
|
46
|
+
|
|
47
|
+
@classmethod
|
|
48
|
+
def is_loadable(cls, filename: str) -> og.Percentage:
|
|
49
|
+
return og.is_raster_image_loadable2D(filename)
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def input_extensions(cls) -> list[str]:
|
|
53
|
+
return og.RasterImageInputFactory2D.list_creators()
|
|
54
|
+
|
|
55
|
+
@classmethod
|
|
56
|
+
def output_extensions(cls) -> list[str]:
|
|
57
|
+
return og.RasterImageOutputFactory2D.list_creators()
|
|
58
|
+
|
|
59
|
+
@classmethod
|
|
60
|
+
def object_priority(cls, filename: str) -> int:
|
|
61
|
+
return og.raster_image_object_priority2D(filename)
|
|
62
|
+
|
|
63
|
+
def is_saveable(self, filename: str) -> bool:
|
|
64
|
+
return og.is_raster_image_saveable2D(self.raster_image, filename)
|
|
65
|
+
|
|
66
|
+
def save(self, filename: str) -> list[str]:
|
|
67
|
+
return og.save_raster_image2D(self.raster_image, filename)
|
|
68
|
+
|
|
69
|
+
def save_viewable(self, filename_without_extension: str) -> str:
|
|
70
|
+
return viewables.save_viewable_raster_image2D(
|
|
71
|
+
self.raster_image, filename_without_extension
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
def save_light_viewable(self, filename_without_extension: str) -> str:
|
|
75
|
+
return viewables.save_light_viewable_raster_image2D(
|
|
76
|
+
self.raster_image, filename_without_extension
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
def inspect(self) -> None:
|
|
80
|
+
return None
|
|
81
|
+
|
|
82
|
+
def vertex_attribute_manager(self) -> og.AttributeManager:
|
|
83
|
+
return og.AttributeManager()
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Standard library imports
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
# Third party imports
|
|
5
|
+
import opengeode as og
|
|
6
|
+
import opengeode_inspector as og_inspector
|
|
7
|
+
import geode_viewables as viewables
|
|
8
|
+
|
|
9
|
+
# Local application imports
|
|
10
|
+
from .types import GeodeMeshType
|
|
11
|
+
from .geode_mesh import GeodeMesh
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class GeodeRasterImage3D(GeodeMesh):
|
|
15
|
+
raster_image: og.RasterImage3D
|
|
16
|
+
|
|
17
|
+
def __init__(self, raster_image: og.RasterImage3D) -> None:
|
|
18
|
+
self.raster_image = raster_image
|
|
19
|
+
super().__init__(self.raster_image)
|
|
20
|
+
|
|
21
|
+
@classmethod
|
|
22
|
+
def geode_object_type(cls) -> GeodeMeshType:
|
|
23
|
+
return "RasterImage3D"
|
|
24
|
+
|
|
25
|
+
def native_extension(self) -> str:
|
|
26
|
+
return self.raster_image.native_extension()
|
|
27
|
+
|
|
28
|
+
@classmethod
|
|
29
|
+
def is_3D(cls) -> bool:
|
|
30
|
+
return True
|
|
31
|
+
|
|
32
|
+
@classmethod
|
|
33
|
+
def is_viewable(cls) -> bool:
|
|
34
|
+
return True
|
|
35
|
+
|
|
36
|
+
def builder(self) -> None:
|
|
37
|
+
return None
|
|
38
|
+
|
|
39
|
+
@classmethod
|
|
40
|
+
def load(cls, filename: str) -> GeodeRasterImage3D:
|
|
41
|
+
return GeodeRasterImage3D(og.load_raster_image3D(filename))
|
|
42
|
+
|
|
43
|
+
@classmethod
|
|
44
|
+
def additional_files(cls, filename: str) -> og.AdditionalFiles:
|
|
45
|
+
return og.raster_image_additional_files3D(filename)
|
|
46
|
+
|
|
47
|
+
@classmethod
|
|
48
|
+
def is_loadable(cls, filename: str) -> og.Percentage:
|
|
49
|
+
return og.is_raster_image_loadable3D(filename)
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def input_extensions(cls) -> list[str]:
|
|
53
|
+
return og.RasterImageInputFactory3D.list_creators()
|
|
54
|
+
|
|
55
|
+
@classmethod
|
|
56
|
+
def output_extensions(cls) -> list[str]:
|
|
57
|
+
return og.RasterImageOutputFactory3D.list_creators()
|
|
58
|
+
|
|
59
|
+
@classmethod
|
|
60
|
+
def object_priority(cls, filename: str) -> int:
|
|
61
|
+
return og.raster_image_object_priority3D(filename)
|
|
62
|
+
|
|
63
|
+
def is_saveable(self, filename: str) -> bool:
|
|
64
|
+
return og.is_raster_image_saveable3D(self.raster_image, filename)
|
|
65
|
+
|
|
66
|
+
def save(self, filename: str) -> list[str]:
|
|
67
|
+
return og.save_raster_image3D(self.raster_image, filename)
|
|
68
|
+
|
|
69
|
+
def save_viewable(self, filename_without_extension: str) -> str:
|
|
70
|
+
return viewables.save_viewable_raster_image3D(
|
|
71
|
+
self.raster_image, filename_without_extension
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
def save_light_viewable(self, filename_without_extension: str) -> str:
|
|
75
|
+
return viewables.save_light_viewable_raster_image3D(
|
|
76
|
+
self.raster_image, filename_without_extension
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
def inspect(self) -> None:
|
|
80
|
+
return None
|
|
81
|
+
|
|
82
|
+
def vertex_attribute_manager(self) -> og.AttributeManager:
|
|
83
|
+
return og.AttributeManager()
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Standard library imports
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
# Third party imports
|
|
5
|
+
import opengeode as og
|
|
6
|
+
import opengeode_inspector as og_inspector
|
|
7
|
+
import geode_viewables as viewables
|
|
8
|
+
|
|
9
|
+
# Local application imports
|
|
10
|
+
from .types import GeodeMeshType
|
|
11
|
+
from .geode_surface_mesh2d import GeodeSurfaceMesh2D
|
|
12
|
+
from .geode_grid2d import GeodeGrid2D
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class GeodeRegularGrid2D(GeodeSurfaceMesh2D, GeodeGrid2D):
|
|
16
|
+
regular_grid: og.RegularGrid2D
|
|
17
|
+
|
|
18
|
+
def __init__(self, regular_grid: og.RegularGrid2D | None = None) -> None:
|
|
19
|
+
self.regular_grid = (
|
|
20
|
+
regular_grid if regular_grid is not None else og.RegularGrid2D.create()
|
|
21
|
+
)
|
|
22
|
+
super().__init__(self.regular_grid)
|
|
23
|
+
|
|
24
|
+
@classmethod
|
|
25
|
+
def geode_object_type(cls) -> GeodeMeshType:
|
|
26
|
+
return "RegularGrid2D"
|
|
27
|
+
|
|
28
|
+
def inspect(self) -> og_inspector.SurfaceInspectionResult:
|
|
29
|
+
return super().inspect()
|
|
30
|
+
|
|
31
|
+
def native_extension(self) -> str:
|
|
32
|
+
return self.regular_grid.native_extension()
|
|
33
|
+
|
|
34
|
+
def builder(self) -> og.RegularGridBuilder2D:
|
|
35
|
+
return og.RegularGridBuilder2D.create(self.regular_grid)
|
|
36
|
+
|
|
37
|
+
@classmethod
|
|
38
|
+
def load(cls, filename: str) -> GeodeRegularGrid2D:
|
|
39
|
+
return GeodeRegularGrid2D(og.load_regular_grid2D(filename))
|
|
40
|
+
|
|
41
|
+
@classmethod
|
|
42
|
+
def additional_files(cls, filename: str) -> og.AdditionalFiles:
|
|
43
|
+
return og.regular_grid_additional_files2D(filename)
|
|
44
|
+
|
|
45
|
+
@classmethod
|
|
46
|
+
def is_loadable(cls, filename: str) -> og.Percentage:
|
|
47
|
+
return og.is_regular_grid_loadable2D(filename)
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def input_extensions(cls) -> list[str]:
|
|
51
|
+
return og.RegularGridInputFactory2D.list_creators()
|
|
52
|
+
|
|
53
|
+
@classmethod
|
|
54
|
+
def output_extensions(cls) -> list[str]:
|
|
55
|
+
return og.RegularGridOutputFactory2D.list_creators()
|
|
56
|
+
|
|
57
|
+
@classmethod
|
|
58
|
+
def object_priority(cls, filename: str) -> int:
|
|
59
|
+
return og.regular_grid_object_priority2D(filename)
|
|
60
|
+
|
|
61
|
+
def is_saveable(self, filename: str) -> bool:
|
|
62
|
+
return og.is_regular_grid_saveable2D(self.regular_grid, filename)
|
|
63
|
+
|
|
64
|
+
def save(self, filename: str) -> list[str]:
|
|
65
|
+
return og.save_regular_grid2D(self.regular_grid, filename)
|
|
66
|
+
|
|
67
|
+
def save_viewable(self, filename_without_extension: str) -> str:
|
|
68
|
+
return viewables.save_viewable_regular_grid2D(
|
|
69
|
+
self.regular_grid, filename_without_extension
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
def save_light_viewable(self, filename_without_extension: str) -> str:
|
|
73
|
+
return viewables.save_light_viewable_regular_grid2D(
|
|
74
|
+
self.regular_grid, filename_without_extension
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
def cell_attribute_manager(self) -> og.AttributeManager:
|
|
78
|
+
return self.regular_grid.cell_attribute_manager()
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Standard library imports
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
# Third party imports
|
|
5
|
+
import opengeode as og
|
|
6
|
+
import opengeode_inspector as og_inspector
|
|
7
|
+
import geode_viewables as viewables
|
|
8
|
+
|
|
9
|
+
# Local application imports
|
|
10
|
+
from .types import GeodeMeshType
|
|
11
|
+
from .geode_solid_mesh3d import GeodeSolidMesh3D
|
|
12
|
+
from .geode_grid3d import GeodeGrid3D
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class GeodeRegularGrid3D(GeodeSolidMesh3D, GeodeGrid3D):
|
|
16
|
+
regular_grid: og.RegularGrid3D
|
|
17
|
+
|
|
18
|
+
def __init__(self, regular_grid: og.RegularGrid3D | None = None) -> None:
|
|
19
|
+
self.regular_grid = (
|
|
20
|
+
regular_grid if regular_grid is not None else og.RegularGrid3D.create()
|
|
21
|
+
)
|
|
22
|
+
super().__init__(self.regular_grid)
|
|
23
|
+
|
|
24
|
+
@classmethod
|
|
25
|
+
def geode_object_type(cls) -> GeodeMeshType:
|
|
26
|
+
return "RegularGrid3D"
|
|
27
|
+
|
|
28
|
+
def native_extension(self) -> str:
|
|
29
|
+
return self.regular_grid.native_extension()
|
|
30
|
+
|
|
31
|
+
def builder(self) -> og.RegularGridBuilder3D:
|
|
32
|
+
return og.RegularGridBuilder3D.create(self.regular_grid)
|
|
33
|
+
|
|
34
|
+
@classmethod
|
|
35
|
+
def load(cls, filename: str) -> GeodeRegularGrid3D:
|
|
36
|
+
return GeodeRegularGrid3D(og.load_regular_grid3D(filename))
|
|
37
|
+
|
|
38
|
+
@classmethod
|
|
39
|
+
def additional_files(cls, filename: str) -> og.AdditionalFiles:
|
|
40
|
+
return og.regular_grid_additional_files3D(filename)
|
|
41
|
+
|
|
42
|
+
@classmethod
|
|
43
|
+
def is_loadable(cls, filename: str) -> og.Percentage:
|
|
44
|
+
return og.is_regular_grid_loadable3D(filename)
|
|
45
|
+
|
|
46
|
+
@classmethod
|
|
47
|
+
def input_extensions(cls) -> list[str]:
|
|
48
|
+
return og.RegularGridInputFactory3D.list_creators()
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def output_extensions(cls) -> list[str]:
|
|
52
|
+
return og.RegularGridOutputFactory3D.list_creators()
|
|
53
|
+
|
|
54
|
+
@classmethod
|
|
55
|
+
def object_priority(cls, filename: str) -> int:
|
|
56
|
+
return og.regular_grid_object_priority3D(filename)
|
|
57
|
+
|
|
58
|
+
def is_saveable(self, filename: str) -> bool:
|
|
59
|
+
return og.is_regular_grid_saveable3D(self.regular_grid, filename)
|
|
60
|
+
|
|
61
|
+
def save(self, filename: str) -> list[str]:
|
|
62
|
+
return og.save_regular_grid3D(self.regular_grid, filename)
|
|
63
|
+
|
|
64
|
+
def save_viewable(self, filename_without_extension: str) -> str:
|
|
65
|
+
return viewables.save_viewable_regular_grid3D(
|
|
66
|
+
self.regular_grid, filename_without_extension
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
def save_light_viewable(self, filename_without_extension: str) -> str:
|
|
70
|
+
return viewables.save_light_viewable_regular_grid3D(
|
|
71
|
+
self.regular_grid, filename_without_extension
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
def cell_attribute_manager(self) -> og.AttributeManager:
|
|
75
|
+
return self.regular_grid.cell_attribute_manager()
|
|
76
|
+
|
|
77
|
+
def inspect(self) -> og_inspector.SolidInspectionResult:
|
|
78
|
+
return super().inspect()
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Standard library imports
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
# Third party imports
|
|
5
|
+
import opengeode as og
|
|
6
|
+
import opengeode_geosciences as og_geosciences
|
|
7
|
+
import opengeode_inspector as og_inspector
|
|
8
|
+
import geode_viewables as viewables
|
|
9
|
+
|
|
10
|
+
# Local application imports
|
|
11
|
+
from .types import GeodeModelType, ViewerType
|
|
12
|
+
from .geode_model import GeodeModel, ComponentRegistry
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class GeodeSection(GeodeModel):
|
|
16
|
+
section: og.Section
|
|
17
|
+
|
|
18
|
+
def __init__(self, section: og.Section | None = None) -> None:
|
|
19
|
+
self.section = section if section is not None else og.Section()
|
|
20
|
+
super().__init__(self.section)
|
|
21
|
+
|
|
22
|
+
@classmethod
|
|
23
|
+
def geode_object_type(cls) -> GeodeModelType:
|
|
24
|
+
return "Section"
|
|
25
|
+
|
|
26
|
+
def native_extension(self) -> str:
|
|
27
|
+
return self.section.native_extension()
|
|
28
|
+
|
|
29
|
+
@classmethod
|
|
30
|
+
def is_3D(cls) -> bool:
|
|
31
|
+
return False
|
|
32
|
+
|
|
33
|
+
@classmethod
|
|
34
|
+
def is_viewable(cls) -> bool:
|
|
35
|
+
return True
|
|
36
|
+
|
|
37
|
+
def builder(self) -> og.SectionBuilder:
|
|
38
|
+
return og.SectionBuilder(self.section)
|
|
39
|
+
|
|
40
|
+
@classmethod
|
|
41
|
+
def load(cls, filename: str) -> GeodeSection:
|
|
42
|
+
return GeodeSection(og.load_section(filename))
|
|
43
|
+
|
|
44
|
+
@classmethod
|
|
45
|
+
def additional_files(cls, filename: str) -> og.AdditionalFiles:
|
|
46
|
+
return og.section_additional_files(filename)
|
|
47
|
+
|
|
48
|
+
@classmethod
|
|
49
|
+
def is_loadable(cls, filename: str) -> og.Percentage:
|
|
50
|
+
return og.is_section_loadable(filename)
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def input_extensions(cls) -> list[str]:
|
|
54
|
+
return og.SectionInputFactory.list_creators()
|
|
55
|
+
|
|
56
|
+
@classmethod
|
|
57
|
+
def output_extensions(cls) -> list[str]:
|
|
58
|
+
return og.SectionOutputFactory.list_creators()
|
|
59
|
+
|
|
60
|
+
@classmethod
|
|
61
|
+
def object_priority(cls, filename: str) -> int:
|
|
62
|
+
return og.section_object_priority(filename)
|
|
63
|
+
|
|
64
|
+
def is_saveable(self, filename: str) -> bool:
|
|
65
|
+
return og.is_section_saveable(self.section, filename)
|
|
66
|
+
|
|
67
|
+
def save(self, filename: str) -> list[str]:
|
|
68
|
+
return og.save_section(self.section, filename)
|
|
69
|
+
|
|
70
|
+
def save_viewable(self, filename_without_extension: str) -> str:
|
|
71
|
+
return viewables.save_viewable_section(self.section, filename_without_extension)
|
|
72
|
+
|
|
73
|
+
def save_light_viewable(self, filename_without_extension: str) -> str:
|
|
74
|
+
return viewables.save_light_viewable_section(
|
|
75
|
+
self.section, filename_without_extension
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
def mesh_components(self) -> ComponentRegistry:
|
|
79
|
+
return self.section.mesh_components()
|
|
80
|
+
|
|
81
|
+
def inspect(self) -> og_inspector.SectionInspectionResult:
|
|
82
|
+
return og_inspector.inspect_section(self.section)
|
|
83
|
+
|
|
84
|
+
def assign_crs(
|
|
85
|
+
self, crs_name: str, info: og_geosciences.GeographicCoordinateSystemInfo
|
|
86
|
+
) -> None:
|
|
87
|
+
builder = self.builder()
|
|
88
|
+
og_geosciences.assign_section_geographic_coordinate_system_info(
|
|
89
|
+
self.section, builder, crs_name, info
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
def convert_crs(
|
|
93
|
+
self, crs_name: str, info: og_geosciences.GeographicCoordinateSystemInfo
|
|
94
|
+
) -> None:
|
|
95
|
+
builder = self.builder()
|
|
96
|
+
og_geosciences.convert_section_coordinate_reference_system(
|
|
97
|
+
self.section, builder, crs_name, info
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
def create_crs(
|
|
101
|
+
self, crs_name: str, input: og.CoordinateSystem2D, output: og.CoordinateSystem2D
|
|
102
|
+
) -> None:
|
|
103
|
+
builder = self.builder()
|
|
104
|
+
og.create_section_coordinate_system(
|
|
105
|
+
self.section, builder, crs_name, input, output
|
|
106
|
+
)
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Standard library imports
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
# Third party imports
|
|
5
|
+
import opengeode as og
|
|
6
|
+
import opengeode_geosciences as og_geosciences
|
|
7
|
+
import opengeode_inspector as og_inspector
|
|
8
|
+
import geode_viewables as viewables
|
|
9
|
+
|
|
10
|
+
# Local application imports
|
|
11
|
+
from .types import GeodeMeshType
|
|
12
|
+
from .geode_vertex_set import GeodeVertexSet
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class GeodeSolidMesh3D(GeodeVertexSet):
|
|
16
|
+
solid_mesh: og.SolidMesh3D
|
|
17
|
+
|
|
18
|
+
def __init__(self, solid_mesh: og.SolidMesh3D | None = None) -> None:
|
|
19
|
+
self.solid_mesh = solid_mesh if solid_mesh is not None else og.SolidMesh3D()
|
|
20
|
+
super().__init__(self.solid_mesh)
|
|
21
|
+
|
|
22
|
+
@classmethod
|
|
23
|
+
def is_3D(cls) -> bool:
|
|
24
|
+
return True
|
|
25
|
+
|
|
26
|
+
@classmethod
|
|
27
|
+
def is_viewable(cls) -> bool:
|
|
28
|
+
return True
|
|
29
|
+
|
|
30
|
+
def builder(self) -> og.SolidMeshBuilder3D:
|
|
31
|
+
return og.SolidMeshBuilder3D.create(self.solid_mesh)
|
|
32
|
+
|
|
33
|
+
def inspect(self) -> og_inspector.SolidInspectionResult:
|
|
34
|
+
return og_inspector.inspect_solid3D(self.solid_mesh)
|
|
35
|
+
|
|
36
|
+
def assign_crs(
|
|
37
|
+
self, crs_name: str, info: og_geosciences.GeographicCoordinateSystemInfo
|
|
38
|
+
) -> None:
|
|
39
|
+
builder = self.builder()
|
|
40
|
+
og_geosciences.assign_solid_mesh_geographic_coordinate_system_info3D(
|
|
41
|
+
self.solid_mesh, builder, crs_name, info
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
def convert_crs(
|
|
45
|
+
self, crs_name: str, info: og_geosciences.GeographicCoordinateSystemInfo
|
|
46
|
+
) -> None:
|
|
47
|
+
builder = self.builder()
|
|
48
|
+
og_geosciences.convert_solid_mesh_coordinate_reference_system3D(
|
|
49
|
+
self.solid_mesh, builder, crs_name, info
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
def create_crs(
|
|
53
|
+
self, crs_name: str, input: og.CoordinateSystem2D, output: og.CoordinateSystem2D
|
|
54
|
+
) -> None:
|
|
55
|
+
builder = self.builder()
|
|
56
|
+
og.create_solid_mesh_coordinate_system3D(
|
|
57
|
+
self.solid_mesh, builder, crs_name, input, output
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
def polyhedron_attribute_manager(self) -> og.AttributeManager:
|
|
61
|
+
return self.solid_mesh.polyhedron_attribute_manager()
|