X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FStdMeshers%2FStdMeshers_Regular_1D.hxx;h=c0217343b7d7b279e931e462e2187363781e1d62;hp=96128d98477692336107b5319cc9146182a2c3f0;hb=aa67cc96d730566d202d1014d97b7f0b3a4d71f4;hpb=d8e7d0d7d955c625b4a5a89d22b141375db22c96 diff --git a/src/StdMeshers/StdMeshers_Regular_1D.hxx b/src/StdMeshers/StdMeshers_Regular_1D.hxx index 96128d984..c0217343b 100644 --- a/src/StdMeshers/StdMeshers_Regular_1D.hxx +++ b/src/StdMeshers/StdMeshers_Regular_1D.hxx @@ -1,41 +1,45 @@ -// SMESH SMESH : implementaion of SMESH idl descriptions +// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + +// SMESH SMESH : implementaion of SMESH idl descriptions // File : StdMeshers_Regular_1D.hxx // Moved here from SMESH_Regular_1D.hxx // Author : Paul RASCLE, EDF // Module : SMESH -// $Header$ - +// #ifndef _SMESH_REGULAR_1D_HXX_ #define _SMESH_REGULAR_1D_HXX_ +#include "SMESH_StdMeshers.hxx" + #include "SMESH_1D_Algo.hxx" -class TopoDS_Edge; +#include "StdMeshers_FixedPoints1D.hxx" + +class Adaptor3d_Curve; +class TopoDS_Vertex; +class StdMeshers_SegmentLengthAroundVertex; -class StdMeshers_Regular_1D: - public SMESH_1D_Algo +class STDMESHERS_EXPORT StdMeshers_Regular_1D: public SMESH_1D_Algo { public: StdMeshers_Regular_1D(int hypId, int studyId, SMESH_Gen* gen); @@ -46,35 +50,89 @@ public: SMESH_Hypothesis::Hypothesis_Status& aStatus); virtual bool Compute(SMESH_Mesh& aMesh, - const TopoDS_Shape& aShape); + const TopoDS_Shape& aShape); - virtual const std::list & - GetUsedHypothesis(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape); + virtual bool Evaluate(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape, + MapShapeNbElems& aResMap); - ostream & SaveTo(ostream & save); - istream & LoadFrom(istream & load); - friend ostream & operator << (ostream & save, StdMeshers_Regular_1D & hyp); - friend istream & operator >> (istream & load, StdMeshers_Regular_1D & hyp); + virtual const std::list & + GetUsedHypothesis(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape, const bool=true); + + /*! + * \brief Sets event listener to submeshes if necessary + * \param subMesh - submesh where algo is set + * + * This method is called when a submesh gets HYP_OK algo_state. + * After being set, event listener is notified on each event of a submesh. + */ + virtual void SetEventListener(SMESH_subMesh* subMesh); + + /*! + * \brief Allow algo to do something after persistent restoration + * \param subMesh - restored submesh + * + * This method is called only if a submesh has HYP_OK algo_state. + */ + void SubmeshRestored(SMESH_subMesh* subMesh); protected: - bool computeInternalParameters (const TopoDS_Edge& theEdge, - std::list< double > & theParameters, - const bool theReverse) const; - - enum HypothesisType { LOCAL_LENGTH, NB_SEGMENTS, BEG_END_LENGTH, DEFLECTION, ARITHMETIC_1D, NONE }; + virtual bool computeInternalParameters (SMESH_Mesh & theMesh, + Adaptor3d_Curve & theC3d, + double theLength, + double theFirstU, + double theLastU, + std::list & theParameters, + const bool theReverse, + bool theConsiderPropagation = false); + + virtual void redistributeNearVertices (SMESH_Mesh & theMesh, + Adaptor3d_Curve & theC3d, + double theLength, + std::list< double > & theParameters, + const TopoDS_Vertex & theVf, + const TopoDS_Vertex & theVl); + + /*! + * \brief Return StdMeshers_SegmentLengthAroundVertex assigned to vertex + */ + static const + StdMeshers_SegmentLengthAroundVertex* getVertexHyp(SMESH_Mesh & theMesh, + const TopoDS_Vertex & theV); + + enum HypothesisType { LOCAL_LENGTH, MAX_LENGTH, NB_SEGMENTS, BEG_END_LENGTH, DEFLECTION, ARITHMETIC_1D, FIXED_POINTS_1D, NONE }; enum ValueIndex { - NB_SEGMENTS_IND = 0, - SCALE_FACTOR_IND = 1, + SCALE_FACTOR_IND = 0, BEG_LENGTH_IND = 0, END_LENGTH_IND = 1, - DEFLECTION_IND = 0 - }; + DEFLECTION_IND = 0, + PRECISION_IND = 1 + }; + + enum IValueIndex { + NB_SEGMENTS_IND = 0, + DISTR_TYPE_IND = 1, + CONV_MODE_IND = 2 + }; + + enum VValueIndex { + TAB_FUNC_IND = 0 + }; + + enum SValueIndex { + EXPR_FUNC_IND = 0 + }; HypothesisType _hypType; + const StdMeshers_FixedPoints1D* _fpHyp; + double _value[2]; + int _ivalue[3]; + std::vector _vvalue[1]; + std::string _svalue[1]; + std::vector _revEdgesIDs; // a source of propagated hypothesis, is set by CheckHypothesis() // always called before Compute()