Version: 9.16.0
StdMeshers_Regular_1D.hxx
Go to the documentation of this file.
1// Copyright (C) 2007-2026 CEA, EDF, OPEN CASCADE
2//
3// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5//
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, or (at your option) any later version.
10//
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.
15//
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
19//
20// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21//
22
23// SMESH SMESH : implementation of SMESH idl descriptions
24// File : StdMeshers_Regular_1D.hxx
25// Moved here from SMESH_Regular_1D.hxx
26// Author : Paul RASCLE, EDF
27// Module : SMESH
28//
29#ifndef _SMESH_REGULAR_1D_HXX_
30#define _SMESH_REGULAR_1D_HXX_
31
32#include "SMESH_StdMeshers.hxx"
33
34#include "SMESH_Algo.hxx"
35
36#include <TopoDS_Shape.hxx>
37
38class Adaptor3d_Curve;
42class TopoDS_Vertex;
43
45{
46public:
47 StdMeshers_Regular_1D(int hypId, SMESH_Gen* gen);
48 virtual ~StdMeshers_Regular_1D();
49
50 virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
51 const TopoDS_Shape& aShape,
53
54 virtual bool Compute(SMESH_Mesh& aMesh,
55 const TopoDS_Shape& aShape);
56
57 virtual bool Evaluate(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape,
58 MapShapeNbElems& aResMap);
59
60 virtual void CancelCompute();
61
62 virtual const std::list <const SMESHDS_Hypothesis *> &
63 GetUsedHypothesis(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape, const bool=true);
64
72 virtual void SetEventListener(SMESH_subMesh* subMesh);
73
80 void SubmeshRestored(SMESH_subMesh* subMesh);
81
82protected:
83
84 virtual bool computeInternalParameters (SMESH_Mesh & theMesh,
85 Adaptor3d_Curve & theC3d,
86 double theLength,
87 double theFirstU,
88 double theLastU,
89 std::list<double> & theParameters,
90 const bool theReverse,
91 bool theConsiderPropagation = false);
92
93 virtual void redistributeNearVertices (SMESH_Mesh & theMesh,
94 Adaptor3d_Curve & theC3d,
95 double theLength,
96 std::list< double > & theParameters,
97 const TopoDS_Vertex & theVf,
98 const TopoDS_Vertex & thieve);
99
100 bool divideIntoEqualSegments( SMESH_Mesh & theMesh,
101 Adaptor3d_Curve & theC3d,
102 smIdType theNbPoints,
103 double theTol,
104 double theLength,
105 double theFirstU,
106 double theLastU,
107 std::list<double> & theParameters );
108
109 bool computeBetaLaw(Adaptor3d_Curve& theC3d,
110 std::list<double>& theParams,
111 double f,
112 double theLength,
113 double beta,
114 int nbSegments,
115 bool theReverse);
116
120 static const
121 StdMeshers_SegmentLengthAroundVertex* getVertexHyp(SMESH_Mesh & theMesh,
122 const TopoDS_Vertex & theV);
123
124 enum HypothesisType { LOCAL_LENGTH, MAX_LENGTH, NB_SEGMENTS, BEG_END_LENGTH, DEFLECTION, ARITHMETIC_1D, FIXED_POINTS_1D, ADAPTIVE, GEOMETRIC_1D, DISTRIB_PROPAGATION, NONE };
125
127 SCALE_FACTOR_IND = 0,
128 BETA_IND = 0,
129 BEG_LENGTH_IND = 0,
130 END_LENGTH_IND = 1,
131 DEFLECTION_IND = 0,
132 PRECISION_IND = 1
133 };
134
136 NB_SEGMENTS_IND = 0,
137 DISTR_TYPE_IND = 1,
138 CONV_MODE_IND = 2
139 };
140
142 TAB_FUNC_IND = 0
143 };
144
146 EXPR_FUNC_IND = 0
147 };
148
150
153
154 double _value [2];
155 smIdType _ivalue[3];
156 std::vector<double> _vvalue[1];
157 std::string _svalue[1];
158 std::vector<int> _revEdgesIDs;
159
160 // a source of propagated hypothesis, is set by CheckHypothesis()
161 // always called before Compute()
162 TopoDS_Shape _mainEdge;
163};
164
165#endif
std::map< SMESH_subMesh *, std::vector< smIdType > > MapShapeNbElems
Definition: SMESH_Algo.hxx:63
#define STDMESHERS_EXPORT
Definition: SMESH_StdMeshers.hxx:38
Definition: SMESH_Algo.hxx:476
virtual bool Evaluate(SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, MapShapeNbElems &aResMap)=0
evaluates size of prospective mesh on a shape
virtual void CancelCompute()
Sets _computeCanceled to true.
Definition: SMESH_Algo.cxx:872
virtual bool CheckHypothesis(SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, SMESH_Hypothesis::Hypothesis_Status &aStatus)=0
Check hypothesis definition to mesh a shape.
virtual void SetEventListener(SMESH_subMesh *subMesh)
Sets event listener to submeshes if necessary.
Definition: SMESH_Algo.cxx:825
virtual void SubmeshRestored(SMESH_subMesh *subMesh)
Allow algo to do something after persistent restoration.
Definition: SMESH_Algo.cxx:838
virtual bool Compute(SMESH_Mesh &aMesh, const TopoDS_Shape &aShape)=0
Computes mesh on a shape.
virtual const std::list< const SMESHDS_Hypothesis * > & GetUsedHypothesis(SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, const bool ignoreAuxiliary=true) const
Return a list of compatible hypotheses used to mesh a shape.
Definition: SMESH_Algo.cxx:261
Definition: SMESH_Gen.hxx:68
Hypothesis_Status
Definition: SMESH_Hypothesis.hxx:51
Definition: SMESH_Mesh.hxx:80
Definition: SMESH_subMesh.hxx:61
Adaptive 1D hypothesis.
Definition: StdMeshers_Adaptive1D.hxx:38
Definition: StdMeshers_FixedPoints1D.hxx:38
Definition: StdMeshers_Regular_1D.hxx:45
const StdMeshers_Adaptive1D * _adaptiveHyp
Definition: StdMeshers_Regular_1D.hxx:152
std::vector< int > _revEdgesIDs
Definition: StdMeshers_Regular_1D.hxx:158
VValueIndex
Definition: StdMeshers_Regular_1D.hxx:141
SValueIndex
Definition: StdMeshers_Regular_1D.hxx:145
IValueIndex
Definition: StdMeshers_Regular_1D.hxx:135
ValueIndex
Definition: StdMeshers_Regular_1D.hxx:126
const StdMeshers_FixedPoints1D * _fpHyp
Definition: StdMeshers_Regular_1D.hxx:151
HypothesisType
Definition: StdMeshers_Regular_1D.hxx:124
@ ADAPTIVE
Definition: StdMeshers_Regular_1D.hxx:124
TopoDS_Shape _mainEdge
Definition: StdMeshers_Regular_1D.hxx:162
HypothesisType _hypType
Definition: StdMeshers_Regular_1D.hxx:149
This hypothesis specifies length of segments adjacent to the vertex the hypothesis is assigned to.
Definition: StdMeshers_SegmentLengthAroundVertex.hxx:41