Salome HOME
Replace oe by ?
[modules/smesh.git] / src / Tools / MeshCut / MeshCut_Cube.cxx
1 #include "MeshCut_Cube.hxx"
2
3 #include <iostream>
4
5 using namespace MESHCUT;
6 using namespace std;
7
8 Cube::Cube(float _x0, float _x1, float _y0, float _y1, float _z0, float _z1)
9 {
10   x0 = _x0;
11   x1 = _x1;
12   y0 = _y0;
13   y1 = _y1;
14   z0 = _z0;
15   z1 = _z1;
16 }
17
18 bool Cube::disjoint(Cube* c2)
19 {
20   return (x0 > c2->x1 || x1 < c2->x0 || y0 > c2->y1 || y1 < c2->y0 || z0 > c2->z1 || z1 < c2->z0);
21 }
22
23 bool Cube::contientNoeud(int ngnoeud, Maillage *MAILLAGE)
24 {
25   float x = *(MAILLAGE->XX + ngnoeud - 1);
26   float y = *(MAILLAGE->YY + ngnoeud - 1);
27   float z = *(MAILLAGE->ZZ + ngnoeud - 1);
28   return (x >= x0 && x <= x1 && y >= y0 && y <= y1 && z >= z0 && z <= z1);
29 }
30
31 void Cube::affichage()
32 {
33   cout << "x0=" << x0 << " ";
34   cout << "x1=" << x1 << " ";
35   cout << "y0=" << y0 << " ";
36   cout << "y1=" << y1 << " ";
37   cout << "z0=" << z0 << " ";
38   cout << "z1=" << z1 << " ";
39 }