Back to index

salome-smesh  6.5.0
StdMeshers_Regular_1D.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //  SMESH SMESH : implementaion of SMESH idl descriptions
00024 //  File   : StdMeshers_Regular_1D.hxx
00025 //           Moved here from SMESH_Regular_1D.hxx
00026 //  Author : Paul RASCLE, EDF
00027 //  Module : SMESH
00028 //
00029 #ifndef _SMESH_REGULAR_1D_HXX_
00030 #define _SMESH_REGULAR_1D_HXX_
00031 
00032 #include "SMESH_StdMeshers.hxx"
00033 
00034 #include "SMESH_1D_Algo.hxx"
00035 
00036 #include "StdMeshers_FixedPoints1D.hxx"
00037 
00038 class Adaptor3d_Curve;
00039 class TopoDS_Vertex;
00040 class StdMeshers_SegmentLengthAroundVertex;
00041 
00042 class STDMESHERS_EXPORT StdMeshers_Regular_1D: public SMESH_1D_Algo
00043 {
00044 public:
00045   StdMeshers_Regular_1D(int hypId, int studyId, SMESH_Gen* gen);
00046   virtual ~StdMeshers_Regular_1D();
00047 
00048   virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
00049                                const TopoDS_Shape& aShape,
00050                                SMESH_Hypothesis::Hypothesis_Status& aStatus);
00051 
00052   virtual bool Compute(SMESH_Mesh& aMesh,
00053                        const TopoDS_Shape& aShape);
00054 
00055   virtual bool Evaluate(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape,
00056                         MapShapeNbElems& aResMap);
00057 
00058   virtual const std::list <const SMESHDS_Hypothesis *> &
00059     GetUsedHypothesis(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape, const bool=true);
00060 
00068   virtual void SetEventListener(SMESH_subMesh* subMesh);
00069 
00076   void SubmeshRestored(SMESH_subMesh* subMesh);
00077 
00078 protected:
00079 
00080   virtual bool computeInternalParameters (SMESH_Mesh &        theMesh,
00081                                           Adaptor3d_Curve &   theC3d,
00082                                           double              theLength,
00083                                           double              theFirstU,
00084                                           double              theLastU,
00085                                           std::list<double> & theParameters,
00086                                           const bool          theReverse,
00087                                           bool                theConsiderPropagation = false);
00088 
00089   virtual void redistributeNearVertices (SMESH_Mesh &          theMesh,
00090                                          Adaptor3d_Curve &     theC3d,
00091                                          double                theLength,
00092                                          std::list< double > & theParameters,
00093                                          const TopoDS_Vertex & theVf,
00094                                          const TopoDS_Vertex & theVl);
00095 
00099   static const
00100   StdMeshers_SegmentLengthAroundVertex* getVertexHyp(SMESH_Mesh &          theMesh,
00101                                                      const TopoDS_Vertex & theV);
00102 
00103   enum HypothesisType { LOCAL_LENGTH, MAX_LENGTH, NB_SEGMENTS, BEG_END_LENGTH, DEFLECTION, ARITHMETIC_1D, FIXED_POINTS_1D, NONE };
00104 
00105   enum ValueIndex {
00106     SCALE_FACTOR_IND = 0,
00107     BEG_LENGTH_IND   = 0,
00108     END_LENGTH_IND   = 1,
00109     DEFLECTION_IND   = 0,
00110     PRECISION_IND    = 1
00111   };
00112 
00113   enum IValueIndex {
00114     NB_SEGMENTS_IND  = 0,
00115     DISTR_TYPE_IND   = 1,
00116     CONV_MODE_IND    = 2
00117   };
00118 
00119   enum VValueIndex {
00120     TAB_FUNC_IND  = 0
00121   };
00122 
00123   enum SValueIndex {
00124     EXPR_FUNC_IND  = 0
00125   };
00126 
00127   HypothesisType _hypType;
00128 
00129   const StdMeshers_FixedPoints1D* _fpHyp;
00130 
00131   double _value[2];
00132   int    _ivalue[3];
00133   std::vector<double> _vvalue[1];
00134   std::string         _svalue[1];
00135   std::vector<int>    _revEdgesIDs;
00136 
00137   // a source of propagated hypothesis, is set by CheckHypothesis()
00138   // always called before Compute()
00139   TopoDS_Shape _mainEdge;
00140 };
00141 
00142 #endif