Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "MeshCut_Cube.hxx"
00021
00022 #include <iostream>
00023
00024 using namespace MESHCUT;
00025 using namespace std;
00026
00027 Cube::Cube(float _x0, float _x1, float _y0, float _y1, float _z0, float _z1)
00028 {
00029 x0 = _x0;
00030 x1 = _x1;
00031 y0 = _y0;
00032 y1 = _y1;
00033 z0 = _z0;
00034 z1 = _z1;
00035 }
00036
00037 bool Cube::disjoint(Cube* c2)
00038 {
00039 return (x0 > c2->x1 || x1 < c2->x0 || y0 > c2->y1 || y1 < c2->y0 || z0 > c2->z1 || z1 < c2->z0);
00040 }
00041
00042 bool Cube::contientNoeud(int ngnoeud, Maillage *MAILLAGE)
00043 {
00044 float x = *(MAILLAGE->XX + ngnoeud - 1);
00045 float y = *(MAILLAGE->YY + ngnoeud - 1);
00046 float z = *(MAILLAGE->ZZ + ngnoeud - 1);
00047 return (x >= x0 && x <= x1 && y >= y0 && y <= y1 && z >= z0 && z <= z1);
00048 }
00049
00050 void Cube::affichage()
00051 {
00052 cout << "x0=" << x0 << " ";
00053 cout << "x1=" << x1 << " ";
00054 cout << "y0=" << y0 << " ";
00055 cout << "y1=" << y1 << " ";
00056 cout << "z0=" << z0 << " ";
00057 cout << "z1=" << z1 << " ";
00058 }