1 // Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
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 // SMESH SMESH : implementaion of SMESH idl descriptions
21 // File : StdMeshers_QuadrangleParams.cxx
22 // Author : Sergey KUUL, OCC
25 #include "StdMeshers_QuadrangleParams.hxx"
27 #include "SMESH_Algo.hxx"
28 #include "SMESH_Mesh.hxx"
30 #include <BRep_Tool.hxx>
31 #include <GCPnts_AbscissaPoint.hxx>
32 #include <GeomAdaptor_Curve.hxx>
33 #include <Geom_Curve.hxx>
35 #include <TopLoc_Location.hxx>
36 #include <TopTools_IndexedMapOfShape.hxx>
38 #include <TopoDS_Edge.hxx>
42 //=============================================================================
46 //=============================================================================
48 StdMeshers_QuadrangleParams::StdMeshers_QuadrangleParams(int hypId, int studyId,
50 :SMESH_Hypothesis(hypId, studyId, gen)
52 _name = "QuadrangleParams";
57 //=============================================================================
61 //=============================================================================
63 StdMeshers_QuadrangleParams::~StdMeshers_QuadrangleParams()
67 //=============================================================================
71 //=============================================================================
73 void StdMeshers_QuadrangleParams::SetTriaVertex(int id)
75 if ( id != _triaVertexID ) {
77 NotifySubMeshesHypothesisModification();
81 //=============================================================================
85 //=============================================================================
87 ostream & StdMeshers_QuadrangleParams::SaveTo(ostream & save)
89 save << _triaVertexID << " " << _objEntry;
93 //=============================================================================
97 //=============================================================================
99 istream & StdMeshers_QuadrangleParams::LoadFrom(istream & load)
102 isOK = (load >> _triaVertexID);
104 load.clear(ios::badbit | load.rdstate());
106 isOK = (load >> _objEntry);
111 //=============================================================================
115 //=============================================================================
117 ostream & operator <<(ostream & save, StdMeshers_QuadrangleParams & hyp)
119 return hyp.SaveTo( save );
122 //=============================================================================
126 //=============================================================================
128 istream & operator >>(istream & load, StdMeshers_QuadrangleParams & hyp)
130 return hyp.LoadFrom( load );
133 //================================================================================
135 * \brief Redifined method
136 * \param theMesh - the built mesh
137 * \param theShape - the geometry of interest
138 * \retval bool - true if parameter values have been successfully defined
140 //================================================================================
142 bool StdMeshers_QuadrangleParams::SetParametersByMesh(const SMESH_Mesh* theMesh,
143 const TopoDS_Shape& theShape)
145 if ( !theMesh || theShape.IsNull() )
151 //================================================================================
153 * \brief Initialize my parameter values by default parameters.
154 * \retval bool - true if parameter values have been successfully defined
156 //================================================================================
158 bool StdMeshers_QuadrangleParams::SetParametersByDefaults(const TDefaults& dflts,
159 const SMESH_Mesh* /*mesh*/)