-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2020 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
StdMeshers_CartesianParameters3D_i::
StdMeshers_CartesianParameters3D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
- MESSAGE( "StdMeshers_CartesianParameters3D_i::StdMeshers_CartesianParameters3D_i" );
myBaseImpl = new ::StdMeshers_CartesianParameters3D( theGenImpl->GetANewId(),
- theStudyId,
theGenImpl );
}
StdMeshers_CartesianParameters3D_i::~StdMeshers_CartesianParameters3D_i()
{
- MESSAGE( "StdMeshers_CartesianParameters3D_i::~StdMeshers_CartesianParameters3D_i" );
}
//=============================================================================
void StdMeshers_CartesianParameters3D_i::SetGrid(const SMESH::double_array& coords,
CORBA::Short axis)
- throw (SALOME::SALOME_Exception)
+
{
std::vector<double> coordVec;//, yCoords, zCoords;
_array2vec( coords, coordVec, );
//=============================================================================
SMESH::double_array* StdMeshers_CartesianParameters3D_i::GetGrid(CORBA::Short axis)
- throw (SALOME::SALOME_Exception)
+
{
std::vector<double> coordVec;
ASSERT( myBaseImpl );
//=============================================================================
void StdMeshers_CartesianParameters3D_i::SetSizeThreshold(CORBA::Double threshold)
- throw (SALOME::SALOME_Exception)
+
{
ASSERT( myBaseImpl );
try {
//\brief Set grid spacing along the three axes
// \param spaceFunctions - functions defining spacing values at given point on axis
// \param internalPoints - points dividing a grid into parts along each direction
-// Parameter t of spaceFunction f(t) is a position [0,1] withing bounding box of
-// the shape to mesh or withing an interval defined by internal points
+// Parameter t of spaceFunction f(t) is a position [0,1] within bounding box of
+// the shape to mesh or within an interval defined by internal points
//=======================================================================
void StdMeshers_CartesianParameters3D_i::SetGridSpacing(const SMESH::string_array& spaceFunctions,
const SMESH::double_array& internalPoints,
CORBA::Short axis)
- throw (SALOME::SALOME_Exception)
+
{
- vector<string> funVec;
- vector<double> pointVec;
+ std::vector<std::string> funVec;
+ std::vector<double> pointVec;
_array2vec( spaceFunctions, funVec, (const char*) );
_array2vec( internalPoints, pointVec, );
void StdMeshers_CartesianParameters3D_i::GetGridSpacing(SMESH::string_array_out xSpaceFunctions,
SMESH::double_array_out xInternalPoints,
CORBA::Short axis)
- throw (SALOME::SALOME_Exception)
+
{
ASSERT( myBaseImpl );
try {
- vector<string> funVec;
- vector<double> pointVec;
+ std::vector<std::string> funVec;
+ std::vector<double> pointVec;
this->GetImpl()->GetGridSpacing( funVec, pointVec, axis );
xSpaceFunctions = new SMESH::string_array();
void StdMeshers_CartesianParameters3D_i::SetAxesDirs(const SMESH::DirStruct& xDir,
const SMESH::DirStruct& yDir,
const SMESH::DirStruct& zDir)
- throw (SALOME::SALOME_Exception)
+
{
double coords[9];
coords[0] = xDir.PS.x;
coords[6] = zDir.PS.x;
coords[7] = zDir.PS.y;
coords[8] = zDir.PS.z;
+
+ const double* oldCoords = GetImpl()->GetAxisDirs();
+ bool isSame = true;
+ for ( int i = 0; i < 9 && isSame; ++i )
+ isSame = ( oldCoords[i] == coords[i] );
+ if ( isSame )
+ return;
+
try {
this->GetImpl()->SetAxisDirs(coords);
void StdMeshers_CartesianParameters3D_i::SetFixedPoint(const SMESH::PointStruct& ps,
CORBA::Boolean toUnset)
{
+ SMESH::PointStruct oldPS;
+ GetFixedPoint( oldPS );
+ if ( oldPS.x == ps.x && oldPS.y == ps.y && oldPS.z == ps.z )
+ return;
+
double p[3] = { ps.x, ps.y, ps.z };
GetImpl()->SetFixedPoint( p, toUnset );
return GetImpl()->GetToAddEdges();
}
+//=======================================================================
+//function : SetToConsiderInternalFaces
+//purpose : Enables treatment of geom faces, either shared by solids or internal.
+//=======================================================================
+
+void StdMeshers_CartesianParameters3D_i::SetToConsiderInternalFaces(CORBA::Boolean toTreat)
+{
+ if ( GetToConsiderInternalFaces() == toTreat )
+ return;
+ GetImpl()->SetToConsiderInternalFaces( toTreat );
+ SMESH::TPythonDump() << _this() << ".SetToConsiderInternalFaces( " << toTreat << " )";
+}
+
+//=======================================================================
+//function : GetToConsiderInternalFaces
+//purpose : Return true if treatment of internal geom faces is enabled
+//=======================================================================
+
+CORBA::Boolean StdMeshers_CartesianParameters3D_i::GetToConsiderInternalFaces()
+{
+ return GetImpl()->GetToConsiderInternalFaces();
+}
+
+//=======================================================================
+//function : SetToUseThresholdForInternalFaces
+//purpose : Enables applying size threshold to grid cells cut by internal geom faces.
+//=======================================================================
+
+void StdMeshers_CartesianParameters3D_i::SetToUseThresholdForInternalFaces(CORBA::Boolean toUse)
+{
+ if ( GetToUseThresholdForInternalFaces() == toUse )
+ return;
+ GetImpl()->SetToUseThresholdForInternalFaces( toUse );
+ SMESH::TPythonDump() << _this() << ".SetToUseThresholdForInternalFaces( " << toUse << " )";
+}
+
+//=======================================================================
+//function : GetToUseThresholdForInternalFaces
+//purpose : Return true if applying size threshold to grid cells cut by
+// internal geom faces is enabled
+//=======================================================================
+
+CORBA::Boolean StdMeshers_CartesianParameters3D_i::GetToUseThresholdForInternalFaces()
+{
+ return GetImpl()->GetToUseThresholdForInternalFaces();
+}
+
+//=======================================================================
+//function : SetToCreateFaces
+//purpose : Enables creation of mesh faces.
+//=======================================================================
+
+void StdMeshers_CartesianParameters3D_i::SetToCreateFaces(CORBA::Boolean toCreate)
+{
+ if ( GetToCreateFaces() == toCreate )
+ return;
+ GetImpl()->SetToCreateFaces( toCreate );
+ SMESH::TPythonDump() << _this() << ".SetToCreateFaces( " << toCreate << " )";
+}
+
+//=======================================================================
+//function : GetToCreateFaces
+//purpose : Check if creation of mesh faces enabled
+//=======================================================================
+
+CORBA::Boolean StdMeshers_CartesianParameters3D_i::GetToCreateFaces()
+{
+ return GetImpl()->GetToCreateFaces();
+}
+
//=======================================================================
//function : IsGridBySpacing
//purpose : Return true if the grid is defined by spacing functions and
SMESH::DirStruct& xDir,
SMESH::DirStruct& yDir,
SMESH::DirStruct& zDir)
- throw (SALOME::SALOME_Exception)
+
{
TopoDS_Shape shape = SMESH_Gen_i::GetSMESHGen()->GeomObjectToShape( go );
if ( shape.IsNull() )
const SMESH::string_array& spaceFuns,
const SMESH::double_array& points,
const char* axisName )
- throw (SALOME::SALOME_Exception)
+
{
- vector<string> xFuns;
- vector<double> xPoints, coords;
+ std::vector<std::string> xFuns;
+ std::vector<double> xPoints, coords;
_array2vec( spaceFuns, xFuns, (const char*) );
_array2vec( points, xPoints, );
::StdMeshers_CartesianParameters3D* StdMeshers_CartesianParameters3D_i::GetImpl()
{
- MESSAGE( "StdMeshers_CartesianParameters3D_i::GetImpl" );
return ( ::StdMeshers_CartesianParameters3D* )myBaseImpl;
}