algo_local.Arithmetic1D(1, 4)
# define "Propagation" hypothesis that propagates algo_local and "Arithmetic1D" hypothesis
-# on all parallel edges of the box
+# from EdgeX to all parallel edges
algo_local.Propagation()
# assign a hexahedral algorithm
mesh.Hexahedron()
-# compute the mesh
+
+# any sub-shape can be meshed individually --
+# compute mesh on two surfaces using different methods
+
+# get surfaces
+surfaces = geompy.SubShapeAll(box, geompy.ShapeType["FACE"])
+
+# method 1: no sub-mesh is created
+mesh.Compute( surfaces[0] )
+
+# method 2: a sub-mesh is created
+submesh = mesh.GetSubMesh( surfaces[2], "submesh 2" )
+submesh.Compute()
+
+
+
+# compute the whole mesh
mesh.Compute()
certain sub-shape, thus to get a locally coarser or finer mesh, to get
elements of different types in the same mesh, etc.
+A sub-mesh can be meshed individually. To achieve this, select a
+sub-mesh and either invoke <b>Compute Sub-mesh</b> vai the contextual
+menu in the Object Browser or invoke <b> Mesh > Compute </b> menu.
+
\section submesh_shape_section How to get a sub-shape for sub-mesh construction
A sub-shape to create a sub-mesh on should be retrieved from the main shape
case SMESHOp::OpCreateMesh:
case SMESHOp::OpCreateSubMesh:
case SMESHOp::OpEditMeshOrSubMesh:
+ case SMESHOp::OpEditMesh:
+ case SMESHOp::OpEditSubMesh:
case SMESHOp::OpCompute:
+ case SMESHOp::OpComputeSubMesh:
case SMESHOp::OpPreCompute:
case SMESHOp::OpEvaluate:
case SMESHOp::OpMeshOrder:
createSMESHAction( SMESHOp::OpCreateMesh, "CREATE_MESH", "ICON_DLG_INIT_MESH" );
createSMESHAction( SMESHOp::OpCreateSubMesh, "CREATE_SUBMESH", "ICON_DLG_ADD_SUBMESH" );
createSMESHAction( SMESHOp::OpEditMeshOrSubMesh, "EDIT_MESHSUBMESH", "ICON_DLG_EDIT_MESH" );
+ createSMESHAction( SMESHOp::OpEditMesh, "EDIT_MESH", "ICON_DLG_EDIT_MESH" );
+ createSMESHAction( SMESHOp::OpEditSubMesh, "EDIT_SUBMESH", "ICON_DLG_EDIT_MESH" );
createSMESHAction( SMESHOp::OpBuildCompoundMesh, "BUILD_COMPOUND", "ICON_BUILD_COMPOUND" );
createSMESHAction( SMESHOp::OpCopyMesh, "COPY_MESH", "ICON_COPY_MESH" );
createSMESHAction( SMESHOp::OpCompute, "COMPUTE", "ICON_COMPUTE" );
+ createSMESHAction( SMESHOp::OpComputeSubMesh, "COMPUTE_SUBMESH", "ICON_COMPUTE" );
createSMESHAction( SMESHOp::OpPreCompute, "PRECOMPUTE", "ICON_PRECOMPUTE" );
createSMESHAction( SMESHOp::OpEvaluate, "EVALUATE", "ICON_EVALUATE" );
createSMESHAction( SMESHOp::OpMeshOrder, "MESH_ORDER", "ICON_MESH_ORDER");
QString dc = "selcount"; // VSR : instead of QtxPopupSelection::defSelCountParam()
myRules.clear();
- QString OB = "'ObjectBrowser'",
- View = "'" + SVTK_Viewer::Type() + "'",
- pat = "'%1'",
- mesh = pat.arg( SMESHGUI_Selection::typeName( SMESH::MESH ) ),
- group = pat.arg( SMESHGUI_Selection::typeName( SMESH::GROUP ) ),
- hypo = pat.arg( SMESHGUI_Selection::typeName( SMESH::HYPOTHESIS ) ),
- algo = pat.arg( SMESHGUI_Selection::typeName( SMESH::ALGORITHM ) ),
- elems = QString( "'%1' '%2' '%3' '%4' '%5' '%6'" ).
- arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH_VERTEX ) ).
- arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH_EDGE ) ).
- arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH_FACE ) ).
- arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH_SOLID ) ).
- arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH_COMPOUND ) ).
- arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH ) ),
- subMesh = elems,
- mesh_part = mesh + " " + subMesh + " " + group,
- mesh_group = mesh + " " + group,
- hyp_alg = hypo + " " + algo;
+ QString
+ OB = "'ObjectBrowser'",
+ View = "'" + SVTK_Viewer::Type() + "'",
+ pat = "'%1'",
+ mesh = pat.arg( SMESHGUI_Selection::typeName( SMESH::MESH ) ),
+ group = pat.arg( SMESHGUI_Selection::typeName( SMESH::GROUP ) ),
+ hypo = pat.arg( SMESHGUI_Selection::typeName( SMESH::HYPOTHESIS ) ),
+ algo = pat.arg( SMESHGUI_Selection::typeName( SMESH::ALGORITHM ) ),
+ elems = QString( "'%1' '%2' '%3' '%4' '%5' '%6'" ).
+ arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH_VERTEX ) ).
+ arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH_EDGE ) ).
+ arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH_FACE ) ).
+ arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH_SOLID ) ).
+ arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH_COMPOUND ) ).
+ arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH ) ),
+ subMesh = elems,
+ mesh_part = mesh + " " + subMesh + " " + group,
+ mesh_group = mesh + " " + group,
+ mesh_submesh = mesh + " " + subMesh,
+ hyp_alg = hypo + " " + algo;
// popup for object browser
QString
hasVolumes("({'Volume'} in elemTypes)"),
hasFacesOrVolumes("(({'Face'} in elemTypes) || ({'Volume'} in elemTypes)) ");
- createPopupItem( SMESHOp::OpFileInformation, OB, mesh, "&& selcount=1 && isImported" );
- createPopupItem( SMESHOp::OpCreateSubMesh, OB, mesh, "&& hasGeomReference");
- createPopupItem( SMESHOp::OpEditMeshOrSubMesh, OB, mesh );
- createPopupItem( SMESHOp::OpEditMeshOrSubMesh, OB, subMesh, "&& hasGeomReference" );
- createPopupItem( SMESHOp::OpEditGroup, OB, group );
+ createPopupItem( SMESHOp::OpFileInformation, OB, mesh, "&& selcount=1 && isImported" );
+ createPopupItem( SMESHOp::OpCreateSubMesh, OB, mesh, "&& hasGeomReference");
+ createPopupItem( SMESHOp::OpEditMesh, OB, mesh, "&& selcount=1" );
+ createPopupItem( SMESHOp::OpEditSubMesh, OB, subMesh, "&& selcount=1 && hasGeomReference" );
+ createPopupItem( SMESHOp::OpEditGroup, OB, group );
createPopupItem( SMESHOp::OpEditGeomGroupAsGroup, OB, group, "&& groupType != 'Group'" );
popupMgr()->insert( separator(), -1, 0 );
- createPopupItem( SMESHOp::OpCompute, OB, mesh, "&& isComputable" );
- createPopupItem( SMESHOp::OpPreCompute, OB, mesh, "&& isPreComputable" );
- createPopupItem( SMESHOp::OpEvaluate, OB, mesh, "&& isComputable" );
- createPopupItem( SMESHOp::OpMeshOrder, OB, mesh, "&& isComputable && hasGeomReference" );
- createPopupItem( SMESHOp::OpUpdate, OB, mesh_part );
- createPopupItem( SMESHOp::OpMeshInformation, OB, mesh_part );
- createPopupItem( SMESHOp::OpFindElementByPoint, OB, mesh_group );
- createPopupItem( SMESHOp::OpOverallMeshQuality, OB, mesh_part );
+ createPopupItem( SMESHOp::OpCompute, OB, mesh, "&& selcount=1 && isComputable" );
+ createPopupItem( SMESHOp::OpComputeSubMesh, OB, subMesh, "&& selcount=1 && isComputable" );
+ createPopupItem( SMESHOp::OpPreCompute, OB, mesh, "&& selcount=1 && isPreComputable" );
+ createPopupItem( SMESHOp::OpEvaluate, OB, mesh, "&& selcount=1 && isComputable" );
+ createPopupItem( SMESHOp::OpMeshOrder, OB, mesh, "&& selcount=1 && isComputable && hasGeomReference" );
+ createPopupItem( SMESHOp::OpUpdate, OB, mesh_part );
+ createPopupItem( SMESHOp::OpMeshInformation, OB, mesh_part );
+ createPopupItem( SMESHOp::OpFindElementByPoint,OB, mesh_group, "&& selcount=1" );
+ createPopupItem( SMESHOp::OpOverallMeshQuality,OB, mesh_part );
popupMgr()->insert( separator(), -1, 0 );
- createPopupItem( SMESHOp::OpCreateGroup, OB, mesh );
- createPopupItem( SMESHOp::OpCreateGeometryGroup, OB, mesh, "&& hasGeomReference" );
- createPopupItem( SMESHOp::OpConstructGroup, OB, subMesh );
+ createPopupItem( SMESHOp::OpCreateGroup, OB, mesh, "&& selcount=1" );
+ createPopupItem( SMESHOp::OpCreateGeometryGroup, OB, mesh, "&& selcount=1 && hasGeomReference" );
+ createPopupItem( SMESHOp::OpConstructGroup, OB, subMesh );
popupMgr()->insert( separator(), -1, 0 );
- createPopupItem( SMESHOp::OpEditHypothesis, OB, hypo, "&& isEditableHyp");
- createPopupItem( SMESHOp::OpUnassign, OB, hyp_alg ); // REMOVE HYPOTHESIS / ALGORITHMS
+ createPopupItem( SMESHOp::OpEditHypothesis, OB, hypo, "&& isEditableHyp");
+ createPopupItem( SMESHOp::OpUnassign, OB, hyp_alg );
popupMgr()->insert( separator(), -1, 0 );
- createPopupItem( SMESHOp::OpConvertMeshToQuadratic, OB, mesh + " " + subMesh ); // convert to quadratic
- createPopupItem( SMESHOp::OpCreateBoundaryElements, OB, mesh + " " + group, // create 2D mesh from 3D
- "&& dim>=2");
+ createPopupItem( SMESHOp::OpConvertMeshToQuadratic, OB, mesh_submesh );
+ createPopupItem( SMESHOp::OpCreateBoundaryElements, OB, mesh_group, "&& selcount=1 && dim>=2");
popupMgr()->insert( separator(), -1, 0 );
createPopupItem( SMESHOp::OpClearMesh, OB, mesh );
- popupMgr()->insert( separator(), -1, 0 );
+ //popupMgr()->insert( separator(), -1, 0 );
QString only_one_non_empty = QString( " && %1=1 && numberOfNodes>0" ).arg( dc );
QString multiple_non_empty = QString( " && %1>0 && numberOfNodes>0" ).arg( dc );
op = new SMESHGUI_MeshOp( true, false );
break;
case SMESHOp::OpEditMeshOrSubMesh:
+ case SMESHOp::OpEditMesh:
+ case SMESHOp::OpEditSubMesh:
op = new SMESHGUI_MeshOp( false );
break;
case SMESHOp::OpCompute:
+ case SMESHOp::OpComputeSubMesh:
op = new SMESHGUI_ComputeOp();
break;
case SMESHOp::OpPreCompute:
if (ac->IsA("SMESH_Actor")) {
SMESH_Actor* aGeomAc = SMESH_Actor::SafeDownCast(ac);
if (aGeomAc->hasIO()) {
- Handle(SALOME_InteractiveObject) io =
- Handle(SALOME_InteractiveObject)::DownCast(aGeomAc->getIO());
+ Handle(SALOME_InteractiveObject) io = aGeomAc->getIO();
if (io->hasEntry() && strcmp(io->getEntry(), entry.toLatin1().data()) == 0) {
isFound = true;
vtkActors.Bind(viewIndex, aGeomAc);
myMesh = SMESH::SMESH_Mesh::_nil();
myMainShape = GEOM::GEOM_Object::_nil();
+ myCurShape = GEOM::GEOM_Object::_nil();
// check selection
LightApp_SelectionMgr *Sel = selectionMgr();
}
myIObject = selected.First();
- myMesh = SMESH::GetMeshByIO(myIObject);
+ CORBA::Object_var anObj = SMESH::IObjectToObject( myIObject );
+
+ myMesh = SMESH::SMESH_Mesh::_narrow(anObj);
+ if ( myMesh->_is_nil() )
+ {
+ SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow(anObj);
+ if ( !aSubMesh->_is_nil() )
+ {
+ myMesh = aSubMesh->GetFather();
+ myCurShape = aSubMesh->GetSubShape();
+ }
+ }
+ else
+ {
+ myCurShape = myMesh->GetShapeToMesh();
+ }
+
if (myMesh->_is_nil()) {
SUIT_MessageBox::warning(desktop(),
tr("SMESH_WRN_WARNING"),
onCancel();
return;
}
+
myMainShape = myMesh->GetShapeToMesh();
SMESHGUI_Operation::startOperation();
myMesh->Clear();
SUIT_OverrideCursor aWaitCursor;
try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
-#endif
- SMESHGUI_ComputeDlg_QThreadQDialog qthreaddialog(desktop(), gen, myMesh, myMainShape);
+ SMESHGUI_ComputeDlg_QThreadQDialog qthreaddialog(desktop(), gen, myMesh, myCurShape);
qthreaddialog.exec();
computeFailed = !qthreaddialog.result();
}
memoryLack = true;
}
try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
-#endif
aCompErrors = gen->GetComputeErrors( myMesh, myMainShape );
// check if there are memory problems
for ( CORBA::ULong i = 0; (i < aCompErrors->length()) && !memoryLack; ++i )
// NPAL16631: if ( !memoryLack )
{
- SMESH::ModifiedMesh( aMeshSObj,
+ _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID(myIObject->getEntry());
+ SMESH::ModifiedMesh( sobj,
!computeFailed && aHypErrors.isEmpty(),
myMesh->NbNodes() == 0);
update( UF_ObjBrowser | UF_Model );
void SMESHGUI_BaseComputeOp::onPublishShape()
{
- GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
- SALOMEDS::Study_var study = SMESHGUI::GetSMESHGen()->GetCurrentStudy();
+ GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
+ SALOMEDS::Study_var study = SMESHGUI::GetSMESHGen()->GetCurrentStudy();
+ GEOM::GEOM_Object_var meshShape = myMesh->GetShapeToMesh();
QStringList entryList;
QList<int> rows;
*/
//================================================================================
-void SMESHGUI_PrecomputeOp::getAssignedAlgos(_PTR(SObject) theMesh,
+void SMESHGUI_PrecomputeOp::getAssignedAlgos(_PTR(SObject) theMesh,
QMap<int,int>& theModeMap)
{
if ( !theMesh ) return;
+
_PTR(SObject) aHypFolder;
_PTR(GenericAttribute) anAttr;
int aPart = SMESH::Tag_RefOnAppliedAlgorithms;
- if ( theMesh->FindSubObject( aPart, aHypFolder ) )
+ if ( theMesh->FindSubObject( aPart, aHypFolder ))
{
_PTR(ChildIterator) anIter =
SMESH::GetActiveStudyDocument()->NewChildIterator( aHypFolder );
protected:
SMESH::SMESH_Mesh_var myMesh;
GEOM::GEOM_Object_var myMainShape;
+ GEOM::GEOM_Object_var myCurShape;
SMESH::TShapeDisplayer* myTShapeDisplayer;
SMESHGUI_MeshEditPreview* myBadMeshDisplayer;
Handle(SALOME_InteractiveObject) myIObject;
objectWg( Mesh, Btn )->hide();
objectWg( Geom, Btn )->hide();
}
+ setTitile( theToCreate, theIsMesh );
}
SMESHGUI_MeshDlg::~SMESHGUI_MeshDlg()
{
}
+//================================================================================
+/*!
+ * \brief Set dialog title
+ */
+//================================================================================
+
+void SMESHGUI_MeshDlg::setTitile( const bool theToCreate, const bool theIsMesh )
+{
+ if ( theToCreate )
+ {
+ setWindowTitle( tr( theIsMesh ? "CREATE_MESH" : "CREATE_SUBMESH" ));
+ }
+ else
+ {
+ setWindowTitle( tr( theIsMesh ? "EDIT_MESH" : "EDIT_SUBMESH") );
+ }
+
+}
+
//================================================================================
/*!
* \brief Gets tab with given id
void setAvailableMeshType(const QStringList& );
int currentMeshType();
void setCurrentMeshType( const int );
+ void setTitile( const bool, const bool );
signals:
void hypoSet( const QString& );
{
SMESH::SMESH_subMesh_var submeshVar =
SMESH::SMESH_subMesh::_narrow( _CAST( SObject,pObj )->GetObject() );
+ myIsMesh = submeshVar->_is_nil();
+ myDlg->setTitile( myToCreate, myIsMesh );
myDlg->setObjectShown( SMESHGUI_MeshDlg::Mesh, !submeshVar->_is_nil() );
myDlg->setObjectShown( SMESHGUI_MeshDlg::Geom, true );
myDlg->objectWg( SMESHGUI_MeshDlg::Mesh, SMESHGUI_MeshDlg::Btn )->hide();
myDlg->objectWg( SMESHGUI_MeshDlg::Geom, SMESHGUI_MeshDlg::Btn )->hide();
myDlg->updateGeometry();
myDlg->adjustSize();
- myIsMesh = submeshVar->_is_nil();
readMesh();
}
else
OpCreateMesh = 2030, // MENU MESH - CREATE MESH
OpCreateSubMesh = 2031, // MENU MESH - CREATE SUBMESH
OpEditMeshOrSubMesh = 2032, // MENU MESH - EDIT MESH/SUBMESH
- OpBuildCompoundMesh = 2033, // MENU MESH - BUILD COMPOUND
- OpCopyMesh = 2034, // MENU MESH - COPY MESH
+ OpEditMesh = 2033, // POPUP - EDIT MESH
+ OpEditSubMesh = 2034, // POPUP - EDIT SUBMESH
+ OpBuildCompoundMesh = 2035, // MENU MESH - BUILD COMPOUND
+ OpCopyMesh = 2036, // MENU MESH - COPY MESH
OpCompute = 2040, // MENU MESH - COMPUTE
- OpPreCompute = 2041, // MENU MESH - PREVIEW
- OpEvaluate = 2042, // MENU MESH - EVALUATE
- OpMeshOrder = 2043, // MENU MESH - CHANGE SUBMESH PRIORITY
+ OpComputeSubMesh = 2041, // POPUP - COMPUTE SUBMESH
+ OpPreCompute = 2042, // MENU MESH - PREVIEW
+ OpEvaluate = 2043, // MENU MESH - EVALUATE
+ OpMeshOrder = 2044, // MENU MESH - CHANGE SUBMESH PRIORITY
OpCreateGroup = 2050, // MENU MESH - CREATE GROUP
OpCreateGeometryGroup = 2051, // MENU MESH - CREATE GROUPS FROM GEOMETRY
OpConstructGroup = 2052, // MENU MESH - CONSTRUCT GROUP
bool SMESHGUI_Selection::isComputable( int ind ) const
{
- if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] == "Mesh" )
+ if ( ind >= 0 && ind < myTypes.count() && ( myTypes[ind] == "Mesh" ||
+ myTypes[ind].startsWith("Mesh " )))
{
QMap<int,int> modeMap;
- _PTR(SObject) so = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
- SMESHGUI_PrecomputeOp::getAssignedAlgos( so, modeMap );
+ _PTR(SObject) meshSO = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
+
+ _PTR(SComponent) component = meshSO->GetFatherComponent();
+ if ( meshSO->Depth() - component->Depth() > 1 ) // sub-mesh, get a mesh
+ while ( meshSO->Depth() - component->Depth() > 1 )
+ meshSO = meshSO->GetFather();
+
+ SMESHGUI_PrecomputeOp::getAssignedAlgos( meshSO, modeMap );
return modeMap.size() > 0;
}
return false;
<source>MEN_COMPUTE</source>
<translation>Compute</translation>
</message>
+ <message>
+ <source>MEN_COMPUTE_SUBMESH</source>
+ <translation>Compute Sub-mesh</translation>
+ </message>
<message>
<source>MEN_PRECOMPUTE</source>
<translation>Preview</translation>
<source>MEN_EDIT_MESHSUBMESH</source>
<translation>Edit Mesh/Sub-mesh</translation>
</message>
+ <message>
+ <source>MEN_EDIT_MESH</source>
+ <translation>Edit Mesh</translation>
+ </message>
+ <message>
+ <source>MEN_EDIT_SUBMESH</source>
+ <translation>Edit Sub-mesh</translation>
+ </message>
<message>
<source>MEN_EXPORT</source>
<translation>Export</translation>
<source>STB_COMPUTE</source>
<translation>Compute</translation>
</message>
+ <message>
+ <source>STB_COMPUTE_SUBMESH</source>
+ <translation>Compute Sub-mesh</translation>
+ </message>
<message>
<source>STB_PRECOMPUTE</source>
<translation>Preview</translation>
<source>STB_EDIT_MESHSUBMESH</source>
<translation>Edit Mesh/Sub-mesh</translation>
</message>
+ <message>
+ <source>STB_EDIT_MESH</source>
+ <translation>Edit Mesh</translation>
+ </message>
+ <message>
+ <source>STB_EDIT_SUBMESH</source>
+ <translation>Edit Sub-mesh</translation>
+ </message>
<message>
<source>STB_EXPORT_DAT</source>
<translation>Export to DAT file</translation>
<source>TOP_COMPUTE</source>
<translation>Compute</translation>
</message>
+ <message>
+ <source>TOP_COMPUTE_SUBMESH</source>
+ <translation>Compute Sub-mesh</translation>
+ </message>
<message>
<source>TOP_PRECOMPUTE</source>
<translation>Preview</translation>
<source>TOP_EDIT_MESHSUBMESH</source>
<translation>Edit Mesh/Sub-mesh</translation>
</message>
+ <message>
+ <source>TOP_EDIT_MESH</source>
+ <translation>Edit Mesh</translation>
+ </message>
+ <message>
+ <source>TOP_EDIT_SUBMESH</source>
+ <translation>Edit Sub-mesh</translation>
+ </message>
<message>
<source>TOP_EXPORT_DAT</source>
<translation>Export to DAT file</translation>
<translation>3D</translation>
</message>
<message>
- <source>EDIT_MESH_SUBMESH</source>
- <translation>Edit mesh/sub-mesh</translation>
+ <source>EDIT_MESH</source>
+ <translation>Edit mesh</translation>
+ </message>
+ <message>
+ <source>EDIT_SUBMESH</source>
+ <translation>Edit sub-mesh</translation>
</message>
<message>
<source>GEOMETRY</source>
myLocShape = SMESH_Mesh::PseudoShape();
// call implementation compute
::SMESH_Mesh& myLocMesh = meshServant->GetImpl();
- myGen.PrepareCompute( myLocMesh, myLocShape);
- bool ok = myGen.Compute( myLocMesh, myLocShape);
+ myGen.PrepareCompute( myLocMesh, myLocShape );
+ bool ok = myGen.Compute( myLocMesh, myLocShape, myLocShape != myLocMesh.GetShapeToMesh());
meshServant->CreateGroupServants(); // algos can create groups (issue 0020918)
myLocMesh.GetMeshDS()->Modified();
return ok;
print allReasons
pass
if salome.sg.hasDesktop() and self.mesh.GetStudyId() >= 0:
- smeshgui = salome.ImportComponentGUI("SMESH")
- smeshgui.Init(self.mesh.GetStudyId())
- smeshgui.SetMeshIcon( salome.ObjectToID( self.mesh ), ok, (self.NbNodes()==0) )
- if refresh: salome.sg.updateObjBrowser(1)
- pass
+ if not isinstance( refresh, list): # not a call from subMesh.Compute()
+ smeshgui = salome.ImportComponentGUI("SMESH")
+ smeshgui.Init(self.mesh.GetStudyId())
+ smeshgui.SetMeshIcon( salome.ObjectToID( self.mesh ), ok, (self.NbNodes()==0) )
+ if refresh: salome.sg.updateObjBrowser(1)
+
return ok
## Return a list of error messages (SMESH.ComputeError) of the last Compute()
pass # end of Mesh class
-## class used to compensate change of CORBA API of SMESH_Mesh for backward compatibility
+## Class used to compensate change of CORBA API of SMESH_Mesh for backward compatibility
# with old dump scripts which call SMESH_Mesh directly and not via smeshBuilder.Mesh
#
class meshProxy(SMESH._objref_SMESH_Mesh):
pass
omniORB.registerObjref(SMESH._objref_SMESH_Mesh._NP_RepositoryId, meshProxy)
-## class used to compensate change of CORBA API of SMESH_MeshEditor for backward compatibility
+
+## Class wrapping SMESH_SubMesh in order to add Compute()
+#
+class submeshProxy(SMESH._objref_SMESH_subMesh):
+ def __init__(self):
+ SMESH._objref_SMESH_subMesh.__init__(self)
+ self.mesh = None
+ def __deepcopy__(self, memo=None):
+ new = self.__class__()
+ return new
+
+ ## Computes the sub-mesh and returns the status of the computation
+ # @param refresh if @c True, Object browser is automatically updated (when running in GUI)
+ # @return True or False
+ # @ingroup l2_construct
+ def Compute(self,refresh=False):
+ if not self.mesh:
+ self.mesh = Mesh( smeshBuilder(), None, self.GetMesh())
+
+ ok = self.mesh.Compute( self.GetSubShape(),refresh=[] )
+
+ if salome.sg.hasDesktop() and self.mesh.GetStudyId() >= 0:
+ smeshgui = salome.ImportComponentGUI("SMESH")
+ smeshgui.Init(self.mesh.GetStudyId())
+ smeshgui.SetMeshIcon( salome.ObjectToID( self ), ok, (self.GetNumberOfElements()==0) )
+ if refresh: salome.sg.updateObjBrowser(1)
+ pass
+
+ return ok
+ pass
+omniORB.registerObjref(SMESH._objref_SMESH_subMesh._NP_RepositoryId, submeshProxy)
+
+
+## Class used to compensate change of CORBA API of SMESH_MeshEditor for backward compatibility
# with old dump scripts which call SMESH_MeshEditor directly and not via smeshBuilder.Mesh
#
class meshEditor(SMESH._objref_SMESH_MeshEditor):
raise RuntimeError, "No class found for algo type %s" % algoType
return None
-# Private class used to substitute and store variable parameters of hypotheses.
+## Private class used to substitute and store variable parameters of hypotheses.
#
class hypMethodWrapper:
def __init__(self, hyp, method):
return result
pass
-# A helper class that call UnRegister() of SALOME.GenericObj'es stored in it
+## A helper class that call UnRegister() of SALOME.GenericObj'es stored in it
+#
class genObjUnRegister:
def __init__(self, genObj=None):
if genObj and hasattr( genObj, "UnRegister" ):
genObj.UnRegister()
+
+## Bind methods creating mesher plug-ins to the Mesh class
+#
for pluginName in os.environ[ "SMESH_MeshersList" ].split( ":" ):
#
#print "pluginName: ", pluginName
for (TopExp_Explorer exp( aShape, TopAbs_FACE ); exp.More(); exp.Next(), ++nbFoundFaces )
{
StdMeshers_FaceSidePtr circSide, linSide1, linSide2;
- int nbSides = analyseFace( aShape, NULL, circSide, linSide1, linSide2 );
+ int nbSides = analyseFace( exp.Current(), NULL, circSide, linSide1, linSide2 );
bool ok = ( 0 < nbSides && nbSides <= 3 &&
isCornerInsideCircle( circSide, linSide1, linSide2 ));
if( toCheckAll && !ok ) return false;