#include "SMDS_VolumeOfNodes.hxx"
#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
-#include <TopTools_ListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
-#include <TColStd_MapOfInteger.hxx>
-
-#include <BRep_Tool.hxx>
-#include <Geom_Surface.hxx>
+#include <TopTools_ListOfShape.hxx>
+#include <TopoDS.hxx>
#include <gp_Pnt2d.hxx>
#include "utilities.h"
#include "utilities.h"
-#include <TopoDS_Face.hxx>
-#include <TopoDS_Edge.hxx>
-#include <Geom_Surface.hxx>
-#include <Geom2d_Curve.hxx>
-#include <gp_Pnt2d.hxx>
-#include <BRep_Tool.hxx>
#include <BRepTools.hxx>
+#include <BRep_Tool.hxx>
+#include <Geom2d_Curve.hxx>
+#include <Geom_Surface.hxx>
+#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_MapOfShape.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Face.hxx>
+#include <TopoDS_Iterator.hxx>
+#include <gp_Pnt2d.hxx>
using namespace std;
*/
//=============================================================================
-StdMeshers_NumberOfSegments::StdMeshers_NumberOfSegments(int hypId, int studyId,
- SMESH_Gen * gen)
+StdMeshers_NumberOfSegments::StdMeshers_NumberOfSegments(int hypId,
+ int studyId,
+ SMESH_Gen * gen)
: SMESH_Hypothesis(hypId, studyId, gen),
_numberOfSegments(1),
_distrType(DT_Regular),
*
*/
//=============================================================================
-const std::vector<double>& StdMeshers_NumberOfSegments::BuildDistributionExpr( const char* expr, int nbSeg, int conv )
-throw ( SALOME_Exception )
+const vector<double>&
+StdMeshers_NumberOfSegments::BuildDistributionExpr( const char* expr,int nbSeg,int conv )
+ throw ( SALOME_Exception )
{
if( !buildDistribution( TCollection_AsciiString( ( Standard_CString )expr ), conv, 0.0, 1.0, nbSeg, _distr, 1E-4 ) )
_distr.resize( 0 );
return _distr;
}
-const std::vector<double>& StdMeshers_NumberOfSegments::BuildDistributionTab( const std::vector<double>& tab,
- int nbSeg, int conv )
-throw ( SALOME_Exception )
+const vector<double>&
+StdMeshers_NumberOfSegments::BuildDistributionTab( const vector<double>& tab,
+ int nbSeg,
+ int conv )
+ throw ( SALOME_Exception )
{
if( !buildDistribution( tab, conv, 0.0, 1.0, nbSeg, _distr, 1E-4 ) )
_distr.resize( 0 );
void StdMeshers_NumberOfSegments::SetNumberOfSegments(int segmentsNumber)
throw(SALOME_Exception)
{
- int oldNumberOfSegments = _numberOfSegments;
- if (segmentsNumber <= 0)
- throw
- SALOME_Exception(LOCALIZED("number of segments must be positive"));
- _numberOfSegments = segmentsNumber;
-
- if (oldNumberOfSegments != _numberOfSegments)
- NotifySubMeshesHypothesisModification();
+ int oldNumberOfSegments = _numberOfSegments;
+ if (segmentsNumber <= 0)
+ throw SALOME_Exception(LOCALIZED("number of segments must be positive"));
+ _numberOfSegments = segmentsNumber;
+
+ if (oldNumberOfSegments != _numberOfSegments)
+ NotifySubMeshesHypothesisModification();
}
//=============================================================================
int StdMeshers_NumberOfSegments::GetNumberOfSegments() const
{
- return _numberOfSegments;
+ return _numberOfSegments;
}
//================================================================================
throw(SALOME_Exception)
{
if (_distrType != DT_Scale)
- throw SALOME_Exception(LOCALIZED("not a scale distribution"));
+ _distrType = DT_Scale;
+ //throw SALOME_Exception(LOCALIZED("not a scale distribution"));
if (scaleFactor < PRECISION)
throw SALOME_Exception(LOCALIZED("scale factor must be positive"));
//if (fabs(scaleFactor - 1.0) < PRECISION)
*/
//================================================================================
-void StdMeshers_NumberOfSegments::SetTableFunction(const std::vector<double>& table)
+void StdMeshers_NumberOfSegments::SetTableFunction(const vector<double>& table)
throw(SALOME_Exception)
{
if (_distrType != DT_TabFunc)
- throw SALOME_Exception(LOCALIZED("not a table function distribution"));
+ _distrType = DT_TabFunc;
+ //throw SALOME_Exception(LOCALIZED("not a table function distribution"));
if ( (table.size() % 2) != 0 )
throw SALOME_Exception(LOCALIZED("odd size of vector of table function"));
*/
//================================================================================
-const std::vector<double>& StdMeshers_NumberOfSegments::GetTableFunction() const
+const vector<double>& StdMeshers_NumberOfSegments::GetTableFunction() const
throw(SALOME_Exception)
{
if (_distrType != DT_TabFunc)
throw(SALOME_Exception)
{
if (_distrType != DT_ExprFunc)
- throw SALOME_Exception(LOCALIZED("not an expression function distribution"));
+ _distrType = DT_ExprFunc;
+ //throw SALOME_Exception(LOCALIZED("not an expression function distribution"));
// remove white spaces
TCollection_AsciiString str((Standard_CString)expr);
return;
}
- std::string func = expr;
+ string func = expr;
if( _func != func )
{
_func = func;
void StdMeshers_NumberOfSegments::SetConversionMode( int conv )
throw(SALOME_Exception)
{
- if (_distrType != DT_TabFunc && _distrType != DT_ExprFunc)
- throw SALOME_Exception(LOCALIZED("not a functional distribution"));
+// if (_distrType != DT_TabFunc && _distrType != DT_ExprFunc)
+// throw SALOME_Exception(LOCALIZED("not a functional distribution"));
if( conv != _convMode )
{
int StdMeshers_NumberOfSegments::ConversionMode() const
throw(SALOME_Exception)
{
- if (_distrType != DT_TabFunc && _distrType != DT_ExprFunc)
- throw SALOME_Exception(LOCALIZED("not a functional distribution"));
+// if (_distrType != DT_TabFunc && _distrType != DT_ExprFunc)
+// throw SALOME_Exception(LOCALIZED("not a functional distribution"));
return _convMode;
}
int nbEdges = 0;
TopTools_IndexedMapOfShape edgeMap;
TopExp::MapShapes( theShape, TopAbs_EDGE, edgeMap );
+ SMESHDS_Mesh* aMeshDS = const_cast< SMESH_Mesh* >( theMesh )->GetMeshDS();
for ( int i = 1; i <= edgeMap.Extent(); ++i )
{
// get current segment length
- SMESHDS_Mesh* aMeshDS = const_cast< SMESH_Mesh* >( theMesh )->GetMeshDS();
SMESHDS_SubMesh * eSubMesh = aMeshDS->MeshElements( edgeMap( i ));
if ( eSubMesh && eSubMesh->NbElements())
_numberOfSegments += eSubMesh->NbElements();
#include "SMESH_subMeshEventListener.hxx"
#include "SMESH_Comment.hxx"
-#include <BRepTools.hxx>
-#include <BRepTools_WireExplorer.hxx>
#include <BRep_Tool.hxx>
-#include <TopAbs_ShapeEnum.hxx>
#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
-#include <TopTools_IndexedMapOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
-#include <TopTools_MapOfShape.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Shell.hxx>
#include <TopoDS_Vertex.hxx>
#include <gp_Pnt.hxx>
-#include <BRepTools.hxx>
-#include <BRepTools_WireExplorer.hxx>
-#include <TopTools_MapOfShape.hxx>
#include <stdio.h>
#include <algorithm>
#include "utilities.h"
-#include <BRepAdaptor_Curve.hxx>
-#include <BRepAdaptor_Curve2d.hxx>
-#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <Geom2dAdaptor_Curve.hxx>
#include <Geom2d_Line.hxx>
+#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
+#include <TopoDS.hxx>
using namespace std;
-#define RETURN_BAD_RESULT(msg) { MESSAGE(msg); return false; }
+#define RETURN_BAD_RESULT(msg) { MESSAGE(")-: Error: " << msg); return false; }
#define gpXYZ(n) gp_XYZ(n->X(),n->Y(),n->Z())
#define SHOWYXZ(msg, xyz) // {\
// gp_Pnt p (xyz); \
#include "utilities.h"
-#define RETURN_BAD_RESULT(msg) { MESSAGE(msg); return false; }
+#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
+#include <TopoDS.hxx>
+
+#define RETURN_BAD_RESULT(msg) { MESSAGE(")-: Error: " << msg); return false; }
#define gpXYZ(n) gp_XYZ(n->X(),n->Y(),n->Z())
#define SHOWYXZ(msg, xyz) // {\
// gp_Pnt p (xyz); \
#include "SMESH_Mesh.hxx"
#include "SMESH_subMesh.hxx"
-#include <TopTools_MapOfShape.hxx>
-#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <BRepTools_WireExplorer.hxx>
+#include <TopTools_ListIteratorOfListOfShape.hxx>
+#include <TopTools_MapOfShape.hxx>
+#include <TopoDS.hxx>
#define DBGMSG(txt) \
// cout << txt << endl;
#include "SMDS_EdgePosition.hxx"
#include "SMDS_FacePosition.hxx"
-#include <BRepAdaptor_Curve.hxx>
-#include <BRep_Tool.hxx>
-#include <BRepLProp.hxx>
#include <BRepTools.hxx>
#include <BRepTools_WireExplorer.hxx>
+#include <BRep_Tool.hxx>
#include <Geom_Surface.hxx>
-#include <Geom_Curve.hxx>
-#include <Geom2d_Curve.hxx>
-#include <GeomAdaptor_Curve.hxx>
-#include <GCPnts_UniformAbscissa.hxx>
-#include <TopExp.hxx>
+#include <NCollection_DefineArray2.hxx>
#include <Precision.hxx>
-#include <gp_Pnt2d.hxx>
-#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <TColStd_SequenceOfReal.hxx>
#include <TColgp_SequenceOfXY.hxx>
-#include <NCollection_DefineArray2.hxx>
+#include <TopExp.hxx>
+#include <TopoDS.hxx>
#include "utilities.h"
#include "Utils_ExceptHandlers.hxx"
#include "utilities.h"
-#include <TopoDS_Solid.hxx>
-#include <TopoDS_Shell.hxx>
-#include <BRepTools.hxx>
#include <BRepAdaptor_Curve.hxx>
-#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
+#include <BRepTools.hxx>
+#include <TopExp_Explorer.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Shell.hxx>
+#include <TopoDS_Solid.hxx>
#include <gp.hxx>
#include <gp_Pnt.hxx>
using namespace std;
-#define RETURN_BAD_RESULT(msg) { MESSAGE(msg); return false; }
+#define RETURN_BAD_RESULT(msg) { MESSAGE(")-: Error: " << msg); return false; }
#define gpXYZ(n) gp_XYZ(n->X(),n->Y(),n->Z())
typedef StdMeshers_ProjectionUtils TAssocTool;
#include <BRepAdaptor_Curve.hxx>
#include <BRep_Tool.hxx>
-#include <TopoDS_Edge.hxx>
-#include <TopExp_Explorer.hxx>
#include <GCPnts_AbscissaPoint.hxx>
#include <GCPnts_UniformAbscissa.hxx>
#include <GCPnts_UniformDeflection.hxx>
#include <Precision.hxx>
+#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Edge.hxx>
#include <string>