291 lines
11 KiB
C++
291 lines
11 KiB
C++
// This file is part of the Herezh++ application.
|
|
//
|
|
// The finite element software Herezh++ is dedicated to the field
|
|
// of mechanics for large transformations of solid structures.
|
|
// It is developed by Gérard Rio (APP: IDDN.FR.010.0106078.000.R.P.2006.035.20600)
|
|
// INSTITUT DE RECHERCHE DUPUY DE LÔME (IRDL) <https://www.irdl.fr/>.
|
|
//
|
|
// Herezh++ is distributed under GPL 3 license ou ultérieure.
|
|
//
|
|
// Copyright (C) 1997-2022 Université Bretagne Sud (France)
|
|
// AUTHOR : Gérard Rio
|
|
// E-MAIL : gerardrio56@free.fr
|
|
//
|
|
// This program is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License,
|
|
// or (at your option) any later version.
|
|
//
|
|
// This program is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty
|
|
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
// See the GNU General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU General Public License
|
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
//
|
|
// For more information, please consult: <https://herezh.irdl.fr/>.
|
|
|
|
#include "Basiques.h"
|
|
using namespace std;
|
|
|
|
// ----- définition des variables statiques ------------
|
|
|
|
short int DeuxEntiers::impre_schem_XML=0;
|
|
short int DeuxDoubles::impre_schem_XML=0;
|
|
short int Entier_et_Double::impre_schem_XML=0;
|
|
short int Deux_String::impre_schem_XML=0;
|
|
short int String_et_entier::impre_schem_XML=0;
|
|
short int Trois_String::impre_schem_XML=0;
|
|
short int quatre_string_un_entier::impre_schem_XML=0;
|
|
short int TroisEntiers::impre_schem_XML=0;
|
|
|
|
// sortie du schemaXML: en fonction de enu
|
|
void DeuxEntiers::SchemaXML_DeuxEntiers(ofstream& sort,const Enum_IO_XML enu) const
|
|
{// sortie balisée simple
|
|
switch (enu)
|
|
{case XML_TYPE_GLOBAUX:
|
|
{sort << "\n <!-- ******************************************************* -->"
|
|
<< "\n<xs:complexType name=\"DeuxEntiers\" >"
|
|
<< "\n <xs:annotation>"
|
|
<< "\n <xs:documentation> type simple pour definir deux entiers </xs:documentation>"
|
|
<< "\n </xs:annotation>"
|
|
<< "\n <xs:attribute name=\"un\" type=\"xs:int\" use=\"required\" />"
|
|
<< "\n <xs:attribute name=\"deux\" type=\"xs:int\" use=\"required\" />"
|
|
<< "\n</xs:complexType>";
|
|
DeuxEntiers::impre_schem_XML=1; // une seule sortie
|
|
};
|
|
default: sort << "\n SchemaXML: cas non pris en compte " ;
|
|
};
|
|
};
|
|
|
|
// surcharge de lecture en XML
|
|
istream & DeuxEntiers::LectXML_DeuxEntiers(istream & ent)
|
|
{ string nom;
|
|
ent >> nom >> nom >> un >> nom >> deux >> nom;
|
|
return ent;
|
|
};
|
|
|
|
// surcharge d'ecriture en XML
|
|
ostream & DeuxEntiers::EcritXML_DeuxEntiers(ostream & sort)
|
|
{ sort << "<DeuxDoubles> un= "<< un << " deux= " << deux << "</DeuxDoubles>";
|
|
return sort;
|
|
};
|
|
|
|
// sortie du schemaXML: en fonction de enu
|
|
void DeuxDoubles::SchemaXML_DeuxDoubles(ofstream& sort,const Enum_IO_XML enu) const
|
|
{// sortie balisée simple
|
|
switch (enu)
|
|
{case XML_TYPE_GLOBAUX:
|
|
{sort << "\n <!-- ******************************************************* -->"
|
|
<< "\n<xs:complexType name=\"DeuxDoubles\" >"
|
|
<< "\n <xs:annotation>"
|
|
<< "\n <xs:documentation> type simple pour definir deux double </xs:documentation>"
|
|
<< "\n </xs:annotation>"
|
|
<< "\n <xs:attribute name=\"un\" type=\"xs:double\" use=\"required\" />"
|
|
<< "\n <xs:attribute name=\"deux\" type=\"xs:double\" use=\"required\" />"
|
|
<< "\n</xs:complexType>";
|
|
DeuxDoubles::impre_schem_XML=1; // une seule sortie
|
|
};
|
|
default: sort << "\n SchemaXML: cas non pris en compte " ;
|
|
|
|
};
|
|
};
|
|
|
|
|
|
// surcharge de lecture en XML
|
|
istream & DeuxDoubles::LectXML_DeuxDoubles(istream & ent)
|
|
{ string nom;
|
|
ent >> nom >> nom >> un >> nom >> deux >> nom;
|
|
return ent;
|
|
};
|
|
|
|
// surcharge d'ecriture en XML
|
|
ostream & DeuxDoubles::EcritXML_DeuxDoubles(ostream & sort)
|
|
{ sort << "<DeuxDoubles> un= "<< un << " deux= " << deux << "</DeuxDoubles>";
|
|
return sort;
|
|
};
|
|
|
|
|
|
// sortie du schemaXML: en fonction de enu
|
|
void Entier_et_Double::SchemaXML_Entier_et_Double(ofstream& sort,const Enum_IO_XML enu) const
|
|
{// sortie balisée simple
|
|
switch (enu)
|
|
{case XML_TYPE_GLOBAUX:
|
|
{sort << "\n <!-- ******************************************************* -->"
|
|
<< "\n<xs:complexType name=\"Entier_et_Double\" >"
|
|
<< "\n <xs:annotation>"
|
|
<< "\n <xs:documentation> type simple pour definir un entier et un double </xs:documentation>"
|
|
<< "\n </xs:annotation>"
|
|
<< "\n <xs:attribute name=\"n\" type=\"xs:int\" use=\"required\" />"
|
|
<< "\n <xs:attribute name=\"x\" type=\"xs:double\" use=\"required\" />"
|
|
<< "\n</xs:complexType>";
|
|
Entier_et_Double::impre_schem_XML=1; // une seule sortie
|
|
};
|
|
default: sort << "\n SchemaXML: cas non pris en compte " ;
|
|
|
|
};
|
|
};
|
|
|
|
// surcharge de lecture en XML
|
|
istream & Entier_et_Double::LectXML_Entier_et_Double(istream & ent)
|
|
{ string nom;
|
|
ent >> nom >> nom >> n >> nom >> x >> nom;
|
|
return ent;
|
|
};
|
|
|
|
// surcharge d'ecriture en XML
|
|
ostream & Entier_et_Double::EcritXML_Entier_et_Double(ostream & sort)
|
|
{ sort << "<DeuxDoubles> un= "<< n << " deux= " << x << "</DeuxDoubles>";
|
|
return sort;
|
|
};
|
|
|
|
|
|
// sortie du schemaXML: en fonction de enu
|
|
void Deux_String::SchemaXML_Deux_String(ofstream& sort,const Enum_IO_XML enu) const
|
|
{// sortie balisée simple
|
|
switch (enu)
|
|
{case XML_TYPE_GLOBAUX:
|
|
{sort << "\n <!-- ******************************************************* -->"
|
|
<< "\n<xs:complexType name=\"Deux_String\" >"
|
|
<< "\n <xs:annotation>"
|
|
<< "\n <xs:documentation> type simple pour definir deux string </xs:documentation>"
|
|
<< "\n </xs:annotation>"
|
|
<< "\n <xs:attribute name=\"n\" type=\"xs:string\" use=\"required\" />"
|
|
<< "\n <xs:attribute name=\"x\" type=\"xs:string\" use=\"required\" />"
|
|
<< "\n</xs:complexType>";
|
|
Deux_String::impre_schem_XML=1; // une seule sortie
|
|
};
|
|
default: sort << "\n SchemaXML: cas non pris en compte " ;
|
|
|
|
};
|
|
};
|
|
|
|
// surcharge de lecture en XML
|
|
istream & Deux_String::LectXML_Deux_String(istream & ent)
|
|
{ string nom;
|
|
ent >> nom >> nom >> nom1 >> nom >> nom2 >> nom;
|
|
return ent;
|
|
};
|
|
|
|
// surcharge d'ecriture en XML
|
|
ostream & Deux_String::EcritXML_Deux_String(ostream & sort)
|
|
{ sort << "<Deux_String> nom1= "<< nom1 << " nom2= " << nom2 << "</Deux_String>";
|
|
return sort;
|
|
};
|
|
|
|
|
|
// sortie du schemaXML: en fonction de enu
|
|
void String_et_entier::SchemaXML_String_et_entier(ofstream& sort,const Enum_IO_XML enu) const
|
|
{// sortie balisée simple
|
|
switch (enu)
|
|
{case XML_TYPE_GLOBAUX:
|
|
{sort << "\n <!-- ******************************************************* -->"
|
|
<< "\n<xs:complexType name=\"String_et_entier\" >"
|
|
<< "\n <xs:annotation>"
|
|
<< "\n <xs:documentation> type simple pour definir un string et un entier </xs:documentation>"
|
|
<< "\n </xs:annotation>"
|
|
<< "\n <xs:attribute name=\"n\" type=\"xs:string\" use=\"required\" />"
|
|
<< "\n <xs:attribute name=\"x\" type=\"xs:int\" use=\"required\" />"
|
|
<< "\n</xs:complexType>";
|
|
String_et_entier::impre_schem_XML=1; // une seule sortie
|
|
};
|
|
default: sort << "\n SchemaXML: cas non pris en compte " ;
|
|
|
|
};
|
|
};
|
|
|
|
// surcharge de lecture en XML
|
|
istream & String_et_entier::LectXML_String_et_entier(istream & ent)
|
|
{ string toto;
|
|
ent >> toto >> toto >> nom >> toto >> n >> toto;
|
|
return ent;
|
|
};
|
|
|
|
// surcharge d'ecriture en XML
|
|
ostream & String_et_entier::EcritXML_String_et_entier(ostream & sort)
|
|
{ sort << "<String_et_entier> nom1= "<< nom << " nom2= " << n << "</String_et_entier>";
|
|
return sort;
|
|
};
|
|
|
|
|
|
// sortie du schemaXML: en fonction de enu
|
|
void Trois_String::SchemaXML_Trois_String(ofstream& sort,const Enum_IO_XML enu) const
|
|
{// sortie balisée simple
|
|
switch (enu)
|
|
{case XML_TYPE_GLOBAUX:
|
|
{sort << "\n <!-- ******************************************************* -->"
|
|
<< "\n<xs:complexType name=\"Trois_String\" >"
|
|
<< "\n <xs:annotation>"
|
|
<< "\n <xs:documentation> type simple pour definir trois string </xs:documentation>"
|
|
<< "\n </xs:annotation>"
|
|
<< "\n <xs:attribute name=\"n\" type=\"xs:string\" use=\"required\" />"
|
|
<< "\n <xs:attribute name=\"x\" type=\"xs:string\" use=\"required\" />"
|
|
<< "\n <xs:attribute name=\"x\" type=\"xs:string\" use=\"required\" />"
|
|
<< "\n</xs:complexType>";
|
|
Trois_String::impre_schem_XML=1; // une seule sortie
|
|
};
|
|
default: sort << "\n SchemaXML: cas non pris en compte " ;
|
|
|
|
};
|
|
};
|
|
|
|
// surcharge de lecture en XML
|
|
istream & Trois_String::LectXML_Trois_String(istream & ent)
|
|
{ string nom;
|
|
ent >> nom >> nom >> nom1 >> nom >> nom2 >> nom >> nom3 >> nom;
|
|
return ent;
|
|
};
|
|
|
|
// surcharge d'ecriture en XML
|
|
ostream & Trois_String::EcritXML_Trois_String(ostream & sort)
|
|
{ sort << "<Deux_String> nom1= "<< nom1 << " nom2= " << nom2 << " nom3= " << nom3 << "</Deux_String>";
|
|
return sort;
|
|
};
|
|
|
|
// sortie du schemaXML: en fonction de enu
|
|
void quatre_string_un_entier::SchemaXML_quatre_string_un_entier(ofstream& sort,const Enum_IO_XML enu) const
|
|
{// sortie balisée simple
|
|
switch (enu)
|
|
{case XML_TYPE_GLOBAUX:
|
|
{sort << "\n <!-- ******************************************************* -->"
|
|
<< "\n<xs:complexType name=\"quatre_string_un_entier\" >"
|
|
<< "\n <xs:annotation>"
|
|
<< "\n <xs:documentation> type simple pour definir trois string </xs:documentation>"
|
|
<< "\n </xs:annotation>"
|
|
<< "\n <xs:attribute name=\"n\" type=\"xs:string\" use=\"required\" />"
|
|
<< "\n <xs:attribute name=\"x\" type=\"xs:string\" use=\"required\" />"
|
|
<< "\n <xs:attribute name=\"x\" type=\"xs:string\" use=\"required\" />"
|
|
<< "\n <xs:attribute name=\"n\" type=\"xs:string\" use=\"required\" />"
|
|
<< "\n <xs:attribute name=\"x\" type=\"xs:int\" use=\"required\" />"
|
|
<< "\n</xs:complexType>";
|
|
Trois_String::impre_schem_XML=1; // une seule sortie
|
|
};
|
|
default: sort << "\n SchemaXML: cas non pris en compte " ;
|
|
};
|
|
};
|
|
|
|
// sortie du schemaXML: en fonction de enu
|
|
void TroisEntiers::SchemaXML_TroisEntiers(ofstream& sort,const Enum_IO_XML enu) const
|
|
{// sortie balisée simple
|
|
switch (enu)
|
|
{case XML_TYPE_GLOBAUX:
|
|
{sort << "\n <!-- ******************************************************* -->"
|
|
<< "\n<xs:complexType name=\"TroisEntiers\" >"
|
|
<< "\n <xs:annotation>"
|
|
<< "\n <xs:documentation> type simple pour definir deux entiers </xs:documentation>"
|
|
<< "\n </xs:annotation>"
|
|
<< "\n <xs:attribute name=\"un\" type=\"xs:int\" use=\"required\" />"
|
|
<< "\n <xs:attribute name=\"un\" type=\"xs:int\" use=\"required\" />"
|
|
<< "\n <xs:attribute name=\"deux\" type=\"xs:int\" use=\"required\" />"
|
|
<< "\n</xs:complexType>";
|
|
TroisEntiers::impre_schem_XML=1; // une seule sortie
|
|
};
|
|
default: sort << "\n SchemaXML: cas non pris en compte " ;
|
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|