1 // Copyright (C) 2006-2015 EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include "MeshCut_Cube.hxx"
24 using namespace MESHCUT;
27 Cube::Cube(float _x0, float _x1, float _y0, float _y1, float _z0, float _z1)
37 bool Cube::disjoint(Cube* c2)
39 return (x0 > c2->x1 || x1 < c2->x0 || y0 > c2->y1 || y1 < c2->y0 || z0 > c2->z1 || z1 < c2->z0);
42 bool Cube::contientNoeud(int ngnoeud, Maillage *MAILLAGE)
44 float x = *(MAILLAGE->XX + ngnoeud - 1);
45 float y = *(MAILLAGE->YY + ngnoeud - 1);
46 float z = *(MAILLAGE->ZZ + ngnoeud - 1);
47 return (x >= x0 && x <= x1 && y >= y0 && y <= y1 && z >= z0 && z <= z1);
50 void Cube::affichage()
52 cout << "x0=" << x0 << " ";
53 cout << "x1=" << x1 << " ";
54 cout << "y0=" << y0 << " ";
55 cout << "y1=" << y1 << " ";
56 cout << "z0=" << z0 << " ";
57 cout << "z1=" << z1 << " ";