#include "VisuGUI_CutLinesDlg.h"
#include "VisuGUI.h"
+#include "VisuGUI_Tools.h"
#include "VISU_Gen_i.hh"
#include "VISU_CutLines_i.hh"
#include "VISU_PipeLine.hxx"
#include "VISU_CutLinesPL.hxx"
+#include "SVTK_ViewWindow.h"
+
#include "SalomeApp_Application.h"
#include "SalomeApp_Study.h"
*/
VisuGUI_CutLinesDlg::~VisuGUI_CutLinesDlg()
{
+ cout<<"### VisuGUI_CutLinesDlg::~VisuGUI_CutLinesDlg"<<endl;
deletePlanes();
- if (myCutLines) delete myCutLines;
- //jfa tmp:if (VTKViewer_ViewWindow* vf = GET_VTK_VIEWWINDOW(myMgr))
- //jfa tmp: vf->Repaint();
+ if (myCutLines) //delete myCutLines;
+ myCutLines->Destroy();
+ if (SVTK_ViewWindow* vf = VISU::GetViewWindow())
+ vf->Repaint();
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void VisuGUI_CutLinesDlg::createPlanes()
{
- //jfa tmp:if (GET_VTK_VIEWWINDOW(myMgr) == NULL)
- //jfa tmp: return;
+ SVTK_ViewWindow* aView = VISU::GetViewWindow();
+ if (aView == NULL) return;
if (myCutLines == NULL) return;
if (myPreviewActor != 0) return;
+ storeToPrsObject(myCutLines);
+ myCutLines->GetPL()->Update();
vtkAppendPolyData* aPolyData = myCutLines->GetCutLinesPL()->GetAppendPolyData();
vtkDataSetMapper* aPlaneMapper = vtkDataSetMapper::New();
aPlaneMapper->SetInput(aPolyData->GetOutput());
myPreviewActor->PickableOff();
myPreviewActor->SetMapper(aPlaneMapper);
aPlaneMapper->Delete();
- //jfa tmp:GET_VTK_VIEWWINDOW(myMgr)->AddActor(myPreviewActor);
+ aView->AddActor(myPreviewActor);
+ aView->getRenderer()->Render();
+ aView->onFitAll();
}
//------------------------------------------------------------------------------
void VisuGUI_CutLinesDlg::deletePlanes()
{
if (myPreviewActor == 0) return;
- //jfa tmp:if (VTKViewer_ViewWindow* vf = GET_VTK_VIEWWINDOW(myMgr))
- //jfa tmp: vf->RemoveActor(myPreviewActor);
+ if (SVTK_ViewWindow* aView = VISU::GetViewWindow())
+ aView->RemoveActor(myPreviewActor);
myPreviewActor->Delete();
myPreviewActor = 0;
}
myRotXLbl2->setText( tr("LBL_ROT_Z"));
myRotYLbl2->setText( tr("LBL_ROT_X"));
}
- //jfa tmp:if (VTKViewer_ViewWindow* vf = GET_VTK_VIEWWINDOW(myMgr)) {
+ if (SVTK_ViewWindow* aView = VISU::GetViewWindow()) {
if (theUpdate && myPreviewCheck->isChecked() && (myCutLines != NULL)) {
- myCutLines->SetOrientation2(getOrientaion(false),
+ /*myCutLines->SetOrientation2(getOrientaion(false),
myRotXSpn2->value()*PI/180.,
myRotYSpn2->value()*PI/180.);
- myCutLines->SetDisplacement2(myPosSpn2->value());
- myCutLines->GetPL()->Update();
+ myCutLines->SetDisplacement2(myPosSpn2->value());*/
+ //myCutLines->GetPL()->Update();
deletePlanes();
createPlanes();
- //jfa tmp:vf->Repaint();
+ //aView->Repaint();
}
- //jfa tmp:}
+ }
}
//------------------------------------------------------------------------------
if (myCBSetDef->isChecked()) {
if (!myCutLines->IsDefault()) myCutLines->SetDefault();
- myCutLines->SetOrientation(getOrientaion(),
+ /*myCutLines->SetOrientation(getOrientaion(),
myRotXSpn->value()*PI/180.,
myRotYSpn->value()*PI/180.);
- myCutLines->SetDisplacement(myPosSpn->value());
- float aPos = myCutLines->GetBasePlanePosition();
+ myCutLines->SetDisplacement(myPosSpn->value());*/
+ /* float aPos = myCutLines->GetBasePlanePosition();
myBasePlanePos->setText( QString::number(aPos) );
- myBasePlanePos->setEnabled(false);
- //jfa tmp:if (VTKViewer_ViewWindow* vf = GET_VTK_VIEWWINDOW(myMgr)) {
+ myBasePlanePos->setEnabled(false);*/
+ if (SVTK_ViewWindow* aView = VISU::GetViewWindow()) {
if (theUpdate && myPreviewCheck->isChecked() && (myCutLines != NULL)) {
- myCutLines->SetBasePlanePosition(aPos);
- myCutLines->GetPL()->Update();
+ //myCutLines->SetBasePlanePosition(aPos);
+ // myCutLines->GetPL()->Update();
deletePlanes();
createPlanes();
- //jfa tmp:vf->Repaint();
+ //aView->Repaint();
}
- //jfa tmp:}
+ }
+ float aPos = myCutLines->GetBasePlanePosition();
+ myBasePlanePos->setText( QString::number(aPos) );
+ myBasePlanePos->setEnabled(false);
} else {
myBasePlanePos->setEnabled(true);
}
vh->setLabel( i, str.arg(i+1) );
}
// Update preview
- //jfa tmp:if (VTKViewer_ViewWindow* vf = GET_VTK_VIEWWINDOW(myMgr)) {
+ if (SVTK_ViewWindow* aView = VISU::GetViewWindow()) {
if (myPreviewCheck->isChecked()) {
- myCutLines->GetPL()->Update();
+ // myCutLines->GetPL()->Update();
deletePlanes();
createPlanes();
- //jfa tmp:vf->Repaint();
+ //aView->Repaint();
}
- //jfa tmp:}
+ }
}
//------------------------------------------------------------------------------
bool isChanged = !aTxt.isEmpty();
((QCheckTableItem*)myPosTable->item(theRow, 1))->setChecked(!isChanged);
- //jfa tmp:if (VTKViewer_ViewWindow* vf = GET_VTK_VIEWWINDOW(myMgr)) {
+ if (SVTK_ViewWindow* aView = VISU::GetViewWindow()) {
if (myPreviewCheck->isChecked()) {
//Update Preview
- myCutLines->SetLinePosition( theRow, aTxt.toDouble());
- myCutLines->GetPL()->Update();
+ //myCutLines->SetLinePosition( theRow, aTxt.toDouble());
+ // myCutLines->GetPL()->Update();
deletePlanes();
createPlanes();
- //jfa tmp:vf->Repaint();
+ //aView->Repaint();
}
- //jfa tmp:}
+ }
} else {
bool isDefault = ((QCheckTableItem*)myPosTable->item(theRow, theCol))->isChecked();
if (isDefault) {
- myCutLines->SetDefaultPosition(theRow);
- myPosTable->setText(theRow, 0, QString::number(myCutLines->GetLinePosition(theRow)));
+ //myCutLines->SetDefaultPosition(theRow);
+ // myPosTable->setText(theRow, 0, QString::number(myCutLines->GetLinePosition(theRow)));
- //jfa tmp:if (VTKViewer_ViewWindow* vf = GET_VTK_VIEWWINDOW(myMgr)) {
+ if (SVTK_ViewWindow* aView = VISU::GetViewWindow()) {
if (myPreviewCheck->isChecked()) {
//Update Preview
- myCutLines->GetPL()->Update();
+ // myCutLines->GetPL()->Update();
deletePlanes();
createPlanes();
- //jfa tmp:vf->Repaint();
+ //aView->Repaint();
}
- //jfa tmp:}
+ }
+ myPosTable->setText(theRow, 0, QString::number(myCutLines->GetLinePosition(theRow)));
}
myPosTable->item(theRow, 0)->setEnabled(!isDefault);
}
{
MYGenerateTable = myCreateTable->isChecked();
MYGenerateCurve = myCurvesCheck->isChecked();
- if (myScalarPane->check()) {
+ // if (myScalarPane->check()) {
/*jfa tmp:((QWidget*)sender())->setDisabled(true);
storeToPrsObject(myPrs);
if (myIsCreation) {
}
}
VisuGUI::application()->objectBrowser()->updateTree();*/
+ deletePlanes();
QDialog::accept();
- }
+ // }
}
void VisuGUI_CutLinesDlg::reject()
visuGUI->DeletePresentation(myPrs);
VisuGUI::application()->objectBrowser()->updateTree();
}*/
+ deletePlanes();
QDialog::reject();
}
void VisuGUI_CutLinesDlg::onPreviewCheck (bool thePreview)
{
- /*jfa tmp:if (VTKViewer_ViewWindow* vf = GET_VTK_VIEWWINDOW(myMgr)) {
+ if (SVTK_ViewWindow* vf = VISU::GetViewWindow()) {
if (thePreview) {
- storeToPrsObject(myCutLines);
- myCutLines->GetPL()->Update();
+ //storeToPrsObject(myCutLines);
+ // myCutLines->GetPL()->Update();
createPlanes();
- vf->onFitAll();
+ //vf->onFitAll();
} else {
deletePlanes();
vf->Repaint();
}
- }*/
+ }
}
void VisuGUI_CutLinesDlg::onRotation (double theValue)
{
if (myCutLines == NULL) return;
- //jfa tmp:if (VTKViewer_ViewWindow* vf = GET_VTK_VIEWWINDOW(myMgr)) {
+ if (SVTK_ViewWindow* aView = VISU::GetViewWindow()) {
if (myPreviewCheck->isChecked()) {
- myCutLines->SetOrientation(getOrientaion(),
+
+ /*myCutLines->SetOrientation(getOrientaion(),
myRotXSpn->value()*PI/180.,
myRotYSpn->value()*PI/180.);
myCutLines->SetOrientation2(getOrientaion(false),
myRotXSpn2->value()*PI/180.,
- myRotYSpn2->value()*PI/180.);
- myCutLines->GetPL()->Update();
+ myRotYSpn2->value()*PI/180.);*/
+ // myCutLines->GetPL()->Update();
deletePlanes();
createPlanes();
- //jfa tmp:vf->Repaint();
+ //aView->Repaint();
}
- //jfa tmp:}
+ }
}
void VisuGUI_CutLinesDlg::onPlanePos (const QString& theValue)
{
if (myCutLines == NULL) return;
- //jfa tmp:if (VTKViewer_ViewWindow* vf = GET_VTK_VIEWWINDOW(myMgr)) {
+ if (SVTK_ViewWindow* aView = VISU::GetViewWindow()) {
if (myPreviewCheck->isChecked()) {
- myCutLines->SetBasePlanePosition(theValue.toDouble());
- myCutLines->GetPL()->Update();
+ //myCutLines->SetBasePlanePosition(theValue.toDouble());
+ // myCutLines->GetPL()->Update();
deletePlanes();
createPlanes();
- //jfa tmp:vf->Repaint();
+ //aView->Repaint();
}
- //jfa tmp:}
+ }
}
//jfa tmp:void VisuGUI_CutLinesDlg::onWindowActivated (SUIT_ViewWindow* theWnd)