mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Geometry: Meshing: Prepare code for next 'mailleurTT' version.
This commit is contained in:
1 parent
db87b1e214
commit
ef583fc9bb
7 files changed
+204
-181
No files matched your search
@@ -560,12 +560,20 @@ class Reach(SQLSubModel):
|
||||
# Import/Export
|
||||
|
||||
def import_geometry(self, file_path_name: str):
|
||||
if file_path_name.endswith(".st"):
|
||||
return self.import_geometry_st(file_path_name)
|
||||
elif file_path_name.endswith(".shp"):
|
||||
return self.import_geometry_shp(file_path_name)
|
||||
else:
|
||||
return []
|
||||
ext = file_path_name.split(".")
|
||||
if len(ext) > 0:
|
||||
ext = ext[-1].lower()
|
||||
|
||||
if ext in ['st', 'm']:
|
||||
return self.import_geometry_st(file_path_name)
|
||||
|
||||
if ext in ['shp']:
|
||||
return self.import_geometry_shp(file_path_name)
|
||||
|
||||
raise FileFormatError(
|
||||
file_path_name,
|
||||
f"Geometry file extention ({ext}) unkown"
|
||||
)
|
||||
|
||||
@timer
|
||||
def import_geometry_shp(self, file_path_name: str):
|
||||
|
||||
Reference in new issue
Block a user