-// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-
#include "VisuGUI_ClippingDlg.h"
#include "VisuGUI.h"
#include "VISU_Prs3d_i.hh"
#include "VISU_Result_i.hh"
+#include "VISU_ColoredPrs3dHolder_i.hh"
#include "VISU_PipeLine.hxx"
+#include "VISU_DataSetActor.h"
#include "LightApp_SelectionMgr.h"
#include "LightApp_Application.h"
#include "SVTK_ViewWindow.h"
+#include <VTKViewer_Utilities.h>
#include "SUIT_Session.h"
#include "SUIT_Desktop.h"
#include "SUIT_OverrideCursor.h"
#include "SALOME_Actor.h"
+#include "VISU_ViewManager_i.hh"
// QT Includes
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qcombobox.h>
-#include <qcheckbox.h>
-#include <qlayout.h>
-#include <qgroupbox.h>
-#include <qvalidator.h>
-#include <qtabwidget.h>
-#include <qhbuttongroup.h>
-#include <qradiobutton.h>
-#include <qspinbox.h>
+#include <QLabel>
+#include <QComboBox>
+#include <QCheckBox>
+#include <QLayout>
+#include <QGroupBox>
+#include <QButtonGroup>
+#include <QValidator>
+#include <QTabWidget>
+#include <QRadioButton>
+#include <QSpinBox>
+#include <QKeyEvent>
+#include <QPushButton>
+#include <QListWidget>
+#include <QVBoxLayout>
+#include <QHBoxLayout>
+#include <QStackedWidget>
// VTK Includes
#include <vtkMath.h>
#include <vtkPolyData.h>
#include <vtkUnstructuredGrid.h>
#include <vtkProperty.h>
+#include <vtkImplicitFunctionCollection.h>
// OCCT Includes
#include <gp_Dir.hxx>
}
}
- void RangeStepAndValidator (QtxDblSpinBox* theSpinBox, double min, double max,
+ void RangeStepAndValidator (QtxDoubleSpinBox* theSpinBox, double min, double max,
double step, unsigned short decimals)
{
theSpinBox->setRange(min, max);
- theSpinBox->setLineStep(step);
- ((QDoubleValidator*)theSpinBox->validator())->setRange(min, max, decimals);
+ theSpinBox->setSingleStep(step);
+ theSpinBox->setRange(min, max );
+ theSpinBox->setDecimals( decimals);
}
};
//
//=================================================================================
VisuGUI_ClippingDlg::VisuGUI_ClippingDlg (VisuGUI* theModule,
- const char* name,
- bool modal,
- WFlags fl)
- : QDialog(VISU::GetDesktop(theModule), name, modal, WStyle_Customize |
- WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose),
+ bool modal )
+ : QDialog(VISU::GetDesktop(theModule), Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
mySelectionMgr(VISU::GetSelectionMgr(theModule)),
myVisuGUI(theModule),
myPrs3d(0),
- myIsSelectPlane(false)
+ myIsSelectPlane(false),
+ myDSActor(0)
{
- if (!name)
- setName("VisuGUI_ClippingDlg");
- setCaption(tr("TITLE"));
+ setWindowTitle(tr("TITLE"));
setSizeGripEnabled(TRUE);
- QGridLayout* VisuGUI_ClippingDlgLayout = new QGridLayout(this);
+ setAttribute( Qt::WA_DeleteOnClose, true );
+
+ QVBoxLayout* VisuGUI_ClippingDlgLayout = new QVBoxLayout(this);
VisuGUI_ClippingDlgLayout->setSpacing(6);
VisuGUI_ClippingDlgLayout->setMargin(11);
+
+ QStackedWidget* aStackWidget = new QStackedWidget(this);
+ VisuGUI_ClippingDlgLayout->addWidget(aStackWidget);
+ // Local planes
+ QWidget* aLocalPlanes = new QWidget(aStackWidget);
+ QVBoxLayout* aLocalLayout = new QVBoxLayout(aLocalPlanes);
+ aStackWidget->addWidget(aLocalPlanes);
// Controls for selecting, creating, deleting planes
- QGroupBox* GroupPlanes = new QGroupBox (this, "GroupPlanes");
- GroupPlanes->setTitle(tr("GRP_PLANES"));
- GroupPlanes->setColumnLayout(0, Qt::Vertical);
- GroupPlanes->layout()->setSpacing(0);
- GroupPlanes->layout()->setMargin(0);
- QGridLayout* GroupPlanesLayout = new QGridLayout (GroupPlanes->layout());
+ QGroupBox* GroupPlanes = new QGroupBox (tr("GRP_PLANES"), aLocalPlanes);
+ QGridLayout* GroupPlanesLayout = new QGridLayout (GroupPlanes);
GroupPlanesLayout->setAlignment(Qt::AlignTop);
GroupPlanesLayout->setSpacing(6);
GroupPlanesLayout->setMargin(11);
+ aLocalLayout->addWidget(GroupPlanes);
- ComboBoxPlanes = new QComboBox (GroupPlanes, "ComboBoxPlanes");
+ ComboBoxPlanes = new QComboBox (GroupPlanes);
GroupPlanesLayout->addWidget(ComboBoxPlanes, 0, 0);
QSpacerItem* spacerGP = new QSpacerItem (20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
GroupPlanesLayout->addItem(spacerGP, 0, 1);
- buttonNew = new QPushButton (GroupPlanes, "buttonNew");
+ buttonNew = new QPushButton (GroupPlanes );
buttonNew->setText(tr("BUT_NEW"));
GroupPlanesLayout->addWidget(buttonNew, 0, 2);
- buttonDelete = new QPushButton(GroupPlanes, "buttonDelete");
+ buttonDelete = new QPushButton(GroupPlanes);
buttonDelete->setText(tr("BUT_DELETE"));
GroupPlanesLayout->addWidget(buttonDelete, 0, 3);
// Controls for defining plane parameters
// Tab pane
- QGroupBox* GroupParameters = new QGroupBox(this, "GroupParameters");
- GroupParameters->setTitle(tr("GRP_PARAMETERS"));
- GroupParameters->setColumnLayout(0, Qt::Vertical);
- GroupParameters->layout()->setSpacing(0);
- GroupParameters->layout()->setMargin(0);
- QGridLayout* GroupParametersLayout = new QGridLayout (GroupParameters->layout());
+ QGroupBox* GroupParameters = new QGroupBox(tr("GRP_PARAMETERS"), aLocalPlanes);
+ QGridLayout* GroupParametersLayout = new QGridLayout (GroupParameters);
GroupParametersLayout->setAlignment(Qt::AlignTop);
GroupParametersLayout->setSpacing(6);
GroupParametersLayout->setMargin(11);
+ aLocalLayout->addWidget(GroupParameters);
TabPane = new QTabWidget (GroupParameters);
TabPane->addTab(createParamsTab() , tr("TAB_NON_STRUCTURED"));
TabPane->addTab(createIJKParamsTab(), tr("TAB_IJK_STRUCTURED"));
GroupParametersLayout->addWidget(TabPane, 0, 0);
+
+
+
+
// "Show preview" and "Auto Apply" check boxes
+ QHBoxLayout* aCheckBoxLayout = new QHBoxLayout(this);
+ VisuGUI_ClippingDlgLayout->addLayout(aCheckBoxLayout);
PreviewCheckBox = new QCheckBox (tr("SHOW_PREVIEW_CHK"), this);
PreviewCheckBox->setChecked(true);
+ aCheckBoxLayout->addWidget(PreviewCheckBox);
+ aCheckBoxLayout->addStretch();
AutoApplyCheckBox = new QCheckBox (tr("AUTO_APPLY_CHK"), this);
AutoApplyCheckBox->setChecked(false);
+ aCheckBoxLayout->addWidget(AutoApplyCheckBox);
// Controls for "Ok", "Apply" and "Close" button
- QGroupBox* GroupButtons = new QGroupBox (this, "GroupButtons");
- GroupButtons->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)7,
- (QSizePolicy::SizeType)0, 0, 0,
- GroupButtons->sizePolicy().hasHeightForWidth()));
+ QGroupBox* GroupButtons = new QGroupBox (this);
+ VisuGUI_ClippingDlgLayout->addWidget(GroupButtons);
+ QSizePolicy aSizePolicy(QSizePolicy::Expanding,
+ QSizePolicy::Fixed );
+ aSizePolicy.setHeightForWidth( GroupButtons->sizePolicy().hasHeightForWidth() );
+ aSizePolicy.setHorizontalStretch( 0 );
+ aSizePolicy.setVerticalStretch( 0 );
+ GroupButtons->setSizePolicy( aSizePolicy );
GroupButtons->setGeometry(QRect(10, 10, 281, 48));
- //GroupButtons->setTitle(tr(""));
- GroupButtons->setColumnLayout(0, Qt::Vertical);
- GroupButtons->layout()->setSpacing(0);
- GroupButtons->layout()->setMargin(0);
- QGridLayout* GroupButtonsLayout = new QGridLayout (GroupButtons->layout());
+ QGridLayout* GroupButtonsLayout = new QGridLayout (GroupButtons);
+ GroupButtons->setLayout(GroupButtonsLayout);
GroupButtonsLayout->setAlignment(Qt::AlignTop);
GroupButtonsLayout->setSpacing(6);
GroupButtonsLayout->setMargin(11);
- buttonHelp = new QPushButton (GroupButtons, "buttonHelp");
+ buttonHelp = new QPushButton (GroupButtons);
buttonHelp->setText(tr("BUT_HELP"));
buttonHelp->setAutoDefault(TRUE);
GroupButtonsLayout->addWidget(buttonHelp, 0, 4);
- buttonCancel = new QPushButton (GroupButtons, "buttonCancel");
+ buttonCancel = new QPushButton (GroupButtons);
buttonCancel->setText(tr("BUT_CLOSE"));
buttonCancel->setAutoDefault(TRUE);
GroupButtonsLayout->addWidget(buttonCancel, 0, 3);
- buttonApply = new QPushButton (GroupButtons, "buttonApply");
+ buttonApply = new QPushButton (GroupButtons);
buttonApply->setText(tr("BUT_APPLY"));
buttonApply->setAutoDefault(TRUE);
GroupButtonsLayout->addWidget(buttonApply, 0, 1);
QSpacerItem* spacer_9 = new QSpacerItem (20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
GroupButtonsLayout->addItem(spacer_9, 0, 2);
- buttonOk = new QPushButton (GroupButtons, "buttonOk");
+ buttonOk = new QPushButton (GroupButtons);
buttonOk->setText(tr("BUT_OK"));
buttonOk->setAutoDefault(TRUE);
buttonOk->setDefault(TRUE);
GroupButtonsLayout->addWidget(buttonOk, 0, 0);
- VisuGUI_ClippingDlgLayout->addMultiCellWidget(GroupPlanes, 0, 0, 0, 1);
- VisuGUI_ClippingDlgLayout->addMultiCellWidget(GroupParameters, 1, 1, 0, 1);
- VisuGUI_ClippingDlgLayout->addWidget(PreviewCheckBox, 2, 0);
- VisuGUI_ClippingDlgLayout->addWidget(AutoApplyCheckBox, 2, 1);
- VisuGUI_ClippingDlgLayout->addMultiCellWidget(GroupButtons, 3, 3, 0, 1);
-
// Initial state
VISU::RangeStepAndValidator(SpinBoxDistance, 0.0, 1.0, 0.01, 3);
VISU::RangeStepAndValidator(SpinBoxRot1, -180.0, 180.0, 1, 3);
VISU::RangeStepAndValidator(SpinBoxRot2, -180.0, 180.0, 1, 3);
- ComboBoxOrientation->insertItem(tr("PARALLEL_XOY_COMBO_ITEM"));
- ComboBoxOrientation->insertItem(tr("PARALLEL_YOZ_COMBO_ITEM"));
- ComboBoxOrientation->insertItem(tr("PARALLEL_ZOX_COMBO_ITEM"));
+ ComboBoxOrientation->addItem(tr("PARALLEL_XOY_COMBO_ITEM"));
+ ComboBoxOrientation->addItem(tr("PARALLEL_YOZ_COMBO_ITEM"));
+ ComboBoxOrientation->addItem(tr("PARALLEL_ZOX_COMBO_ITEM"));
SpinBoxDistance->setValue(0.5);
connect(SpinBoxDistance , SIGNAL(valueChanged(double)) , this, SLOT(SetCurrentPlaneParam()));
connect(SpinBoxRot1 , SIGNAL(valueChanged(double)) , this, SLOT(SetCurrentPlaneParam()));
connect(SpinBoxRot2 , SIGNAL(valueChanged(double)) , this, SLOT(SetCurrentPlaneParam()));
- connect(ButtonGroupIJKAxis , SIGNAL(clicked(int)) , this, SLOT(onIJKAxisChanged(int)));
+ connect(ButtonGroupIJKAxis , SIGNAL(buttonClicked(int)) , this, SLOT(onIJKAxisChanged(int)));
connect(SpinBoxIJKIndex , SIGNAL(valueChanged(int)) , this, SLOT(SetCurrentPlaneIJKParam()));
connect(CheckBoxIJKPlaneReverse, SIGNAL(toggled(bool)) , this, SLOT(SetCurrentPlaneIJKParam()));
connect(TabPane , SIGNAL(currentChanged (QWidget*)), this, SLOT(onTabChanged(QWidget*)));
GroupParametersLayout->setSpacing(6);
GroupParametersLayout->setMargin(11);
- TextLabelOrientation = new QLabel(GroupParameters, "TextLabelOrientation");
+ TextLabelOrientation = new QLabel(GroupParameters);
TextLabelOrientation->setText(tr("LBL_ORIENTATION"));
GroupParametersLayout->addWidget(TextLabelOrientation, 0, 0);
- ComboBoxOrientation = new QComboBox(GroupParameters, "ComboBoxOrientation");
+ ComboBoxOrientation = new QComboBox(GroupParameters);
GroupParametersLayout->addWidget(ComboBoxOrientation, 0, 1);
- TextLabelDistance = new QLabel(GroupParameters, "TextLabelDistance");
+ TextLabelDistance = new QLabel(GroupParameters);
TextLabelDistance->setText(tr("LBL_DISTANCE"));
GroupParametersLayout->addWidget(TextLabelDistance, 1, 0);
- SpinBoxDistance = new QtxDblSpinBox(GroupParameters, "SpinBoxDistance");
+ SpinBoxDistance = new QtxDoubleSpinBox(GroupParameters);
GroupParametersLayout->addWidget(SpinBoxDistance, 1, 1);
- TextLabelRot1 = new QLabel(GroupParameters, "TextLabelRot1");
+ TextLabelRot1 = new QLabel(GroupParameters);
TextLabelRot1->setText(tr("LBL_ROTATION_YZ"));
GroupParametersLayout->addWidget(TextLabelRot1, 2, 0);
- SpinBoxRot1 = new QtxDblSpinBox(GroupParameters, "SpinBoxRot1");
+ SpinBoxRot1 = new QtxDoubleSpinBox(GroupParameters);
GroupParametersLayout->addWidget(SpinBoxRot1, 2, 1);
- TextLabelRot2 = new QLabel(GroupParameters, "TextLabelRot2");
+ TextLabelRot2 = new QLabel(GroupParameters);
TextLabelRot2->setText(tr("LBL_ROTATION_XZ"));
GroupParametersLayout->addWidget(TextLabelRot2, 3, 0);
- SpinBoxRot2 = new QtxDblSpinBox(GroupParameters, "SpinBoxRot2");
+ SpinBoxRot2 = new QtxDoubleSpinBox(GroupParameters);
GroupParametersLayout->addWidget(SpinBoxRot2, 3, 1);
return GroupParameters;
IJKParametersLayout->setMargin(11);
// Axis group
- ButtonGroupIJKAxis = new QHButtonGroup (tr("GRP_IJK_AXIS"), WidgetIJKTab);
- new QRadioButton (tr("I_RADIO_BTN"), ButtonGroupIJKAxis); // 0
- new QRadioButton (tr("J_RADIO_BTN"), ButtonGroupIJKAxis); // 1
- new QRadioButton (tr("K_RADIO_BTN"), ButtonGroupIJKAxis); // 2
- ButtonGroupIJKAxis->setButton(0);
+ ButtonGroupIJKAxis = new QButtonGroup ( WidgetIJKTab);
+ //QGroupBox* aGBGroupBoxIJKAxis= new QGroupBox(tr("GRP_IJK_AXIS"), WidgetIJKTab );
+ GroupBoxIJKAxis= new QGroupBox(tr("GRP_IJK_AXIS"), WidgetIJKTab );
+ QHBoxLayout* aHBLay = new QHBoxLayout( GroupBoxIJKAxis );
+ ButtonGroupIJKAxis->addButton( new QRadioButton (tr("I_RADIO_BTN"), GroupBoxIJKAxis), 0 ); // 0
+ ButtonGroupIJKAxis->addButton( new QRadioButton (tr("J_RADIO_BTN"), GroupBoxIJKAxis), 1 ); // 1
+ ButtonGroupIJKAxis->addButton( new QRadioButton (tr("K_RADIO_BTN"), GroupBoxIJKAxis), 2 ); // 2
+ ButtonGroupIJKAxis->button(0)->setChecked(true);
+ aHBLay->addWidget( ButtonGroupIJKAxis->button(0) );
+ aHBLay->addWidget( ButtonGroupIJKAxis->button(1) );
+ aHBLay->addWidget( ButtonGroupIJKAxis->button(2) );
// Index
- TextLabelIJKIndex = new QLabel(WidgetIJKTab, "TextLabelIJKIndex");
+ TextLabelIJKIndex = new QLabel(WidgetIJKTab);
TextLabelIJKIndex->setText(tr("LBL_IJK_INDEX"));
- SpinBoxIJKIndex = new QSpinBox(WidgetIJKTab, "SpinBoxIJKIndex");
+ SpinBoxIJKIndex = new QSpinBox(WidgetIJKTab);
// Orientation
CheckBoxIJKPlaneReverse = new QCheckBox (tr("REVERSE_NORMAL_CHK"), WidgetIJKTab);
CheckBoxIJKPlaneReverse->setChecked(false);
- IJKParametersLayout->addMultiCellWidget(ButtonGroupIJKAxis, 0, 0, 0, 1);
+ IJKParametersLayout->addWidget(GroupBoxIJKAxis, 0, 0, 1, 2);
IJKParametersLayout->addWidget(TextLabelIJKIndex, 1, 0);
IJKParametersLayout->addWidget(SpinBoxIJKIndex, 1, 1);
IJKParametersLayout->addWidget(CheckBoxIJKPlaneReverse, 2, 0);
// purpose :
//=================================================================================
void VisuGUI_ClippingDlg::ClickOnApply()
+{
+ applyLocalPlanes();
+}
+
+
+//=================================================================================
+// function : applyLocalPlanes()
+// purpose :
+//=================================================================================
+void VisuGUI_ClippingDlg::applyLocalPlanes()
{
if (!myPrs3d)
return;
}
// Try to apply new clipping
- myPrs3d->RemoveAllClippingPlanes();
+ //myPrs3d->RemoveAllClippingPlanes();
+ removeAllClippingPlanes(myPrs3d);
VISU::TPlanes::iterator anIter = myPlanes.begin();
for (; anIter != myPlanes.end(); anIter++) {
if (isFailed) {
// Restore previous clipping state because of failure.
- myPrs3d->RemoveAllClippingPlanes();
+ //myPrs3d->RemoveAllClippingPlanes();
+ removeAllClippingPlanes(myPrs3d);
TPlns::iterator anOldIter = anOldPlanes.begin();
for (; anOldIter != anOldPlanes.end(); anOldIter++) {
myPrs3d->AddClippingPlane(anOldIter->GetPointer());
}
- SUIT_MessageBox::warn1(VISU::GetDesktop(myVisuGUI),
- tr("WRN_VISU"),
- tr("WRN_EMPTY_RESULTING_PRS"),
- tr("BUT_OK") );
+ SUIT_MessageBox::warning(VISU::GetDesktop(myVisuGUI),
+ tr("WRN_VISU"),
+ tr("WRN_EMPTY_RESULTING_PRS"),
+ tr("BUT_OK") );
}
//VISU::RenderViewWindow(aViewWindow);
}
}
+
+
+
//=================================================================================
// function : ClickOnOk()
// purpose :
#else
platform = "application";
#endif
- SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warning(0, QObject::tr("WRN_WARNING"),
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName),
+ QObject::tr("BUT_OK"));
}
}
if (!anIO.IsNull())
myIO = anIO;
- SetPrs3d(dynamic_cast<VISU::Prs3d_i*>(aBase));
+ //----
+ // rnv: fix for issue 0020114 (EDF VISU 918 : Impossible to
+ // create a new clipping plane on field presentation)
+ // set last visited presentation from holder as myPrs3d
+ VISU::ColoredPrs3dHolder_i* aHolder = dynamic_cast<VISU::ColoredPrs3dHolder_i*>(aBase);
+ VISU::Prs3d_i* aPrs3d = NULL;
+ if(aHolder)
+ aPrs3d = aHolder->GetPrs3dDevice();
+ else
+ aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aBase);
+ //----
+
+ SetPrs3d(aPrs3d);
if (myPrs3d) {
std::for_each(myPlanes.begin(),myPlanes.end(),TSetVisiblity(false));
myPlanes.clear();
}
// enable/disable IJK tab
- TabPane->setTabEnabled(WidgetIJKTab, isStructured());
+ TabPane->setTabEnabled(TabPane->indexOf(WidgetIJKTab), isStructured());
Sinchronize();
VISU::RenderViewWindow(aViewWindow);
}
case VISU::YZ: item = 1; break;
case VISU::ZX: item = 2; break;
}
- ComboBoxOrientation->setCurrentItem(item);
+ ComboBoxOrientation->setCurrentIndex(item);
- bool isIJK = (TabPane->currentPage() == WidgetIJKTab);
+ bool isIJK = (TabPane->currentWidget() == WidgetIJKTab);
if (isIJK)
setIJKByNonStructured();
else
if (!myPrs3d || myPlanes.empty())
return;
- int aPlaneIndex = ComboBoxPlanes->currentItem();
+ int aPlaneIndex = ComboBoxPlanes->currentIndex();
VISU::TPlanes::iterator anIter = myPlanes.begin() + aPlaneIndex;
anIter->GetPointer()->myActor->SetVisibility(false);
QString aName;
for (int i = 1; i<=aNbPlanes; i++) {
aName = QString(tr("PLANES_COMBO_ITEM_i")).arg(i);
- ComboBoxPlanes->insertItem(aName);
+ ComboBoxPlanes->addItem(aName);
}
int aPos = ComboBoxPlanes->count() - 1;
- ComboBoxPlanes->setCurrentItem(aPos);
+ ComboBoxPlanes->setCurrentIndex(aPos);
bool anIsControlsEnable = (aPos >= 0);
if (anIsControlsEnable) {
onSelectPlane(aPos);
} else {
- ComboBoxPlanes->insertItem(tr("PLANES_COMBO_ITEM_no"));
+ ComboBoxPlanes->addItem(tr("PLANES_COMBO_ITEM_no"));
SpinBoxRot1->setValue(0.0);
SpinBoxRot2->setValue(0.0);
SpinBoxDistance->setValue(0.5);
}
buttonDelete ->setEnabled(anIsControlsEnable);
- buttonApply ->setEnabled(anIsControlsEnable);
- PreviewCheckBox ->setEnabled(anIsControlsEnable);
- AutoApplyCheckBox ->setEnabled(anIsControlsEnable);
+ //buttonApply ->setEnabled(anIsControlsEnable);
+ // PreviewCheckBox ->setEnabled(anIsControlsEnable);
+ // AutoApplyCheckBox ->setEnabled(anIsControlsEnable);
ComboBoxOrientation ->setEnabled(anIsControlsEnable);
SpinBoxDistance ->setEnabled(anIsControlsEnable);
SpinBoxRot1 ->setEnabled(anIsControlsEnable);
SpinBoxRot2 ->setEnabled(anIsControlsEnable);
- ButtonGroupIJKAxis ->setEnabled(anIsControlsEnable);
+ GroupBoxIJKAxis ->setEnabled(anIsControlsEnable);
SpinBoxIJKIndex ->setEnabled(anIsControlsEnable);
CheckBoxIJKPlaneReverse->setEnabled(anIsControlsEnable);
//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
- if(myPrs3d){
+ if ( myPrs3d ) {
VISU_PipeLine* aPipeLine = myPrs3d->GetPipeLine();
VISU::PIDMapper anIDMapper = aPipeLine->GetIDMapper();
- if(anIDMapper->IsStructured()){
- VISU::TIdTypeVector aVec = anIDMapper->GetStructure();
- switch(aVec.size()){
- case 1:
- ButtonGroupIJKAxis->find(0)->setEnabled(true);
- ButtonGroupIJKAxis->find(1)->setEnabled(false);
- ButtonGroupIJKAxis->find(2)->setEnabled(false);
- break;
- case 2:
- ButtonGroupIJKAxis->find(0)->setEnabled(true);
- ButtonGroupIJKAxis->find(1)->setEnabled(true);
- ButtonGroupIJKAxis->find(2)->setEnabled(false);
- break;
- case 3:
- ButtonGroupIJKAxis->find(0)->setEnabled(true);
- ButtonGroupIJKAxis->find(1)->setEnabled(true);
- ButtonGroupIJKAxis->find(2)->setEnabled(true);
- break;
- }
+ if ( anIDMapper->IsStructured() ) {
+ VISU::TStructuredId aStructuredId = anIDMapper->GetStructure();
+ ButtonGroupIJKAxis->button(0)->setEnabled( aStructuredId[0] >= 0 );
+ ButtonGroupIJKAxis->button(1)->setEnabled( aStructuredId[1] >= 0 );
+ ButtonGroupIJKAxis->button(2)->setEnabled( aStructuredId[2] >= 0 );
}
}
//ENK: 23.11.2006
if (myPlanes.empty() || myIsSelectPlane)
return;
- int aCurPlaneIndex = ComboBoxPlanes->currentItem();
+ int aCurPlaneIndex = ComboBoxPlanes->currentIndex();
OrientedPlane* aPlane = myPlanes[aCurPlaneIndex].GetPointer();
aV[0] = aRot[0] > 0? aV[0]: -aV[0];
aV[1] = aRot[1] > 0? aV[1]: -aV[1];
- switch (ComboBoxOrientation->currentItem()) {
+ switch (ComboBoxOrientation->currentIndex()) {
case 0:
anOrientation = VISU::XY;
setIJKByNonStructured();
else {
// set correct labels of rotation spin boxes
- onSelectOrientation(ComboBoxOrientation->currentItem());
+ onSelectOrientation(ComboBoxOrientation->currentIndex());
}
}
return;
// get axis data
- int i, axId = ButtonGroupIJKAxis->id (ButtonGroupIJKAxis->selected());
+ int i, axId = ButtonGroupIJKAxis->id (ButtonGroupIJKAxis->checkedButton());
VISU::Result_i::TAxis axis = (VISU::Result_i::TAxis) axId;
gp_Dir dir;
CORBA::String_var aMeshName = myPrs3d->GetMeshName();
// set paramerets
myIsSelectPlane = true;
- ComboBoxOrientation->setCurrentItem(axId);
+ ComboBoxOrientation->setCurrentIndex(axId);
setRotation(-angle[0], -angle[1]);
setDistance(distance);
myIsSelectPlane = false;
return;
// get plane normal
- int planeIndex = ComboBoxPlanes->currentItem();
+ int planeIndex = ComboBoxPlanes->currentIndex();
OrientedPlane* plane = myPlanes[ planeIndex ].GetPointer();
vtkPlaneSource* planeSource = plane->myPlaneSource;
vtkFloatingPointType * planeNormal = planeSource->GetNormal();
int aNbAxes = 3;
VISU_PipeLine* aPipeLine = myPrs3d->GetPipeLine();
VISU::PIDMapper anIDMapper = aPipeLine->GetIDMapper();
- if(anIDMapper->IsStructured() && !anIDMapper->myType)
- aNbAxes = (anIDMapper->GetStructure()).size();
+ if ( anIDMapper->IsStructured() && !anIDMapper->myIsPolarType )
+ aNbAxes = anIDMapper->GetStructureDim();
for (i = 0; i < aNbAxes; ++i) {
VISU::Result_i::TAxis axis = (VISU::Result_i::TAxis) i;
CORBA::String_var aMeshName = myPrs3d->GetMeshName();
myIsSelectPlane = true;
CheckBoxIJKPlaneReverse->setChecked(normal * axDir < 0);
SpinBoxIJKIndex->setValue(i);
- ButtonGroupIJKAxis->setButton(gridAxId);
+ ButtonGroupIJKAxis->button(gridAxId)->setChecked( true );
onIJKAxisChanged(gridAxId); // update label and range of index
myIsSelectPlane = false;
if ( e->isAccepted() )
return;
- if ( e->key() == Key_F1 )
+ if ( e->key() == Qt::Key_F1 )
{
e->accept();
ClickOnHelp();
} else
return;
}
+
+
+void VisuGUI_ClippingDlg::removeAllClippingPlanes(VISU::Prs3d_i* thePrs)
+{
+ for (int i = thePrs->GetNumberOfClippingPlanes() - 1; i >= 0 ; i--) {
+ OrientedPlane* aPlane = dynamic_cast<OrientedPlane*>(thePrs->GetClippingPlane(i));
+ if (aPlane)
+ thePrs->RemoveClippingPlane(i);
+ }
+}
+
+