Salome HOME
Switch development flag to 1
[modules/hexablock.git] / src / HEXABLOCK / HexPropagation.hxx
index 21c990df59a3d06bdc7e89a0abc634990648286f..ecfd0036b2edeefedbc2d114106e222e579664d6 100755 (executable)
@@ -1,17 +1,38 @@
+// Copyright (C) 2009-2016  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 
 // class : Ensembles de propagation
 
 #ifndef __PROPAGATION_H
 #define __PROPAGATION_H
 
+#include "HexEltBase.hxx"
+
 #include "HexDocument.hxx"
 #include "HexEdge.hxx"
 #include "HexXmlWriter.hxx"
 #include "HexLaw.hxx"
+#include "HexGlobale.hxx"
 
 BEGIN_NAMESPACE_HEXA
 
-class Propagation 
+class HexaExport Propagation : public EltBase 
 {
 public:
    const Edges& getEdges ()        { return prop_edges; }
@@ -22,8 +43,8 @@ public:
    int   setLaw (Law* loi);
 
 public:
-    Propagation  ();
-    void saveXml (XmlWriter& xml);
+    Propagation  (Document*  doc);
+    void saveXml (XmlWriter* xml);
     void addEdge (Edge* arete);
     void majLaw  ();
 
@@ -33,7 +54,8 @@ private:
     bool  prop_way;
 };
 // =========================================================== Constructeur
-inline Propagation::Propagation ()
+inline Propagation::Propagation (Document* doc)
+                  : EltBase (doc, EL_PROPAGATION)
 {
     prop_law = NULL;
     prop_way = true;
@@ -58,6 +80,9 @@ inline int Propagation::setLaw (Law* loi)
 {
    prop_law = loi; 
    majLaw ();
+
+   DumpStart  ("setLaw", loi);
+   DumpEnd;
    return HOK;
 }
 // =========================================================== majLaw
@@ -76,17 +101,17 @@ inline void Propagation::addEdge (Edge* arete)
        prop_law =  arete->getLaw();
 }
 // =========================================================== saveXml
-inline void Propagation::saveXml (XmlWriter& xml)
+inline void Propagation::saveXml (XmlWriter* xml)
 {
     char   buffer[12];
     cpchar booleen [] = { "true", "false" };
     cpchar law = prop_law == NULL ? "default" : prop_law->getName();
 
-    xml.openMark     ("Propagation");
-    xml.addAttribute ("edge", prop_edges[0]->getName (buffer));
-    xml.addAttribute ("law",  law);
-    xml.addAttribute ("way",  booleen [prop_way]);
-    xml.closeMark ();
+    xml->openMark     ("Propagation");
+    xml->addAttribute ("edge", prop_edges[0]->getName (buffer));
+    xml->addAttribute ("law",  law);
+    xml->addAttribute ("way",  booleen [prop_way]);
+    xml->closeMark ();
 }
 END_NAMESPACE_HEXA