#include "VisuGUI.h"
#include "VisuGUI_Tools.h"
+#include "VisuGUI_ViewTools.h"
#include "VISU_CutPlanes_i.hh"
#include "VISU_CutPlanesPL.hxx"
VisuGUI_CutPlanesPane::~VisuGUI_CutPlanesPane()
{
- cout<<"### VisuGUI_CutPlanesPane::~VisuGUI_CutPlanesPane"<<endl;
deletePlanes();
if (myCutPlanes)
myCutPlanes->Destroy();
- if (SVTK_ViewWindow* vf = VISU::GetViewWindow())
+ if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>())
vf->Repaint();
}
void VisuGUI_CutPlanesPane::createPlanes()
{
- if (VISU::GetViewWindow() == NULL) return;
+ if (VISU::GetActiveViewWindow<SVTK_ViewWindow>() == NULL) return;
if (myCutPlanes == NULL) return;
if (myPreviewActor != 0) return;
myPreviewActor->PickableOff();
myPreviewActor->SetMapper(aPlaneMapper);
aPlaneMapper->Delete();
- VISU::GetViewWindow()->AddActor(myPreviewActor);
+ VISU::GetActiveViewWindow<SVTK_ViewWindow>()->AddActor(myPreviewActor);
}
int VisuGUI_CutPlanesPane::storeToPrsObject (VISU::CutPlanes_i* thePrs)
// Update preview
if (myPreviewCheck->isChecked()) {
- if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
+ if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
myCutPlanes->GetPL()->Update();
deletePlanes();
createPlanes();
if (myPreviewCheck->isChecked()) {
//Update Preview
- if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
+ if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
myCutPlanes->SetPlanePosition( theRow, aTxt.toDouble());
myCutPlanes->GetPL()->Update();
deletePlanes();
myPosTable->setText(theRow, 0, QString::number(myCutPlanes->GetPlanePosition(theRow)));
if (myPreviewCheck->isChecked()) {
- if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
+ if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
//Update Preview
myCutPlanes->GetPL()->Update();
deletePlanes();
void VisuGUI_CutPlanesPane::deletePlanes()
{
if (myPreviewActor == 0) return;
- if (SVTK_ViewWindow* vf = VISU::GetViewWindow())
+ if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>())
vf->RemoveActor(myPreviewActor);
myPreviewActor->Delete();
myPreviewActor = 0;
{
if (myCutPlanes == NULL) return;
if (myPreviewCheck->isChecked()) {
- if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
+ if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
myCutPlanes->SetOrientation(getOrientaion(),getRotation1()*PI/180.,getRotation2()*PI/180.);
myCutPlanes->GetPL()->Update();
deletePlanes();
void VisuGUI_CutPlanesPane::onPreviewCheck (bool thePreview)
{
- if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
+ if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
if (thePreview) {
storeToPrsObject(myCutPlanes);
myCutPlanes->GetPL()->Update();
Constructor
*/
VisuGUI_CutPlanesDlg::VisuGUI_CutPlanesDlg (SalomeApp_Module* theModule)
- : QDialog(VISU::GetDesktop(theModule), "VisuGUI_CutPlanesDlg", true,
+ : QDialog(VISU::GetDesktop(theModule), "VisuGUI_CutPlanesDlg", false,
WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
{
setCaption("Cut Planes Definition");
// return;
//}
if (myScalarPane->check())
- QDialog::accept();
+ {
+ myScalarPane->deletePreview();
+ QDialog::accept();
+ }
}
void VisuGUI_CutPlanesDlg::reject() {
+ myScalarPane->deletePreview();
QDialog::reject();
}