myHelpFileName = "about_meshes.html"; // V4
}
+//================================================================================
+/*!
+ * \brief Gets dialog of this operation
+ * \retval LightApp_Dialog* - pointer to dialog of this operation
+ */
+//================================================================================
+
+LightApp_Dialog* SMESHGUI_BaseComputeOp::dlg() const
+{
+ return myCompDlg;
+}
+
+//================================================================================
+/*!
+ * \brief Return a selected mesh
+ */
+//================================================================================
+
SMESH::SMESH_Mesh_ptr SMESHGUI_BaseComputeOp::getMesh()
{
LightApp_SelectionMgr* Sel = selectionMgr();
return myMesh->_is_nil() ? aMesh._retn() : SMESH::SMESH_Mesh::_duplicate( myMesh );
}
+//================================================================================
+/*!
+ * \brief check the same operations on the same mesh
+ */
+//================================================================================
+
+bool SMESHGUI_BaseComputeOp::isValid( SUIT_Operation* theOp ) const
+{
+ SMESHGUI_BaseComputeOp* baseOp = dynamic_cast<SMESHGUI_BaseComputeOp*>( theOp );
+ bool ret = true;
+ if ( !myMesh->_is_nil() && baseOp ) {
+ SMESH::SMESH_Mesh_var aMesh = baseOp->getMesh();
+ if ( !aMesh->_is_nil() && aMesh->GetId() == myMesh->GetId() ) ret = false;
+ }
+ return ret;
+}
+
//================================================================================
/*!
* \brief Start operation
return;
}
+ myCompDlg->myMeshName->setText( SMESH::GetName( myIObject ));
+
myMainShape = myMesh->GetShapeToMesh();
SMESHGUI_Operation::startOperation();
bool shapeOK = myMainShape->_is_nil() ? !hasShape : hasShape;
if ( shapeOK )
{
- myCompDlg->myMeshName->setText( aMeshSObj->GetName().c_str() );
SMESH::SMESH_Gen_var gen = getSMESHGUI()->GetSMESHGen();
SMESH::algo_error_array_var errors = gen->GetAlgoState(myMesh,myMainShape);
if ( errors->length() > 0 ) {
computeMesh();
}
-//================================================================================
-/*!
- * \brief check the same operations on the same mesh
- */
-//================================================================================
-
-bool SMESHGUI_BaseComputeOp::isValid( SUIT_Operation* theOp ) const
-{
- SMESHGUI_BaseComputeOp* baseOp = dynamic_cast<SMESHGUI_BaseComputeOp*>( theOp );
- bool ret = true;
- if ( !myMesh->_is_nil() && baseOp ) {
- SMESH::SMESH_Mesh_var aMesh = baseOp->getMesh();
- if ( !aMesh->_is_nil() && aMesh->GetId() == myMesh->GetId() ) ret = false;
- }
- return ret;
-}
-
//================================================================================
/*!
* \brief Gets dialog of this operation
bool computeFailed = true, memoryLack = false;
SMESHGUI_ComputeDlg* aCompDlg = computeDlg();
- aCompDlg->myMeshName->setText( aMeshSObj->GetName().c_str() );
SMESHGUI* gui = getSMESHGUI();
SMESH::SMESH_Gen_var gen = gui->GetSMESHGen();
bool shapeOK = myMainShape->_is_nil() ? !hasShape : hasShape;
if ( shapeOK )
{
- myCompDlg->myMeshName->setText( aMeshSObj->GetName().c_str() );
SMESH::SMESH_Gen_var gen = getSMESHGUI()->GetSMESHGen();
SMESH::algo_error_array_var errors = gen->GetAlgoState(myMesh,myMainShape);
if ( errors->length() > 0 ) {
return myCompDlg;
}
+//================================================================================
+/*!
+ * \brief SMESHGUI_BaseComputeOp constructor
+ */
+//================================================================================
+
+SMESHGUI_ShowErrorsOp::SMESHGUI_ShowErrorsOp():
+ SMESHGUI_BaseComputeOp()
+{
+}
+
+//================================================================================
+/*!
+ * \brief Start SMESHGUI_ShowErrorsOp
+ */
+//================================================================================
+
+void SMESHGUI_ShowErrorsOp::startOperation()
+{
+ SMESHGUI_BaseComputeOp::startOperation();
+
+ if ( myMesh->_is_nil() )
+ return;
+
+ SMESH::SMESH_Gen_var gen = getSMESHGUI()->GetSMESHGen();
+ SMESH::compute_error_array_var compErrors = gen->GetComputeErrors( myMesh, myMainShape );
+ QString hypErrors;
+ if ( compErrors->length() == 0 )
+ return;
+
+ showComputeResult( /*MemoryLack=*/false, /*NoCompError=*/false, compErrors,
+ /*NoHypoError=*/true, hypErrors );
+
+ SMESHGUI_ComputeDlg* aCompDlg = computeDlg();
+ aCompDlg->setWindowTitle( tr( "SMESH_WRN_COMPUTE_FAILED" ));
+ aCompDlg->myFullInfo->hide();
+ aCompDlg->myBriefInfo->hide();
+
+ return;
+}