// 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 "Cylindre.h" #include "MathUtil.h" #include "ParaGlob.h" // CONSTRUCTEURS : // par defaut Cylindre::Cylindre () : cercle(3) { if (ParaGlob::Dimension() != 3) { cout << "\nErreur : la dimension est differente de 3 et on veut utiliser un Cylindre ??? "; cout << "\nCylindre::Cylindre ()" << endl; Sortie(1); }; }; // avec les datas Cylindre::Cylindre ( const Cercle& cer): cercle(cer) { if (ParaGlob::Dimension() != 3) { cout << "\nErreur : la dimension est differente de 3 et on veut utiliser un Cylindre ??? "; cout << "\nCylindre::Cylindre (.." << endl; Sortie(1); }; }; // avec la dimension Cylindre::Cylindre (int dim): cercle(dim) { if (ParaGlob::Dimension() != 3) { cout << "\nErreur : la dimension est differente de 3 et on veut utiliser un Cylindre ??? "; cout << "\nCylindre::Cylindre ()" << endl; Sortie(1); }; if (dim != 3) { cout << "\nErreur : la dimension demandee est differente de 3 et on veut utiliser un Cylindre ??? "; cout << "\nCylindre::Cylindre ()" << endl; Sortie(1); }; }; // de copie Cylindre::Cylindre ( const Cylindre& a): cercle(a.cercle) { }; // DESTRUCTEUR : Cylindre::~Cylindre () { }; // surcharge des operator Cylindre& Cylindre::operator = ( const Cylindre & cer) { cercle = cer.cercle; return *this; }; // METHODES PUBLIQUES : // change le cercle du Cylindre void Cylindre::Change_cercle( const Cercle& cer) { #ifdef MISE_AU_POINT if (cer.CentreCercle().Dimension() != cercle.CentreCercle().Dimension()) { cout << "\nErreur : les dimensions du cercle demande n'est pas identique a celle existante !"; cout <<"\ndim nouveau = " <> (istream & entree, Cylindre & cer) { // vérification du type string nom; entree >> nom; #ifdef MISE_AU_POINT if (nom != "_Cylindre_") { cout << "\nErreur, en lecture d'une instance Cylindre " << " on attendait _Cylindre_ et on a lue: " << nom ; cout << "istream & operator >> (istream & entree, Cylindre & cer)\n"; Sortie(1); }; #endif // puis lecture des différents éléments entree >> nom >> cer.cercle ; return entree; }; // surcharge de l'operateur d'ecriture ostream & operator << ( ostream & sort,const Cylindre & cer) { // tout d'abord un indicateur donnant le type sort << " _Cylindre_ " ; // puis les différents éléments sort << "\n Cercle= " << cer.cercle << " "; return sort; };