Salome HOME
Undef max Visual Studio definition.
[modules/hexablock.git] / src / HEXABLOCK / HexPipe.cxx
1
2 // C++ : Gestion des tuyaux
3
4 // Copyright (C) 2009-2013  CEA/DEN, EDF R&D
5 //
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.
10 //
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.
15 //
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
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 #include "HexPipe.hxx"
23
24 #include "HexDocument.hxx"
25 #include "HexVertex.hxx"
26 #include "HexVector.hxx"
27 #include "HexXmlWriter.hxx"
28
29 BEGIN_NAMESPACE_HEXA
30
31 // ======================================================== Constructeur
32 Pipe::Pipe (Vertex* b, Vector* v, double ri, double re, double h)
33     : Cylinder (b, v, re, h)
34 {
35     c_int_radius = ri;
36     if (isBad () || c_int_radius <= el_root->getTolerance () 
37                  || c_int_radius >= c_radius)
38         setError ();
39 }
40 // ========================================================= saveXml 
41 void Pipe::saveXml  (XmlWriter* xml)
42 {
43    char buffer[12];
44
45    xml->openMark     ("Pipe");
46    xml->addAttribute ("c_base", c_base->getName (buffer));
47    xml->addAttribute ("c_dir",  c_dir->getName  (buffer));
48    xml->addAttribute ("c_radius",     c_radius);
49    xml->addAttribute ("c_int_radius", c_int_radius);
50    xml->addAttribute ("c_height",     c_height);
51    xml->closeMark ();
52 }
53 END_NAMESPACE_HEXA