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,121 @@
|
|
|
1
|
+
# Standard library imports
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
# Third party imports
|
|
5
|
+
import flask
|
|
6
|
+
import opengeode
|
|
7
|
+
from opengeodeweb_microservice.schemas import get_schemas_dict
|
|
8
|
+
|
|
9
|
+
# Local application imports
|
|
10
|
+
from opengeodeweb_back import geode_functions, utils_functions
|
|
11
|
+
from . import schemas
|
|
12
|
+
from opengeodeweb_back.geode_objects.geode_point_set3d import GeodePointSet3D
|
|
13
|
+
from opengeodeweb_back.geode_objects.geode_edged_curve3d import GeodeEdgedCurve3D
|
|
14
|
+
|
|
15
|
+
routes = flask.Blueprint("create", __name__, url_prefix="/create")
|
|
16
|
+
schemas_dict = get_schemas_dict(os.path.join(os.path.dirname(__file__), "schemas"))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@routes.route(
|
|
20
|
+
schemas_dict["create_point"]["route"],
|
|
21
|
+
methods=schemas_dict["create_point"]["methods"],
|
|
22
|
+
)
|
|
23
|
+
def create_point() -> flask.Response:
|
|
24
|
+
"""Endpoint to create a single point in 3D space."""
|
|
25
|
+
json_data = utils_functions.validate_request(
|
|
26
|
+
flask.request, schemas_dict["create_point"]
|
|
27
|
+
)
|
|
28
|
+
params = schemas.CreatePoint.from_dict(json_data)
|
|
29
|
+
|
|
30
|
+
# Create the point
|
|
31
|
+
pointset = GeodePointSet3D()
|
|
32
|
+
builder = pointset.builder()
|
|
33
|
+
builder.set_name(params.name)
|
|
34
|
+
builder.create_point(opengeode.Point3D([params.x, params.y, params.z]))
|
|
35
|
+
|
|
36
|
+
# Save and get info
|
|
37
|
+
result = utils_functions.generate_native_viewable_and_light_viewable_from_object(
|
|
38
|
+
pointset
|
|
39
|
+
)
|
|
40
|
+
return flask.make_response(result, 200)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
@routes.route(
|
|
44
|
+
schemas_dict["create_aoi"]["route"], methods=schemas_dict["create_aoi"]["methods"]
|
|
45
|
+
)
|
|
46
|
+
def create_aoi() -> flask.Response:
|
|
47
|
+
"""Endpoint to create an Area of Interest (AOI) as an EdgedCurve3D."""
|
|
48
|
+
json_data = utils_functions.validate_request(
|
|
49
|
+
flask.request, schemas_dict["create_aoi"]
|
|
50
|
+
)
|
|
51
|
+
params = schemas.CreateAoi.from_dict(json_data)
|
|
52
|
+
|
|
53
|
+
# Create the edged curve
|
|
54
|
+
edged_curve = GeodeEdgedCurve3D()
|
|
55
|
+
builder = edged_curve.builder()
|
|
56
|
+
builder.set_name(params.name)
|
|
57
|
+
|
|
58
|
+
# Create vertices first
|
|
59
|
+
for point in params.points:
|
|
60
|
+
builder.create_point(opengeode.Point3D([point.x, point.y, params.z]))
|
|
61
|
+
|
|
62
|
+
# Create edges between consecutive vertices and close the loop
|
|
63
|
+
num_vertices = len(params.points)
|
|
64
|
+
for i in range(num_vertices):
|
|
65
|
+
next_i = (i + 1) % num_vertices
|
|
66
|
+
builder.create_edge_with_vertices(i, next_i)
|
|
67
|
+
|
|
68
|
+
# Save and get info
|
|
69
|
+
result = utils_functions.generate_native_viewable_and_light_viewable_from_object(
|
|
70
|
+
edged_curve
|
|
71
|
+
)
|
|
72
|
+
return flask.make_response(result, 200)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
@routes.route(
|
|
76
|
+
schemas_dict["create_voi"]["route"], methods=schemas_dict["create_voi"]["methods"]
|
|
77
|
+
)
|
|
78
|
+
def create_voi() -> flask.Response:
|
|
79
|
+
"""Endpoint to create a Volume of Interest (VOI) as an EdgedCurve3D (a bounding box/prism)."""
|
|
80
|
+
json_data = utils_functions.validate_request(
|
|
81
|
+
flask.request, schemas_dict["create_voi"]
|
|
82
|
+
)
|
|
83
|
+
params = schemas.CreateVoi.from_dict(json_data)
|
|
84
|
+
|
|
85
|
+
aoi_data = geode_functions.get_data_info(params.aoi_id)
|
|
86
|
+
if not aoi_data:
|
|
87
|
+
flask.abort(404, f"AOI with id {params.aoi_id} not found")
|
|
88
|
+
|
|
89
|
+
aoi_object = geode_functions.load_geode_object(params.aoi_id)
|
|
90
|
+
if not isinstance(aoi_object, GeodeEdgedCurve3D):
|
|
91
|
+
flask.abort(400, f"AOI with id {params.aoi_id} is not a GeodeEdgedCurve3D")
|
|
92
|
+
|
|
93
|
+
aoi_curve = aoi_object.edged_curve
|
|
94
|
+
nb_points = aoi_curve.nb_vertices()
|
|
95
|
+
|
|
96
|
+
edged_curve = GeodeEdgedCurve3D()
|
|
97
|
+
builder = edged_curve.builder()
|
|
98
|
+
builder.set_name(params.name)
|
|
99
|
+
|
|
100
|
+
for point_id in range(nb_points):
|
|
101
|
+
aoi_point = aoi_curve.point(point_id)
|
|
102
|
+
builder.create_point(
|
|
103
|
+
opengeode.Point3D([aoi_point.value(0), aoi_point.value(1), params.z_min])
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
for point_id in range(nb_points):
|
|
107
|
+
aoi_point = aoi_curve.point(point_id)
|
|
108
|
+
builder.create_point(
|
|
109
|
+
opengeode.Point3D([aoi_point.value(0), aoi_point.value(1), params.z_max])
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
for point_id in range(nb_points):
|
|
113
|
+
next_point = (point_id + 1) % nb_points
|
|
114
|
+
builder.create_edge_with_vertices(point_id, next_point)
|
|
115
|
+
builder.create_edge_with_vertices(point_id + nb_points, next_point + nb_points)
|
|
116
|
+
builder.create_edge_with_vertices(point_id, point_id + nb_points)
|
|
117
|
+
|
|
118
|
+
result = utils_functions.generate_native_viewable_and_light_viewable_from_object(
|
|
119
|
+
edged_curve
|
|
120
|
+
)
|
|
121
|
+
return flask.make_response(result, 200)
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"route": "/create_aoi",
|
|
3
|
+
"methods": [
|
|
4
|
+
"POST"
|
|
5
|
+
],
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"name": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "Name of the AOI"
|
|
11
|
+
},
|
|
12
|
+
"points": {
|
|
13
|
+
"type": "array",
|
|
14
|
+
"items": {
|
|
15
|
+
"type": "object",
|
|
16
|
+
"properties": {
|
|
17
|
+
"x": {
|
|
18
|
+
"type": "number"
|
|
19
|
+
},
|
|
20
|
+
"y": {
|
|
21
|
+
"type": "number"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"required": [
|
|
25
|
+
"x",
|
|
26
|
+
"y"
|
|
27
|
+
],
|
|
28
|
+
"additionalProperties": false
|
|
29
|
+
},
|
|
30
|
+
"minItems": 3
|
|
31
|
+
},
|
|
32
|
+
"z": {
|
|
33
|
+
"type": "number"
|
|
34
|
+
},
|
|
35
|
+
"id": {
|
|
36
|
+
"type": "string"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"required": [
|
|
40
|
+
"name",
|
|
41
|
+
"points",
|
|
42
|
+
"z"
|
|
43
|
+
],
|
|
44
|
+
"additionalProperties": false
|
|
45
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
from dataclasses_json import DataClassJsonMixin
|
|
2
|
+
from dataclasses import dataclass
|
|
3
|
+
from typing import List, Optional
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@dataclass
|
|
7
|
+
class Point(DataClassJsonMixin):
|
|
8
|
+
def __post_init__(self) -> None:
|
|
9
|
+
print(self, flush=True)
|
|
10
|
+
|
|
11
|
+
x: float
|
|
12
|
+
y: float
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@dataclass
|
|
16
|
+
class CreateAoi(DataClassJsonMixin):
|
|
17
|
+
def __post_init__(self) -> None:
|
|
18
|
+
print(self, flush=True)
|
|
19
|
+
|
|
20
|
+
name: str
|
|
21
|
+
"""Name of the AOI"""
|
|
22
|
+
|
|
23
|
+
points: List[Point]
|
|
24
|
+
z: float
|
|
25
|
+
id: Optional[str] = None
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"route": "/create_point",
|
|
3
|
+
"methods": [
|
|
4
|
+
"POST"
|
|
5
|
+
],
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"name": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"minLength": 1
|
|
11
|
+
},
|
|
12
|
+
"x": {
|
|
13
|
+
"type": "number"
|
|
14
|
+
},
|
|
15
|
+
"y": {
|
|
16
|
+
"type": "number"
|
|
17
|
+
},
|
|
18
|
+
"z": {
|
|
19
|
+
"type": "number"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"required": [
|
|
23
|
+
"name",
|
|
24
|
+
"x",
|
|
25
|
+
"y",
|
|
26
|
+
"z"
|
|
27
|
+
],
|
|
28
|
+
"additionalProperties": false
|
|
29
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"route": "/create_voi",
|
|
3
|
+
"methods": [
|
|
4
|
+
"POST"
|
|
5
|
+
],
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"name": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "Name of the VOI"
|
|
11
|
+
},
|
|
12
|
+
"aoi_id": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "ID of the corresponding AOI"
|
|
15
|
+
},
|
|
16
|
+
"z_min": {
|
|
17
|
+
"type": "number",
|
|
18
|
+
"description": "Minimum Z coordinate"
|
|
19
|
+
},
|
|
20
|
+
"z_max": {
|
|
21
|
+
"type": "number",
|
|
22
|
+
"description": "Maximum Z coordinate"
|
|
23
|
+
},
|
|
24
|
+
"id": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"description": "Optional ID for updating existing VOI"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"required": [
|
|
30
|
+
"name",
|
|
31
|
+
"aoi_id",
|
|
32
|
+
"z_min",
|
|
33
|
+
"z_max"
|
|
34
|
+
],
|
|
35
|
+
"additionalProperties": false
|
|
36
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from dataclasses_json import DataClassJsonMixin
|
|
2
|
+
from dataclasses import dataclass
|
|
3
|
+
from typing import Optional
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@dataclass
|
|
7
|
+
class CreateVoi(DataClassJsonMixin):
|
|
8
|
+
def __post_init__(self) -> None:
|
|
9
|
+
print(self, flush=True)
|
|
10
|
+
|
|
11
|
+
aoi_id: str
|
|
12
|
+
"""ID of the corresponding AOI"""
|
|
13
|
+
|
|
14
|
+
name: str
|
|
15
|
+
"""Name of the VOI"""
|
|
16
|
+
|
|
17
|
+
z_max: float
|
|
18
|
+
"""Maximum Z coordinate"""
|
|
19
|
+
|
|
20
|
+
z_min: float
|
|
21
|
+
"""Minimum Z coordinate"""
|
|
22
|
+
|
|
23
|
+
id: Optional[str] = None
|
|
24
|
+
"""Optional ID for updating existing VOI"""
|
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
import json
|
|
2
1
|
import os
|
|
3
2
|
import xml.etree.ElementTree as ET
|
|
4
3
|
import flask
|
|
5
|
-
from
|
|
4
|
+
from opengeodeweb_microservice.schemas import get_schemas_dict
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
schemas = os.path.join(os.path.dirname(__file__), "schemas")
|
|
6
|
+
from opengeodeweb_back import geode_functions, utils_functions
|
|
7
|
+
from opengeodeweb_back.geode_objects.geode_model import GeodeModel
|
|
8
|
+
from . import schemas
|
|
11
9
|
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
routes = flask.Blueprint("models", __name__, url_prefix="/models")
|
|
11
|
+
schemas_dict = get_schemas_dict(os.path.join(os.path.dirname(__file__), "schemas"))
|
|
14
12
|
|
|
15
13
|
|
|
16
14
|
@routes.route(
|
|
17
|
-
|
|
15
|
+
schemas_dict["vtm_component_indices"]["route"],
|
|
16
|
+
methods=schemas_dict["vtm_component_indices"]["methods"],
|
|
18
17
|
)
|
|
19
|
-
def uuid_to_flat_index():
|
|
20
|
-
utils_functions.validate_request(
|
|
21
|
-
|
|
22
|
-
vtm_file_path = geode_functions.data_file_path(
|
|
23
|
-
flask.request.get_json().get("id"), "viewable.vtm"
|
|
18
|
+
def uuid_to_flat_index() -> flask.Response:
|
|
19
|
+
json_data = utils_functions.validate_request(
|
|
20
|
+
flask.request, schemas_dict["vtm_component_indices"]
|
|
24
21
|
)
|
|
22
|
+
params = schemas.VtmComponentIndices.from_dict(json_data)
|
|
23
|
+
vtm_file_path = geode_functions.data_file_path(params.id, "viewable.vtm")
|
|
25
24
|
tree = ET.parse(vtm_file_path)
|
|
26
25
|
root = tree.find("vtkMultiBlockDataSet")
|
|
26
|
+
if root is None:
|
|
27
|
+
flask.abort(500, "Failed to read viewable file")
|
|
27
28
|
uuid_to_flat_index = {}
|
|
28
29
|
current_index = 0
|
|
29
30
|
for elem in root.iter():
|
|
@@ -33,22 +34,21 @@ def uuid_to_flat_index():
|
|
|
33
34
|
return flask.make_response({"uuid_to_flat_index": uuid_to_flat_index}, 200)
|
|
34
35
|
|
|
35
36
|
|
|
36
|
-
|
|
37
|
+
@routes.route(
|
|
38
|
+
schemas_dict["mesh_components"]["route"],
|
|
39
|
+
methods=schemas_dict["mesh_components"]["methods"],
|
|
40
|
+
)
|
|
41
|
+
def extract_uuids_endpoint() -> flask.Response:
|
|
42
|
+
json_data = utils_functions.validate_request(
|
|
43
|
+
flask.request, schemas_dict["mesh_components"]
|
|
44
|
+
)
|
|
45
|
+
params = schemas.MeshComponents.from_dict(json_data)
|
|
46
|
+
model = geode_functions.load_geode_object(params.id)
|
|
47
|
+
if not isinstance(model, GeodeModel):
|
|
48
|
+
flask.abort(400, f"{params.id} is not a GeodeModel")
|
|
37
49
|
mesh_components = model.mesh_components()
|
|
38
50
|
uuid_dict = {}
|
|
39
51
|
for mesh_component, ids in mesh_components.items():
|
|
40
52
|
component_name = mesh_component.get()
|
|
41
53
|
uuid_dict[component_name] = [id.string() for id in ids]
|
|
42
|
-
return uuid_dict
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
with open(os.path.join(schemas, "mesh_components.json"), "r") as file:
|
|
46
|
-
mesh_components_json = json.load(file)
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
@routes.route(mesh_components_json["route"], methods=mesh_components_json["methods"])
|
|
50
|
-
def extract_uuids_endpoint():
|
|
51
|
-
utils_functions.validate_request(flask.request, mesh_components_json)
|
|
52
|
-
model = geode_functions.load_data(flask.request.get_json().get("id"))
|
|
53
|
-
uuid_dict = extract_model_uuids(model)
|
|
54
54
|
return flask.make_response({"uuid_dict": uuid_dict}, 200)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from .vertex_attribute_names import *
|
|
2
|
+
from .upload_file import *
|
|
3
|
+
from .texture_coordinates import *
|
|
4
|
+
from .save_viewable_file import *
|
|
5
|
+
from .polyhedron_attribute_names import *
|
|
6
|
+
from .polygon_attribute_names import *
|
|
7
|
+
from .ping import *
|
|
8
|
+
from .missing_files import *
|
|
9
|
+
from .kill import *
|
|
10
|
+
from .inspect_file import *
|
|
11
|
+
from .import_project import *
|
|
12
|
+
from .geographic_coordinate_systems import *
|
|
13
|
+
from .geode_objects_and_output_extensions import *
|
|
14
|
+
from .export_project import *
|
|
15
|
+
from .cell_attribute_names import *
|
|
16
|
+
from .allowed_objects import *
|
|
17
|
+
from .allowed_files import *
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"route": "/allowed_files",
|
|
3
|
-
"methods": [
|
|
3
|
+
"methods": [
|
|
4
|
+
"POST"
|
|
5
|
+
],
|
|
4
6
|
"type": "object",
|
|
5
|
-
"properties": {
|
|
6
|
-
|
|
7
|
-
"type": ["string", "null"]
|
|
8
|
-
}
|
|
9
|
-
},
|
|
10
|
-
"required": ["supported_feature"],
|
|
7
|
+
"properties": {},
|
|
8
|
+
"required": [],
|
|
11
9
|
"additionalProperties": false
|
|
12
|
-
}
|
|
10
|
+
}
|
|
@@ -8,17 +8,10 @@
|
|
|
8
8
|
"filename": {
|
|
9
9
|
"type": "string",
|
|
10
10
|
"minLength": 1
|
|
11
|
-
},
|
|
12
|
-
"supported_feature": {
|
|
13
|
-
"type": [
|
|
14
|
-
"string",
|
|
15
|
-
"null"
|
|
16
|
-
]
|
|
17
11
|
}
|
|
18
12
|
},
|
|
19
13
|
"required": [
|
|
20
|
-
"filename"
|
|
21
|
-
"supported_feature"
|
|
14
|
+
"filename"
|
|
22
15
|
],
|
|
23
16
|
"additionalProperties": false
|
|
24
17
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"route": "/export_project",
|
|
3
|
+
"methods": [
|
|
4
|
+
"POST"
|
|
5
|
+
],
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"snapshot": {
|
|
9
|
+
"type": "object"
|
|
10
|
+
},
|
|
11
|
+
"filename": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"minLength": 1
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"required": [
|
|
17
|
+
"snapshot",
|
|
18
|
+
"filename"
|
|
19
|
+
],
|
|
20
|
+
"additionalProperties": false
|
|
21
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from dataclasses_json import DataClassJsonMixin
|
|
2
|
+
from dataclasses import dataclass
|
|
3
|
+
from typing import Dict, Any
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@dataclass
|
|
7
|
+
class ExportProject(DataClassJsonMixin):
|
|
8
|
+
def __post_init__(self) -> None:
|
|
9
|
+
print(self, flush=True)
|
|
10
|
+
|
|
11
|
+
filename: str
|
|
12
|
+
snapshot: Dict[str, Any]
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
],
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
|
-
"
|
|
8
|
+
"geode_object_type": {
|
|
9
9
|
"type": "string",
|
|
10
10
|
"minLength": 1
|
|
11
11
|
},
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"required": [
|
|
18
|
-
"
|
|
18
|
+
"geode_object_type",
|
|
19
19
|
"filename"
|
|
20
20
|
],
|
|
21
21
|
"additionalProperties": false
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
from dataclasses_json import DataClassJsonMixin
|
|
2
|
+
from dataclasses import dataclass
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
@dataclass
|
|
6
|
+
class GeodeObjectsAndOutputExtensions(DataClassJsonMixin):
|
|
7
|
+
def __post_init__(self) -> None:
|
|
8
|
+
print(self, flush=True)
|
|
9
|
+
|
|
10
|
+
filename: str
|
|
11
|
+
geode_object_type: str
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
],
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
|
-
"
|
|
8
|
+
"geode_object_type": {
|
|
9
9
|
"type": "string",
|
|
10
10
|
"minLength": 1
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
13
|
"required": [
|
|
14
|
-
"
|
|
14
|
+
"geode_object_type"
|
|
15
15
|
],
|
|
16
16
|
"additionalProperties": false
|
|
17
17
|
}
|
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
"type": "string",
|
|
10
10
|
"minLength": 1
|
|
11
11
|
},
|
|
12
|
-
"
|
|
12
|
+
"geode_object_type": {
|
|
13
13
|
"type": "string",
|
|
14
14
|
"minLength": 1
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"required": [
|
|
18
18
|
"filename",
|
|
19
|
-
"
|
|
19
|
+
"geode_object_type"
|
|
20
20
|
],
|
|
21
21
|
"additionalProperties": false
|
|
22
22
|
}
|