38 #include <tinyxml2/tinyxml2.h> 48 filename_( std::move( filename ) )
60 "I/O",
"The GeoModel have to be defined with layers." );
66 tinyxml2::XMLDocument column;
67 tinyxml2::XMLError Result = column.LoadFile( filename_.c_str() );
68 if( Result != tinyxml2::XML_SUCCESS )
71 "I/O",
"Error while loading Stratigraphic Column XML file." );
73 tinyxml2::XMLNode* root = column.FirstChild();
77 "Error while getting root of Stratigraphic Column XML file." );
79 tinyxml2::XMLElement* local =
80 root->FirstChildElement(
"LocalStratigraphicColumn" );
81 tinyxml2::XMLElement* name_column = local->FirstChildElement(
"name" );
82 const std::string name_of_column = name_column->GetText();
84 tinyxml2::XMLElement* paradigm =
85 local->FirstChildElement(
"classification_type" );
86 std::string paradigm_str = paradigm->GetText();
88 tinyxml2::XMLElement* units = local->FirstChildElement(
"units" );
89 tinyxml2::XMLElement* unit = units->FirstChildElement(
"unit" );
91 std::vector< std::string > unitList;
94 tinyxml2::XMLElement* name = unit->FirstChildElement(
"name" );
95 unitList.push_back( name->GetText() );
96 tinyxml2::XMLElement* top = unit->FirstChildElement(
"top" );
99 tinyxml2::XMLElement* name_top =
100 top->FirstChildElement(
"name" );
101 unitList.push_back( name_top->GetText() );
105 unitList.push_back(
"none" );
107 tinyxml2::XMLElement* base = unit->FirstChildElement(
"base" );
110 tinyxml2::XMLElement* name_base =
111 base->FirstChildElement(
"name" );
112 unitList.push_back( name_base->GetText() );
116 unitList.push_back(
"none" );
118 unit = unit->NextSiblingElement(
"unit" );
123 std::vector< const StratigraphicUnit* > units_vec_construction;
124 for( index_t i = 0; i < unitList.size(); i += 3 )
126 const std::string& name_of_unit = unitList[i];
127 if( name_of_unit !=
"none" )
132 &(
model_.geological_entity(
138 if( unitList[i + 1] !=
"none" )
140 std::string name_of_interface_top = unitList[i + 1];
141 index_t top_interface_id =
144 name_of_interface_top );
146 &(
model_.geological_entity(
148 top_interface_id ) ) );
151 if( unitList[i + 2] !=
"none" )
153 std::string name_of_interface_base = unitList[i + 2];
154 index_t base_interface_id =
157 name_of_interface_base );
159 &(
model_.geological_entity(
161 base_interface_id ) ) );
165 *top_interface, *base_interface, *layer,
167 std::numeric_limits< double >::max() );
168 units_vec_construction.push_back( &unit );
171 const std::vector< const StratigraphicUnit* > units_vec =
172 units_vec_construction;
174 if( paradigm_str ==
"chronostratigraphy" )
178 else if( paradigm_str ==
"lithostratigraphy" )
Manages the RockFeature, which contains a RockType and more informations.
The GeologicalEntityType described the type of the Geological entities User can defined there own Geo...
StratigraphicColumnBuilder(StratigraphicColumn &column, GeoModel3D &model)
index_t find_geological_entity_id_from_name(const RINGMesh::GeoModel< DIMENSION > &geomodel, const RINGMesh::GeologicalEntityType &gmge_type, const std::string &name)
A stratigraphic column is composed of several stratigraphic units.
StratigraphicColumn & column_
#define ringmesh_assert(x)
void load_file() override
StratigraphicColumnBuilderFile(StratigraphicColumn &column, GeoModel3D &model, std::string filename)
Classes to build GeoModel from various inputs.