2009-02-17 10:27:49 +05:00
|
|
|
// Copyright (C) 2007-2008 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
|
2004-06-18 14:34:31 +06:00
|
|
|
//
|
2009-02-17 10:27:49 +05:00
|
|
|
// 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.
|
2004-06-18 14:34:31 +06:00
|
|
|
//
|
2009-02-17 10:27:49 +05:00
|
|
|
// 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.
|
2004-06-18 14:34:31 +06:00
|
|
|
//
|
2009-02-17 10:27:49 +05:00
|
|
|
// 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
|
2004-06-18 14:34:31 +06:00
|
|
|
//
|
2009-02-17 10:27:49 +05:00
|
|
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
|
|
|
//
|
|
|
|
// SMESH SMESH : implementaion of SMESH idl descriptions
|
2004-06-18 14:34:31 +06:00
|
|
|
// File : StdMeshers_Regular_1D.hxx
|
|
|
|
// Moved here from SMESH_Regular_1D.hxx
|
|
|
|
// Author : Paul RASCLE, EDF
|
|
|
|
// Module : SMESH
|
|
|
|
|
|
|
|
#ifndef _SMESH_REGULAR_1D_HXX_
|
|
|
|
#define _SMESH_REGULAR_1D_HXX_
|
|
|
|
|
2008-03-07 12:47:05 +05:00
|
|
|
#include "SMESH_StdMeshers.hxx"
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
#include "SMESH_1D_Algo.hxx"
|
|
|
|
|
2008-03-07 12:47:05 +05:00
|
|
|
class Adaptor3d_Curve;
|
|
|
|
class TopoDS_Vertex;
|
|
|
|
class StdMeshers_SegmentLengthAroundVertex;
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2008-03-07 12:47:05 +05:00
|
|
|
class STDMESHERS_EXPORT StdMeshers_Regular_1D: public SMESH_1D_Algo
|
2004-06-18 14:34:31 +06:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
StdMeshers_Regular_1D(int hypId, int studyId, SMESH_Gen* gen);
|
|
|
|
virtual ~StdMeshers_Regular_1D();
|
|
|
|
|
|
|
|
virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
|
|
|
|
const TopoDS_Shape& aShape,
|
|
|
|
SMESH_Hypothesis::Hypothesis_Status& aStatus);
|
|
|
|
|
|
|
|
virtual bool Compute(SMESH_Mesh& aMesh,
|
|
|
|
const TopoDS_Shape& aShape);
|
|
|
|
|
2009-06-29 19:26:16 +06:00
|
|
|
virtual bool Evaluate(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape,
|
|
|
|
MapShapeNbElems& aResMap);
|
|
|
|
|
2004-12-01 15:48:31 +05:00
|
|
|
virtual const std::list <const SMESHDS_Hypothesis *> &
|
2006-03-13 20:29:49 +05:00
|
|
|
GetUsedHypothesis(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape, const bool=true);
|
2004-12-01 15:48:31 +05:00
|
|
|
|
2008-03-07 12:47:05 +05:00
|
|
|
/*!
|
|
|
|
* \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);
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
protected:
|
2004-12-01 15:48:31 +05:00
|
|
|
|
2008-03-07 12:47:05 +05:00
|
|
|
virtual bool computeInternalParameters (SMESH_Mesh & theMesh,
|
|
|
|
Adaptor3d_Curve & theC3d,
|
|
|
|
double theLength,
|
|
|
|
double theFirstU,
|
|
|
|
double theLastU,
|
|
|
|
std::list<double> & 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);
|
2004-12-01 15:48:31 +05:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
enum HypothesisType { LOCAL_LENGTH, MAX_LENGTH, NB_SEGMENTS, BEG_END_LENGTH, DEFLECTION, ARITHMETIC_1D, NONE };
|
2004-12-01 15:48:31 +05:00
|
|
|
|
|
|
|
enum ValueIndex {
|
2005-08-16 18:26:35 +06:00
|
|
|
SCALE_FACTOR_IND = 0,
|
2004-12-01 15:48:31 +05:00
|
|
|
BEG_LENGTH_IND = 0,
|
|
|
|
END_LENGTH_IND = 1,
|
2009-02-17 10:27:49 +05:00
|
|
|
DEFLECTION_IND = 0,
|
|
|
|
PRECISION_IND = 1
|
2008-03-07 12:47:05 +05:00
|
|
|
};
|
2005-01-21 19:15:45 +05:00
|
|
|
|
2005-08-16 18:26:35 +06:00
|
|
|
enum IValueIndex {
|
|
|
|
NB_SEGMENTS_IND = 0,
|
|
|
|
DISTR_TYPE_IND = 1,
|
2008-03-07 12:47:05 +05:00
|
|
|
CONV_MODE_IND = 2
|
2005-08-16 18:26:35 +06:00
|
|
|
};
|
|
|
|
|
|
|
|
enum VValueIndex {
|
|
|
|
TAB_FUNC_IND = 0
|
|
|
|
};
|
|
|
|
|
|
|
|
enum SValueIndex {
|
|
|
|
EXPR_FUNC_IND = 0
|
|
|
|
};
|
|
|
|
|
2004-12-01 15:48:31 +05:00
|
|
|
HypothesisType _hypType;
|
|
|
|
|
|
|
|
double _value[2];
|
2005-08-16 18:26:35 +06:00
|
|
|
int _ivalue[3];
|
|
|
|
std::vector<double> _vvalue[1];
|
|
|
|
std::string _svalue[1];
|
2009-07-08 16:34:09 +06:00
|
|
|
std::vector<int> _revEdgesIDs;
|
2005-01-21 19:15:45 +05:00
|
|
|
|
|
|
|
// a source of propagated hypothesis, is set by CheckHypothesis()
|
|
|
|
// always called before Compute()
|
|
|
|
TopoDS_Shape _mainEdge;
|
2004-06-18 14:34:31 +06:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|