2 // class : Au nom de la loi
7 #include "HexXmlWriter.hxx"
14 const char* getName () { return law_name.c_str() ; }
15 int getNodes () { return nbr_nodes ; }
16 double getCoefficient () { return law_coefficient ; }
17 KindLaw getKind () { return law_type ; }
19 int setNodes (int nbre);
20 int setCoefficient (double coeff);
21 void setKind (KindLaw type) { law_type = type ; }
22 int setName (const char* nom);
25 Law (cpchar name, int nbnodes);
26 void saveXml (XmlWriter& xml);
32 double law_coefficient;
34 // ================================================== Constructeur
35 inline Law::Law (cpchar name, int nbnodes)
40 law_coefficient = 0.0;
42 // ================================================== setNodes
43 inline int Law::setNodes (int nbre)
48 // ================================================== setCoefficient
49 inline int Law::setCoefficient (double coeff)
51 law_coefficient = coeff;
54 // ================================================== setName
55 inline int Law::setName (const char* name)
60 // ================================================== saveXml
61 inline void Law::saveXml (XmlWriter& xml)
63 cpchar kind_law [] = { "Uniform", "Arithmetic", "Geometric" };
66 xml.addAttribute ("id", getName ());
67 xml.addAttribute ("kind", kind_law [law_type]);
68 xml.addAttribute ("nodes", nbr_nodes);
69 xml.addAttribute ("coeff", law_coefficient);