434 lines
17 KiB
C++
434 lines
17 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;
|
|
short int Deux_String_un_entier::impre_schem_XML=0;
|
|
short int QuatreEntiers::impre_schem_XML=0;
|
|
short int CinqEntiers::impre_schem_XML=0;
|
|
|
|
// sortie du schemaXML: en fonction de enu
|
|
void DeuxEntiers::SchemaXML_DeuxEntiers(ostream& 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 << "<DeuxEntiers> un= "<< un << " deux= " << deux << " </DeuxEntiers>";
|
|
return sort;
|
|
};
|
|
|
|
// sortie du schemaXML: en fonction de enu
|
|
void DeuxDoubles::SchemaXML_DeuxDoubles(ostream& 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(ostream& 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 << "<Entier_et_Double> un= "<< n << " deux= " << x << " </Entier_et_Double>";
|
|
return sort;
|
|
};
|
|
|
|
|
|
// sortie du schemaXML: en fonction de enu
|
|
void Deux_String::SchemaXML_Deux_String(ostream& 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(ostream& 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 << " n= " << n << " </String_et_entier>";
|
|
return sort;
|
|
};
|
|
|
|
|
|
// sortie du schemaXML: en fonction de enu
|
|
void Trois_String::SchemaXML_Trois_String(ostream& 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 << "<Trois_String> nom1= "<< nom1 << " nom2= " << nom2 << " nom3= " << nom3 << " </Trois_String>";
|
|
return sort;
|
|
};
|
|
|
|
// sortie du schemaXML: en fonction de enu
|
|
void Quatre_string_un_entier::SchemaXML_Quatre_string_un_entier(ostream& 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>";
|
|
Quatre_string_un_entier::impre_schem_XML=1; // une seule sortie
|
|
};
|
|
default: sort << "\n SchemaXML: cas non pris en compte " ;
|
|
};
|
|
};
|
|
|
|
// surcharge de lecture en XML
|
|
istream & Quatre_string_un_entier::LectXML_Quatre_string_un_entier(istream & ent)
|
|
{ string nom;
|
|
ent >> nom >> nom >> nom1 >> nom >> nom2 >> nom >> nom3 >> nom >> nom4 >> nom >> n >> nom;
|
|
return ent;
|
|
};
|
|
|
|
// surcharge d'ecriture en XML
|
|
ostream & Quatre_string_un_entier::EcritXML_Quatre_string_un_entier(ostream & sort)
|
|
{ sort << "<Quatre_string_un_entier> nom1= "<< nom1 << " nom2= " << nom2
|
|
<< " nom3= " << nom3 << "nom4= " << nom4 << " n= " << n << " </Quatre_string_un_entier>";
|
|
return sort;
|
|
};
|
|
|
|
|
|
// sortie du schemaXML: en fonction de enu
|
|
void TroisEntiers::SchemaXML_TroisEntiers(ostream& 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=\"deux\" type=\"xs:int\" use=\"required\" />"
|
|
<< "\n <xs:attribute name=\"trois\" 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 " ;
|
|
|
|
};
|
|
};
|
|
|
|
// surcharge de lecture en XML
|
|
istream & TroisEntiers::LectXML_TroisEntiers(istream & ent)
|
|
{ string nom;
|
|
ent >> nom >> nom >> un >> nom >> deux >> nom >> trois >> nom;
|
|
return ent;
|
|
};
|
|
|
|
// surcharge d'ecriture en XML
|
|
ostream & TroisEntiers::EcritXML_TroisEntiers(ostream & sort)
|
|
{ sort << "<TroisEntiers> un= "<< un << " deux= " << deux << " trois= " << trois << " </TroisEntiers>";
|
|
return sort;
|
|
};
|
|
|
|
|
|
// sortie du schemaXML: en fonction de enu
|
|
void Deux_String_un_entier::SchemaXML_Deux_String_un_entier(ostream& 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_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:int\" use=\"required\" />"
|
|
<< "\n</xs:complexType>";
|
|
Deux_String_un_entier::impre_schem_XML=1; // une seule sortie
|
|
};
|
|
default: sort << "\n SchemaXML: cas non pris en compte " ;
|
|
};
|
|
};
|
|
|
|
// surcharge de lecture en XML
|
|
istream & Deux_String_un_entier::LectXML_Deux_String_un_entier(istream & ent)
|
|
{ string nom;
|
|
ent >> nom >> nom >> nom1 >> nom >> nom2 >> nom >> n >> nom;
|
|
return ent;
|
|
};
|
|
|
|
// surcharge d'ecriture en XML
|
|
ostream & Deux_String_un_entier::EcritXML_Deux_String_un_entier(ostream & sort)
|
|
{ sort << "<Deux_String_un_entier> nom1= "<< nom1 << " nom2= " << nom2
|
|
<< " n= " << n << " </Deux_String_un_entier>";
|
|
return sort;
|
|
};
|
|
|
|
// sortie du schemaXML: en fonction de enu
|
|
void QuatreEntiers::SchemaXML_QuatreEntiers(ostream& sort,const Enum_IO_XML enu) const
|
|
{// sortie balisée simple
|
|
switch (enu)
|
|
{case XML_TYPE_GLOBAUX:
|
|
{sort << "\n <!-- ******************************************************* -->"
|
|
<< "\n<xs:complexType name=\"QuatreEntiers\" >"
|
|
<< "\n <xs:annotation>"
|
|
<< "\n <xs:documentation> type simple pour definir quatre 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:attribute name=\"trois\" type=\"xs:int\" use=\"required\" />"
|
|
<< "\n <xs:attribute name=\"quatre\" type=\"xs:int\" use=\"required\" />"
|
|
<< "\n</xs:complexType>";
|
|
QuatreEntiers::impre_schem_XML=1; // une seule sortie
|
|
};
|
|
default: sort << "\n SchemaXML: cas non pris en compte " ;
|
|
|
|
};
|
|
};
|
|
|
|
|
|
// surcharge de lecture en XML
|
|
istream & QuatreEntiers::LectXML_QuatreEntiers(istream & ent)
|
|
{ string nom;
|
|
ent >> nom >> nom >> un >> nom >> deux >> nom >> trois >> nom >> quatre >> nom;
|
|
return ent;
|
|
};
|
|
|
|
// surcharge d'ecriture en XML
|
|
ostream & QuatreEntiers::EcritXML_QuatreEntiers(ostream & sort)
|
|
{ sort << "<QuatreEntiers> un= "<< un << " deux= " << deux << " trois= " << trois
|
|
<< " quatre= " << quatre << " </QuatreEntiers>";
|
|
return sort;
|
|
};
|
|
|
|
|
|
// sortie du schemaXML: en fonction de enu
|
|
void CinqEntiers::SchemaXML_CinqEntiers(ostream& sort,const Enum_IO_XML enu) const
|
|
{// sortie balisée simple
|
|
switch (enu)
|
|
{case XML_TYPE_GLOBAUX:
|
|
{sort << "\n <!-- ******************************************************* -->"
|
|
<< "\n<xs:complexType name=\"CinqEntiers\" >"
|
|
<< "\n <xs:annotation>"
|
|
<< "\n <xs:documentation> type simple pour definir quatre 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:attribute name=\"trois\" type=\"xs:int\" use=\"required\" />"
|
|
<< "\n <xs:attribute name=\"quatre\" type=\"xs:int\" use=\"required\" />"
|
|
<< "\n <xs:attribute name=\"cinq\" type=\"xs:int\" use=\"required\" />"
|
|
<< "\n</xs:complexType>";
|
|
CinqEntiers::impre_schem_XML=1; // une seule sortie
|
|
};
|
|
default: sort << "\n SchemaXML: cas non pris en compte " ;
|
|
|
|
};
|
|
};
|
|
|
|
|
|
// surcharge de lecture en XML
|
|
istream & CinqEntiers::LectXML_CinqEntiers(istream & ent)
|
|
{ string nom;
|
|
ent >> nom >> nom >> un >> nom >> deux >> nom >> trois
|
|
>> nom >> quatre >> nom >> cinq >> nom;
|
|
return ent;
|
|
};
|
|
|
|
// surcharge d'ecriture en XML
|
|
ostream & CinqEntiers::EcritXML_CinqEntiers(ostream & sort)
|
|
{ sort << "<CinqEntiers> un= "<< un << " deux= " << deux << " trois= " << trois
|
|
<< " quatre= " << quatre << " cinq= " << cinq << " </CinqEntiers>";
|
|
return sort;
|
|
};
|
|
|
|
|
|
|
|
|