// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include "SUIT_ViewWindow.h"
#include "SVTK_ViewWindow.h"
#include "SVTK_ViewModel.h"
+
#include "OCCViewer_ViewWindow.h"
#include "OCCViewer_ViewPort3d.h"
#include <qcombobox.h>
// VTK Includes
+#include "VTKViewer.h"
#include <vtkCamera.h>
#include <vtkRenderer.h>
// class : OperationGUI_ClippingDlg()
// purpose :
//=================================================================================
-OperationGUI_ClippingDlg::OperationGUI_ClippingDlg( QWidget* parent, const char* name, bool modal, WFlags fl )
- : GEOMBase_Skeleton( parent, "OperationGUI_ClippingDlg", false,
- WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+OperationGUI_ClippingDlg::OperationGUI_ClippingDlg(GeometryGUI* theGeometryGUI, QWidget* parent)
+ : GEOMBase_Skeleton(theGeometryGUI, parent, "OperationGUI_ClippingDlg", false,
+ WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
{
setCaption( tr( "Change clipping range" ) );
-
+
GroupConstructors->close();
GroupBoxName->close();
GroupArgumentsLayout->setAlignment( Qt::AlignTop );
GroupArgumentsLayout->setSpacing( 6 );
GroupArgumentsLayout->setMargin( 11 );
-
+
// Controls
TextLabelNear = new QLabel( GroupArguments, "TextLabelNear" );
TextLabelNear->setText( tr( "Near" ) );
TextLabelFar->setText( tr( "Far" ) );
TextLabelFar->setFixedWidth(74);
GroupArgumentsLayout->addWidget( TextLabelFar, 0, 2 );
-
+
SpinBox_Far = new DlgRef_SpinBox( GroupArguments, "SpinBox_Far");
GroupArgumentsLayout->addWidget( SpinBox_Far, 0, 3 );
-
+
resetButton = new QPushButton( GroupArguments, "resetButton" );
resetButton->setText( tr( "Reset" ) );
GroupArgumentsLayout->addWidget( resetButton, 0, 4 );
TypeCB->insertItem(tr("FRONT"));
TypeCB->insertItem(tr("SLICE"));
GroupArgumentsLayout->addMultiCellWidget( TypeCB, 1, 1, 0, 4 );
-
+
Layout1->addWidget( GroupArguments, 2, 0 );
-
+
/* Initialisations */
SpinBox_Near->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 );
SpinBox_Far->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 );
-
- //GeometryGUI* aGeomGUI = GeometryGUI::GetGeomGUI();
-
+
/* signals and slots connections */
- connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
- connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ;
- connect( buttonApply, SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
-
+ connect( buttonOk , SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
+ connect( buttonApply, SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
+
connect( resetButton, SIGNAL (clicked() ), this, SLOT( onReset() ) ) ;
-
- // connect( aGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( onDeactivate() ) ) ;
- //connect( aGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ;
+
+ setHelpFileName("none.htm");
Init();
}
// no need to delete child widgets, Qt does it all for us
}
-
//=================================================================================
// function : Init()
// purpose :
double position[3];
anActiveCamera->GetPosition(position);
- float bounds[6];
+ vtkFloatingPointType bounds[6];
aRenderer->ComputeVisiblePropBounds(bounds);
double center[3];
(position[1]-center[1])*(position[1]-center[1]) +
(position[2]-center[2])*(position[2]-center[2]));
- float range[2] = {distance - width/2.0, distance + width/2.0};
+ vtkFloatingPointType range[2] = {distance - width/2.0, distance + width/2.0};
SpinBox_Near->SetValue(range[0]);
SpinBox_Far->SetValue(range[1]);
return false;
}
- float range[2] = { SpinBox_Near->GetValue(), SpinBox_Far->GetValue() };
+ vtkFloatingPointType range[2] = { SpinBox_Near->GetValue(), SpinBox_Far->GetValue() };
if (range[0] < 0.0) range[0] = 0.0;
anActiveCamera->SetClippingRange( range );
ClickOnCancel();
}
-
-//=================================================================================
-// function : ClickOnCancel()
-// purpose :
-//=================================================================================
-void OperationGUI_ClippingDlg::ClickOnCancel()
-{
- GEOMBase_Skeleton::ClickOnCancel();
-}
-
-
//=================================================================================
// function : onActivate()
// purpose :
GEOMBase_Skeleton::ActivateThisDialog();
}
-
-//=================================================================================
-// function : onDeactivate()
-// purpose : public slot to deactivate if active
-//=================================================================================
-void OperationGUI_ClippingDlg::DeactivateActiveDialog()
-{
- return;
-}
-
//=================================================================================
// function : enterEvent()
// purpose :
//=================================================================================
-void OperationGUI_ClippingDlg::enterEvent(QEvent* e)
+void OperationGUI_ClippingDlg::enterEvent(QEvent*)
{
this->setEnabled(true);
return;
}
-
//=================================================================================
// function : closeEvent
// purpose :
QDialog::closeEvent( e );
}
-
//=================================================================================
// function : onReset()
// purpose :
//=================================================================================
void OperationGUI_ClippingDlg::onReset()
{
- SUIT_ViewWindow* anActiveWindow = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
+ SUIT_ViewWindow* anActiveWindow =
+ SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
if (!anActiveWindow)
return;
double position[3];
anActiveCamera->GetPosition(position);
- float bounds[6];
+ vtkFloatingPointType bounds[6];
aRenderer->ComputeVisiblePropBounds(bounds);
double center[3];
(position[1]-center[1])*(position[1]-center[1]) +
(position[2]-center[2])*(position[2]-center[2]));
- float range[2] = {distance - width/2.0, distance + width/2.0};
+ vtkFloatingPointType range[2] = {distance - width/2.0, distance + width/2.0};
SpinBox_Near->SetValue(range[0]);
SpinBox_Far->SetValue(range[1]);
TypeCB->setCurrentItem(ztype);
}
-
-
return;
}