SMESHGUI_MakeNodeAtPointOp::SMESHGUI_MakeNodeAtPointOp()
{
mySimulation = 0;
+ mySMESHGUI = 0;
myDlg = new SMESHGUI_MakeNodeAtPointDlg;
myFilter = 0;
myHelpFileName = "mesh_through_point_page.html";
// init simulation with a current View
if ( mySimulation ) delete mySimulation;
- mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( getSMESHGUI() ));
+ mySMESHGUI = getSMESHGUI();
+ mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ) );
+ connect(mySMESHGUI, SIGNAL (SignalActivatedViewManager()), this, SLOT(onOpenView()));
+ connect(mySMESHGUI, SIGNAL (SignalCloseView()), this, SLOT(onCloseView()));
vtkProperty* aProp = vtkProperty::New();
aProp->SetRepresentationToWireframe();
aProp->SetColor(250, 0, 250);
void SMESHGUI_MakeNodeAtPointOp::stopOperation()
{
myNoPreview = true;
- mySimulation->SetVisibility(false);
+ if ( mySimulation )
+ {
+ mySimulation->SetVisibility(false);
+ delete mySimulation;
+ mySimulation = 0;
+ }
if ( myMeshActor ) {
myMeshActor->SetPointRepresentation(false);
SMESH::RepaintCurrentView();
myMeshActor = 0;
}
+ disconnect(mySMESHGUI, SIGNAL (SignalActivatedViewManager()), this, SLOT(onOpenView()));
+ disconnect(mySMESHGUI, SIGNAL (SignalCloseView()), this, SLOT(onCloseView()));
selectionMgr()->removeFilter( myFilter );
SMESHGUI_SelectionOp::stopOperation();
}
aMeshPreviewStruct->elementConnectivities.length(1);
aMeshPreviewStruct->elementConnectivities[0] = 0;
}
-
+ if (!mySimulation)
+ mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ));
// display data
if ( aMeshPreviewStruct.operator->() )
{
myNoPreview = false;
}
+//=================================================================================
+/*!
+ * \brief SLOT called when the viewer opened
+ */
+//=================================================================================
+void SMESHGUI_MakeNodeAtPointOp::onOpenView()
+{
+ if ( mySimulation ) {
+ mySimulation->SetVisibility(false);
+ SMESH::SetPointRepresentation(false);
+ }
+ else {
+ mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ));
+ }
+}
+
+//=================================================================================
+/*!
+ * \brief SLOT called when the viewer closed
+ */
+//=================================================================================
+void SMESHGUI_MakeNodeAtPointOp::onCloseView()
+{
+ delete mySimulation;
+ mySimulation = 0;
+}
+
//================================================================================
/*!
* \brief SLOT called when the node id is manually changed