[325] | 1 | /* ************************************************************************** * |
---|
[335] | 2 | * Copyright © IPSL/LSCE, xios, Avril 2010 - Octobre 2011 * |
---|
[325] | 3 | * ************************************************************************** */ |
---|
| 4 | |
---|
| 5 | #include <boost/multi_array.hpp> |
---|
| 6 | #include <boost/shared_ptr.hpp> |
---|
| 7 | |
---|
[591] | 8 | #include "xios.hpp" |
---|
[325] | 9 | |
---|
[352] | 10 | #include "attribute_template.hpp" |
---|
| 11 | #include "object_template.hpp" |
---|
| 12 | #include "group_template.hpp" |
---|
[325] | 13 | |
---|
| 14 | #include "icutil.hpp" |
---|
[347] | 15 | #include "timer.hpp" |
---|
[352] | 16 | #include "context.hpp" |
---|
| 17 | #include "grid.hpp" |
---|
| 18 | #include "file.hpp" |
---|
| 19 | #include "field.hpp" |
---|
| 20 | #include "axis.hpp" |
---|
| 21 | #include "domain.hpp" |
---|
[472] | 22 | #include "variable.hpp" |
---|
[836] | 23 | #include "zoom_domain.hpp" |
---|
| 24 | #include "interpolate_domain.hpp" |
---|
| 25 | #include "generate_rectilinear_domain.hpp" |
---|
| 26 | #include "zoom_axis.hpp" |
---|
| 27 | #include "interpolate_axis.hpp" |
---|
| 28 | #include "inverse_axis.hpp" |
---|
[325] | 29 | |
---|
| 30 | extern "C" |
---|
| 31 | { |
---|
| 32 | // /////////////////////////////// Définitions ////////////////////////////// // |
---|
| 33 | |
---|
| 34 | // ----------------------- Redéfinition de types ---------------------------- |
---|
| 35 | |
---|
[345] | 36 | typedef xios::CContext * XContextPtr; |
---|
[325] | 37 | |
---|
[345] | 38 | typedef xios::CGrid * XGridPtr; |
---|
| 39 | typedef xios::CGridGroup * XGridGroupPtr; |
---|
[325] | 40 | |
---|
[345] | 41 | typedef xios::CFile * XFilePtr; |
---|
| 42 | typedef xios::CFileGroup * XFileGroupPtr; |
---|
[325] | 43 | |
---|
[345] | 44 | typedef xios::CField * XFieldPtr; |
---|
| 45 | typedef xios::CFieldGroup * XFieldGroupPtr; |
---|
[325] | 46 | |
---|
[345] | 47 | typedef xios::CDomain * XDomainPtr; |
---|
| 48 | typedef xios::CDomainGroup * XDomainGroupPtr; |
---|
[325] | 49 | |
---|
[345] | 50 | typedef xios::CAxis * XAxisPtr; |
---|
| 51 | typedef xios::CAxisGroup * XAxisGroupPtr; |
---|
[509] | 52 | |
---|
[472] | 53 | typedef xios::CVariable * XVariablePtr; |
---|
| 54 | typedef xios::CVariableGroup * XVariableGroupPtr; |
---|
[509] | 55 | |
---|
[836] | 56 | typedef xios::CTransformation<CDomain> * XTransformationDomainPtr; |
---|
| 57 | typedef xios::CZoomDomain * XZoomDomainPtr; |
---|
| 58 | typedef xios::CInterpolateDomain * XInterpolateDomainPtr; |
---|
| 59 | typedef xios::CGenerateRectilinearDomain * XGenerateRectilinearDomainPtr; |
---|
| 60 | |
---|
| 61 | typedef xios::CTransformation<CAxis> * XTransformationAxisPtr; |
---|
| 62 | typedef xios::CZoomAxis * XZoomAxisPtr; |
---|
| 63 | typedef xios::CInterpolateAxis * XInterpolateAxisPtr; |
---|
| 64 | typedef xios::CInverseAxis * XInverseAxisPtr; |
---|
| 65 | |
---|
[325] | 66 | // ----------------------- Ajout d'enfant à un parent ----------------------- |
---|
[509] | 67 | |
---|
[325] | 68 | void cxios_xml_tree_add_field |
---|
| 69 | (XFieldGroupPtr parent_, XFieldPtr * child_, const char * child_id, int child_id_size) |
---|
| 70 | { |
---|
[509] | 71 | std::string child_id_str; |
---|
[347] | 72 | CTimer::get("XIOS").resume() ; |
---|
[325] | 73 | if (cstr2string(child_id, child_id_size, child_id_str)) |
---|
| 74 | { |
---|
[347] | 75 | *child_ = parent_->createChild(child_id_str) ; |
---|
[325] | 76 | } |
---|
| 77 | else |
---|
| 78 | { |
---|
[347] | 79 | *child_ = parent_->createChild() ; |
---|
[325] | 80 | } |
---|
[347] | 81 | CTimer::get("XIOS").suspend() ; |
---|
[325] | 82 | } |
---|
[509] | 83 | |
---|
[325] | 84 | void cxios_xml_tree_add_grid |
---|
| 85 | (XGridGroupPtr parent_, XGridPtr * child_, const char * child_id, int child_id_size) |
---|
| 86 | { |
---|
[509] | 87 | std::string child_id_str; |
---|
[347] | 88 | CTimer::get("XIOS").resume() ; |
---|
[325] | 89 | if (cstr2string(child_id, child_id_size, child_id_str)) |
---|
| 90 | { |
---|
[347] | 91 | *child_ = parent_->createChild(child_id_str) ; |
---|
[325] | 92 | } |
---|
| 93 | else |
---|
| 94 | { |
---|
[347] | 95 | *child_ = parent_->createChild() ; |
---|
[325] | 96 | } |
---|
[347] | 97 | CTimer::get("XIOS").suspend() ; |
---|
[325] | 98 | } |
---|
[509] | 99 | |
---|
[325] | 100 | void cxios_xml_tree_add_file |
---|
| 101 | (XFileGroupPtr parent_, XFilePtr * child_, const char * child_id, int child_id_size) |
---|
| 102 | { |
---|
[509] | 103 | std::string child_id_str; |
---|
[347] | 104 | CTimer::get("XIOS").resume() ; |
---|
[325] | 105 | if (cstr2string(child_id, child_id_size, child_id_str)) |
---|
| 106 | { |
---|
[347] | 107 | *child_ = parent_->createChild(child_id_str) ; |
---|
[325] | 108 | } |
---|
| 109 | else |
---|
| 110 | { |
---|
[347] | 111 | *child_ = parent_->createChild() ; |
---|
[325] | 112 | } |
---|
[347] | 113 | CTimer::get("XIOS").suspend() ; |
---|
[325] | 114 | } |
---|
[509] | 115 | |
---|
[325] | 116 | void cxios_xml_tree_add_axis |
---|
| 117 | (XAxisGroupPtr parent_, XAxisPtr * child_, const char * child_id, int child_id_size) |
---|
| 118 | { |
---|
[509] | 119 | std::string child_id_str; |
---|
[347] | 120 | CTimer::get("XIOS").resume() ; |
---|
[325] | 121 | if (cstr2string(child_id, child_id_size, child_id_str)) |
---|
| 122 | { |
---|
[347] | 123 | *child_ = parent_->createChild(child_id_str) ; |
---|
[325] | 124 | } |
---|
| 125 | else |
---|
| 126 | { |
---|
[347] | 127 | *child_ = parent_->createChild() ; |
---|
[325] | 128 | } |
---|
[347] | 129 | CTimer::get("XIOS").suspend() ; |
---|
[325] | 130 | } |
---|
[509] | 131 | |
---|
[325] | 132 | void cxios_xml_tree_add_domain |
---|
| 133 | (XDomainGroupPtr parent_, XDomainPtr * child_, const char * child_id, int child_id_size) |
---|
| 134 | { |
---|
[347] | 135 | std::string child_id_str; |
---|
| 136 | CTimer::get("XIOS").resume() ; |
---|
[325] | 137 | if (cstr2string(child_id, child_id_size, child_id_str)) |
---|
| 138 | { |
---|
[347] | 139 | *child_ = parent_->createChild(child_id_str) ; |
---|
[325] | 140 | } |
---|
| 141 | else |
---|
| 142 | { |
---|
[347] | 143 | *child_ = parent_->createChild() ; |
---|
[325] | 144 | } |
---|
[347] | 145 | CTimer::get("XIOS").suspend() ; |
---|
[325] | 146 | } |
---|
[509] | 147 | |
---|
[325] | 148 | void cxios_xml_tree_add_fieldtofile |
---|
| 149 | (XFilePtr parent_, XFieldPtr * child_, const char * child_id, int child_id_size) |
---|
| 150 | { |
---|
[347] | 151 | std::string child_id_str; |
---|
| 152 | CTimer::get("XIOS").resume() ; |
---|
[509] | 153 | |
---|
[325] | 154 | if (cstr2string(child_id, child_id_size, child_id_str)) |
---|
| 155 | { |
---|
[347] | 156 | *child_ = parent_->addField(child_id_str); |
---|
[325] | 157 | } |
---|
| 158 | else |
---|
| 159 | { |
---|
[347] | 160 | *child_ = parent_->addField(); |
---|
[325] | 161 | } |
---|
[347] | 162 | CTimer::get("XIOS").suspend() ; |
---|
[325] | 163 | } |
---|
| 164 | |
---|
[472] | 165 | void cxios_xml_tree_add_variabletofile |
---|
| 166 | (XFilePtr parent_, XVariablePtr * child_, const char * child_id, int child_id_size) |
---|
| 167 | { |
---|
| 168 | std::string child_id_str; |
---|
| 169 | CTimer::get("XIOS").resume() ; |
---|
[509] | 170 | |
---|
[472] | 171 | if (cstr2string(child_id, child_id_size, child_id_str)) |
---|
| 172 | { |
---|
| 173 | *child_ = parent_->addVariable(child_id_str); |
---|
| 174 | } |
---|
| 175 | else |
---|
| 176 | { |
---|
| 177 | *child_ = parent_->addVariable(); |
---|
| 178 | } |
---|
| 179 | CTimer::get("XIOS").suspend() ; |
---|
| 180 | } |
---|
[509] | 181 | |
---|
[472] | 182 | void cxios_xml_tree_add_variabletofield |
---|
| 183 | (XFieldPtr parent_, XVariablePtr * child_, const char * child_id, int child_id_size) |
---|
| 184 | { |
---|
| 185 | std::string child_id_str; |
---|
| 186 | CTimer::get("XIOS").resume() ; |
---|
[509] | 187 | |
---|
[472] | 188 | if (cstr2string(child_id, child_id_size, child_id_str)) |
---|
| 189 | { |
---|
| 190 | *child_ = parent_->addVariable(child_id_str); |
---|
| 191 | } |
---|
| 192 | else |
---|
| 193 | { |
---|
| 194 | *child_ = parent_->addVariable(); |
---|
| 195 | } |
---|
| 196 | CTimer::get("XIOS").suspend() ; |
---|
[509] | 197 | } |
---|
[325] | 198 | // ----------------------- Ajout de groupe à un parent ---------------------- |
---|
| 199 | |
---|
| 200 | void cxios_xml_tree_add_fieldgroup |
---|
| 201 | (XFieldGroupPtr parent_, XFieldGroupPtr * child_, const char * child_id, int child_id_size) |
---|
| 202 | { |
---|
[509] | 203 | std::string child_id_str; |
---|
[347] | 204 | CTimer::get("XIOS").resume() ; |
---|
[325] | 205 | if (cstr2string(child_id, child_id_size, child_id_str)) |
---|
| 206 | { |
---|
[347] | 207 | *child_ = parent_->createChildGroup(child_id_str) ; |
---|
[325] | 208 | } |
---|
| 209 | else |
---|
| 210 | { |
---|
[347] | 211 | *child_ = parent_->createChildGroup() ; |
---|
[325] | 212 | } |
---|
[347] | 213 | CTimer::get("XIOS").suspend() ; |
---|
[325] | 214 | } |
---|
| 215 | |
---|
| 216 | void cxios_xml_tree_add_gridgroup |
---|
| 217 | (XGridGroupPtr parent_, XGridGroupPtr * child_, const char * child_id, int child_id_size) |
---|
| 218 | { |
---|
| 219 | std::string child_id_str; |
---|
[347] | 220 | CTimer::get("XIOS").resume() ; |
---|
[325] | 221 | if (cstr2string(child_id, child_id_size, child_id_str)) |
---|
| 222 | { |
---|
[347] | 223 | *child_ = parent_->createChildGroup(child_id_str) ; |
---|
[325] | 224 | } |
---|
| 225 | else |
---|
| 226 | { |
---|
[347] | 227 | *child_ = parent_->createChildGroup() ; |
---|
[325] | 228 | } |
---|
[347] | 229 | CTimer::get("XIOS").suspend() ; |
---|
[325] | 230 | } |
---|
| 231 | |
---|
| 232 | void cxios_xml_tree_add_filegroup |
---|
| 233 | (XFileGroupPtr parent_, XFileGroupPtr * child_, const char * child_id, int child_id_size) |
---|
| 234 | { |
---|
| 235 | std::string child_id_str; |
---|
[347] | 236 | CTimer::get("XIOS").resume() ; |
---|
[325] | 237 | if (cstr2string(child_id, child_id_size, child_id_str)) |
---|
| 238 | { |
---|
[347] | 239 | *child_ = parent_->createChildGroup(child_id_str) ; |
---|
[325] | 240 | } |
---|
| 241 | else |
---|
| 242 | { |
---|
[347] | 243 | *child_ = parent_->createChildGroup() ; |
---|
[325] | 244 | } |
---|
[347] | 245 | CTimer::get("XIOS").suspend() ; |
---|
[325] | 246 | } |
---|
| 247 | |
---|
| 248 | void cxios_xml_tree_add_axisgroup |
---|
| 249 | (XAxisGroupPtr parent_, XAxisGroupPtr * child_, const char * child_id, int child_id_size) |
---|
| 250 | { |
---|
| 251 | std::string child_id_str; |
---|
[347] | 252 | CTimer::get("XIOS").resume() ; |
---|
[325] | 253 | if (cstr2string(child_id, child_id_size, child_id_str)) |
---|
| 254 | { |
---|
[347] | 255 | *child_ = parent_->createChildGroup(child_id_str) ; |
---|
[325] | 256 | } |
---|
| 257 | else |
---|
| 258 | { |
---|
[347] | 259 | *child_ = parent_->createChildGroup() ; |
---|
[325] | 260 | } |
---|
[347] | 261 | CTimer::get("XIOS").suspend() ; |
---|
[325] | 262 | } |
---|
| 263 | |
---|
| 264 | void cxios_xml_tree_add_domaingroup |
---|
| 265 | (XDomainGroupPtr parent_, XDomainGroupPtr * child_, const char * child_id, int child_id_size) |
---|
| 266 | { |
---|
| 267 | std::string child_id_str; |
---|
[347] | 268 | CTimer::get("XIOS").resume() ; |
---|
[325] | 269 | if (cstr2string(child_id, child_id_size, child_id_str)) |
---|
| 270 | { |
---|
[347] | 271 | *child_ = parent_->createChildGroup(child_id_str) ; |
---|
[325] | 272 | } |
---|
| 273 | else |
---|
| 274 | { |
---|
[347] | 275 | *child_ = parent_->createChildGroup() ; |
---|
[325] | 276 | } |
---|
[347] | 277 | CTimer::get("XIOS").suspend() ; |
---|
[325] | 278 | } |
---|
| 279 | |
---|
| 280 | void cxios_xml_tree_add_fieldgrouptofile |
---|
| 281 | (XFilePtr parent_, XFieldGroupPtr * child_, const char * child_id, int child_id_size) |
---|
| 282 | { |
---|
[509] | 283 | std::string child_id_str; |
---|
[347] | 284 | CTimer::get("XIOS").resume() ; |
---|
[325] | 285 | if (cstr2string(child_id, child_id_size, child_id_str)) |
---|
| 286 | { |
---|
[347] | 287 | *child_ = parent_->addFieldGroup(child_id_str); |
---|
[325] | 288 | } |
---|
| 289 | else |
---|
| 290 | { |
---|
[347] | 291 | *child_ = parent_->addFieldGroup(); |
---|
[325] | 292 | } |
---|
[347] | 293 | CTimer::get("XIOS").suspend() ; |
---|
[325] | 294 | } |
---|
[509] | 295 | |
---|
[472] | 296 | void cxios_xml_tree_add_variablegrouptofile |
---|
| 297 | (XFilePtr parent_, XVariableGroupPtr * child_, const char * child_id, int child_id_size) |
---|
| 298 | { |
---|
[509] | 299 | std::string child_id_str; |
---|
[472] | 300 | CTimer::get("XIOS").resume() ; |
---|
| 301 | if (cstr2string(child_id, child_id_size, child_id_str)) |
---|
| 302 | { |
---|
| 303 | *child_ = parent_->addVariableGroup(child_id_str); |
---|
| 304 | } |
---|
| 305 | else |
---|
| 306 | { |
---|
| 307 | *child_ = parent_->addVariableGroup(); |
---|
| 308 | } |
---|
| 309 | CTimer::get("XIOS").suspend() ; |
---|
| 310 | } |
---|
[509] | 311 | |
---|
[472] | 312 | void cxios_xml_tree_add_variablegrouptofield |
---|
| 313 | (XFieldPtr parent_, XVariableGroupPtr * child_, const char * child_id, int child_id_size) |
---|
| 314 | { |
---|
[509] | 315 | std::string child_id_str; |
---|
[472] | 316 | CTimer::get("XIOS").resume() ; |
---|
| 317 | if (cstr2string(child_id, child_id_size, child_id_str)) |
---|
| 318 | { |
---|
| 319 | *child_ = parent_->addVariableGroup(child_id_str); |
---|
| 320 | } |
---|
| 321 | else |
---|
| 322 | { |
---|
| 323 | *child_ = parent_->addVariableGroup(); |
---|
| 324 | } |
---|
| 325 | CTimer::get("XIOS").suspend() ; |
---|
[509] | 326 | } |
---|
| 327 | |
---|
[835] | 328 | void cxios_xml_tree_add_axistogrid |
---|
| 329 | (XGridPtr parent_, XAxisPtr * child_, const char * child_id, int child_id_size) |
---|
| 330 | { |
---|
| 331 | std::string child_id_str; |
---|
| 332 | CTimer::get("XIOS").resume() ; |
---|
| 333 | if (cstr2string(child_id, child_id_size, child_id_str)) |
---|
| 334 | { |
---|
| 335 | *child_ = parent_->addAxis(child_id_str); |
---|
| 336 | } |
---|
| 337 | else |
---|
| 338 | { |
---|
| 339 | *child_ = parent_->addAxis(); |
---|
| 340 | } |
---|
| 341 | CTimer::get("XIOS").suspend() ; |
---|
| 342 | } |
---|
[509] | 343 | |
---|
[835] | 344 | void cxios_xml_tree_add_domaintogrid |
---|
| 345 | (XGridPtr parent_, XDomainPtr * child_, const char * child_id, int child_id_size) |
---|
| 346 | { |
---|
| 347 | std::string child_id_str; |
---|
| 348 | CTimer::get("XIOS").resume() ; |
---|
| 349 | if (cstr2string(child_id, child_id_size, child_id_str)) |
---|
| 350 | { |
---|
| 351 | *child_ = parent_->addDomain(child_id_str); |
---|
| 352 | } |
---|
| 353 | else |
---|
| 354 | { |
---|
| 355 | *child_ = parent_->addDomain(); |
---|
| 356 | } |
---|
| 357 | CTimer::get("XIOS").suspend() ; |
---|
| 358 | } |
---|
| 359 | |
---|
[836] | 360 | void cxios_xml_tree_add_zoomdomaintodomain |
---|
| 361 | (XDomainPtr parent_, XZoomDomainPtr * child_, const char * child_id, int child_id_size) |
---|
| 362 | { |
---|
| 363 | std::string child_id_str; |
---|
| 364 | XTransformationDomainPtr tmpChild_; |
---|
| 365 | CTimer::get("XIOS").resume() ; |
---|
| 366 | if (cstr2string(child_id, child_id_size, child_id_str)) |
---|
| 367 | { |
---|
| 368 | tmpChild_ = parent_->addTransformation(TRANS_ZOOM_DOMAIN, child_id_str); |
---|
| 369 | } |
---|
| 370 | else |
---|
| 371 | { |
---|
| 372 | tmpChild_ = parent_->addTransformation(TRANS_ZOOM_DOMAIN); |
---|
| 373 | } |
---|
| 374 | *child_ = static_cast<XZoomDomainPtr>(tmpChild_); |
---|
| 375 | CTimer::get("XIOS").suspend() ; |
---|
| 376 | } |
---|
| 377 | |
---|
| 378 | void cxios_xml_tree_add_interpolatedomaintodomain |
---|
| 379 | (XDomainPtr parent_, XInterpolateDomainPtr * child_, const char * child_id, int child_id_size) |
---|
| 380 | { |
---|
| 381 | std::string child_id_str; |
---|
| 382 | XTransformationDomainPtr tmpChild_; |
---|
| 383 | CTimer::get("XIOS").resume() ; |
---|
| 384 | if (cstr2string(child_id, child_id_size, child_id_str)) |
---|
| 385 | { |
---|
| 386 | tmpChild_ = parent_->addTransformation(TRANS_INTERPOLATE_DOMAIN, child_id_str); |
---|
| 387 | } |
---|
| 388 | else |
---|
| 389 | { |
---|
| 390 | tmpChild_ = parent_->addTransformation(TRANS_INTERPOLATE_DOMAIN); |
---|
| 391 | } |
---|
| 392 | *child_ = static_cast<XInterpolateDomainPtr>(tmpChild_); |
---|
| 393 | CTimer::get("XIOS").suspend() ; |
---|
| 394 | } |
---|
| 395 | |
---|
| 396 | void cxios_xml_tree_add_generatedomaintodomain |
---|
| 397 | (XDomainPtr parent_, XGenerateRectilinearDomainPtr * child_, const char * child_id, int child_id_size) |
---|
| 398 | { |
---|
| 399 | std::string child_id_str; |
---|
| 400 | XTransformationDomainPtr tmpChild_; |
---|
| 401 | CTimer::get("XIOS").resume() ; |
---|
| 402 | if (cstr2string(child_id, child_id_size, child_id_str)) |
---|
| 403 | { |
---|
| 404 | tmpChild_ = parent_->addTransformation(TRANS_GENERATE_RECTILINEAR_DOMAIN, child_id_str); |
---|
| 405 | } |
---|
| 406 | else |
---|
| 407 | { |
---|
| 408 | tmpChild_ = parent_->addTransformation(TRANS_GENERATE_RECTILINEAR_DOMAIN); |
---|
| 409 | } |
---|
| 410 | *child_ = static_cast<XGenerateRectilinearDomainPtr>(tmpChild_); |
---|
| 411 | CTimer::get("XIOS").suspend() ; |
---|
| 412 | } |
---|
| 413 | |
---|
| 414 | void cxios_xml_tree_add_zoomaxistoaxis |
---|
| 415 | (XAxisPtr parent_, XZoomAxisPtr * child_, const char * child_id, int child_id_size) |
---|
| 416 | { |
---|
| 417 | std::string child_id_str; |
---|
| 418 | XTransformationAxisPtr tmpChild_; |
---|
| 419 | CTimer::get("XIOS").resume() ; |
---|
| 420 | if (cstr2string(child_id, child_id_size, child_id_str)) |
---|
| 421 | { |
---|
| 422 | tmpChild_ = parent_->addTransformation(TRANS_ZOOM_AXIS, child_id_str); |
---|
| 423 | } |
---|
| 424 | else |
---|
| 425 | { |
---|
| 426 | tmpChild_ = parent_->addTransformation(TRANS_ZOOM_AXIS); |
---|
| 427 | } |
---|
| 428 | *child_ = static_cast<XZoomAxisPtr>(tmpChild_); |
---|
| 429 | CTimer::get("XIOS").suspend() ; |
---|
| 430 | } |
---|
| 431 | |
---|
| 432 | void cxios_xml_tree_add_interpolateaxistoaxis |
---|
| 433 | (XAxisPtr parent_, XInterpolateAxisPtr * child_, const char * child_id, int child_id_size) |
---|
| 434 | { |
---|
| 435 | std::string child_id_str; |
---|
| 436 | XTransformationAxisPtr tmpChild_; |
---|
| 437 | CTimer::get("XIOS").resume() ; |
---|
| 438 | if (cstr2string(child_id, child_id_size, child_id_str)) |
---|
| 439 | { |
---|
| 440 | tmpChild_ = parent_->addTransformation(TRANS_INTERPOLATE_AXIS, child_id_str); |
---|
| 441 | } |
---|
| 442 | else |
---|
| 443 | { |
---|
| 444 | tmpChild_ = parent_->addTransformation(TRANS_INTERPOLATE_AXIS); |
---|
| 445 | } |
---|
| 446 | *child_ = static_cast<XInterpolateAxisPtr>(tmpChild_); |
---|
| 447 | CTimer::get("XIOS").suspend() ; |
---|
| 448 | } |
---|
| 449 | |
---|
| 450 | void cxios_xml_tree_add_inverseaxistoaxis |
---|
| 451 | (XAxisPtr parent_, XInverseAxisPtr * child_, const char * child_id, int child_id_size) |
---|
| 452 | { |
---|
| 453 | std::string child_id_str; |
---|
| 454 | XTransformationAxisPtr tmpChild_; |
---|
| 455 | CTimer::get("XIOS").resume() ; |
---|
| 456 | if (cstr2string(child_id, child_id_size, child_id_str)) |
---|
| 457 | { |
---|
| 458 | tmpChild_ = parent_->addTransformation(TRANS_INVERSE_AXIS, child_id_str); |
---|
| 459 | } |
---|
| 460 | else |
---|
| 461 | { |
---|
| 462 | tmpChild_ = parent_->addTransformation(TRANS_INVERSE_AXIS); |
---|
| 463 | } |
---|
| 464 | *child_ = static_cast<XInverseAxisPtr>(tmpChild_); |
---|
| 465 | CTimer::get("XIOS").suspend() ; |
---|
| 466 | } |
---|
| 467 | |
---|
[325] | 468 | // ----------------------- Affichage de l'arborescence ---------------------- |
---|
[509] | 469 | |
---|
| 470 | // void cxios_xml_tree_show (const char * filename, int filename_size) |
---|
[346] | 471 | // { |
---|
| 472 | // std::string filename_str; |
---|
| 473 | // try |
---|
| 474 | // { |
---|
| 475 | // if (cstr2string(filename, filename_size, filename_str)) |
---|
| 476 | // xios::CTreeManager::PrintTreeToFile(filename_str); |
---|
| 477 | // else |
---|
| 478 | // xios::CTreeManager::PrintTreeToStream(std::clog); |
---|
| 479 | // } |
---|
| 480 | // catch (xios::CException & exc) |
---|
| 481 | // { |
---|
| 482 | // std::cerr << exc.getMessage() << std::endl; |
---|
| 483 | // exit (EXIT_FAILURE); |
---|
| 484 | // } |
---|
| 485 | // } |
---|
[509] | 486 | |
---|
| 487 | |
---|
[325] | 488 | // ----------------------- Parsing de document xml -------------------------- |
---|
[509] | 489 | |
---|
[346] | 490 | // void cxios_xml_parse_file (const char * filename , int filename_size)// |
---|
| 491 | // { |
---|
[509] | 492 | // std::string filename_str; |
---|
[346] | 493 | // if (!cstr2string(filename, filename_size, filename_str)) return; |
---|
| 494 | // |
---|
| 495 | // try |
---|
| 496 | // { |
---|
| 497 | // xios::CTreeManager::ParseFile(filename_str); |
---|
| 498 | // } |
---|
| 499 | // catch (xios::CException & exc) |
---|
| 500 | // { |
---|
| 501 | // std::cerr << exc.getMessage() << std::endl; |
---|
| 502 | // exit (EXIT_FAILURE); |
---|
| 503 | // } |
---|
| 504 | // } |
---|
[509] | 505 | |
---|
[346] | 506 | // void cxios_xml_parse_string(const char * xmlcontent, int xmlcontent_size) |
---|
| 507 | // { |
---|
[509] | 508 | // std::string xmlcontent_str; |
---|
[346] | 509 | // if (!cstr2string(xmlcontent, xmlcontent_size, xmlcontent_str)) return; |
---|
| 510 | // |
---|
| 511 | // try |
---|
| 512 | // { |
---|
| 513 | // xios::CTreeManager::ParseString(xmlcontent_str); |
---|
| 514 | // } |
---|
| 515 | // catch (xios::CException & exc) |
---|
| 516 | // { |
---|
| 517 | // std::cerr << exc.getMessage() << std::endl; |
---|
| 518 | // exit (EXIT_FAILURE); |
---|
| 519 | // } |
---|
| 520 | // } |
---|
[325] | 521 | |
---|
| 522 | |
---|
[509] | 523 | |
---|
[325] | 524 | } // extern "C" |
---|