PAL19802 A "Clear Mesh data" method for SMESH.Mesh objects

This commit is contained in:
eap 2008-05-26 14:14:19 +00:00
parent 06b29d4531
commit 54df188f64
14 changed files with 248 additions and 171 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 610 B

View File

@ -204,6 +204,11 @@ module SMESH
GEOM::GEOM_Object GetShapeToMesh() GEOM::GEOM_Object GetShapeToMesh()
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*!
* Remove all nodes and elements
*/
void Clear()
raises (SALOME::SALOME_Exception);
/*! /*!
* Get the subMesh object associated to a subShape. The subMesh object * Get the subMesh object associated to a subShape. The subMesh object

View File

@ -39,6 +39,7 @@ dist_salomeres_DATA = \
mesh_area.png \ mesh_area.png \
mesh_aspect.png \ mesh_aspect.png \
mesh_aspect_3d.png \ mesh_aspect_3d.png \
mesh_clear.png \
mesh_compute.png \ mesh_compute.png \
mesh_connectivity.png \ mesh_connectivity.png \
mesh_diagonal.png \ mesh_diagonal.png \

BIN
resources/mesh_clear.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 610 B

View File

@ -201,6 +201,54 @@ const TopoDS_Solid& SMESH_Mesh::PseudoShape()
return aSolid; return aSolid;
} }
//=======================================================================
/*!
* \brief Remove all nodes and elements
*/
//=======================================================================
void SMESH_Mesh::Clear()
{
// clear sub-meshes; get ready to re-compute as a side-effect
if ( SMESH_subMesh *sm = GetSubMeshContaining( GetShapeToMesh() ) )
{
SMESH_subMeshIteratorPtr smIt = sm->getDependsOnIterator(/*includeSelf=*/true,
/*complexShapeFirst=*/false);
while ( smIt->more() )
{
sm = smIt->next();
TopAbs_ShapeEnum shapeType = sm->GetSubShape().ShapeType();
if ( shapeType == TopAbs_VERTEX || shapeType < TopAbs_SOLID )
// all other shapes depends on vertices so they are already cleaned
sm->ComputeStateEngine( SMESH_subMesh::CLEAN );
}
}
// clear entities not on sub-meshes
SMDS_VolumeIteratorPtr vIt = _myMeshDS->volumesIterator();
while ( vIt->more() )
_myMeshDS->RemoveFreeElement( vIt->next(), 0 );
SMDS_FaceIteratorPtr fIt = _myMeshDS->facesIterator();
while ( fIt->more() )
_myMeshDS->RemoveFreeElement( fIt->next(), 0 );
SMDS_EdgeIteratorPtr eIt = _myMeshDS->edgesIterator();
while ( eIt->more() )
_myMeshDS->RemoveFreeElement( eIt->next(), 0 );
SMDS_NodeIteratorPtr nIt = _myMeshDS->nodesIterator();
while ( nIt->more() ) {
const SMDS_MeshNode * node = nIt->next();
if ( node->NbInverseElements() == 0 )
_myMeshDS->RemoveFreeNode( node, 0 );
else
_myMeshDS->RemoveNode(node);
}
}
//======================================================================= //=======================================================================
//function : UNVToMesh //function : UNVToMesh
//purpose : //purpose :

View File

@ -82,6 +82,10 @@ public:
*/ */
static const TopoDS_Solid& PseudoShape(); static const TopoDS_Solid& PseudoShape();
/*!
* \brief Remove all nodes and elements
*/
void Clear();
int UNVToMesh(const char* theFileName); int UNVToMesh(const char* theFileName);
/*! /*!

View File

@ -1223,8 +1223,10 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
_computeState = READY_TO_COMPUTE; _computeState = READY_TO_COMPUTE;
SMESHDS_SubMesh* smDS = GetSubMeshDS(); SMESHDS_SubMesh* smDS = GetSubMeshDS();
if ( smDS && smDS->NbNodes() ) { if ( smDS && smDS->NbNodes() ) {
if ( event == CLEAN ) // this occures for algo which !NeedDescretBoundary() (PAL19272) if ( event == CLEAN ) {
CleanDependants();
cleanSubMesh( this ); cleanSubMesh( this );
}
else else
_computeState = COMPUTE_OK; _computeState = COMPUTE_OK;
} }

View File

@ -1513,6 +1513,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
new SMESHGUI_BuildCompoundDlg( this ); new SMESHGUI_BuildCompoundDlg( this );
} }
break; break;
case 407: // DIAGONAL INVERSION case 407: // DIAGONAL INVERSION
case 408: // Delete diagonal case 408: // Delete diagonal
{ {
@ -2143,6 +2144,38 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
} }
break; break;
} }
case 4043: { // CLEAR_MESH
if(checkLock(aStudy)) break;
SALOME_ListIO selected;
if( LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr() )
aSel->selectedObjects( selected );
SUIT_OverrideCursor wc;
SALOME_ListIteratorOfListIO It (selected);
for ( ; It.More(); It.Next() )
{
Handle(SALOME_InteractiveObject) IOS = It.Value();
SMESH::SMESH_Mesh_var aMesh =
SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IOS);
if ( aMesh->_is_nil()) continue;
try {
SMESH::UpdateView(SMESH::eErase, IOS->getEntry());
aMesh->Clear();
_PTR(SObject) aMeshSObj = SMESH::FindSObject(aMesh);
SMESH::ModifiedMesh( aMeshSObj, false, true);
}
catch (const SALOME::SALOME_Exception& S_ex){
wc.suspend();
SalomeApp_Tools::QtCatchCorbaException(S_ex);
wc.resume();
}
}
SMESH::UpdateView();
updateObjBrowser();
break;
}
case 4051: // RENUMBERING NODES case 4051: // RENUMBERING NODES
{ {
if(checkLock(aStudy)) break; if(checkLock(aStudy)) break;
@ -2533,6 +2566,7 @@ void SMESHGUI::initialize( CAM_Application* app )
createSMESHAction( 4032, "HEXA", "ICON_DLG_HEXAS" ); createSMESHAction( 4032, "HEXA", "ICON_DLG_HEXAS" );
createSMESHAction( 4041, "REMOVE_NODES", "ICON_DLG_REM_NODE" ); createSMESHAction( 4041, "REMOVE_NODES", "ICON_DLG_REM_NODE" );
createSMESHAction( 4042, "REMOVE_ELEMENTS", "ICON_DLG_REM_ELEMENT" ); createSMESHAction( 4042, "REMOVE_ELEMENTS", "ICON_DLG_REM_ELEMENT" );
createSMESHAction( 4043, "CLEAR_MESH" , "ICON_CLEAR_MESH" );
createSMESHAction( 4051, "RENUM_NODES", "ICON_DLG_RENUMBERING_NODES" ); createSMESHAction( 4051, "RENUM_NODES", "ICON_DLG_RENUMBERING_NODES" );
createSMESHAction( 4052, "RENUM_ELEMENTS", "ICON_DLG_RENUMBERING_ELEMENTS" ); createSMESHAction( 4052, "RENUM_ELEMENTS", "ICON_DLG_RENUMBERING_ELEMENTS" );
createSMESHAction( 4061, "TRANS", "ICON_SMESH_TRANSLATION_VECTOR" ); createSMESHAction( 4061, "TRANS", "ICON_SMESH_TRANSLATION_VECTOR" );
@ -2624,7 +2658,7 @@ void SMESHGUI::initialize( CAM_Application* app )
createMenu( 5105, toolsId, -1 ); createMenu( 5105, toolsId, -1 );
createMenu( 702, meshId, -1 ); createMenu( 702, meshId, -1 ); // "Mesh" menu
createMenu( 703, meshId, -1 ); createMenu( 703, meshId, -1 );
createMenu( 704, meshId, -1 ); createMenu( 704, meshId, -1 );
createMenu( 710, meshId, -1 ); createMenu( 710, meshId, -1 );
@ -2683,6 +2717,7 @@ void SMESHGUI::initialize( CAM_Application* app )
createMenu( 4041, removeId, -1 ); createMenu( 4041, removeId, -1 );
createMenu( 4042, removeId, -1 ); createMenu( 4042, removeId, -1 );
createMenu( 4043, removeId, -1 );
createMenu( 4051, renumId, -1 ); createMenu( 4051, renumId, -1 );
createMenu( 4052, renumId, -1 ); createMenu( 4052, renumId, -1 );
@ -2770,6 +2805,7 @@ void SMESHGUI::initialize( CAM_Application* app )
createTool( separator(), addRemTb ); createTool( separator(), addRemTb );
createTool( 4041, addRemTb ); createTool( 4041, addRemTb );
createTool( 4042, addRemTb ); createTool( 4042, addRemTb );
createTool( 4043, addRemTb );
createTool( separator(), addRemTb ); createTool( separator(), addRemTb );
createTool( 4051, addRemTb ); createTool( 4051, addRemTb );
createTool( 4052, addRemTb ); createTool( 4052, addRemTb );
@ -2833,12 +2869,16 @@ void SMESHGUI::initialize( CAM_Application* app )
createPopupItem( 801, OB, mesh ); // CREATE_GROUP createPopupItem( 801, OB, mesh ); // CREATE_GROUP
createPopupItem( 802, OB, subMesh ); // CONSTRUCT_GROUP createPopupItem( 802, OB, subMesh ); // CONSTRUCT_GROUP
popupMgr()->insert( separator(), -1, 0 ); popupMgr()->insert( separator(), -1, 0 );
createPopupItem( 1100, OB, hypo, "" /*"&& $hasReference={false}"*/ ); // EDIT HYPOTHESIS createPopupItem( 1100, OB, hypo); // EDIT HYPOTHESIS
createPopupItem( 1102, OB, hyp_alg ); // REMOVE HYPOTHESIS / ALGORITHMS createPopupItem( 1102, OB, hyp_alg ); // REMOVE HYPOTHESIS / ALGORITHMS
createPopupItem( 1101, OB, mesh_group + " " + hyp_alg, "" /*"&& $hasReference={false}"*/ ); // RENAME createPopupItem( 1101, OB, mesh_group + " " + hyp_alg ); // RENAME
popupMgr()->insert( separator(), -1, 0 );
createPopupItem( 4043, OB, mesh ); // CLEAR_MESH
popupMgr()->insert( separator(), -1, 0 ); popupMgr()->insert( separator(), -1, 0 );
QString only_one_non_empty = QString( " && %1=1 && numberOfNodes>0" ).arg( QtxPopupMgr::Selection::defSelCountParam() ); QString nbSelected = QtxPopupMgr::Selection::defSelCountParam();
QString only_one_non_empty = QString( " && %1=1 && numberOfNodes>0" ).arg( nbSelected );
createPopupItem( 125, OB, mesh, only_one_non_empty ); // EXPORT_MED createPopupItem( 125, OB, mesh, only_one_non_empty ); // EXPORT_MED
createPopupItem( 126, OB, mesh, only_one_non_empty ); // EXPORT_UNV createPopupItem( 126, OB, mesh, only_one_non_empty ); // EXPORT_UNV
createPopupItem( 141, OB, mesh, only_one_non_empty ); // EXPORT_STL createPopupItem( 141, OB, mesh, only_one_non_empty ); // EXPORT_STL

View File

@ -304,6 +304,9 @@ msgstr "mesh_compute.png"
msgid "ICON_BUILD_COMPOUND" msgid "ICON_BUILD_COMPOUND"
msgstr "mesh_build_compound.png" msgstr "mesh_build_compound.png"
msgid "ICON_CLEAR_MESH"
msgstr "mesh_clear.png"
msgid "ICON_UNION" msgid "ICON_UNION"
msgstr "mesh_unionGroups.png" msgstr "mesh_unionGroups.png"

View File

@ -2514,6 +2514,9 @@ msgstr "Quality controls"
msgid "MEN_RENAME" msgid "MEN_RENAME"
msgstr "Rename" msgstr "Rename"
msgid "MEN_CLEAR_MESH"
msgstr "Clear Mesh Data"
msgid "MEN_UNASSIGN" msgid "MEN_UNASSIGN"
msgstr "Unassign" msgstr "Unassign"
@ -2834,6 +2837,9 @@ msgstr "Update"
msgid "TOP_RENAME" msgid "TOP_RENAME"
msgstr "Rename" msgstr "Rename"
msgid "TOP_CLEAR_MESH"
msgstr "Clear Mesh Data"
msgid "TOP_UNASSIGN" msgid "TOP_UNASSIGN"
msgstr "Unassign" msgstr "Unassign"
@ -3156,6 +3162,9 @@ msgstr "Update"
msgid "STB_RENAME" msgid "STB_RENAME"
msgstr "Rename" msgstr "Rename"
msgid "STB_CLEAR_MESH"
msgstr "Clear Mesh Data"
msgid "STB_UNASSIGN" msgid "STB_UNASSIGN"
msgstr "Unassign" msgstr "Unassign"

View File

@ -753,6 +753,7 @@ bool _pyMesh::NeedMeshAccess( const Handle(_pyCommand)& theCommand )
"GetNodeInverseElements","GetShapeID","GetShapeIDForElem","GetElemNbNodes", "GetNodeInverseElements","GetShapeID","GetShapeIDForElem","GetElemNbNodes",
"GetElemNode","IsMediumNode","IsMediumNodeOfAnyElem","ElemNbEdges","ElemNbFaces", "GetElemNode","IsMediumNode","IsMediumNodeOfAnyElem","ElemNbEdges","ElemNbFaces",
"IsPoly","IsQuadratic","BaryCenter","GetHypothesisList", "SetAutoColor", "GetAutoColor", "IsPoly","IsQuadratic","BaryCenter","GetHypothesisList", "SetAutoColor", "GetAutoColor",
"Clear"
"" }; // <- mark of end "" }; // <- mark of end
sameMethods.Insert( names ); sameMethods.Insert( names );
} }

View File

@ -175,7 +175,7 @@ CORBA::Boolean SMESH_Mesh_i::HasShapeToMesh()
//======================================================================= //=======================================================================
GEOM::GEOM_Object_ptr SMESH_Mesh_i::GetShapeToMesh() GEOM::GEOM_Object_ptr SMESH_Mesh_i::GetShapeToMesh()
throw (SALOME::SALOME_Exception) throw (SALOME::SALOME_Exception)
{ {
Unexpect aCatch(SALOME_SalomeException); Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Object_var aShapeObj; GEOM::GEOM_Object_var aShapeObj;
@ -190,6 +190,24 @@ GEOM::GEOM_Object_ptr SMESH_Mesh_i::GetShapeToMesh()
return aShapeObj._retn(); return aShapeObj._retn();
} }
//================================================================================
/*!
* \brief Remove all nodes and elements
*/
//================================================================================
void SMESH_Mesh_i::Clear() throw (SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
try {
_impl->Clear();
}
catch(SALOME_Exception & S_ex) {
THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
}
TPythonDump() << _this() << ".Clear()";
}
//============================================================================= //=============================================================================
/*! /*!
* *

View File

@ -74,6 +74,9 @@ public:
GEOM::GEOM_Object_ptr GetShapeToMesh() GEOM::GEOM_Object_ptr GetShapeToMesh()
throw (SALOME::SALOME_Exception); throw (SALOME::SALOME_Exception);
void Clear()
throw (SALOME::SALOME_Exception);
SMESH::Hypothesis_Status AddHypothesis(GEOM::GEOM_Object_ptr aSubShapeObject, SMESH::Hypothesis_Status AddHypothesis(GEOM::GEOM_Object_ptr aSubShapeObject,
SMESH::SMESH_Hypothesis_ptr anHyp) SMESH::SMESH_Hypothesis_ptr anHyp)
throw (SALOME::SALOME_Exception); throw (SALOME::SALOME_Exception);

View File

@ -885,8 +885,18 @@ class Mesh:
pass pass
return ok return ok
## Removes all nodes and elements
# @ingroup l2_construct
def Clear(self):
self.mesh.Clear()
if salome.sg.hasDesktop():
smeshgui = salome.ImportComponentGUI("SMESH")
smeshgui.Init(salome.myStudyId)
smeshgui.SetMeshIcon( salome.ObjectToID( self.mesh ), False, True )
salome.sg.updateObjBrowser(1)
## Computes a tetrahedral mesh using AutomaticLength + MEFISTO + NETGEN ## Computes a tetrahedral mesh using AutomaticLength + MEFISTO + NETGEN
# The parameter \a fineness [0,-1] defines mesh fineness # @param fineness [0,-1] defines mesh fineness
# @return True or False # @return True or False
# @ingroup l3_algos_basic # @ingroup l3_algos_basic
def AutomaticTetrahedralization(self, fineness=0): def AutomaticTetrahedralization(self, fineness=0):
@ -903,7 +913,7 @@ class Mesh:
return self.Compute() return self.Compute()
## Computes an hexahedral mesh using AutomaticLength + Quadrangle + Hexahedron ## Computes an hexahedral mesh using AutomaticLength + Quadrangle + Hexahedron
# The parameter \a fineness [0,-1] defines mesh fineness # @param fineness [0,-1] defines mesh fineness
# @return True or False # @return True or False
# @ingroup l3_algos_basic # @ingroup l3_algos_basic
def AutomaticHexahedralization(self, fineness=0): def AutomaticHexahedralization(self, fineness=0):
@ -3193,129 +3203,100 @@ class Mesh_Triangle(Mesh_Algorithm):
print "Netgen 1D-2D algo doesn't support this hypothesis" print "Netgen 1D-2D algo doesn't support this hypothesis"
return None return None
## Sets a way to define size of mesh elements to generate ## Sets a way to define size of mesh elements to generate.
# @param thePhysicalMesh is: DefaultSize or Custom # @param thePhysicalMesh is: DefaultSize or Custom.
# Parameter of BLSURF algo
# @ingroup l3_hypos_blsurf # @ingroup l3_hypos_blsurf
def SetPhysicalMesh(self, thePhysicalMesh=DefaultSize): def SetPhysicalMesh(self, thePhysicalMesh=DefaultSize):
if self.params == 0: # Parameter of BLSURF algo
self.Parameters() self.Parameters().SetPhysicalMesh(thePhysicalMesh)
self.params.SetPhysicalMesh(thePhysicalMesh)
## Sets size of mesh elements to generate ## Sets size of mesh elements to generate.
# Parameter of BLSURF algo
# @ingroup l3_hypos_blsurf # @ingroup l3_hypos_blsurf
def SetPhySize(self, theVal): def SetPhySize(self, theVal):
if self.params == 0: # Parameter of BLSURF algo
self.Parameters() self.Parameters().SetPhySize(theVal)
self.params.SetPhySize(theVal)
## Sets lower boundary of mesh element size (PhySize) ## Sets lower boundary of mesh element size (PhySize).
# Parameter of BLSURF algo
# @ingroup l3_hypos_blsurf # @ingroup l3_hypos_blsurf
def SetPhyMin(self, theVal=-1): def SetPhyMin(self, theVal=-1):
if self.params == 0: # Parameter of BLSURF algo
self.Parameters() self.Parameters().SetPhyMin(theVal)
self.params.SetPhyMin(theVal)
## Sets upper boundary of mesh element size (PhySize) ## Sets upper boundary of mesh element size (PhySize).
# Parameter of BLSURF algo
# @ingroup l3_hypos_blsurf # @ingroup l3_hypos_blsurf
def SetPhyMax(self, theVal=-1): def SetPhyMax(self, theVal=-1):
if self.params == 0: # Parameter of BLSURF algo
self.Parameters() self.Parameters().SetPhyMax(theVal)
self.params.SetPhyMax(theVal)
## Sets a way to define maximum angular deflection of mesh from CAD model ## Sets a way to define maximum angular deflection of mesh from CAD model.
# @param theGeometricMesh is: DefaultGeom or Custom # @param theGeometricMesh is: DefaultGeom or Custom
# Parameter of BLSURF algo
# @ingroup l3_hypos_blsurf # @ingroup l3_hypos_blsurf
def SetGeometricMesh(self, theGeometricMesh=0): def SetGeometricMesh(self, theGeometricMesh=0):
if self.params == 0: # Parameter of BLSURF algo
self.Parameters() if self.Parameters().GetPhysicalMesh() == 0: theGeometricMesh = 1
if self.params.GetPhysicalMesh() == 0: theGeometricMesh = 1
self.params.SetGeometricMesh(theGeometricMesh) self.params.SetGeometricMesh(theGeometricMesh)
## Sets angular deflection (in degrees) of a mesh face from CAD surface ## Sets angular deflection (in degrees) of a mesh face from CAD surface.
# Parameter of BLSURF algo
# @ingroup l3_hypos_blsurf # @ingroup l3_hypos_blsurf
def SetAngleMeshS(self, theVal=_angleMeshS): def SetAngleMeshS(self, theVal=_angleMeshS):
if self.params == 0: # Parameter of BLSURF algo
self.Parameters() if self.Parameters().GetGeometricMesh() == 0: theVal = self._angleMeshS
if self.params.GetGeometricMesh() == 0: theVal = self._angleMeshS
self.params.SetAngleMeshS(theVal) self.params.SetAngleMeshS(theVal)
## Sets angular deflection (in degrees) of a mesh edge from CAD curve ## Sets angular deflection (in degrees) of a mesh edge from CAD curve.
# Parameter of BLSURF algo
# @ingroup l3_hypos_blsurf # @ingroup l3_hypos_blsurf
def SetAngleMeshC(self, theVal=_angleMeshS): def SetAngleMeshC(self, theVal=_angleMeshS):
if self.params == 0: # Parameter of BLSURF algo
self.Parameters() if self.Parameters().GetGeometricMesh() == 0: theVal = self._angleMeshS
if self.params.GetGeometricMesh() == 0: theVal = self._angleMeshS
self.params.SetAngleMeshC(theVal) self.params.SetAngleMeshC(theVal)
## Sets lower boundary of mesh element size computed to respect angular deflection ## Sets lower boundary of mesh element size computed to respect angular deflection.
# Parameter of BLSURF algo
# @ingroup l3_hypos_blsurf # @ingroup l3_hypos_blsurf
def SetGeoMin(self, theVal=-1): def SetGeoMin(self, theVal=-1):
if self.params == 0: # Parameter of BLSURF algo
self.Parameters() self.Parameters().SetGeoMin(theVal)
self.params.SetGeoMin(theVal)
## Sets upper boundary of mesh element size computed to respect angular deflection ## Sets upper boundary of mesh element size computed to respect angular deflection.
# Parameter of BLSURF algo
# @ingroup l3_hypos_blsurf # @ingroup l3_hypos_blsurf
def SetGeoMax(self, theVal=-1): def SetGeoMax(self, theVal=-1):
if self.params == 0: # Parameter of BLSURF algo
self.Parameters() self.Parameters().SetGeoMax(theVal)
self.params.SetGeoMax(theVal)
## Sets maximal allowed ratio between the lengths of two adjacent edges ## Sets maximal allowed ratio between the lengths of two adjacent edges.
# Parameter of BLSURF algo
# @ingroup l3_hypos_blsurf # @ingroup l3_hypos_blsurf
def SetGradation(self, theVal=_gradation): def SetGradation(self, theVal=_gradation):
if self.params == 0: # Parameter of BLSURF algo
self.Parameters() if self.Parameters().GetGeometricMesh() == 0: theVal = self._gradation
if self.params.GetGeometricMesh() == 0: theVal = self._gradation
self.params.SetGradation(theVal) self.params.SetGradation(theVal)
## Sets topology usage way defining how mesh conformity is assured: ## Sets topology usage way.
# FromCAD, PreProcess or PreProcessPlus # @param way defines how mesh conformity is assured <ul>
# FromCAD - mesh conformity is assured by conformity of a shape # <li>FromCAD - mesh conformity is assured by conformity of a shape</li>
# PreProcess or PreProcessPlus - by pre-processing a CAD model # <li>PreProcess or PreProcessPlus - by pre-processing a CAD model</li></ul>
# Parameter of BLSURF algo
# @ingroup l3_hypos_blsurf # @ingroup l3_hypos_blsurf
def SetTopology(self, way): def SetTopology(self, way):
if self.params == 0: # Parameter of BLSURF algo
self.Parameters() self.Parameters().SetTopology(way)
self.params.SetTopology(way)
## To respect geometrical edges or not ## To respect geometrical edges or not.
# Parameter of BLSURF algo
# @ingroup l3_hypos_blsurf # @ingroup l3_hypos_blsurf
def SetDecimesh(self, toIgnoreEdges=False): def SetDecimesh(self, toIgnoreEdges=False):
if self.params == 0: # Parameter of BLSURF algo
self.Parameters() self.Parameters().SetDecimesh(toIgnoreEdges)
self.params.SetDecimesh(toIgnoreEdges)
## Sets verbosity level in the range 0 to 100. ## Sets verbosity level in the range 0 to 100.
# Parameter of BLSURF algo
# @ingroup l3_hypos_blsurf # @ingroup l3_hypos_blsurf
def SetVerbosity(self, level): def SetVerbosity(self, level):
if self.params == 0: # Parameter of BLSURF algo
self.Parameters() self.Parameters().SetVerbosity(level)
self.params.SetVerbosity(level)
## Sets advanced option value ## Sets advanced option value.
# Parameter of BLSURF algo
# @ingroup l3_hypos_blsurf # @ingroup l3_hypos_blsurf
def SetOptionValue(self, optionName, value): def SetOptionValue(self, optionName, level):
if self.params == 0: # Parameter of BLSURF algo
self.Parameters() self.Parameters().SetOptionValue(optionName,level)
self.params.SetOptionValue(optionName,level)
## Sets QuadAllowed flag ## Sets QuadAllowed flag.
#
# Only for algoType == NETGEN || NETGEN_2D || BLSURF # Only for algoType == NETGEN || NETGEN_2D || BLSURF
# @ingroup l3_hypos_netgen l3_hypos_blsurf # @ingroup l3_hypos_netgen l3_hypos_blsurf
def SetQuadAllowed(self, toAllow=True): def SetQuadAllowed(self, toAllow=True):
@ -3330,17 +3311,15 @@ class Mesh_Triangle(Mesh_Algorithm):
pass pass
pass pass
return return
if self.params == 0: if self.Parameters():
self.Parameters()
if self.params:
self.params.SetQuadAllowed(toAllow) self.params.SetQuadAllowed(toAllow)
return return
## Defines "Netgen 2D Parameters" hypothesis ## Defines "Netgen 2D Parameters" hypothesis
# #
# Only for algoType == NETGEN
# @ingroup l3_hypos_netgen # @ingroup l3_hypos_netgen
def Parameters(self): def Parameters(self):
# Only for algoType == NETGEN
if self.params: if self.params:
return self.params return self.params
if self.algoType == NETGEN: if self.algoType == NETGEN:
@ -3365,9 +3344,7 @@ class Mesh_Triangle(Mesh_Algorithm):
# Only for algoType == NETGEN # Only for algoType == NETGEN
# @ingroup l3_hypos_netgen # @ingroup l3_hypos_netgen
def SetMaxSize(self, theSize): def SetMaxSize(self, theSize):
if self.params == 0: if self.Parameters():
self.Parameters()
if self.params is not None:
self.params.SetMaxSize(theSize) self.params.SetMaxSize(theSize)
## Sets SecondOrder flag ## Sets SecondOrder flag
@ -3375,9 +3352,7 @@ class Mesh_Triangle(Mesh_Algorithm):
# Only for algoType == NETGEN # Only for algoType == NETGEN
# @ingroup l3_hypos_netgen # @ingroup l3_hypos_netgen
def SetSecondOrder(self, theVal): def SetSecondOrder(self, theVal):
if self.params == 0: if self.Parameters():
self.Parameters()
if self.params is not None:
self.params.SetSecondOrder(theVal) self.params.SetSecondOrder(theVal)
## Sets Optimize flag ## Sets Optimize flag
@ -3385,9 +3360,7 @@ class Mesh_Triangle(Mesh_Algorithm):
# Only for algoType == NETGEN # Only for algoType == NETGEN
# @ingroup l3_hypos_netgen # @ingroup l3_hypos_netgen
def SetOptimize(self, theVal): def SetOptimize(self, theVal):
if self.params == 0: if self.Parameters():
self.Parameters()
if self.params is not None:
self.params.SetOptimize(theVal) self.params.SetOptimize(theVal)
## Sets Fineness ## Sets Fineness
@ -3397,9 +3370,7 @@ class Mesh_Triangle(Mesh_Algorithm):
# Only for algoType == NETGEN # Only for algoType == NETGEN
# @ingroup l3_hypos_netgen # @ingroup l3_hypos_netgen
def SetFineness(self, theFineness): def SetFineness(self, theFineness):
if self.params == 0: if self.Parameters():
self.Parameters()
if self.params is not None:
self.params.SetFineness(theFineness) self.params.SetFineness(theFineness)
## Sets GrowthRate ## Sets GrowthRate
@ -3407,9 +3378,7 @@ class Mesh_Triangle(Mesh_Algorithm):
# Only for algoType == NETGEN # Only for algoType == NETGEN
# @ingroup l3_hypos_netgen # @ingroup l3_hypos_netgen
def SetGrowthRate(self, theRate): def SetGrowthRate(self, theRate):
if self.params == 0: if self.Parameters():
self.Parameters()
if self.params is not None:
self.params.SetGrowthRate(theRate) self.params.SetGrowthRate(theRate)
## Sets NbSegPerEdge ## Sets NbSegPerEdge
@ -3417,9 +3386,7 @@ class Mesh_Triangle(Mesh_Algorithm):
# Only for algoType == NETGEN # Only for algoType == NETGEN
# @ingroup l3_hypos_netgen # @ingroup l3_hypos_netgen
def SetNbSegPerEdge(self, theVal): def SetNbSegPerEdge(self, theVal):
if self.params == 0: if self.Parameters():
self.Parameters()
if self.params is not None:
self.params.SetNbSegPerEdge(theVal) self.params.SetNbSegPerEdge(theVal)
## Sets NbSegPerRadius ## Sets NbSegPerRadius
@ -3427,9 +3394,7 @@ class Mesh_Triangle(Mesh_Algorithm):
# Only for algoType == NETGEN # Only for algoType == NETGEN
# @ingroup l3_hypos_netgen # @ingroup l3_hypos_netgen
def SetNbSegPerRadius(self, theVal): def SetNbSegPerRadius(self, theVal):
if self.params == 0: if self.Parameters():
self.Parameters()
if self.params is not None:
self.params.SetNbSegPerRadius(theVal) self.params.SetNbSegPerRadius(theVal)
pass pass
@ -3508,6 +3473,8 @@ class Mesh_Tetrahedron(Mesh_Algorithm):
## Defines "Netgen 3D Parameters" hypothesis ## Defines "Netgen 3D Parameters" hypothesis
# @ingroup l3_hypos_netgen # @ingroup l3_hypos_netgen
def Parameters(self): def Parameters(self):
if self.params:
return self.params
if (self.algoType == FULL_NETGEN): if (self.algoType == FULL_NETGEN):
self.params = self.Hypothesis("NETGEN_Parameters", [], self.params = self.Hypothesis("NETGEN_Parameters", [],
"libNETGENEngine.so", UseExisting=0) "libNETGENEngine.so", UseExisting=0)
@ -3524,25 +3491,19 @@ class Mesh_Tetrahedron(Mesh_Algorithm):
# Parameter of FULL_NETGEN # Parameter of FULL_NETGEN
# @ingroup l3_hypos_netgen # @ingroup l3_hypos_netgen
def SetMaxSize(self, theSize): def SetMaxSize(self, theSize):
if self.params == 0: self.Parameters().SetMaxSize(theSize)
self.Parameters()
self.params.SetMaxSize(theSize)
## Sets SecondOrder flag ## Sets SecondOrder flag
# Parameter of FULL_NETGEN # Parameter of FULL_NETGEN
# @ingroup l3_hypos_netgen # @ingroup l3_hypos_netgen
def SetSecondOrder(self, theVal): def SetSecondOrder(self, theVal):
if self.params == 0: self.Parameters().SetSecondOrder(theVal)
self.Parameters()
self.params.SetSecondOrder(theVal)
## Sets Optimize flag ## Sets Optimize flag
# Parameter of FULL_NETGEN # Parameter of FULL_NETGEN
# @ingroup l3_hypos_netgen # @ingroup l3_hypos_netgen
def SetOptimize(self, theVal): def SetOptimize(self, theVal):
if self.params == 0: self.Parameters().SetOptimize(theVal)
self.Parameters()
self.params.SetOptimize(theVal)
## Sets Fineness ## Sets Fineness
# @param theFineness is: # @param theFineness is:
@ -3550,114 +3511,96 @@ class Mesh_Tetrahedron(Mesh_Algorithm):
# Parameter of FULL_NETGEN # Parameter of FULL_NETGEN
# @ingroup l3_hypos_netgen # @ingroup l3_hypos_netgen
def SetFineness(self, theFineness): def SetFineness(self, theFineness):
if self.params == 0: self.Parameters().SetFineness(theFineness)
self.Parameters()
self.params.SetFineness(theFineness)
## Sets GrowthRate ## Sets GrowthRate
# Parameter of FULL_NETGEN # Parameter of FULL_NETGEN
# @ingroup l3_hypos_netgen # @ingroup l3_hypos_netgen
def SetGrowthRate(self, theRate): def SetGrowthRate(self, theRate):
if self.params == 0: self.Parameters().SetGrowthRate(theRate)
self.Parameters()
self.params.SetGrowthRate(theRate)
## Sets NbSegPerEdge ## Sets NbSegPerEdge
# Parameter of FULL_NETGEN # Parameter of FULL_NETGEN
# @ingroup l3_hypos_netgen # @ingroup l3_hypos_netgen
def SetNbSegPerEdge(self, theVal): def SetNbSegPerEdge(self, theVal):
if self.params == 0: self.Parameters().SetNbSegPerEdge(theVal)
self.Parameters()
self.params.SetNbSegPerEdge(theVal)
## Sets NbSegPerRadius ## Sets NbSegPerRadius
# Parameter of FULL_NETGEN # Parameter of FULL_NETGEN
# @ingroup l3_hypos_netgen # @ingroup l3_hypos_netgen
def SetNbSegPerRadius(self, theVal): def SetNbSegPerRadius(self, theVal):
if self.params == 0: self.Parameters().SetNbSegPerRadius(theVal)
self.Parameters()
self.params.SetNbSegPerRadius(theVal)
## To mesh "holes" in a solid or not. Default is to mesh. ## To mesh "holes" in a solid or not. Default is to mesh.
# Parameter of GHS3D
# @ingroup l3_hypos_ghs3dh # @ingroup l3_hypos_ghs3dh
def SetToMeshHoles(self, toMesh): def SetToMeshHoles(self, toMesh):
if self.params == 0: self.Parameters() # Parameter of GHS3D
self.params.SetToMeshHoles(toMesh) self.Parameters().SetToMeshHoles(toMesh)
## Set Optimization level: ## Set Optimization level:
# None_Optimization, Light_Optimization, Medium_Optimization, Strong_Optimization. # None_Optimization, Light_Optimization, Medium_Optimization, Strong_Optimization.
# Default is Medium_Optimization # Default is Medium_Optimization
# Parameter of GHS3D
# @ingroup l3_hypos_ghs3dh # @ingroup l3_hypos_ghs3dh
def SetOptimizationLevel(self, level): def SetOptimizationLevel(self, level):
if self.params == 0: self.Parameters() # Parameter of GHS3D
self.params.SetOptimizationLevel(level) self.Parameters().SetOptimizationLevel(level)
## Maximal size of memory to be used by the algorithm (in Megabytes). ## Maximal size of memory to be used by the algorithm (in Megabytes).
# Advanced parameter of GHS3D
# @ingroup l3_hypos_ghs3dh # @ingroup l3_hypos_ghs3dh
def SetMaximumMemory(self, MB): def SetMaximumMemory(self, MB):
if self.params == 0: self.Parameters() # Advanced parameter of GHS3D
self.params.SetMaximumMemory(MB) self.Parameters().SetMaximumMemory(MB)
## Initial size of memory to be used by the algorithm (in Megabytes) in ## Initial size of memory to be used by the algorithm (in Megabytes) in
# automatic memory adjustment mode # automatic memory adjustment mode.
# Advanced parameter of GHS3D
# @ingroup l3_hypos_ghs3dh # @ingroup l3_hypos_ghs3dh
def SetInitialMemory(self, MB): def SetInitialMemory(self, MB):
if self.params == 0: self.Parameters() # Advanced parameter of GHS3D
self.params.SetInitialMemory(MB) self.Parameters().SetInitialMemory(MB)
## Path to working directory ## Path to working directory.
# Advanced parameter of GHS3D
# @ingroup l3_hypos_ghs3dh # @ingroup l3_hypos_ghs3dh
def SetWorkingDirectory(self, path): def SetWorkingDirectory(self, path):
if self.params == 0: self.Parameters() # Advanced parameter of GHS3D
self.params.SetWorkingDirectory(path) self.Parameters().SetWorkingDirectory(path)
## To keep working files or remove them. Log file remains in case of errors anyway ## To keep working files or remove them. Log file remains in case of errors anyway.
# Advanced parameter of GHS3D
# @ingroup l3_hypos_ghs3dh # @ingroup l3_hypos_ghs3dh
def SetKeepFiles(self, toKeep): def SetKeepFiles(self, toKeep):
if self.params == 0: self.Parameters() # Advanced parameter of GHS3D
self.params.SetKeepFiles(toKeep) self.Parameters().SetKeepFiles(toKeep)
## To set verbose level [0-10] ## To set verbose level [0-10]. <ul>
# 0 - no standard output, #<li> 0 - no standard output,
# 2 - prints the data, quality statistics of the skin and final meshes and #<li> 2 - prints the data, quality statistics of the skin and final meshes and
# indicates when the final mesh is being saved. In addition the software # indicates when the final mesh is being saved. In addition the software
# gives indication regarding the CPU time. # gives indication regarding the CPU time.
# 10 - same as 2 plus the main steps in the computation, quality statistics #<li>10 - same as 2 plus the main steps in the computation, quality statistics
# histogram of the skin mesh, quality statistics histogram together with # histogram of the skin mesh, quality statistics histogram together with
# the characteristics of the final mesh. # the characteristics of the final mesh.</ul>
# Advanced parameter of GHS3D
# @ingroup l3_hypos_ghs3dh # @ingroup l3_hypos_ghs3dh
def SetVerboseLevel(self, level): def SetVerboseLevel(self, level):
if self.params == 0: self.Parameters() # Advanced parameter of GHS3D
self.params.SetVerboseLevel(level) self.Parameters().SetVerboseLevel(level)
## To create new nodes ## To create new nodes.
# Advanced parameter of GHS3D
# @ingroup l3_hypos_ghs3dh # @ingroup l3_hypos_ghs3dh
def SetToCreateNewNodes(self, toCreate): def SetToCreateNewNodes(self, toCreate):
if self.params == 0: self.Parameters() # Advanced parameter of GHS3D
self.params.SetToCreateNewNodes(toCreate) self.Parameters().SetToCreateNewNodes(toCreate)
## To use boundary recovery version which tries to create mesh on a very poor ## To use boundary recovery version which tries to create mesh on a very poor
# quality surface mesh # quality surface mesh.
# Advanced parameter of GHS3D
# @ingroup l3_hypos_ghs3dh # @ingroup l3_hypos_ghs3dh
def SetToUseBoundaryRecoveryVersion(self, toUse): def SetToUseBoundaryRecoveryVersion(self, toUse):
if self.params == 0: self.Parameters() # Advanced parameter of GHS3D
self.params.SetToUseBoundaryRecoveryVersion(toUse) self.Parameters().SetToUseBoundaryRecoveryVersion(toUse)
## To set hidden/undocumented/advanced options ## Sets command line option as text.
# Advanced parameter of GHS3D
# @ingroup l3_hypos_ghs3dh # @ingroup l3_hypos_ghs3dh
def SetTextOption(self, option): def SetTextOption(self, option):
if self.params == 0: self.Parameters() # Advanced parameter of GHS3D
self.params.SetTextOption(option) self.Parameters().SetTextOption(option)
# Public class: Mesh_Hexahedron # Public class: Mesh_Hexahedron
# ------------------------------ # ------------------------------