Herezh_dev/herezh_pp/contact/Cylindre.h

122 lines
5 KiB
C++
Executable file

// 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-2021 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/>.
/************************************************************************
* DATE: 19/01/2007 *
* $ *
* AUTEUR: G RIO (mailto:gerardrio56@free.fr) *
* $ *
* PROJET: Herezh++ *
* $ *
************************************************************************
* BUT: Def géométrie d'un cylindre: un cercle 3D, donc avec une *
* normale. Le cylindre n'est pas limité en hauteur. *
* $ *
* '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' * *
* VERIFICATION: *
* *
* ! date ! auteur ! but ! *
* ------------------------------------------------------------ *
* ! ! ! ! *
* $ *
* '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' *
* MODIFICATIONS: *
* ! date ! auteur ! but ! *
* ------------------------------------------------------------ *
* $ *
************************************************************************/
#ifndef CYLINDREE_H
#define CYLINDREE_H
#include "Droite.h"
#include "Coordonnee.h"
#include "Cercle.h"
/// @addtogroup Groupe_sur_les_contacts
/// @{
///
class Cylindre
{ // surcharge de l'operator de lecture
friend istream & operator >> (istream &, Cylindre &);
// surcharge de l'operator d'ecriture
friend ostream & operator << (ostream &, const Cylindre &);
public :
// CONSTRUCTEURS :
// par defaut
Cylindre ();
// avec les datas
Cylindre ( const Cercle& B);
// avec la dimension
Cylindre (int dim);
// de copie
Cylindre ( const Cylindre& a);
// DESTRUCTEUR :
~Cylindre ();
// surcharge des operator
Cylindre& operator = ( const Cylindre & P);
// METHODES PUBLIQUES :
// retourne le cercle d'embase du Cylindre
inline const Cercle& CercleCylindre() const { return cercle;};
// change le centre du Cylindre
void Change_cercle( const Cercle& B);
// change toutes les donnees
void change_donnees( const Cercle& cer);
// calcul les deux intercections M1 et M2 d'une droite avec le Cylindre,
// ramene 0 s'il n'y a pas d'intersection, ramene -1 si l'intercection
// ne peut pas etre calculee
// et 1 s'il y a deux points d'intercection
int Intersection( const Droite & D,Coordonnee& M1, Coordonnee& M2);
// calcul la distance d'un point au Cylindre
double Distance_au_Cylindre(const Coordonnee& M) const;
// ramène true si le point est à l'intérieur du cylindre, false sinon
bool Dedans(const Coordonnee& M)const ;
// projection d'un point M sur la parois du cylindre
// dans le cas où M appartient à l'axe du cylindre, la projection n'est pas
// possible, dans ce cas projection_ok = false en retour, sinon true
Coordonnee Projete(const Coordonnee& M,bool& projection_ok) const;
protected :
// VARIABLES PROTEGEES :
Cercle cercle; // cercle du Cylindre
// METHODES PROTEGEES :
};
/// @} // end of group
#endif