// FICHIER : Reference.cc // CLASSE : Reference // 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) . // // 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 . // // For more information, please consult: . #include "Reference.h" #ifndef REFERENCE_H_deja_inclus // --------------- variables statiques --------- // déclaré dans Reference_static.cp //MotCle Reference::motCle; // liste des mots clés // finalement déclaré ici ! #ifndef MISE_AU_POINT inline #endif Reference::Reference (string nom): // Constructeur par defaut (appel au constructeur par defaut de Tableau) nom_ref(nom),nbmaille(0),indic(0) { }; #ifndef MISE_AU_POINT inline #endif // Constructeur fonction du nb de maillage et du type de ref Reference::Reference (int nb , int ind) : nbmaille(nb),indic(ind),nom_ref("aucun nom") { }; #ifndef MISE_AU_POINT inline #endif Reference::Reference (string nom,int nb , int ind) : // Constructeur utile si le nom de la reference est connu nom_ref(nom),nbmaille(nb),indic(ind) { }; #ifndef MISE_AU_POINT inline #endif Reference::Reference (const Reference& ref): // Constructeur de copie nom_ref(ref.nom_ref),nbmaille(ref.nbmaille),indic(ref.indic) { }; #ifndef MISE_AU_POINT inline #endif Reference::~Reference () // Destructeur { }; // METHODES : // Surcharge de l'operateur = : realise l'egalite entre deux references #ifndef MISE_AU_POINT inline #endif Reference& Reference::operator= (const Reference& ref) { indic = ref.indic; nbmaille = ref.nbmaille; nom_ref = ref.nom_ref; return (*this); }; // Retourne le nom associe a la reference #ifndef MISE_AU_POINT inline #endif string Reference::Nom () const { return nom_ref; }; // Retourne le type de reference #ifndef MISE_AU_POINT inline #endif int Reference::Indic () const { return indic; }; // Retourne le numero du maillage auquelle la reference se rattache #ifndef MISE_AU_POINT inline #endif int Reference::Nbmaille() const { return nbmaille; }; // Remplace l'ancien nom de la reference par nouveau_nom #ifndef MISE_AU_POINT inline #endif void Reference::Change_nom (string nouveau_nom) { nom_ref = nouveau_nom; }; // Affiche les donnees liees a la reference #ifndef MISE_AU_POINT inline #endif void Reference::Affiche () const { cout << "\nNom de la reference : " << nom_ref << " , maillage nb =" << nbmaille << ", de type = " << indic << '\n'; }; // methodes appellées par les classes dérivées // cas donne le niveau de la récupération // = 1 : on récupère tout // = 2 : on récupère uniquement les données variables (supposées comme telles) #ifndef MISE_AU_POINT inline #endif void Reference::Lect_int_base_info(ifstream& ent) { string toto; ent >> nom_ref >> nbmaille ; }; // cas donne le niveau de sauvegarde // = 1 : on sauvegarde tout // = 2 : on sauvegarde uniquement les données variables (supposées comme telles) #ifndef MISE_AU_POINT inline #endif void Reference::Ecrit_int_base_info(ofstream& sort) { sort << nom_ref <<" " << nbmaille << " "; }; #endif