try {
CORBA::String_var error;
res = aMesh->AddHypothesis(aShapeObject, aHyp, error.out());
+ UpdateViewer(aMesh);
if (res > SMESH::HYP_OK) {
wc.suspend();
processHypothesisStatus(res, aHyp, true, error.in() );
{
CORBA::String_var error;
res = aMesh->AddHypothesis( aShapeObject, aHyp, error.out() );
+ UpdateViewer(aMesh);
if (res > SMESH::HYP_OK) {
wc.suspend();
processHypothesisStatus( res, aHyp, true, error.in() );
processHypothesisStatus(res, anHyp, false);
wc.resume();
}
- if ( _PTR(SObject) meshSO = SMESH::FindSObject(aMesh) )
- {
- if ( SMESH_Actor* actor = SMESH::FindActorByEntry( meshSO->GetID().c_str() ))
- if( actor->GetVisibility() )
- actor->Update();
- }
+ UpdateViewer(aMesh);
}
} catch(const SALOME::SALOME_Exception& S_ex) {
wc.suspend();
}
}
return res < SMESH::HYP_UNKNOWN_FATAL;
+ }
+
+ void UpdateViewer(SMESH::SMESH_Mesh_ptr theMesh)
+ {
+ if (_PTR(SObject) meshSO = SMESH::FindSObject(theMesh))
+ {
+ if (SMESH_Actor* actor = SMESH::FindActorByEntry(meshSO->GetID().c_str()))
+ if (actor->GetVisibility())
+ actor->Update();
+ }
}
SObjectList GetMeshesUsingAlgoOrHypothesis(SMESH::SMESH_Hypothesis_ptr AlgoOrHyp)
bool RemoveHypothesisOrAlgorithmOnMesh( _PTR(SObject),
SMESH::SMESH_Hypothesis_ptr );
+ SMESHGUI_EXPORT void UpdateViewer(SMESH::SMESH_Mesh_ptr);
+
typedef std::vector<_PTR(SObject)> SObjectList;
SMESHGUI_EXPORT
SObjectList GetMeshesUsingAlgoOrHypothesis( SMESH::SMESH_Hypothesis_ptr );
if (( myToCreate && !myIsMesh ) || myIsInvalidSubMesh )
aResult = createSubMesh( aMess, anEntryList );
else if ( !myToCreate )
- aResult = editMeshOrSubMesh( aMess );
+ aResult = editMeshOrSubMesh( aMess, anEntryList );
if ( aResult )
{
SMESHGUI::Modified();
//================================================================================
/*!
* \brief Edits mesh or sub-mesh
- * \param theMess - Output parameter intended for returning error message
- * \retval bool - TRUE if mesh is edited successfully, FALSE otherwise
+ * \param theMess - Output parameter intended for returning error message
+ * \param theEntryList - List of entries of published objects
+ * \retval bool - TRUE if mesh is edited successfully, FALSE otherwise
*
* Assigns new name hypotheses and algorithms to the mesh or sub-mesh
*/
//================================================================================
-bool SMESHGUI_MeshOp::editMeshOrSubMesh( QString& theMess )
+bool SMESHGUI_MeshOp::editMeshOrSubMesh( QString& theMess, QStringList& theEntryList)
{
theMess = "";
if ( !isMesh && !aSubMeshVar->_is_nil() )
aMesh = aSubMeshVar->GetFather();
+ _PTR(SObject) aMeshSO = SMESH::FindSObject(aMesh.in());
+ if (aMeshSO) {
+ SMESH::SetName(aMeshSO, myDlg->objectText(SMESHGUI_MeshDlg::Obj));
+ theEntryList.append(aMeshSO->GetID().c_str());
+ }
+
// Assign new algorithms and hypotheses
for ( int dim = aDim; dim <= SMESH::DIM_3D; dim++ )
{
bool createMesh( QString&, QStringList& );
bool createSubMesh( QString&, QStringList& );
- bool editMeshOrSubMesh( QString& );
+ bool editMeshOrSubMesh( QString&, QStringList& );
void createSubMeshOnInternalEdges( SMESH::SMESH_Mesh_ptr mesh,
GEOM::GEOM_Object_ptr mainShape );
bool checkSubMeshConcurrency( SMESH::SMESH_Mesh_ptr mesh,