X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FMEFISTO2%2FRn.h;h=d068199eecc0af2b0a1e4f3711be21feda594cdc;hp=a2856eeec46a8e285a4ebef6b9f6d90dd570bef9;hb=20d9e162bd67182cbfa841bbfc9319919f4703e3;hpb=8b4ba0cdff7660465a9ea7b26ef0df0757afed97 diff --git a/src/MEFISTO2/Rn.h b/src/MEFISTO2/Rn.h index a2856eeec..d068199ee 100755 --- a/src/MEFISTO2/Rn.h +++ b/src/MEFISTO2/Rn.h @@ -1,3 +1,28 @@ +// MEFISTO : library to compute 2D triangulation from segmented boundaries +// +// Copyright (C) 2006-2016 CEA/DEN, EDF R&D, OPEN CASCADE +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : Rn.h +// Module : SMESH +// Authors: Frederic HECHT & Alain PERRONNET +// Date : 13 novembre 2006 + #ifndef Rn__h #define Rn__h @@ -14,7 +39,6 @@ #include #include -using namespace std; template inline T Abs (const T &a){return a <0 ? -a : a;} template inline void Echange (T& a,T& b) {T c=a;a=b;b=c;} @@ -36,11 +60,19 @@ typedef char Nom[1+24]; //le type N des nombres entiers positifs //========= +#ifndef PCLINUX64 typedef unsigned long int N; +#else +typedef unsigned int N; +#endif //le type Z des nombres entiers relatifs //========= +#ifndef PCLINUX64 typedef long int Z; +#else +typedef int Z; +#endif //le type R des nombres "reels" //========= @@ -54,14 +86,14 @@ typedef double R; //============ class R2 { - friend ostream& operator << (ostream& f, const R2 & P) + friend std::ostream& operator << (std::ostream& f, const R2 & P) { f << P.x << ' ' << P.y ; return f; } - friend istream& operator >> (istream& f, R2 & P) + friend std::istream& operator >> (std::istream& f, R2 & P) { f >> P.x >> P.y ; return f; } - friend ostream& operator << (ostream& f, const R2 * P) + friend std::ostream& operator << (std::ostream& f, const R2 * P) { f << P->x << ' ' << P->y ; return f; } - friend istream& operator >> (istream& f, R2 * P) + friend std::istream& operator >> (std::istream& f, R2 * P) { f >> P->x >> P->y ; return f; } public: @@ -93,14 +125,14 @@ public: //============ class R3 { - friend ostream& operator << (ostream& f, const R3 & P) + friend std::ostream& operator << (std::ostream& f, const R3 & P) { f << P.x << ' ' << P.y << ' ' << P.z ; return f; } - friend istream& operator >> (istream& f, R3 & P) + friend std::istream& operator >> (std::istream& f, R3 & P) { f >> P.x >> P.y >> P.z ; return f; } - friend ostream& operator << (ostream& f, const R3 * P) + friend std::ostream& operator << (std::ostream& f, const R3 * P) { f << P->x << ' ' << P->y << ' ' << P->z ; return f; } - friend istream& operator >> (istream& f, R3 * P) + friend std::istream& operator >> (std::istream& f, R3 * P) { f >> P->x >> P->y >> P->z ; return f; } public: @@ -138,20 +170,20 @@ public: bool DansPave( R3 & xyzMin, R3 & xyzMax ) { return xyzMin.x<=x && x<=xyzMax.x && - xyzMin.y<=y && y<=xyzMax.y && - xyzMin.z<=z && z<=xyzMax.z; } + xyzMin.y<=y && y<=xyzMax.y && + xyzMin.z<=z && z<=xyzMax.z; } }; //la classe R4 //============ class R4: public R3 { - friend ostream& operator <<(ostream& f, const R4 & P ) + friend std::ostream& operator <<(std::ostream& f, const R4 & P ) { f << P.x << ' ' << P.y << ' ' << P.z << ' ' << P.omega; return f; } friend istream& operator >>(istream& f, R4 & P) { f >> P.x >> P.y >> P.z >> P.omega ; return f; } - friend ostream& operator <<(ostream& f, const R4 * P ) + friend std::ostream& operator <<(std::ostream& f, const R4 * P ) { f << P->x << ' ' << P->y << ' ' << P->z << ' ' << P->omega; return f; } friend istream& operator >>(istream& f, R4 * P) { f >> P->x >> P->y >> P->z >> P->omega ; return f; }