1 // Copyright (C) 2009-2013 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.
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 : SetDocument
67 //=======================================================================
68 void HEXABLOCKPlugin_Hypothesis::SetDocument (cpchar name)
70 hyp_document = hexa_root->findDocument (name);
73 //=======================================================================
74 //function : GetDimension
75 //=======================================================================
77 int HEXABLOCKPlugin_Hypothesis::GetDimension() const
82 //=======================================================================
83 //function : SetDimension
84 //=======================================================================
86 void HEXABLOCKPlugin_Hypothesis::SetDimension(int dim)
91 //=======================================================================
93 //=======================================================================
95 std::ostream & HEXABLOCKPlugin_Hypothesis::SaveTo(std::ostream & save)
97 //save << hyp_document->getXML() << " ";
98 save << hyp_dimension << " ";
103 //=======================================================================
104 //function : LoadFrom
105 //=======================================================================
107 std::istream & HEXABLOCKPlugin_Hypothesis::LoadFrom(std::istream & load)
113 // isOK = (load >> str);
115 // hyp_document = xml_2_doc(str);
117 // load.clear(ios::badbit | load.rdstate());
123 load.clear(ios::badbit | load.rdstate());
128 //=======================================================================
129 //function : SetParametersByMesh
130 //=======================================================================
132 bool HEXABLOCKPlugin_Hypothesis::SetParametersByMesh(const SMESH_Mesh* ,const TopoDS_Shape&)
138 //================================================================================
140 * \brief Return false
142 //================================================================================
144 bool HEXABLOCKPlugin_Hypothesis::SetParametersByDefaults(const TDefaults& /*dflts*/,
145 const SMESH_Mesh* /*theMesh*/)