OpenGeodeWeb-Back 5.3.2__py3-none-any.whl → 5.4.0__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-5.3.2.dist-info → OpenGeodeWeb_Back-5.4.0.dist-info}/METADATA +29 -29
- {OpenGeodeWeb_Back-5.3.2.dist-info → OpenGeodeWeb_Back-5.4.0.dist-info}/RECORD +12 -8
- {OpenGeodeWeb_Back-5.3.2.dist-info → OpenGeodeWeb_Back-5.4.0.dist-info}/WHEEL +1 -1
- opengeodeweb_back/geode_functions.py +6 -2
- opengeodeweb_back/geode_objects.py +55 -25
- opengeodeweb_back/routes/blueprint_routes.py +101 -2
- opengeodeweb_back/routes/schemas/create_point.json +24 -0
- opengeodeweb_back/routes/schemas/polygon_attribute_names.json +15 -0
- opengeodeweb_back/routes/schemas/vertex_attribute_names.json +15 -0
- opengeodeweb_back/test_utils.py +25 -0
- {OpenGeodeWeb_Back-5.3.2.dist-info → OpenGeodeWeb_Back-5.4.0.dist-info}/LICENSE +0 -0
- {OpenGeodeWeb_Back-5.3.2.dist-info → OpenGeodeWeb_Back-5.4.0.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: OpenGeodeWeb-Back
|
3
|
-
Version: 5.
|
3
|
+
Version: 5.4.0
|
4
4
|
Summary: OpenGeodeWeb-Back is an open source framework that proposes handy python functions and wrappers for the OpenGeode ecosystem
|
5
5
|
Author-email: Geode-solutions <team-web@geode-solutions.com>
|
6
6
|
Project-URL: Homepage, https://github.com/Geode-solutions/OpenGeodeWeb-Back
|
@@ -11,34 +11,34 @@ Classifier: Operating System :: OS Independent
|
|
11
11
|
Requires-Python: >=3.8
|
12
12
|
Description-Content-Type: text/markdown
|
13
13
|
License-File: LICENSE
|
14
|
-
Requires-Dist: asgiref
|
15
|
-
Requires-Dist: attrs
|
16
|
-
Requires-Dist: blinker
|
17
|
-
Requires-Dist: click
|
18
|
-
Requires-Dist: flask[async]
|
19
|
-
Requires-Dist: flask-cors
|
20
|
-
Requires-Dist: geode-background
|
21
|
-
Requires-Dist: geode-common
|
22
|
-
Requires-Dist: geode-conversion
|
23
|
-
Requires-Dist: geode-explicit
|
24
|
-
Requires-Dist: geode-implicit
|
25
|
-
Requires-Dist: geode-numerics
|
26
|
-
Requires-Dist: geode-simplex
|
27
|
-
Requires-Dist: geode-viewables
|
28
|
-
Requires-Dist: itsdangerous
|
29
|
-
Requires-Dist: jinja2
|
30
|
-
Requires-Dist: jsonschema
|
31
|
-
Requires-Dist: jsonschema-specifications
|
32
|
-
Requires-Dist: markupsafe
|
33
|
-
Requires-Dist: opengeode-core
|
34
|
-
Requires-Dist: opengeode-geosciences
|
35
|
-
Requires-Dist: opengeode-geosciencesio
|
36
|
-
Requires-Dist: opengeode-inspector
|
37
|
-
Requires-Dist: opengeode-io
|
38
|
-
Requires-Dist: referencing
|
39
|
-
Requires-Dist: rpds-py
|
40
|
-
Requires-Dist: typing-extensions
|
41
|
-
Requires-Dist: werkzeug
|
14
|
+
Requires-Dist: asgiref==3.8.1
|
15
|
+
Requires-Dist: attrs==24.2.0
|
16
|
+
Requires-Dist: blinker==1.9.0
|
17
|
+
Requires-Dist: click==8.1.7
|
18
|
+
Requires-Dist: flask[async]==3.1.0
|
19
|
+
Requires-Dist: flask-cors==5.0.0
|
20
|
+
Requires-Dist: geode-background==8.7.5
|
21
|
+
Requires-Dist: geode-common==33.1.3
|
22
|
+
Requires-Dist: geode-conversion==6.0.18
|
23
|
+
Requires-Dist: geode-explicit==6.1.17
|
24
|
+
Requires-Dist: geode-implicit==3.3.5
|
25
|
+
Requires-Dist: geode-numerics==5.2.0
|
26
|
+
Requires-Dist: geode-simplex==8.2.18
|
27
|
+
Requires-Dist: geode-viewables==3.0.8
|
28
|
+
Requires-Dist: itsdangerous==2.2.0
|
29
|
+
Requires-Dist: jinja2==3.1.4
|
30
|
+
Requires-Dist: jsonschema==4.23.0
|
31
|
+
Requires-Dist: jsonschema-specifications==2024.10.1
|
32
|
+
Requires-Dist: markupsafe==3.0.2
|
33
|
+
Requires-Dist: opengeode-core==15.6.7
|
34
|
+
Requires-Dist: opengeode-geosciences==8.2.0
|
35
|
+
Requires-Dist: opengeode-geosciencesio==5.3.2
|
36
|
+
Requires-Dist: opengeode-inspector==6.1.15
|
37
|
+
Requires-Dist: opengeode-io==7.0.7
|
38
|
+
Requires-Dist: referencing==0.35.1
|
39
|
+
Requires-Dist: rpds-py==0.21.0
|
40
|
+
Requires-Dist: typing-extensions==4.12.2
|
41
|
+
Requires-Dist: werkzeug==3.1.3
|
42
42
|
|
43
43
|
<h1 align="center">OpenGeodeWeb-Back<sup><i>by Geode-solutions</i></sup></h1>
|
44
44
|
<h3 align="center">OpenSource Python framework based on OpenGeode</h3>
|
@@ -1,20 +1,24 @@
|
|
1
1
|
opengeodeweb_back/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
2
|
opengeodeweb_back/app_config.py,sha256=bZIs0giTA0cYJJYbt25ZHYlHdsOy82h5xSxdOitgR4A,752
|
3
|
-
opengeodeweb_back/geode_functions.py,sha256=
|
4
|
-
opengeodeweb_back/geode_objects.py,sha256=
|
3
|
+
opengeodeweb_back/geode_functions.py,sha256=e13Ws4JDzPBxOUQfpOxjmxd7ZDj43-AsI8z8JsKDtG4,8824
|
4
|
+
opengeodeweb_back/geode_objects.py,sha256=hREwA-Qyi6YIVWhCu3HBnWMfLohPr9TpylVtZbJ2qyc,23658
|
5
|
+
opengeodeweb_back/test_utils.py,sha256=gvRPOzin4nI5TKuB-AFgIxcekTOYM4h7yUYk0tYIZFI,820
|
5
6
|
opengeodeweb_back/utils_functions.py,sha256=18kp8M3bnrlu692qj-ymJJPA1hTpPjx_xl9oVi5qGyg,4120
|
6
|
-
opengeodeweb_back/routes/blueprint_routes.py,sha256=
|
7
|
+
opengeodeweb_back/routes/blueprint_routes.py,sha256=oPFLxjTBgfxsjug4Qmn5YW_vlFOodAFl9H_aXDSO-24,11598
|
7
8
|
opengeodeweb_back/routes/schemas/allowed_files.json,sha256=pRsGf39LiJpl3zEGLg4IqvRtm7iUx3Wq4Tb4tSFXGV0,234
|
8
9
|
opengeodeweb_back/routes/schemas/allowed_objects.json,sha256=8JLtAI46eXeiJuiryS2geRVv0J1rGkFb87pRwtBZSZw,296
|
10
|
+
opengeodeweb_back/routes/schemas/create_point.json,sha256=fqBOLRxpRtCVz1t7ottdfhSMREhqNFUHrQwamn-F7Ds,306
|
9
11
|
opengeodeweb_back/routes/schemas/geode_objects_and_output_extensions.json,sha256=0t4YhdKxDlzcLh85JU85z6Pn5h8wlXVt3Zi4ZhXXmTQ,308
|
10
12
|
opengeodeweb_back/routes/schemas/geographic_coordinate_systems.json,sha256=86QEBxAJXdMHulj2SyrxvAAwvyUq3mpKSazwASukeoM,242
|
11
13
|
opengeodeweb_back/routes/schemas/inspect_file.json,sha256=7jmmLD2oZ2dxn5-2HqS6fU92eGM3FWBQdj3CjyYmGOA,285
|
12
14
|
opengeodeweb_back/routes/schemas/missing_files.json,sha256=tJVdSM3CqYFZRC6eNW6Q3JG3RtoaZDxaZtbfx6djbX0,286
|
13
15
|
opengeodeweb_back/routes/schemas/ping.json,sha256=MhI5jtrjMsAsfIKEzdY8p1HyV9xv4O3hYfESWw6tkyE,162
|
16
|
+
opengeodeweb_back/routes/schemas/polygon_attribute_names.json,sha256=y0qDZ0v3zkzYuM-9jfBXU0aTUnWz2w0gXqes9Xs7PgE,296
|
14
17
|
opengeodeweb_back/routes/schemas/save_viewable_file.json,sha256=7BXO8vsQrmqyEQ2uycm2Ift_EY7a0KocvnGEjYrQFcQ,368
|
15
18
|
opengeodeweb_back/routes/schemas/upload_file.json,sha256=sE6bxz3mJbSZlGmrnR_hZmcx0dvZGn3Wpnn6szRPxXQ,186
|
16
|
-
|
17
|
-
OpenGeodeWeb_Back-5.
|
18
|
-
OpenGeodeWeb_Back-5.
|
19
|
-
OpenGeodeWeb_Back-5.
|
20
|
-
OpenGeodeWeb_Back-5.
|
19
|
+
opengeodeweb_back/routes/schemas/vertex_attribute_names.json,sha256=wijww9z7vVUIr1_3hMnR5efpMfW2-o2-QvcO_MVDefE,295
|
20
|
+
OpenGeodeWeb_Back-5.4.0.dist-info/LICENSE,sha256=LoTB-aqQvzTGxoTRXNnhNV0LKiqdk2bQv6MB34l8zkI,1079
|
21
|
+
OpenGeodeWeb_Back-5.4.0.dist-info/METADATA,sha256=JIIKZbtHHFCw2G2IZhcY7RlK1Qiv0SQyFRyeNb6DWZ8,3056
|
22
|
+
OpenGeodeWeb_Back-5.4.0.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
23
|
+
OpenGeodeWeb_Back-5.4.0.dist-info/top_level.txt,sha256=tN1FZeLIVBrdja2-pbmhg5-tK-JILmmT9OeIBnhlUrQ,18
|
24
|
+
OpenGeodeWeb_Back-5.4.0.dist-info/RECORD,,
|
@@ -15,6 +15,10 @@ def geode_object_value(geode_object: str):
|
|
15
15
|
return geode_objects_dict()[geode_object]
|
16
16
|
|
17
17
|
|
18
|
+
def geode_object_class(geode_object: str):
|
19
|
+
return geode_object_value(geode_object)["class"]
|
20
|
+
|
21
|
+
|
18
22
|
def input_factory(geode_object: str):
|
19
23
|
return geode_object_value(geode_object)["input_factory"]
|
20
24
|
|
@@ -72,8 +76,8 @@ def create_crs(
|
|
72
76
|
)
|
73
77
|
|
74
78
|
|
75
|
-
def
|
76
|
-
return geode_object_value(geode_object)["
|
79
|
+
def get_object_type(geode_object: str):
|
80
|
+
return geode_object_value(geode_object)["object_type"]
|
77
81
|
|
78
82
|
|
79
83
|
def is_3D(geode_object: str):
|
@@ -1,3 +1,6 @@
|
|
1
|
+
# Standard library imports
|
2
|
+
|
3
|
+
# Third party imports
|
1
4
|
import opengeode as og
|
2
5
|
import opengeode_io as og_io
|
3
6
|
import opengeode_inspector as og_inspector
|
@@ -5,10 +8,13 @@ import opengeode_geosciences as og_gs
|
|
5
8
|
import opengeode_geosciencesio as og_gs_io
|
6
9
|
import geode_viewables as g_v
|
7
10
|
|
11
|
+
# Local application imports
|
12
|
+
|
8
13
|
|
9
14
|
def geode_objects_dict():
|
10
15
|
return {
|
11
16
|
"BRep": {
|
17
|
+
"class": og.BRep,
|
12
18
|
"input_factory": og.BRepInputFactory,
|
13
19
|
"output_factory": og.BRepOutputFactory,
|
14
20
|
"missing_files": og.check_brep_missing_files,
|
@@ -22,7 +28,7 @@ def geode_objects_dict():
|
|
22
28
|
"convert": og_gs.convert_brep_coordinate_reference_system,
|
23
29
|
"create": og.create_brep_coordinate_system,
|
24
30
|
},
|
25
|
-
"
|
31
|
+
"object_type": "model",
|
26
32
|
"is_3D": True,
|
27
33
|
"is_viewable": True,
|
28
34
|
"save_viewable": g_v.save_viewable_brep,
|
@@ -30,6 +36,7 @@ def geode_objects_dict():
|
|
30
36
|
},
|
31
37
|
"CrossSection": {
|
32
38
|
"parent": "Section",
|
39
|
+
"class": og_gs.CrossSection,
|
33
40
|
"input_factory": og_gs.CrossSectionInputFactory,
|
34
41
|
"output_factory": og_gs.CrossSectionOutputFactory,
|
35
42
|
"missing_files": og_gs.check_cross_section_missing_files,
|
@@ -43,13 +50,14 @@ def geode_objects_dict():
|
|
43
50
|
"convert": og_gs.convert_section_coordinate_reference_system,
|
44
51
|
"create": og.create_section_coordinate_system,
|
45
52
|
},
|
46
|
-
"
|
53
|
+
"object_type": "model",
|
47
54
|
"is_3D": False,
|
48
55
|
"is_viewable": True,
|
49
56
|
"save_viewable": g_v.save_viewable_cross_section,
|
50
57
|
"inspector": og_inspector.inspect_section,
|
51
58
|
},
|
52
59
|
"EdgedCurve2D": {
|
60
|
+
"class": og.EdgedCurve2D,
|
53
61
|
"input_factory": og.EdgedCurveInputFactory2D,
|
54
62
|
"output_factory": og.EdgedCurveOutputFactory2D,
|
55
63
|
"missing_files": og.check_edged_curve_missing_files2D,
|
@@ -63,13 +71,14 @@ def geode_objects_dict():
|
|
63
71
|
"convert": og_gs.convert_edged_curve_coordinate_reference_system2D,
|
64
72
|
"create": og.create_edged_curve_coordinate_system2D,
|
65
73
|
},
|
66
|
-
"
|
74
|
+
"object_type": "mesh",
|
67
75
|
"is_3D": False,
|
68
76
|
"is_viewable": True,
|
69
77
|
"save_viewable": g_v.save_viewable_edged_curve2D,
|
70
78
|
"inspector": og_inspector.inspect_edged_curve2D,
|
71
79
|
},
|
72
80
|
"EdgedCurve3D": {
|
81
|
+
"class": og.EdgedCurve3D,
|
73
82
|
"input_factory": og.EdgedCurveInputFactory3D,
|
74
83
|
"output_factory": og.EdgedCurveOutputFactory3D,
|
75
84
|
"missing_files": og.check_edged_curve_missing_files3D,
|
@@ -83,13 +92,14 @@ def geode_objects_dict():
|
|
83
92
|
"convert": og_gs.convert_edged_curve_coordinate_reference_system3D,
|
84
93
|
"create": og.create_edged_curve_coordinate_system3D,
|
85
94
|
},
|
86
|
-
"
|
95
|
+
"object_type": "mesh",
|
87
96
|
"is_3D": True,
|
88
97
|
"is_viewable": True,
|
89
98
|
"save_viewable": g_v.save_viewable_edged_curve3D,
|
90
99
|
"inspector": og_inspector.inspect_edged_curve3D,
|
91
100
|
},
|
92
101
|
"Graph": {
|
102
|
+
"class": og.Graph,
|
93
103
|
"input_factory": og.GraphInputFactory,
|
94
104
|
"output_factory": og.GraphOutputFactory,
|
95
105
|
"missing_files": og.check_graph_missing_files,
|
@@ -98,11 +108,12 @@ def geode_objects_dict():
|
|
98
108
|
"is_saveable": og.is_graph_saveable,
|
99
109
|
"save": og.save_graph,
|
100
110
|
"builder": og.GraphBuilder.create,
|
101
|
-
"
|
111
|
+
"object_type": "mesh",
|
102
112
|
"is_3D": False,
|
103
113
|
"is_viewable": True,
|
104
114
|
},
|
105
115
|
"HybridSolid3D": {
|
116
|
+
"class": og.HybridSolid3D,
|
106
117
|
"input_factory": og.HybridSolidInputFactory3D,
|
107
118
|
"output_factory": og.HybridSolidOutputFactory3D,
|
108
119
|
"missing_files": og.check_hybrid_solid_missing_files3D,
|
@@ -116,7 +127,7 @@ def geode_objects_dict():
|
|
116
127
|
"convert": og_gs.convert_solid_mesh_coordinate_reference_system3D,
|
117
128
|
"create": og.create_solid_mesh_coordinate_system3D,
|
118
129
|
},
|
119
|
-
"
|
130
|
+
"object_type": "mesh",
|
120
131
|
"is_3D": True,
|
121
132
|
"is_viewable": True,
|
122
133
|
"save_viewable": g_v.save_viewable_hybrid_solid3D,
|
@@ -124,6 +135,7 @@ def geode_objects_dict():
|
|
124
135
|
},
|
125
136
|
"ImplicitCrossSection": {
|
126
137
|
"parent": "CrossSection",
|
138
|
+
"class": og_gs.ImplicitCrossSection,
|
127
139
|
"input_factory": og_gs.ImplicitCrossSectionInputFactory,
|
128
140
|
"output_factory": og_gs.ImplicitCrossSectionOutputFactory,
|
129
141
|
"missing_files": og_gs.check_implicit_cross_section_missing_files,
|
@@ -137,7 +149,7 @@ def geode_objects_dict():
|
|
137
149
|
"convert": og_gs.convert_section_coordinate_reference_system,
|
138
150
|
"create": og.create_section_coordinate_system,
|
139
151
|
},
|
140
|
-
"
|
152
|
+
"object_type": "model",
|
141
153
|
"is_3D": False,
|
142
154
|
"is_viewable": True,
|
143
155
|
"save_viewable": g_v.save_viewable_implicit_cross_section,
|
@@ -145,6 +157,7 @@ def geode_objects_dict():
|
|
145
157
|
},
|
146
158
|
"ImplicitStructuralModel": {
|
147
159
|
"parent": "StructuralModel",
|
160
|
+
"class": og_gs.ImplicitStructuralModel,
|
148
161
|
"input_factory": og_gs.ImplicitStructuralModelInputFactory,
|
149
162
|
"output_factory": og_gs.ImplicitStructuralModelOutputFactory,
|
150
163
|
"missing_files": og_gs.check_implicit_structural_model_missing_files,
|
@@ -158,13 +171,14 @@ def geode_objects_dict():
|
|
158
171
|
"convert": og_gs.convert_brep_coordinate_reference_system,
|
159
172
|
"create": og.create_brep_coordinate_system,
|
160
173
|
},
|
161
|
-
"
|
174
|
+
"object_type": "model",
|
162
175
|
"is_3D": True,
|
163
176
|
"is_viewable": True,
|
164
177
|
"save_viewable": g_v.save_viewable_implicit_structural_model,
|
165
178
|
"inspector": og_inspector.inspect_brep,
|
166
179
|
},
|
167
180
|
"LightRegularGrid2D": {
|
181
|
+
"class": og.LightRegularGrid2D,
|
168
182
|
"input_factory": og.LightRegularGridInputFactory2D,
|
169
183
|
"output_factory": og.LightRegularGridOutputFactory2D,
|
170
184
|
"missing_files": og.check_light_regular_grid_missing_files2D,
|
@@ -172,12 +186,13 @@ def geode_objects_dict():
|
|
172
186
|
"load": og.load_light_regular_grid2D,
|
173
187
|
"is_saveable": og.is_light_regular_grid_saveable2D,
|
174
188
|
"save": og.save_light_regular_grid2D,
|
175
|
-
"
|
189
|
+
"object_type": "mesh",
|
176
190
|
"is_3D": False,
|
177
191
|
"is_viewable": True,
|
178
192
|
"save_viewable": g_v.save_viewable_light_regular_grid2D,
|
179
193
|
},
|
180
194
|
"LightRegularGrid3D": {
|
195
|
+
"class": og.LightRegularGrid3D,
|
181
196
|
"input_factory": og.LightRegularGridInputFactory3D,
|
182
197
|
"output_factory": og.LightRegularGridOutputFactory3D,
|
183
198
|
"missing_files": og.check_light_regular_grid_missing_files3D,
|
@@ -185,12 +200,13 @@ def geode_objects_dict():
|
|
185
200
|
"load": og.load_light_regular_grid3D,
|
186
201
|
"is_saveable": og.is_light_regular_grid_saveable3D,
|
187
202
|
"save": og.save_light_regular_grid3D,
|
188
|
-
"
|
203
|
+
"object_type": "mesh",
|
189
204
|
"is_3D": True,
|
190
205
|
"is_viewable": True,
|
191
206
|
"save_viewable": g_v.save_viewable_light_regular_grid3D,
|
192
207
|
},
|
193
208
|
"PointSet2D": {
|
209
|
+
"class": og.PointSet2D,
|
194
210
|
"input_factory": og.PointSetInputFactory2D,
|
195
211
|
"output_factory": og.PointSetOutputFactory2D,
|
196
212
|
"missing_files": og.check_point_set_missing_files2D,
|
@@ -204,13 +220,14 @@ def geode_objects_dict():
|
|
204
220
|
"convert": og_gs.convert_point_set_coordinate_reference_system2D,
|
205
221
|
"create": og.create_point_set_coordinate_system2D,
|
206
222
|
},
|
207
|
-
"
|
223
|
+
"object_type": "mesh",
|
208
224
|
"is_3D": False,
|
209
225
|
"is_viewable": True,
|
210
226
|
"save_viewable": g_v.save_viewable_point_set2D,
|
211
227
|
"inspector": og_inspector.inspect_point_set2D,
|
212
228
|
},
|
213
229
|
"PointSet3D": {
|
230
|
+
"class": og.PointSet3D,
|
214
231
|
"input_factory": og.PointSetInputFactory3D,
|
215
232
|
"output_factory": og.PointSetOutputFactory3D,
|
216
233
|
"missing_files": og.check_point_set_missing_files3D,
|
@@ -224,13 +241,14 @@ def geode_objects_dict():
|
|
224
241
|
"convert": og_gs.convert_point_set_coordinate_reference_system3D,
|
225
242
|
"create": og.create_point_set_coordinate_system3D,
|
226
243
|
},
|
227
|
-
"
|
244
|
+
"object_type": "mesh",
|
228
245
|
"is_3D": True,
|
229
246
|
"is_viewable": True,
|
230
247
|
"save_viewable": g_v.save_viewable_point_set3D,
|
231
248
|
"inspector": og_inspector.inspect_point_set3D,
|
232
249
|
},
|
233
250
|
"PolygonalSurface2D": {
|
251
|
+
"class": og.PolygonalSurface2D,
|
234
252
|
"input_factory": og.PolygonalSurfaceInputFactory2D,
|
235
253
|
"output_factory": og.PolygonalSurfaceOutputFactory2D,
|
236
254
|
"missing_files": og.check_polygonal_surface_missing_files2D,
|
@@ -244,13 +262,14 @@ def geode_objects_dict():
|
|
244
262
|
"convert": og_gs.convert_surface_mesh_coordinate_reference_system2D,
|
245
263
|
"create": og.create_surface_mesh_coordinate_system2D,
|
246
264
|
},
|
247
|
-
"
|
265
|
+
"object_type": "mesh",
|
248
266
|
"is_3D": False,
|
249
267
|
"is_viewable": True,
|
250
268
|
"save_viewable": g_v.save_viewable_polygonal_surface2D,
|
251
269
|
"inspector": og_inspector.inspect_surface2D,
|
252
270
|
},
|
253
271
|
"PolygonalSurface3D": {
|
272
|
+
"class": og.PolygonalSurface3D,
|
254
273
|
"input_factory": og.PolygonalSurfaceInputFactory3D,
|
255
274
|
"output_factory": og.PolygonalSurfaceOutputFactory3D,
|
256
275
|
"missing_files": og.check_polygonal_surface_missing_files3D,
|
@@ -264,13 +283,14 @@ def geode_objects_dict():
|
|
264
283
|
"convert": og_gs.convert_surface_mesh_coordinate_reference_system3D,
|
265
284
|
"create": og.create_surface_mesh_coordinate_system3D,
|
266
285
|
},
|
267
|
-
"
|
286
|
+
"object_type": "mesh",
|
268
287
|
"is_3D": True,
|
269
288
|
"is_viewable": True,
|
270
289
|
"save_viewable": g_v.save_viewable_polygonal_surface3D,
|
271
290
|
"inspector": og_inspector.inspect_surface3D,
|
272
291
|
},
|
273
292
|
"PolyhedralSolid3D": {
|
293
|
+
"class": og.PolyhedralSolid3D,
|
274
294
|
"input_factory": og.PolyhedralSolidInputFactory3D,
|
275
295
|
"output_factory": og.PolyhedralSolidOutputFactory3D,
|
276
296
|
"missing_files": og.check_polyhedral_solid_missing_files3D,
|
@@ -284,13 +304,14 @@ def geode_objects_dict():
|
|
284
304
|
"convert": og_gs.convert_solid_mesh_coordinate_reference_system3D,
|
285
305
|
"create": og.create_solid_mesh_coordinate_system3D,
|
286
306
|
},
|
287
|
-
"
|
307
|
+
"object_type": "mesh",
|
288
308
|
"is_3D": True,
|
289
309
|
"is_viewable": True,
|
290
310
|
"save_viewable": g_v.save_viewable_polyhedral_solid3D,
|
291
311
|
"inspector": og_inspector.inspect_solid3D,
|
292
312
|
},
|
293
313
|
"RasterImage2D": {
|
314
|
+
"class": og.RasterImage2D,
|
294
315
|
"input_factory": og.RasterImageInputFactory2D,
|
295
316
|
"output_factory": og.RasterImageOutputFactory2D,
|
296
317
|
"missing_files": og.check_raster_image_missing_files2D,
|
@@ -298,12 +319,13 @@ def geode_objects_dict():
|
|
298
319
|
"load": og.load_raster_image2D,
|
299
320
|
"is_saveable": og.is_raster_image_saveable2D,
|
300
321
|
"save": og.save_raster_image2D,
|
301
|
-
"
|
322
|
+
"object_type": "mesh",
|
302
323
|
"is_3D": False,
|
303
324
|
"is_viewable": False,
|
304
325
|
"save_viewable": g_v.save_viewable_raster_image2D,
|
305
326
|
},
|
306
327
|
"RasterImage3D": {
|
328
|
+
"class": og.RasterImage3D,
|
307
329
|
"input_factory": og.RasterImageInputFactory3D,
|
308
330
|
"output_factory": og.RasterImageOutputFactory3D,
|
309
331
|
"missing_files": og.check_raster_image_missing_files3D,
|
@@ -311,12 +333,13 @@ def geode_objects_dict():
|
|
311
333
|
"load": og.load_raster_image3D,
|
312
334
|
"is_saveable": og.is_raster_image_saveable3D,
|
313
335
|
"save": og.save_raster_image3D,
|
314
|
-
"
|
336
|
+
"object_type": "mesh",
|
315
337
|
"is_3D": False,
|
316
338
|
"is_viewable": False,
|
317
339
|
"save_viewable": g_v.save_viewable_raster_image3D,
|
318
340
|
},
|
319
341
|
"RegularGrid2D": {
|
342
|
+
"class": og.RegularGrid2D,
|
320
343
|
"input_factory": og.RegularGridInputFactory2D,
|
321
344
|
"output_factory": og.RegularGridOutputFactory2D,
|
322
345
|
"missing_files": og.check_regular_grid_missing_files2D,
|
@@ -330,12 +353,13 @@ def geode_objects_dict():
|
|
330
353
|
"convert": og_gs.convert_surface_mesh_coordinate_reference_system2D,
|
331
354
|
"create": og.create_surface_mesh_coordinate_system2D,
|
332
355
|
},
|
333
|
-
"
|
356
|
+
"object_type": "mesh",
|
334
357
|
"is_3D": False,
|
335
358
|
"is_viewable": True,
|
336
359
|
"save_viewable": g_v.save_viewable_regular_grid2D,
|
337
360
|
},
|
338
361
|
"RegularGrid3D": {
|
362
|
+
"class": og.RegularGrid3D,
|
339
363
|
"input_factory": og.RegularGridInputFactory3D,
|
340
364
|
"output_factory": og.RegularGridOutputFactory3D,
|
341
365
|
"missing_files": og.check_regular_grid_missing_files3D,
|
@@ -349,12 +373,13 @@ def geode_objects_dict():
|
|
349
373
|
"convert": og_gs.convert_solid_mesh_coordinate_reference_system3D,
|
350
374
|
"create": og.create_surface_mesh_coordinate_system3D,
|
351
375
|
},
|
352
|
-
"
|
376
|
+
"object_type": "mesh",
|
353
377
|
"is_3D": True,
|
354
378
|
"is_viewable": True,
|
355
379
|
"save_viewable": g_v.save_viewable_regular_grid3D,
|
356
380
|
},
|
357
381
|
"Section": {
|
382
|
+
"class": og.Section,
|
358
383
|
"input_factory": og.SectionInputFactory,
|
359
384
|
"output_factory": og.SectionOutputFactory,
|
360
385
|
"missing_files": og.check_section_missing_files,
|
@@ -368,7 +393,7 @@ def geode_objects_dict():
|
|
368
393
|
"convert": og_gs.convert_section_coordinate_reference_system,
|
369
394
|
"create": og.create_section_coordinate_system,
|
370
395
|
},
|
371
|
-
"
|
396
|
+
"object_type": "model",
|
372
397
|
"is_3D": False,
|
373
398
|
"is_viewable": True,
|
374
399
|
"save_viewable": g_v.save_viewable_section,
|
@@ -376,6 +401,7 @@ def geode_objects_dict():
|
|
376
401
|
},
|
377
402
|
"StructuralModel": {
|
378
403
|
"parent": "BRep",
|
404
|
+
"class": og_gs.StructuralModel,
|
379
405
|
"input_factory": og_gs.StructuralModelInputFactory,
|
380
406
|
"output_factory": og_gs.StructuralModelOutputFactory,
|
381
407
|
"missing_files": og_gs.check_structural_model_missing_files,
|
@@ -389,13 +415,14 @@ def geode_objects_dict():
|
|
389
415
|
"convert": og_gs.convert_brep_coordinate_reference_system,
|
390
416
|
"create": og.create_brep_coordinate_system,
|
391
417
|
},
|
392
|
-
"
|
418
|
+
"object_type": "model",
|
393
419
|
"is_3D": True,
|
394
420
|
"is_viewable": True,
|
395
421
|
"save_viewable": g_v.save_viewable_structural_model,
|
396
422
|
"inspector": og_inspector.inspect_brep,
|
397
423
|
},
|
398
424
|
"TetrahedralSolid3D": {
|
425
|
+
"class": og.TetrahedralSolid3D,
|
399
426
|
"input_factory": og.TetrahedralSolidInputFactory3D,
|
400
427
|
"output_factory": og.TetrahedralSolidOutputFactory3D,
|
401
428
|
"missing_files": og.check_tetrahedral_solid_missing_files3D,
|
@@ -409,13 +436,14 @@ def geode_objects_dict():
|
|
409
436
|
"convert": og_gs.convert_solid_mesh_coordinate_reference_system3D,
|
410
437
|
"create": og.create_solid_mesh_coordinate_system3D,
|
411
438
|
},
|
412
|
-
"
|
439
|
+
"object_type": "mesh",
|
413
440
|
"is_3D": True,
|
414
441
|
"is_viewable": True,
|
415
442
|
"save_viewable": g_v.save_viewable_tetrahedral_solid3D,
|
416
443
|
"inspector": og_inspector.inspect_solid3D,
|
417
444
|
},
|
418
445
|
"TriangulatedSurface2D": {
|
446
|
+
"class": og.TriangulatedSurface2D,
|
419
447
|
"input_factory": og.TriangulatedSurfaceInputFactory2D,
|
420
448
|
"output_factory": og.TriangulatedSurfaceOutputFactory2D,
|
421
449
|
"missing_files": og.check_triangulated_surface_missing_files2D,
|
@@ -429,13 +457,14 @@ def geode_objects_dict():
|
|
429
457
|
"convert": og_gs.convert_surface_mesh_coordinate_reference_system2D,
|
430
458
|
"create": og.create_surface_mesh_coordinate_system2D,
|
431
459
|
},
|
432
|
-
"
|
460
|
+
"object_type": "mesh",
|
433
461
|
"is_3D": False,
|
434
462
|
"is_viewable": True,
|
435
463
|
"save_viewable": g_v.save_viewable_triangulated_surface2D,
|
436
464
|
"inspector": og_inspector.inspect_surface2D,
|
437
465
|
},
|
438
466
|
"TriangulatedSurface3D": {
|
467
|
+
"class": og.TriangulatedSurface3D,
|
439
468
|
"input_factory": og.TriangulatedSurfaceInputFactory3D,
|
440
469
|
"output_factory": og.TriangulatedSurfaceOutputFactory3D,
|
441
470
|
"missing_files": og.check_triangulated_surface_missing_files3D,
|
@@ -449,13 +478,14 @@ def geode_objects_dict():
|
|
449
478
|
"convert": og_gs.convert_surface_mesh_coordinate_reference_system3D,
|
450
479
|
"create": og.create_surface_mesh_coordinate_system3D,
|
451
480
|
},
|
452
|
-
"
|
481
|
+
"object_type": "mesh",
|
453
482
|
"is_3D": True,
|
454
483
|
"is_viewable": True,
|
455
484
|
"save_viewable": g_v.save_viewable_triangulated_surface3D,
|
456
485
|
"inspector": og_inspector.inspect_surface3D,
|
457
486
|
},
|
458
487
|
"VertexSet": {
|
488
|
+
"class": og.VertexSet,
|
459
489
|
"input_factory": og.VertexSetInputFactory,
|
460
490
|
"output_factory": og.VertexSetOutputFactory,
|
461
491
|
"missing_files": og.check_vertex_set_missing_files,
|
@@ -464,7 +494,7 @@ def geode_objects_dict():
|
|
464
494
|
"is_saveable": og.is_vertex_set_saveable,
|
465
495
|
"save": og.save_vertex_set,
|
466
496
|
"builder": og.VertexSetBuilder.create,
|
467
|
-
"
|
497
|
+
"object_type": "mesh",
|
468
498
|
"is_3D": False,
|
469
499
|
"is_viewable": False,
|
470
500
|
},
|
@@ -5,9 +5,12 @@ import time
|
|
5
5
|
|
6
6
|
# Third party imports
|
7
7
|
import flask
|
8
|
-
|
9
|
-
import werkzeug
|
8
|
+
import opengeode
|
10
9
|
import uuid
|
10
|
+
import werkzeug
|
11
|
+
|
12
|
+
# Local application imports
|
13
|
+
from .. import geode_functions, utils_functions
|
11
14
|
|
12
15
|
routes = flask.Blueprint("routes", __name__)
|
13
16
|
|
@@ -257,6 +260,9 @@ def save_viewable_file():
|
|
257
260
|
DATA_FOLDER_PATH,
|
258
261
|
generated_id + "." + native_extension,
|
259
262
|
)
|
263
|
+
object_type = geode_functions.get_object_type(
|
264
|
+
flask.request.json["input_geode_object"]
|
265
|
+
)
|
260
266
|
|
261
267
|
native_file_name = os.path.basename(absolute_native_file_path)
|
262
268
|
viewable_file_name = os.path.basename(saved_viewable_file_path)
|
@@ -266,6 +272,99 @@ def save_viewable_file():
|
|
266
272
|
"native_file_name": native_file_name,
|
267
273
|
"viewable_file_name": viewable_file_name,
|
268
274
|
"id": generated_id,
|
275
|
+
"object_type": object_type,
|
276
|
+
},
|
277
|
+
200,
|
278
|
+
)
|
279
|
+
|
280
|
+
|
281
|
+
with open(os.path.join(schemas, "create_point.json"), "r") as file:
|
282
|
+
create_point_json = json.load(file)
|
283
|
+
|
284
|
+
|
285
|
+
@routes.route(create_point_json["route"], methods=create_point_json["methods"])
|
286
|
+
def create_point():
|
287
|
+
utils_functions.validate_request(flask.request, create_point_json)
|
288
|
+
DATA_FOLDER_PATH = flask.current_app.config["DATA_FOLDER_PATH"]
|
289
|
+
x = flask.request.json["x"]
|
290
|
+
y = flask.request.json["y"]
|
291
|
+
z = flask.request.json["z"]
|
292
|
+
class_ = geode_functions.geode_object_class("PointSet3D")
|
293
|
+
PointSet3D = class_.create()
|
294
|
+
builder = geode_functions.create_builder("PointSet3D", PointSet3D)
|
295
|
+
builder.create_point(opengeode.Point3D([x, y, z]))
|
296
|
+
|
297
|
+
generated_id = str(uuid.uuid4()).replace("-", "")
|
298
|
+
saved_viewable_file_path = geode_functions.save_viewable(
|
299
|
+
"PointSet3D", PointSet3D, DATA_FOLDER_PATH, generated_id
|
300
|
+
)
|
301
|
+
|
302
|
+
return flask.make_response(
|
303
|
+
{
|
304
|
+
"viewable_file_name": os.path.basename(saved_viewable_file_path),
|
305
|
+
"id": generated_id,
|
306
|
+
},
|
307
|
+
200,
|
308
|
+
)
|
309
|
+
|
310
|
+
|
311
|
+
with open(
|
312
|
+
os.path.join(schemas, "vertex_attribute_names.json"),
|
313
|
+
"r",
|
314
|
+
) as file:
|
315
|
+
vertex_attribute_names_json = json.load(file)
|
316
|
+
|
317
|
+
|
318
|
+
@routes.route(
|
319
|
+
vertex_attribute_names_json["route"],
|
320
|
+
methods=vertex_attribute_names_json["methods"],
|
321
|
+
)
|
322
|
+
def vertex_attribute_names():
|
323
|
+
|
324
|
+
UPLOAD_FOLDER = flask.current_app.config["UPLOAD_FOLDER"]
|
325
|
+
utils_functions.validate_request(flask.request, vertex_attribute_names_json)
|
326
|
+
file_absolute_path = os.path.join(
|
327
|
+
UPLOAD_FOLDER, werkzeug.utils.secure_filename(flask.request.json["filename"])
|
328
|
+
)
|
329
|
+
data = geode_functions.load(
|
330
|
+
flask.request.json["input_geode_object"], file_absolute_path
|
331
|
+
)
|
332
|
+
vertex_attribute_names = data.vertex_attribute_manager().attribute_names()
|
333
|
+
|
334
|
+
return flask.make_response(
|
335
|
+
{
|
336
|
+
"vertex_attribute_names": vertex_attribute_names,
|
337
|
+
},
|
338
|
+
200,
|
339
|
+
)
|
340
|
+
|
341
|
+
|
342
|
+
with open(
|
343
|
+
os.path.join(schemas, "polygon_attribute_names.json"),
|
344
|
+
"r",
|
345
|
+
) as file:
|
346
|
+
polygon_attribute_names_json = json.load(file)
|
347
|
+
|
348
|
+
|
349
|
+
@routes.route(
|
350
|
+
polygon_attribute_names_json["route"],
|
351
|
+
methods=polygon_attribute_names_json["methods"],
|
352
|
+
)
|
353
|
+
def polygon_attribute_names():
|
354
|
+
|
355
|
+
UPLOAD_FOLDER = flask.current_app.config["UPLOAD_FOLDER"]
|
356
|
+
utils_functions.validate_request(flask.request, vertex_attribute_names_json)
|
357
|
+
file_absolute_path = os.path.join(
|
358
|
+
UPLOAD_FOLDER, werkzeug.utils.secure_filename(flask.request.json["filename"])
|
359
|
+
)
|
360
|
+
data = geode_functions.load(
|
361
|
+
flask.request.json["input_geode_object"], file_absolute_path
|
362
|
+
)
|
363
|
+
polygon_attribute_names = data.polygon_attribute_manager().attribute_names()
|
364
|
+
|
365
|
+
return flask.make_response(
|
366
|
+
{
|
367
|
+
"polygon_attribute_names": polygon_attribute_names,
|
269
368
|
},
|
270
369
|
200,
|
271
370
|
)
|
@@ -0,0 +1,24 @@
|
|
1
|
+
{
|
2
|
+
"route": "/create_point",
|
3
|
+
"methods": [
|
4
|
+
"POST"
|
5
|
+
],
|
6
|
+
"type": "object",
|
7
|
+
"properties": {
|
8
|
+
"x": {
|
9
|
+
"type": "number"
|
10
|
+
},
|
11
|
+
"y": {
|
12
|
+
"type": "number"
|
13
|
+
},
|
14
|
+
"z": {
|
15
|
+
"type": "number"
|
16
|
+
}
|
17
|
+
},
|
18
|
+
"required": [
|
19
|
+
"x",
|
20
|
+
"y",
|
21
|
+
"z"
|
22
|
+
],
|
23
|
+
"additionalProperties": false
|
24
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
{
|
2
|
+
"route": "/polygon_attribute_names",
|
3
|
+
"methods": ["POST"],
|
4
|
+
"type": "object",
|
5
|
+
"properties": {
|
6
|
+
"input_geode_object": {
|
7
|
+
"type": "string"
|
8
|
+
},
|
9
|
+
"filename": {
|
10
|
+
"type": "string"
|
11
|
+
}
|
12
|
+
},
|
13
|
+
"required": ["input_geode_object", "filename"],
|
14
|
+
"additionalProperties": false
|
15
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
{
|
2
|
+
"route": "/vertex_attribute_names",
|
3
|
+
"methods": ["POST"],
|
4
|
+
"type": "object",
|
5
|
+
"properties": {
|
6
|
+
"input_geode_object": {
|
7
|
+
"type": "string"
|
8
|
+
},
|
9
|
+
"filename": {
|
10
|
+
"type": "string"
|
11
|
+
}
|
12
|
+
},
|
13
|
+
"required": ["input_geode_object", "filename"],
|
14
|
+
"additionalProperties": false
|
15
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# Standard library imports
|
2
|
+
|
3
|
+
# Third party imports
|
4
|
+
|
5
|
+
# Local application imports
|
6
|
+
|
7
|
+
|
8
|
+
def test_route_wrong_params(client, route, get_full_data):
|
9
|
+
for key, value in get_full_data().items():
|
10
|
+
json = get_full_data()
|
11
|
+
json.pop(key)
|
12
|
+
response = client.post(route, json=json)
|
13
|
+
assert response.status_code == 400
|
14
|
+
error_description = response.json["description"]
|
15
|
+
assert error_description == f"Validation error: '{key}' is a required property"
|
16
|
+
|
17
|
+
json = get_full_data()
|
18
|
+
json["dumb_key"] = "dumb_value"
|
19
|
+
response = client.post(route, json=json)
|
20
|
+
assert response.status_code == 400
|
21
|
+
error_description = response.json["description"]
|
22
|
+
assert (
|
23
|
+
error_description
|
24
|
+
== "Validation error: Additional properties are not allowed ('dumb_key' was unexpected)"
|
25
|
+
)
|
File without changes
|
File without changes
|