1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // SMESH SMESH : implementaion of SMESH idl descriptions
23 // File : StdMeshers_QuadrangleParams.cxx
24 // Author : Sergey KUUL, OCC
27 #include "StdMeshers_QuadrangleParams.hxx"
29 #include "SMESH_Algo.hxx"
30 #include "SMESH_Mesh.hxx"
32 #include <BRep_Tool.hxx>
33 #include <GCPnts_AbscissaPoint.hxx>
34 #include <GeomAdaptor_Curve.hxx>
35 #include <Geom_Curve.hxx>
37 #include <TopLoc_Location.hxx>
38 #include <TopTools_IndexedMapOfShape.hxx>
40 #include <TopoDS_Edge.hxx>
44 //=============================================================================
48 //=============================================================================
50 StdMeshers_QuadrangleParams::StdMeshers_QuadrangleParams(int hypId, int studyId,
52 :SMESH_Hypothesis(hypId, studyId, gen)
54 _name = "QuadrangleParams";
59 //=============================================================================
63 //=============================================================================
65 StdMeshers_QuadrangleParams::~StdMeshers_QuadrangleParams()
69 //=============================================================================
73 //=============================================================================
75 void StdMeshers_QuadrangleParams::SetTriaVertex(int id)
77 if ( id != _triaVertexID ) {
79 NotifySubMeshesHypothesisModification();
83 //=============================================================================
87 //=============================================================================
89 ostream & StdMeshers_QuadrangleParams::SaveTo(ostream & save)
91 save << _triaVertexID << " " << _objEntry;
95 //=============================================================================
99 //=============================================================================
101 istream & StdMeshers_QuadrangleParams::LoadFrom(istream & load)
104 isOK = (load >> _triaVertexID);
106 load.clear(ios::badbit | load.rdstate());
108 isOK = (load >> _objEntry);
113 //=============================================================================
117 //=============================================================================
119 ostream & operator <<(ostream & save, StdMeshers_QuadrangleParams & hyp)
121 return hyp.SaveTo( save );
124 //=============================================================================
128 //=============================================================================
130 istream & operator >>(istream & load, StdMeshers_QuadrangleParams & hyp)
132 return hyp.LoadFrom( load );
135 //================================================================================
137 * \brief Redifined method
138 * \param theMesh - the built mesh
139 * \param theShape - the geometry of interest
140 * \retval bool - true if parameter values have been successfully defined
142 //================================================================================
144 bool StdMeshers_QuadrangleParams::SetParametersByMesh(const SMESH_Mesh* theMesh,
145 const TopoDS_Shape& theShape)
147 if ( !theMesh || theShape.IsNull() )
153 //================================================================================
155 * \brief Initialize my parameter values by default parameters.
156 * \retval bool - true if parameter values have been successfully defined
158 //================================================================================
160 bool StdMeshers_QuadrangleParams::SetParametersByDefaults(const TDefaults& dflts,
161 const SMESH_Mesh* /*mesh*/)