1 // Copyright (C) 2007-2012 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
23 // SMESH SMESH : implementaion of SMESH idl descriptions
24 // File : StdMeshers_Regular_1D.hxx
25 // Moved here from SMESH_Regular_1D.hxx
26 // Author : Paul RASCLE, EDF
29 #ifndef _SMESH_REGULAR_1D_HXX_
30 #define _SMESH_REGULAR_1D_HXX_
32 #include "SMESH_StdMeshers.hxx"
34 #include "SMESH_Algo.hxx"
36 #include "StdMeshers_FixedPoints1D.hxx"
38 class Adaptor3d_Curve;
40 class StdMeshers_SegmentLengthAroundVertex;
42 class STDMESHERS_EXPORT StdMeshers_Regular_1D: public SMESH_1D_Algo
45 StdMeshers_Regular_1D(int hypId, int studyId, SMESH_Gen* gen);
46 virtual ~StdMeshers_Regular_1D();
48 virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
49 const TopoDS_Shape& aShape,
50 SMESH_Hypothesis::Hypothesis_Status& aStatus);
52 virtual bool Compute(SMESH_Mesh& aMesh,
53 const TopoDS_Shape& aShape);
55 virtual bool Evaluate(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape,
56 MapShapeNbElems& aResMap);
58 virtual const std::list <const SMESHDS_Hypothesis *> &
59 GetUsedHypothesis(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape, const bool=true);
62 * \brief Sets event listener to submeshes if necessary
63 * \param subMesh - submesh where algo is set
65 * This method is called when a submesh gets HYP_OK algo_state.
66 * After being set, event listener is notified on each event of a submesh.
68 virtual void SetEventListener(SMESH_subMesh* subMesh);
71 * \brief Allow algo to do something after persistent restoration
72 * \param subMesh - restored submesh
74 * This method is called only if a submesh has HYP_OK algo_state.
76 void SubmeshRestored(SMESH_subMesh* subMesh);
80 virtual bool computeInternalParameters (SMESH_Mesh & theMesh,
81 Adaptor3d_Curve & theC3d,
85 std::list<double> & theParameters,
86 const bool theReverse,
87 bool theConsiderPropagation = false);
89 virtual void redistributeNearVertices (SMESH_Mesh & theMesh,
90 Adaptor3d_Curve & theC3d,
92 std::list< double > & theParameters,
93 const TopoDS_Vertex & theVf,
94 const TopoDS_Vertex & theVl);
97 * \brief Return StdMeshers_SegmentLengthAroundVertex assigned to vertex
100 StdMeshers_SegmentLengthAroundVertex* getVertexHyp(SMESH_Mesh & theMesh,
101 const TopoDS_Vertex & theV);
103 enum HypothesisType { LOCAL_LENGTH, MAX_LENGTH, NB_SEGMENTS, BEG_END_LENGTH, DEFLECTION, ARITHMETIC_1D, FIXED_POINTS_1D, NONE };
106 SCALE_FACTOR_IND = 0,
127 HypothesisType _hypType;
129 const StdMeshers_FixedPoints1D* _fpHyp;
133 std::vector<double> _vvalue[1];
134 std::string _svalue[1];
135 std::vector<int> _revEdgesIDs;
137 // a source of propagated hypothesis, is set by CheckHypothesis()
138 // always called before Compute()
139 TopoDS_Shape _mainEdge;