Back to index

salome-smesh  6.5.0
MeshCut_Carre.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2006-2012  EDF R&D
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 #include "MeshCut_Carre.hxx"
00021 
00022 #include <iostream>
00023 
00024 using namespace MESHCUT;
00025 using namespace std;
00026 
00027 Carre::Carre(float _x0, float _x1, float _y0, float _y1)
00028 {
00029   x0 = _x0;
00030   x1 = _x1;
00031   y0 = _y0;
00032   y1 = _y1;
00033 }
00034 
00035 bool Carre::disjoint(Carre* c2)
00036 {
00037   return (x0 > c2->x1 || x1 < c2->x0 || y0 > c2->y1 || y1 < c2->y0);
00038 }
00039 
00040 bool Carre::contientNoeud(int ngnoeud, Maillage *MAILLAGE)
00041 {
00042   float x = *(MAILLAGE->XX + ngnoeud - 1);
00043   float y = *(MAILLAGE->YY + ngnoeud - 1);
00044   return (x >= x0 && x <= x1 && y >= y0 && y <= y1);
00045 }
00046 
00047 void Carre::affichage()
00048 {
00049   cout << "x0=" << x0 << " ";
00050   cout << "x1=" << x1 << " ";
00051   cout << "y0=" << y0 << " ";
00052   cout << "y1=" << y1 << " ";
00053 }
00054