1 // Copyright (C) 2009-2014 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 //=============================================================================
21 // File : HEXABLOCKPlugin_Hypothesis.cxx
22 // Created : Wed Apr 2 12:36:29 2008
23 // Author : Lioka RAZAFINDRAZAKA (CEA)
24 //=============================================================================
26 #include "HEXABLOCKPlugin_Hypothesis.hxx"
29 //=======================================================================
30 //function : HEXABLOCKPlugin_Hypothesis
31 //=======================================================================
33 HEXABLOCKPlugin_Hypothesis::HEXABLOCKPlugin_Hypothesis(int hypId, int studyId, SMESH_Gen * gen)
34 : SMESH_Hypothesis(hypId, studyId, gen)
36 hexa_root = HEXA_NS::Hex::getInstance ();
40 // PutData (hexa_root->countDocument ());
42 _name = "HEXABLOCK_Parameters";
46 //=======================================================================
47 //function : GetDocument
48 //=======================================================================
50 HEXA_NS::Document* HEXABLOCKPlugin_Hypothesis::GetDocument() const
55 //=======================================================================
56 //function : SetXmlFlow
57 //=======================================================================
58 void HEXABLOCKPlugin_Hypothesis::SetXmlFlow (cpchar xml)
60 if (hyp_document ==NULL)
61 hyp_document = hexa_root->addDocument ("tobe_meshed");
62 hyp_document->setXml (xml);
65 //=======================================================================
66 //function : GetXmlFlow
67 //=======================================================================
68 cpchar HEXABLOCKPlugin_Hypothesis::GetXmlFlow () const
70 return (hyp_document == NULL) ? NULL : hyp_document->getXml();
73 //=======================================================================
74 //function : SetDocument
75 //=======================================================================
76 void HEXABLOCKPlugin_Hypothesis::SetDocument (cpchar name)
78 hyp_document = hexa_root->findDocument (name);
81 //=======================================================================
82 //function : GetDimension
83 //=======================================================================
85 int HEXABLOCKPlugin_Hypothesis::GetDimension() const
90 //=======================================================================
91 //function : SetDimension
92 //=======================================================================
94 void HEXABLOCKPlugin_Hypothesis::SetDimension(int dim)
99 //=======================================================================
101 //=======================================================================
103 std::ostream & HEXABLOCKPlugin_Hypothesis::SaveTo(std::ostream & save)
105 //save << hyp_document->getXML() << " ";
106 save << hyp_dimension << " ";
111 //=======================================================================
112 //function : LoadFrom
113 //=======================================================================
115 std::istream & HEXABLOCKPlugin_Hypothesis::LoadFrom(std::istream & load)
121 // isOK = (load >> str);
123 // hyp_document = xml_2_doc(str);
125 // load.clear(ios::badbit | load.rdstate());
131 load.clear(ios::badbit | load.rdstate());
136 //=======================================================================
137 //function : SetParametersByMesh
138 //=======================================================================
140 bool HEXABLOCKPlugin_Hypothesis::SetParametersByMesh(const SMESH_Mesh* ,const TopoDS_Shape&)
146 //================================================================================
148 * \brief Return false
150 //================================================================================
152 bool HEXABLOCKPlugin_Hypothesis::SetParametersByDefaults(const TDefaults& /*dflts*/,
153 const SMESH_Mesh* /*theMesh*/)