1 // HexoticPlugin : C++ implementation
3 // Copyright (C) 2006 OPEN CASCADE, CEA/DEN, EDF R&D
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License.
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // Lesser General Public License for more details.
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with this library; if not, write to the Free Software
17 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
22 // File : HexoticPlugin_Hypothesis.cxx
23 // Author : Lioka RAZAFINDRAZAKA (CEA)
26 //=============================================================================
29 #include <HexoticPlugin_Hypothesis.hxx>
30 #include <utilities.h>
32 //=============================================================================
36 //=============================================================================
37 HexoticPlugin_Hypothesis::HexoticPlugin_Hypothesis (int hypId, int studyId,
39 : SMESH_Hypothesis(hypId, studyId, gen),
40 _hexesMinLevel( GetDefaultHexesMinLevel() ),
41 _hexesMaxLevel( GetDefaultHexesMaxLevel() ),
42 _hexoticQuadrangles( GetDefaultHexoticQuadrangles() )
44 MESSAGE("HexoticPlugin_Hypothesis::HexoticPlugin_Hypothesis");
45 _name = "Hexotic_Parameters";
49 //=============================================================================
53 //=============================================================================
55 void HexoticPlugin_Hypothesis::SetHexesMinLevel(int theVal) {
56 if (theVal != _hexesMinLevel) {
57 _hexesMinLevel = theVal;
58 NotifySubMeshesHypothesisModification();
62 void HexoticPlugin_Hypothesis::SetHexesMaxLevel(int theVal) {
63 if (theVal != _hexesMaxLevel) {
64 _hexesMaxLevel = theVal;
65 NotifySubMeshesHypothesisModification();
69 void HexoticPlugin_Hypothesis::SetHexoticQuadrangles(bool theVal) {
70 if (theVal != _hexoticQuadrangles) {
71 _hexoticQuadrangles = theVal;
72 NotifySubMeshesHypothesisModification();
76 //=============================================================================
80 //=============================================================================
81 ostream & HexoticPlugin_Hypothesis::SaveTo(ostream & save)
83 save << _hexesMinLevel << " " << _hexesMaxLevel;
84 save << " " << (int)_hexoticQuadrangles;
86 cout << "save : " << save << endl;
92 //=============================================================================
96 //=============================================================================
97 istream & HexoticPlugin_Hypothesis::LoadFrom(istream & load)
103 // isOK = (load >> val);
107 // load.clear(ios::badbit | load.rdstate());
109 // isOK = (load >> is);
111 // SetFineness((Fineness) is);
113 // load.clear(ios::badbit | load.rdstate());
115 // if (_fineness == UserDefined)
117 // isOK = (load >> val);
119 // _growthRate = val;
121 // load.clear(ios::badbit | load.rdstate());
123 // isOK = (load >> val);
125 // _nbSegPerEdge = val;
127 // load.clear(ios::badbit | load.rdstate());
129 // isOK = (load >> val);
131 // _nbSegPerRadius = val;
133 // load.clear(ios::badbit | load.rdstate());
136 // isOK = (load >> is);
138 // _secondOrder = (bool) is;
140 // load.clear(ios::badbit | load.rdstate());
142 // isOK = (load >> is);
144 // _optimize = (bool) is;
146 // load.clear(ios::badbit | load.rdstate());
150 //=============================================================================
154 //=============================================================================
155 ostream & operator <<(ostream & save, HexoticPlugin_Hypothesis & hyp)
157 return hyp.SaveTo( save );
160 //=============================================================================
164 //=============================================================================
165 istream & operator >>(istream & load, HexoticPlugin_Hypothesis & hyp)
167 return hyp.LoadFrom( load );
171 //================================================================================
173 * \brief Does nothing
174 * \param theMesh - the built mesh
175 * \param theShape - the geometry of interest
176 * \retval bool - always false
178 //================================================================================
179 bool HexoticPlugin_Hypothesis::SetParametersByMesh(const SMESH_Mesh* theMesh,
180 const TopoDS_Shape& theShape)
185 //=============================================================================
186 int HexoticPlugin_Hypothesis::GetDefaultHexesMinLevel()
191 int HexoticPlugin_Hypothesis::GetDefaultHexesMaxLevel()
196 bool HexoticPlugin_Hypothesis::GetDefaultHexoticQuadrangles()