You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Enable schema file specification;
if not specified, the default schema from
fourcipp is taken.
- Add support for files with materials currently
not assigned to any elements.
Previously, the webviewer attempted
to create material meshes even for such materials, and
it failed --- such files were therefore not
visualizable. Now, the specific material meshes are set
to 'None' and they are not visualized.
Copy file name to clipboardExpand all lines: src/fourc_webviewer/fourc_webserver.py
+59-26Lines changed: 59 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,7 @@
3
3
web viewer."""
4
4
5
5
importcopy
6
+
importjson
6
7
importre
7
8
importshutil
8
9
importtempfile
@@ -55,18 +56,33 @@ class FourCWebServer:
55
56
def__init__(
56
57
self,
57
58
fourc_yaml_file,
59
+
fourc_schema_file=None,
58
60
page_title="4C Webviewer",
59
61
):
60
62
"""Constructor.
61
63
62
64
Args:
63
65
fourc_yaml_file (string|Path): path to the input fourc yaml file.
66
+
fourc_schema_file (string|Path): path to the fourc schema json file. If not provided, the default FourCIPP schema from CONFIG.fourc_json_schema is used.
64
67
page_title (string): page title appearing in the browser
65
68
tab.
66
69
"""
67
70
68
71
self.server=get_server()
69
72
73
+
# set 4C schema: if a file was provided, read it; otherwise take the schema provided by fourcipp
74
+
iffourc_schema_file:
75
+
# check whether the provided file is really a json schema file
"general_sections[selected_main_section_name][selected_section_name][item_key]", # binding item_val directly does not work, since Object.entries(...) creates copies for the mutable objects
update_modelValue="flushState('general_sections')", # this is required in order to flush the state changes correctly to the server, as our passed on v-model is a nested variable
update_modelValue="flushState('add_value')", # this is required in order to flush the state changes correctly to the server, as our passed on v-model is a nested variable
0 commit comments