2 // CC++ : Fonctions Interface Cascade
4 // Copyright (C) 2009-2012 CEA/DEN, EDF R&D
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
25 #include "HexKas_functions.hxx"
29 // ====================================================== same_coords
30 bool same_coords (gp_Pnt& pa, gp_Pnt& pb, double epsilon)
32 double d2 = carre (pb.X()-pa.X()) + carre (pb.Y()-pa.Y())
33 + carre (pb.Z()-pa.Z()) ;
36 // ====================================================== save_brep
37 void save_brep (cpchar nom, string brep, int& compteur)
41 sprintf (buff ,"%d", compteur);
46 FILE* fic = fopen (name.c_str(), "w");
47 fprintf (fic, "%s\n", brep.c_str());
50 // ====================================================== geom_make_brep
51 void geom_make_brep (TopoDS_Shape& shape, string& brep)
53 ostringstream stream_shape;
54 BRepTools::Write (shape, stream_shape);
55 brep = stream_shape.str();