# VSR: this is the original packages list
# SUBDIRS += SVTK
# VSR: already migrated to Qt4 packages
- SUBDIRS +=
+ SUBDIRS += SVTK
endif
endif
if ENABLE_OCCVIEWER
//
#include "OCCViewer_ClippingDlg.h"
-#include <QtxDblSpinBox.h>
+#include <QtxDoubleSpinBox.h>
#include <QtxAction.h>
#include "SUIT_Session.h"
const double max = 1e+16;
const double step = 5;
const int precision = -6; // PAL12789. Minus is for using 'g' double->string conversion specifier,
- // see QtxDblSpinBox::mapValueToText( double v )
+ // see QtxDoubleSpinBox::mapValueToText( double v )
TextLabelX = new QLabel( GroupPoint );
TextLabelX->setObjectName( "TextLabelX" );
TextLabelX->setText( tr("X:") );
GroupPointLayout->addWidget( TextLabelX, 0, 0 );
- SpinBox_X = new QtxDblSpinBox( min, max, step, GroupPoint, "SpinBox_X" );
- SpinBox_X->setPrecision( precision );
+ SpinBox_X = new QtxDoubleSpinBox( min, max, step, GroupPoint );
+ SpinBox_X->setObjectName("SpinBox_X" );
+ SpinBox_X->setDecimals( precision );
GroupPointLayout->addWidget( SpinBox_X, 0, 1 );
TextLabelY = new QLabel( GroupPoint );
TextLabelY->setText( tr("Y:") );
GroupPointLayout->addWidget( TextLabelY, 0, 2 );
- SpinBox_Y = new QtxDblSpinBox( min, max, step, GroupPoint, "SpinBox_Y" );
- SpinBox_Y->setPrecision( precision );
+ SpinBox_Y = new QtxDoubleSpinBox( min, max, step, GroupPoint );
+ SpinBox_Y->setObjectName("SpinBox_Y" );
+ SpinBox_Y->setDecimals( precision );
GroupPointLayout->addWidget( SpinBox_Y, 0, 3 );
TextLabelZ = new QLabel( GroupPoint );
TextLabelZ->setText( tr("Z:") );
GroupPointLayout->addWidget( TextLabelZ, 0, 4 );
- SpinBox_Z = new QtxDblSpinBox( min, max, step, GroupPoint, "SpinBox_Z" );
- SpinBox_Z->setPrecision( precision );
+ SpinBox_Z = new QtxDoubleSpinBox( min, max, step, GroupPoint );
+ SpinBox_Z->setObjectName("SpinBox_Z" );
+ SpinBox_Z->setDecimals( precision );
GroupPointLayout->addWidget( SpinBox_Z, 0, 5 );
resetButton = new QPushButton( GroupPoint );
TextLabelDx->setText( tr("Dx:") );
GroupDirectionLayout->addWidget( TextLabelDx, 0, 0 );
- SpinBox_Dx = new QtxDblSpinBox( min, max, step, GroupDirection, "SpinBox_Dx" );
- SpinBox_Dx->setPrecision( precision );
+ SpinBox_Dx = new QtxDoubleSpinBox( min, max, step, GroupDirection );
+ SpinBox_Dx->setObjectName("SpinBox_Dx" );
+ SpinBox_Dx->setDecimals( precision );
GroupDirectionLayout->addWidget( SpinBox_Dx, 0, 1 );
TextLabelDy = new QLabel( GroupDirection );
TextLabelDy->setText( tr("Dy:") );
GroupDirectionLayout->addWidget( TextLabelDy, 0, 2 );
- SpinBox_Dy = new QtxDblSpinBox( min, max, step, GroupDirection, "SpinBox_Dy" );
- SpinBox_Dy->setPrecision( precision );
+ SpinBox_Dy = new QtxDoubleSpinBox( min, max, step, GroupDirection );
+ SpinBox_Dy->setObjectName("SpinBox_Dy" );
+ SpinBox_Dy->setDecimals( precision );
GroupDirectionLayout->addWidget( SpinBox_Dy, 0, 3 );
TextLabelDz = new QLabel( GroupDirection );
TextLabelDz->setText( tr("Dz:") );
GroupDirectionLayout->addWidget( TextLabelDz, 0, 4 );
- SpinBox_Dz = new QtxDblSpinBox( min, max, step, GroupDirection, "SpinBox_Dz" );
- SpinBox_Dz->setPrecision( precision );
+ SpinBox_Dz = new QtxDoubleSpinBox( min, max, step, GroupDirection );
+ SpinBox_Dz->setObjectName("SpinBox_Dz" );
+ SpinBox_Dz->setDecimals( precision );
GroupDirectionLayout->addWidget( SpinBox_Dz, 0, 5 );
invertButton = new QPushButton( GroupDirection );
class QPushButton;
class QComboBox;
class QCheckBox;
-class QtxDblSpinBox;
+class QtxDoubleSpinBox;
class QtxAction;
class OCCViewer_ViewWindow;
QLabel* TextLabelX;
QLabel* TextLabelY;
QLabel* TextLabelZ;
- QtxDblSpinBox* SpinBox_X;
- QtxDblSpinBox* SpinBox_Y;
- QtxDblSpinBox* SpinBox_Z;
+ QtxDoubleSpinBox* SpinBox_X;
+ QtxDoubleSpinBox* SpinBox_Y;
+ QtxDoubleSpinBox* SpinBox_Z;
QPushButton* resetButton;
QGroupBox* GroupDirection;
QLabel* TextLabelDx;
QLabel* TextLabelDy;
QLabel* TextLabelDz;
- QtxDblSpinBox* SpinBox_Dx;
- QtxDblSpinBox* SpinBox_Dy;
- QtxDblSpinBox* SpinBox_Dz;
+ QtxDoubleSpinBox* SpinBox_Dx;
+ QtxDoubleSpinBox* SpinBox_Dy;
+ QtxDoubleSpinBox* SpinBox_Dz;
QPushButton* invertButton;
QComboBox* DirectionCB;
$(QT_INCLUDES) \
$(CAS_CPPFLAGS) \
$(VTK_INCLUDES) \
- $(QWT_INCLUDES) \
$(BOOST_CPPFLAGS) \
-I$(srcdir)/../Qtx -I$(srcdir)/../SUIT -I$(srcdir)/../STD \
-I$(srcdir)/../CAM -I$(srcdir)/../OBJECT -I$(srcdir)/../Prs \
libSVTK_la_LDFLAGS= \
$(QT_MT_LIBS) \
$(OCC_LIBS) \
- $(QWT_LIBS) \
$(VTK_LIBS)
libSVTK_la_LIBADD= ../Qtx/libqtx.la ../SUIT/libsuit.la ../STD/libstd.la \
#include "SALOME_Actor.h"
+#include "SALOME_InteractiveObject.hxx"
#include "VTKViewer_Transform.h"
#include "VTKViewer_TransformFilter.h"
#include "SVTK_Selector.h"
#include "SVTK.h"
-#include "SALOME_InteractiveObject.hxx"
+class Handle(SALOME_InteractiveObject);
// undefining min and max because CASCADE's defines them and
// it clashes with std::min(), std::max()
--- /dev/null
+TEMPLATE = lib
+TARGET = SVTK
+DESTDIR = ../../lib
+MOC_DIR = ../../moc
+OBJECTS_DIR = ../../obj/$$TARGET
+
+VTKHOME = $$(VTKHOME)
+VTK_INCLUDES = $${VTKHOME}/include/vtk
+
+VTK_LIBS = -L$${VTKHOME}/lib/vtk -L$${VTKHOME}/lib/vtk/python -lvtkCommon -lvtkGraphics -lvtkImaging -lvtkFiltering -lvtkIO -lvtkRendering -lvtkHybrid -lvtkParallel -lvtkWidgets -lGL -L/usr/X11R6/lib -lGLU -L/usr/X11R6/lib -lX11 -lXt
+
+CASROOT = $$(CASROOT)
+CAS_CPPFLAGS = $${CASROOT}/inc
+
+BOOST_CPPFLAGS = $$(BOOSTDIR)/include
+
+OCC_LIBS =
+
+INCLUDEPATH += ../../include $${CAS_CPPFLAGS} $${VTK_INCLUDES} $${BOOST_CPPFLAGS} ../Qtx ../SUIT ../STD ../CAM ../OBJECT ../Prs ../VTKViewer
+LIBS += -L../../lib -lqtx -lsuit -lstd -lCAM -lSalomeObject -lSalomePrs -lVTKViewer $${OCC_LIBS} $${VTK_LIBS}
+
+CONFIG -= debug release debug_and_release
+CONFIG += qt thread debug dll shared
+
+win32:DEFINES += WIN32
+DEFINES += SVTK_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
+
+HEADERS = SVTK.h
+HEADERS += SVTK_Prs.h
+HEADERS += SVTK_Actor.h
+HEADERS += SALOME_Actor.h
+HEADERS += SVTK_RectPicker.h
+HEADERS += SVTK_DeviceActor.h
+HEADERS += SVTK_DialogBase.h
+HEADERS += SVTK_FontWidget.h
+HEADERS += SVTK_CubeAxesActor2D.h
+HEADERS += SVTK_Functor.h
+HEADERS += SVTK_MainWindow.h
+HEADERS += SVTK_View.h
+HEADERS += SVTK_ViewManager.h
+HEADERS += SVTK_ViewModel.h
+HEADERS += SVTK_ViewWindow.h
+HEADERS += SVTK_Renderer.h
+HEADERS += SVTK_InteractorStyle.h
+HEADERS += SVTK_RenderWindowInteractor.h
+HEADERS += SVTK_GenericRenderWindowInteractor.h
+HEADERS += SVTK_Selector.h
+HEADERS += SVTK_Selection.h
+HEADERS += SVTK_SelectionEvent.h
+HEADERS += SVTK_SpaceMouse.h
+HEADERS += SVTK_Event.h
+HEADERS += SVTK_ViewModelBase.h
+HEADERS += SVTK_SetRotationPointDlg.h
+HEADERS += SVTK_Extension.h
+
+SOURCES = SVTK_Prs.cxx
+SOURCES += SVTK_Actor.cxx
+SOURCES += SALOME_Actor.cxx
+SOURCES += SVTK_RectPicker.cxx
+SOURCES += SVTK_DeviceActor.cxx
+SOURCES += SVTK_CubeAxesActor2D.cxx
+SOURCES += SVTK_NonIsometricDlg.cxx
+SOURCES += SVTK_UpdateRateDlg.cxx
+SOURCES += SVTK_CubeAxesDlg.cxx
+SOURCES += SVTK_DialogBase.cxx
+SOURCES += SVTK_FontWidget.cxx
+SOURCES += SVTK_Trihedron.cxx
+SOURCES += SVTK_MainWindow.cxx
+SOURCES += SVTK_View.cxx
+SOURCES += SVTK_ViewManager.cxx
+SOURCES += SVTK_ViewModel.cxx
+SOURCES += SVTK_Renderer.cxx
+SOURCES += SVTK_ViewWindow.cxx
+SOURCES += SVTK_InteractorStyle.cxx
+SOURCES += SVTK_RenderWindowInteractor.cxx
+SOURCES += SVTK_GenericRenderWindowInteractor.cxx
+SOURCES += SVTK_SpaceMouse.cxx
+SOURCES += SVTK_Selector.cxx
+SOURCES += SVTK_SetRotationPointDlg.cxx
+SOURCES += SVTK_Extension.cxx
+
+TRANSLATIONS = resources/SVTK_images.ts \
+ resources/SVTK_msg_en.ts
+
+ICONS = resources/*.png
+
+includes.files = $$HEADERS
+includes.path = ../../include
+
+resources.files = $$ICONS resources/*.qm
+resources.path = ../../resources
+
+INSTALLS += includes resources
#include "SVTK_Actor.h"
#include "SALOME_Actor.h"
+#include "SALOME_InteractiveObject.hxx"
+
// VTK Includes
#include <vtkObjectFactory.h>
#include <vtkUnstructuredGrid.h>
#include "QtxAction.h"
#include "QtxIntSpinBox.h"
-#include <qlayout.h>
-#include <qframe.h>
-#include <qpushbutton.h>
-#include <qtabwidget.h>
-#include <qcheckbox.h>
-#include <qgroupbox.h>
-#include <qlineedit.h>
-#include <qlabel.h>
-#include <qobjectlist.h>
-#include <qvalidator.h>
+#include <QHBoxLayout>
+#include <QVBoxLayout>
+#include <QPushButton>
+#include <QTabWidget>
+#include <QCheckBox>
+#include <QGroupBox>
+#include <QLineEdit>
+#include <QLabel>
#include <vtkAxisActor2D.h>
#include <vtkTextProperty.h>
SVTK_AxisWidget::SVTK_AxisWidget (QWidget* theParent)
: QFrame(theParent)
{
- QValueList< QLabel* > aLabels;
+ QList< QLabel* > aLabels;
// "Name" grp
- myNameGrp = new QGroupBox(3, Qt::Vertical, tr("AXIS_NAME"), this);
+ myNameGrp = new QGroupBox(tr("AXIS_NAME"), this);
+ QVBoxLayout* aVBox = new QVBoxLayout;
+
myIsNameVisible = new QCheckBox(tr("IS_VISIBLE"), myNameGrp);
+ aVBox->addWidget(myIsNameVisible);
- QHBox* aHBox = new QHBox(myNameGrp);
+ QHBoxLayout* aHBox = new QHBoxLayout(myNameGrp);
aHBox->setSpacing(5);
- QLabel* aLabel = new QLabel(tr("NAME"), aHBox);
- myAxisName = new QLineEdit(aHBox);
+ QLabel* aLabel = new QLabel(tr("NAME"));
+ aHBox->addWidget(aLabel);
+ myAxisName = new QLineEdit;
+ aHBox->addWidget(myAxisName);
aLabels.append(aLabel);
+ aVBox->addLayout(aHBox);
- aHBox = new QHBox(myNameGrp);
+ aHBox = new QHBoxLayout(myNameGrp);
aHBox->setSpacing(5);
- aLabel = new QLabel(tr("FONT"), aHBox);
- myNameFont = new SVTK_FontWidget(aHBox);
+ aLabel = new QLabel(tr("FONT"));
+ aHBox->addWidget(aLabel);
+ myNameFont = new SVTK_FontWidget(myNameGrp);
+ aHBox->addWidget(myNameFont);
aLabels.append(aLabel);
+ aVBox->addLayout(aHBox);
+ myNameGrp->setLayout(aVBox);
// "Labels" grp
- myLabelsGrp = new QGroupBox(4, Qt::Vertical, tr("LABELS"), this);
+ myLabelsGrp = new QGroupBox(tr("LABELS"), this);
+ aVBox = new QVBoxLayout;
+
myIsLabelsVisible = new QCheckBox(tr("IS_VISIBLE"), myLabelsGrp);
+ aVBox->addWidget(myIsLabelsVisible);
- aHBox = new QHBox(myLabelsGrp);
+ aHBox = new QHBoxLayout(myLabelsGrp);
aHBox->setSpacing(5);
- aLabel = new QLabel(tr("NUMBER"), aHBox);
- myLabelNumber = new QtxIntSpinBox(0,25,1,aHBox,"SpinBoxLabelNumber");
+ aLabel = new QLabel(tr("NUMBER"));
+ aHBox->addWidget(aLabel);
+ myLabelNumber = new QtxIntSpinBox(0,25,1,myLabelsGrp);
+ myLabelNumber->setObjectName("SpinBoxLabelNumber");
+ aHBox->addWidget(myLabelNumber);
aLabels.append(aLabel);
+ aVBox->addLayout(aHBox);
- aHBox = new QHBox(myLabelsGrp);
+ aHBox = new QHBoxLayout(myLabelsGrp);
aHBox->setSpacing(5);
- aLabel = new QLabel(tr("OFFSET"), aHBox);
- myLabelOffset = new QtxIntSpinBox(0,100,1,aHBox,"SpinBoxLabellOffset");
+ aLabel = new QLabel(tr("OFFSET"));
+ aHBox->addWidget(aLabel);
+ myLabelOffset = new QtxIntSpinBox(0,100,1,myLabelsGrp);
+ myLabelOffset->setObjectName("SpinBoxLabellOffset");
+ aHBox->addWidget(myLabelOffset);
aLabels.append(aLabel);
+ aVBox->addLayout(aHBox);
- aHBox = new QHBox(myLabelsGrp);
+ aHBox = new QHBoxLayout(myLabelsGrp);
aHBox->setSpacing(5);
- aLabel = new QLabel(tr("FONT"), aHBox);
- myLabelsFont = new SVTK_FontWidget(aHBox);
+ aLabel = new QLabel(tr("FONT"));
+ aHBox->addWidget(aLabel);
+ myLabelsFont = new SVTK_FontWidget(myLabelsGrp);
+ aHBox->addWidget(myLabelsFont);
aLabels.append(aLabel);
+ aVBox->addLayout(aHBox);
+
+ myLabelsGrp->setLayout(aVBox);
// "Tick marks" grp
- myTicksGrp = new QGroupBox(2, Qt::Vertical, tr("TICK_MARKS"), this);
+ myTicksGrp = new QGroupBox(tr("TICK_MARKS"), this);
+ aVBox = new QVBoxLayout;
+
myIsTicksVisible = new QCheckBox(tr("IS_VISIBLE"), myTicksGrp);
+ aVBox->addWidget(myIsTicksVisible);
- aHBox = new QHBox(myTicksGrp);
+ aHBox = new QHBoxLayout(myTicksGrp);
aHBox->setSpacing(5);
- aLabel = new QLabel(tr("LENGTH"), aHBox);
- myTickLength = new QtxIntSpinBox(0,100,1,aHBox,"SpinBoxTickLength");
-
+ aLabel = new QLabel(tr("LENGTH"));
+ aHBox->addWidget(aLabel);
+ myTickLength = new QtxIntSpinBox(0,100,1,myTicksGrp);
+ myTickLength->setObjectName("SpinBoxTickLength");
+ aHBox->addWidget(myTickLength);
aLabels.append(aLabel);
+ aVBox->addLayout(aHBox);
+
+ myTicksGrp->setLayout(aVBox);
// Layout
- QVBoxLayout* aLay = new QVBoxLayout(this, 0, 5);
+ QVBoxLayout* aLay = new QVBoxLayout(this);
+ aLay->setMargin(0);
+ aLay->setSpacing(5);
aLay->addWidget(myNameGrp);
aLay->addWidget(myLabelsGrp);
aLay->addWidget(myTicksGrp);
updateControlState();
// Adjust label widths
- QValueList< QLabel* >::iterator anIter;
+ QList< QLabel* >::iterator anIter;
int aMaxWidth = 0;
for (anIter = aLabels.begin(); anIter != aLabels.end(); anIter++)
- aMaxWidth = QMAX(aMaxWidth, (*anIter)->sizeHint().width());
+ aMaxWidth = qMax(aMaxWidth, (*anIter)->sizeHint().width());
for (anIter = aLabels.begin(); anIter != aLabels.end(); anIter++)
(*anIter)->setFixedWidth(aMaxWidth);
void SVTK_AxisWidget::setEnabled(QGroupBox* theGrp, const bool theState)
{
- QObjectList aChildren(*theGrp->children());
+ QObjectList aChildren(theGrp->children());
QObject* anObj;
- for(anObj = aChildren.first(); anObj !=0; anObj = aChildren.next())
- if (anObj !=0 && anObj->inherits("QHBox"))
- ((QHBox*)anObj)->setEnabled(theState);
+ for(int i = 0; i < aChildren.size(); i++)
+ {
+ anObj = aChildren.at(i);
+ if (anObj !=0 && anObj->inherits("QHBoxLayout"))
+ ((QHBoxLayout*)anObj)->setEnabled(theState);
+ }
}
void SVTK_AxisWidget::onLabelsChecked()
// Name
theActor->SetTitleVisibility(myIsNameVisible->isChecked() ? 1 : 0);
- theActor->SetTitle(myAxisName->text().latin1());
+ theActor->SetTitle(myAxisName->text().toLatin1());
QColor aTitleColor(255, 255, 255);
int aTitleFontFamily = VTK_ARIAL;
theName),
myMainWindow(theParent)
{
- setCaption(tr("CAPTION"));
+ setWindowTitle(tr("CAPTION"));
- QVBoxLayout* aLay = new QVBoxLayout(this, 5, 5);
+ QVBoxLayout* aLay = new QVBoxLayout(this);
+ aLay->setMargin(5);
+ aLay->setSpacing(5);
aLay->addWidget(createMainFrame(this));
aLay->addWidget(createButtonFrame(this));
myTabWg->addTab(myAxes[ 1 ], tr("Y_AXIS"));
myTabWg->addTab(myAxes[ 2 ], tr("Z_AXIS"));
- myTabWg->setMargin(5);
+ myTabWg->setContentsMargins(5,5,5,5);
myIsVisible = new QCheckBox(tr("IS_VISIBLE"), aFrame);
- QVBoxLayout* aLay = new QVBoxLayout(aFrame, 0, 5);
+ QVBoxLayout* aLay = new QVBoxLayout(aFrame);
+ aLay->setMargin(0);
+ aLay->setSpacing(5);
aLay->addWidget(myTabWg);
aLay->addWidget(myIsVisible);
QSpacerItem* aSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
- QHBoxLayout* aLay = new QHBoxLayout(aFrame, 5, 5);
+ QHBoxLayout* aLay = new QHBoxLayout(aFrame);
+ aLay->setMargin(5);
+ aLay->setSpacing(5);
aLay->addWidget(myOkBtn);
aLay->addWidget(myApplyBtn);
#include "SVTK_DialogBase.h"
-#include <qframe.h>
+#include <QFrame>
class QWidget;
-class QFrame;
class QPushButton;
class QTabWidget;
class QCheckBox;
QWidget* theParent,
const char* theName,
bool theModal,
- WFlags theWFalgs):
+ Qt::WindowFlags theWFalgs):
QDialog(theParent,
- theName,
- theModal,
- theWFalgs | WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
+ theWFalgs | Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
myAction(theAction)
{
+ setObjectName(theName);
+ setModal(theModal);
+
connect(theParent, SIGNAL(Show( QShowEvent * )), this, SLOT(onParentShow()));
connect(theParent, SIGNAL(Hide( QHideEvent * )), this, SLOT(onParentHide()));
}
SVTK_DialogBase
::onParentShow()
{
- if(myAction->isOn())
+ if(myAction->isChecked())
show();
else
hide();
SVTK_DialogBase
::done( int r )
{
- myAction->setOn( false );
+ myAction->setChecked( false );
QDialog::done( r );
}
#include "SVTK.h"
-#include <qdialog.h>
+#include <QDialog>
class QtxAction;
QWidget* theParent,
const char* theName = "",
bool theModal = FALSE,
- WFlags theWFalgs = 0);
+ Qt::WindowFlags theWFalgs = 0);
~SVTK_DialogBase();
#include "SVTK_FontWidget.h"
-#include <qtoolbutton.h>
-#include <qcombobox.h>
-#include <qcolordialog.h>
-#include <qcheckbox.h>
+#include <QToolButton>
+#include <QComboBox>
+#include <QColorDialog>
+#include <QCheckBox>
+#include <QHBoxLayout>
#include <vtkTextProperty.h>
Constructor
*/
SVTK_FontWidget::SVTK_FontWidget( QWidget* theParent )
-: QHBox( theParent )
+: QWidget( theParent )
{
- setSpacing( 5 );
myColorBtn = new QToolButton( this );
myColorBtn->setMinimumWidth( 20 );
myFamily = new QComboBox( this );
- myFamily->insertItem( tr( "ARIAL" ) );
- myFamily->insertItem( tr( "COURIER" ) );
- myFamily->insertItem( tr( "TIMES" ) );
+ myFamily->insertItem( myFamily->count(), tr( "ARIAL" ) );
+ myFamily->insertItem( myFamily->count(), tr( "COURIER" ) );
+ myFamily->insertItem( myFamily->count(), tr( "TIMES" ) );
myBold = new QCheckBox( tr( "BOLD" ), this );
myItalic = new QCheckBox( tr( "ITALIC" ), this );
myShadow = new QCheckBox( tr( "SHADOW" ), this );
+ QHBoxLayout* aHBLayout = new QHBoxLayout;
+ aHBLayout->setSpacing( 5 );
+ aHBLayout->addWidget(myColorBtn);
+ aHBLayout->addWidget(myFamily);
+ aHBLayout->addWidget(myBold);
+ aHBLayout->addWidget(myItalic);
+ aHBLayout->addWidget(myShadow);
+ this->setLayout(aHBLayout);
+
connect( myColorBtn, SIGNAL( clicked() ), SLOT( onColor() ) );
}
void SVTK_FontWidget::SetColor( const QColor& theColor )
{
- myColorBtn->setPaletteBackgroundColor( theColor );
+ QPalette palette;
+ palette.setColor(myColorBtn->backgroundRole(), theColor);
+ myColorBtn->setPalette(palette);
}
QColor SVTK_FontWidget::GetColor() const
{
- return myColorBtn->paletteBackgroundColor();
+ return myColorBtn->palette().color( myColorBtn->backgroundRole() );
}
void SVTK_FontWidget::onColor()
SetColor( theColor );
if ( theFamily == VTK_ARIAL )
- myFamily->setCurrentItem( 0 );
+ myFamily->setCurrentIndex( 0 );
else if ( theFamily == VTK_COURIER )
- myFamily->setCurrentItem( 1 );
+ myFamily->setCurrentIndex( 1 );
else
- myFamily->setCurrentItem( 2 );
+ myFamily->setCurrentIndex( 2 );
myBold->setChecked( theBold );
myItalic->setChecked( theItalic );
{
theColor = GetColor();
- int anItem =myFamily->currentItem();
+ int anItem =myFamily->currentIndex();
if ( anItem == 0 )
theFamily = VTK_ARIAL;
else if ( anItem == 1 )
#include "SVTK.h"
-#include <qhbox.h>
+#include <QWidget>
class QToolButton;
class QComboBox;
* Class : SVTK_FontWidget
* Description : Dialog for specifynig font
*/
-class SVTK_EXPORT SVTK_FontWidget : public QHBox
+class SVTK_EXPORT SVTK_FontWidget : public QWidget
{
Q_OBJECT
#include <vtkObjectFactory.h>
#include <vtkCommand.h>
-#include <qtimer.h>
+#include <QTimer>
using namespace std;
// Start a one-shot timer for <DELAY> ms.
//
static int DELAY = 1;
- myTimer->start(DELAY,TRUE);
+ myTimer->setSingleShot(TRUE);
+ myTimer->start(DELAY);
return 1;
}
#include "SVTK.h"
-#include <qobject.h>
+#include <QObject>
#include <vtkGenericRenderWindowInteractor.h>
#include <vtkSmartPointer.h>
class QWidget;
class SVTK_Selector;
-class SVTK_Renderer;
+//class SVTK_Renderer;
#ifdef WIN32
#pragma warning ( disable:4251 )
#include <vtkPerspectiveTransform.h>
#include <vtkMatrix4x4.h>
-#include <qapplication.h>
-#include <qpixmap.h>
-#include <qpainter.h>
+#include <QPixmap>
+#include <QWidget>
+#include <QRubberBand>
#include <algorithm>
#include <iostream>
myLastPreHighlitedActor(NULL),
myControllerIncrement(SVTK_ControllerIncrement::New()),
myControllerOnKeyDown(SVTK_ControllerOnKeyDown::New()),
- myHighlightRotationPointActor(SVTK_Actor::New())
+ myHighlightRotationPointActor(SVTK_Actor::New()),
+ myRectBand(0)
{
myPicker->Delete();
myPointPicker->Delete();
SVTK_InteractorStyle
::~SVTK_InteractorStyle()
{
+ endDrawRect();
}
/*!
case VTK_INTERACTOR_STYLE_CAMERA_SELECT:
case VTK_INTERACTOR_STYLE_CAMERA_FIT:
{
- QPainter p(GetRenderWidget());
- p.setPen(Qt::lightGray);
- p.setRasterOp(Qt::XorROP);
- p.drawRect(QRect(myPoint, myOtherPoint));
+ drawRect();
break;
}
case VTK_INTERACTOR_STYLE_CAMERA_ZOOM:
case VTK_INTERACTOR_STYLE_CAMERA_SELECT:
case VTK_INTERACTOR_STYLE_CAMERA_FIT:
{
- QPainter aPainter(GetRenderWidget());
- aPainter.setPen(Qt::lightGray);
- aPainter.setRasterOp(Qt::XorROP);
+ endDrawRect();
QRect aRect(myPoint, myOtherPoint);
- aPainter.drawRect(aRect);
- aRect = aRect.normalize();
+ aRect = aRect.normalized();
if (State == VTK_INTERACTOR_STYLE_CAMERA_FIT) {
// making fit rect opeation
}
case VTK_INTERACTOR_STYLE_CAMERA_FIT:
{
- QPainter p(GetRenderWidget());
- p.setPen(Qt::lightGray);
- p.setRasterOp(Qt::XorROP);
- p.drawRect(QRect(myPoint, myOtherPoint));
- myOtherPoint = mousePos;
- p.drawRect(QRect(myPoint, myOtherPoint));
+ drawRect();
break;
}
}
printf( "\n--DominantCombinedSwitch() NOT IMPLEMENTED--\n" );
}
+/*!
+ Draws rectangle by starting and current points
+*/
+void
+SVTK_InteractorStyle
+::drawRect()
+{
+ if ( !myRectBand )
+ myRectBand = new QRubberBand( QRubberBand::Rectangle, GetRenderWidget() );
+ myRectBand->hide();
+
+ QRect aRect(myPoint, myOtherPoint);
+ myRectBand->setGeometry( aRect );
+ myRectBand->setVisible( aRect.isValid() );
+}
+
+/*!
+ \brief Delete rubber band on the end on the dragging operation.
+*/
+void
+SVTK_InteractorStyle
+::endDrawRect()
+{
+ if ( myRectBand ) myRectBand->hide();
+
+ delete myRectBand;
+ myRectBand = 0;
+}
+
/*!
Main process event method (reimplemented from #vtkInteractorStyle)
*/
#include <vtkInteractorStyle.h>
#include <vtkSmartPointer.h>
-#include <qcursor.h>
-#include <qevent.h>
+#include <QCursor>
#include <map>
void operator=(const SVTK_ControllerOnKeyDown&); //Not implemented
};
-class vtkCell;
class vtkPicker;
class vtkPointPicker;
class SVTK_GenericRenderWindowInteractor;
class SVTK_Actor;
+class QRubberBand;
+
#define VTK_INTERACTOR_STYLE_CAMERA_NONE 0
#define VTK_INTERACTOR_STYLE_CAMERA_ROTATE 1
#define VTK_INTERACTOR_STYLE_CAMERA_PAN 2
void DominantCombinedSwitch();
+ void drawRect();
+ void endDrawRect();
+
protected:
QCursor myDefCursor;
QCursor myPanCursor;
vtkFloatingPointType myBBCenter[3];
bool myBBFirstCheck;
+
+ QRubberBand* myRectBand; //!< selection rectangle rubber band
};
#ifdef WIN32
#include "SVTK_Selector.h"
-#include <qimage.h>
+#include <QImage>
+#include <QToolBar>
/*!
Constructor
const char* theName,
SUIT_ResourceMgr* theResourceMgr,
SUIT_ViewWindow* theViewWindow) :
- QMainWindow(theParent,theName,0),
+ QMainWindow(theParent,0),
myViewWindow(theViewWindow)
{
+ setObjectName(theName);
+
myToolBar = new QToolBar(this);
- myToolBar->setCloseMode(QDockWindow::Undocked);
- myToolBar->setLabel(tr("LBL_TOOLBAR_LABEL"));
+ //myToolBar->setCloseMode(QDockWindow::Undocked);
+ myToolBar->setWindowTitle(tr("LBL_TOOLBAR_LABEL"));
createActions(theResourceMgr);
createToolBar();
SetEventDispatcher(myInteractor->GetDevice());
setCentralWidget(myInteractor);
- myInteractor->setBackgroundMode(Qt::NoBackground);
+ myInteractor->setBackgroundRole( QPalette::NoRole );//NoBackground
- myInteractor->setFocusPolicy(StrongFocus);
+ myInteractor->setFocusPolicy(Qt::StrongFocus);
myInteractor->setFocus();
setFocusProxy(myInteractor);
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ROTATION_POINT" ) ),
tr( "MNU_CHANGINGROTATIONPOINT_VIEW" ), 0, this);
anAction->setStatusTip(tr("DSC_CHANGINGROTATIONPOINT_VIEW"));
- anAction->setToggleAction(true);
+ anAction->setCheckable(true);
connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onChangeRotationPoint(bool)));
myActionsMap[ ChangeRotationPointId ] = anAction;
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_SCALING" ) ),
tr( "MNU_SVTK_SCALING" ), 0, this);
anAction->setStatusTip(tr("DSC_SVTK_SCALING"));
- anAction->setToggleAction(true);
+ anAction->setCheckable(true);
connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onNonIsometric(bool)));
myActionsMap[ NonIsometric ] = anAction;
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_GRADUATED_AXES" ) ),
tr( "MNU_SVTK_GRADUATED_AXES" ), 0, this);
anAction->setStatusTip(tr("DSC_SVTK_GRADUATED_AXES"));
- anAction->setToggleAction(true);
+ anAction->setCheckable(true);
connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onGraduatedAxes(bool)));
myActionsMap[ GraduatedAxes ] = anAction;
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_UPDATE_RATE" ) ),
tr( "MNU_SVTK_UPDATE_RATE" ), 0, this);
anAction->setStatusTip(tr("DSC_SVTK_UPDATE_RATE"));
- anAction->setToggleAction(true);
+ anAction->setCheckable(true);
connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onUpdateRate(bool)));
myActionsMap[ UpdateRate ] = anAction;
}
::dumpView()
{
QPixmap px = QPixmap::grabWindow( GetInteractor()->winId() );
- return px.convertToImage();
+ return px.toImage();
}
#include <vtkSmartPointer.h>
-#include <qmainwindow.h>
+#include <QMainWindow>
+#include <QMap>
class QtxAction;
class SVTK_SetRotationPointDlg;
class VTKViewer_Trihedron;
-class VTKViewer_Transform;
class VTKViewer_Actor;
class SVTK_Renderer;
#include "SVTK_MainWindow.h"
#include "SVTK_Renderer.h"
-#include "QtxDblSpinBox.h"
+#include "QtxDoubleSpinBox.h"
#include "QtxAction.h"
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qlayout.h>
+#include <QGroupBox>
+#include <QLabel>
+#include <QPushButton>
+#include <QGridLayout>
using namespace std;
theName),
m_MainWindow(theParent)
{
- setCaption(tr("DLG_TITLE"));
+ setWindowTitle(tr("DLG_TITLE"));
setSizeGripEnabled(TRUE);
// Create layout for this dialog
layoutDlg->setMargin(11);
// Create croup box with grid layout
- QGroupBox* aGroupBox = new QGroupBox(this, "GroupBox");
+ QGroupBox* aGroupBox = new QGroupBox(this);
+ aGroupBox->setObjectName("GroupBox");
QHBoxLayout* aHBoxLayout = new QHBoxLayout(aGroupBox);
aHBoxLayout->setMargin(11);
aHBoxLayout->setSpacing(6);
// "X" scaling
- QLabel* TextLabelX = new QLabel (tr("LBL_X"), aGroupBox, "TextLabelX");
+ QLabel* TextLabelX = new QLabel (tr("LBL_X"), aGroupBox);
+ TextLabelX->setObjectName("TextLabelX");
TextLabelX->setFixedWidth(15);
- m_sbXcoeff = new QtxDblSpinBox(-VTK_LARGE_FLOAT, VTK_LARGE_FLOAT, 0.1, aGroupBox);
+ m_sbXcoeff = new QtxDoubleSpinBox(-VTK_LARGE_FLOAT, VTK_LARGE_FLOAT, 0.1, aGroupBox);
m_sbXcoeff->setMinimumWidth(80);
m_sbXcoeff->setValue(1.0);
// "Y" scaling
- QLabel* TextLabelY = new QLabel (tr("LBL_Y"), aGroupBox, "TextLabelY");
+ QLabel* TextLabelY = new QLabel (tr("LBL_Y"), aGroupBox);
+ TextLabelY->setObjectName("TextLabelY");
TextLabelY->setFixedWidth(15);
- m_sbYcoeff = new QtxDblSpinBox(-VTK_LARGE_FLOAT, VTK_LARGE_FLOAT, 0.1, aGroupBox);
+ m_sbYcoeff = new QtxDoubleSpinBox(-VTK_LARGE_FLOAT, VTK_LARGE_FLOAT, 0.1, aGroupBox);
m_sbYcoeff->setMinimumWidth(80);
m_sbYcoeff->setValue(1.0);
// "Z" scaling
- QLabel* TextLabelZ = new QLabel (tr("LBL_Z"), aGroupBox, "TextLabelZ");
+ QLabel* TextLabelZ = new QLabel (tr("LBL_Z"), aGroupBox);
+ TextLabelZ->setObjectName("TextLabelZ");
TextLabelZ->setFixedWidth(15);
- m_sbZcoeff = new QtxDblSpinBox(-VTK_LARGE_FLOAT, VTK_LARGE_FLOAT, 0.1, aGroupBox);
+ m_sbZcoeff = new QtxDoubleSpinBox(-VTK_LARGE_FLOAT, VTK_LARGE_FLOAT, 0.1, aGroupBox);
m_sbZcoeff->setMinimumWidth(80);
m_sbZcoeff->setValue(1.0);
// Create <Reset> button
- m_bReset = new QPushButton(tr("&Reset"), aGroupBox, "m_bReset");
+ m_bReset = new QPushButton(tr("&Reset"), aGroupBox);
+ m_bReset->setObjectName("m_bReset");
// Layout widgets in the group box
aHBoxLayout->addWidget(TextLabelX);
aHBoxLayout2->setMargin(11);
aHBoxLayout2->setSpacing(6);
// Create <OK> button
- QPushButton* m_bOk = new QPushButton(tr("O&K"), aGroupBox2, "m_bOk");
+ QPushButton* m_bOk = new QPushButton(tr("O&K"), aGroupBox2);
+ m_bOk->setObjectName("m_bOk");
m_bOk->setDefault(TRUE);
m_bOk->setAutoDefault(TRUE);
// Create <Apply> button
- QPushButton* m_bApply = new QPushButton(tr("&Apply"), aGroupBox2, "m_bApply");
+ QPushButton* m_bApply = new QPushButton(tr("&Apply"), aGroupBox2);
+ m_bApply->setObjectName("m_bApply");
m_bApply->setAutoDefault(TRUE);
// Create <Cancel> button
- QPushButton* m_bCancel = new QPushButton(tr("&Cancel"), aGroupBox2, "m_bCancel");
+ QPushButton* m_bCancel = new QPushButton(tr("&Cancel"), aGroupBox2);
+ m_bCancel->setObjectName("m_bCancel");
m_bCancel->setAutoDefault(TRUE);
// Layout buttons
class SVTK_MainWindow;
-class QtxDblSpinBox;
+class QtxDoubleSpinBox;
class QtxAction;
class QPushButton;
protected:
SVTK_MainWindow *m_MainWindow;
- QtxDblSpinBox* m_sbXcoeff;
- QtxDblSpinBox* m_sbYcoeff;
- QtxDblSpinBox* m_sbZcoeff;
+ QtxDoubleSpinBox* m_sbXcoeff;
+ QtxDoubleSpinBox* m_sbYcoeff;
+ QtxDoubleSpinBox* m_sbZcoeff;
QPushButton* m_bReset;
protected slots:
// $Header$
#include "SVTK_Prs.h"
+
+#include <vtkActorCollection.h>
+
using namespace std;
/*!
#include <SVTK.h>
#include "SALOME_Prs.h"
-#include <vtkActorCollection.h>
+class vtkActorCollection;
+class vtkActor;
class SVTK_EXPORT SVTK_Prs : public SALOME_VTKPrs
{
// $Header$
#include "SVTK_RenderWindowInteractor.h"
-#include "SVTK_GenericRenderWindowInteractor.h"
+//#include "SVTK_GenericRenderWindowInteractor.h"
#include "SVTK_InteractorStyle.h"
#include "SVTK_Renderer.h"
#include "SVTK_Functor.h"
#include "SALOME_Actor.h"
+// QT Includes
+// Put Qt includes before the X11 includes which #define the symbol None
+// (see SVTK_SpaceMouse.h) to avoid the compilation error.
+#include <QX11Info>
+#include <QMouseEvent>
+
#include "SVTK_SpaceMouse.h"
#include "SVTK_Event.h"
#include <vtkPicker.h>
#include <vtkCamera.h>
-// QT Includes
-#include <qtimer.h>
-#include <qapplication.h>
-#include <qcolordialog.h>
-#include <qpaintdevice.h>
-
using namespace std;
static bool GENERATE_SUIT_EVENTS = false;
QVTK_RenderWindowInteractor
::QVTK_RenderWindowInteractor(QWidget* theParent,
const char* theName):
- QWidget(theParent,theName,Qt::WNoAutoErase),
+ QWidget(theParent),
myRenderWindow(vtkRenderWindow::New())
{
+ setObjectName(theName);
+
setMouseTracking(true);
myRenderWindow->Delete();
myRenderWindow->DoubleBufferOn();
#ifndef WIN32
- myRenderWindow->SetDisplayId((void*)x11Display());
+ myRenderWindow->SetDisplayId((void*)QX11Info::display());
#endif
myRenderWindow->SetWindowId((void*)winId());
}
#ifndef WIN32
SVTK_SpaceMouse* aSpaceMouse = SVTK_SpaceMouse::getInstance();
if ( aSpaceMouse && aSpaceMouse->isSpaceMouseOn() )
- aSpaceMouse->close( x11Display() );
+ aSpaceMouse->close( QX11Info::display() );
#endif
}
{
GetDevice()->SetEventInformationFlipY(event->x(),
event->y(),
- event->state() & ControlButton,
- event->state() & ShiftButton);
+ event->modifiers() & Qt::ControlModifier,
+ event->modifiers() & Qt::ShiftModifier);
GetDevice()->MouseMoveEvent();
}
{
GetDevice()->SetEventInformationFlipY(event->x(),
event->y(),
- event->state() & ControlButton,
- event->state() & ShiftButton);
- if( event->button() & LeftButton )
+ event->modifiers() & Qt::ControlModifier,
+ event->modifiers() & Qt::ShiftModifier);
+ if( event->button() & Qt::LeftButton )
GetDevice()->LeftButtonPressEvent();
- else if( event->button() & MidButton )
+ else if( event->button() & Qt::MidButton )
GetDevice()->MiddleButtonPressEvent();
- else if( event->button() & RightButton )
+ else if( event->button() & Qt::RightButton )
GetDevice()->RightButtonPressEvent();
}
{
GetDevice()->SetEventInformationFlipY(event->x(),
event->y(),
- event->state() & ControlButton,
- event->state() & ShiftButton);
+ event->modifiers() & Qt::ControlModifier,
+ event->modifiers() & Qt::ShiftModifier);
- if( event->button() & LeftButton )
+ if( event->button() & Qt::LeftButton )
GetDevice()->LeftButtonReleaseEvent();
- else if( event->button() & MidButton )
+ else if( event->button() & Qt::MidButton )
GetDevice()->MiddleButtonReleaseEvent();
- else if( event->button() & RightButton )
+ else if( event->button() & Qt::RightButton )
GetDevice()->RightButtonReleaseEvent();
}
QVTK_RenderWindowInteractor
::wheelEvent( QWheelEvent* event )
{
- setActiveWindow();
+ activateWindow();
setFocus();
}
QVTK_RenderWindowInteractor
::keyPressEvent( QKeyEvent* event )
{
- GetDevice()->SetKeyEventInformation(event->state() & ControlButton,
- event->state() & ShiftButton,
+ GetDevice()->SetKeyEventInformation(event->modifiers() & Qt::ControlModifier,
+ event->modifiers() & Qt::ShiftModifier,
event->key());
GetDevice()->KeyPressEvent();
GetDevice()->CharEvent();
QVTK_RenderWindowInteractor
::keyReleaseEvent( QKeyEvent * event )
{
- GetDevice()->SetKeyEventInformation(event->state() & ControlButton,
- event->state() & ShiftButton,
+ GetDevice()->SetKeyEventInformation(event->modifiers() & Qt::ControlModifier,
+ event->modifiers() & Qt::ShiftModifier,
event->key());
GetDevice()->KeyReleaseEvent();
}
::enterEvent( QEvent* event )
{
if(FOCUS_UNDER_MOUSE){
- setActiveWindow();
+ activateWindow();
setFocus();
}
GetDevice()->EnterEvent();
{
if ( !aSpaceMouse->isSpaceMouseOn() )
// initialize 3D space mouse driver
- aSpaceMouse->initialize( x11Display(), winId() );
+ aSpaceMouse->initialize( QX11Info::display(), winId() );
else
- aSpaceMouse->setWindow( x11Display(), winId() );
+ aSpaceMouse->setWindow( QX11Info::display(), winId() );
}
#endif
}
// unregister set space mouse events receiver
SVTK_SpaceMouse* aSpaceMouse = SVTK_SpaceMouse::getInstance();
if ( aSpaceMouse && aSpaceMouse->isSpaceMouseOn() )
- aSpaceMouse->setWindow( x11Display(), 0 );
+ aSpaceMouse->setWindow( QX11Info::display(), 0 );
#endif
}
if ( aSpaceMouse->isSpaceMouseOn() && xEvent->type == ClientMessage )
{
SVTK_SpaceMouse::MoveEvent anEvent;
- int type = aSpaceMouse->translateEvent( x11Display(), xEvent, &anEvent, 1.0, 1.0 );
+ int type = aSpaceMouse->translateEvent( QX11Info::display(), xEvent, &anEvent, 1.0, 1.0 );
switch ( type )
{
case SVTK_SpaceMouse::SpaceMouseMove:
SVTK_RenderWindowInteractor
::contextMenuEvent( QContextMenuEvent* event )
{
- if( !( event->state() & KeyButtonMask ) )
+ if( !( event->modifiers() & Qt::KeyboardModifierMask ) )
emit contextMenuRequested( event );
}
#include "SVTK_Selection.h"
#include <vtkSmartPointer.h>
-#include <qwidget.h>
+#include <QWidget>
// undefining min and max because CASCADE's defines them and
// it clashes with std::min(), std::max()
#include "SVTK_SelectorDef.h"
+#include "VTKViewer_Filter.h"
+
#include "SALOME_Actor.h"
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
#include "SVTK.h"
#include "SVTK_Selection.h"
#include "SALOME_ListIO.hxx"
-#include "VTKViewer_Filter.h"
-#include "SALOME_InteractiveObject.hxx"
#include <TColStd_MapOfInteger.hxx>
#include <TColStd_IndexedMapOfInteger.hxx>
#include <vtkObject.h>
+class Handle(VTKViewer_Filter);
+
class SALOME_Actor;
+class Handle(SALOME_InteractiveObject);
//! Define an abstract interface for selection in SVTK package
/*!
#include <TColStd_MapOfInteger.hxx>
#include <vtkSmartPointer.h>
+#include "SALOME_InteractiveObject.hxx"
+
#include "SVTK_Selector.h"
class SALOME_Actor;
#include "QtxAction.h"
-#include <qlineedit.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qlayout.h>
-#include <qvalidator.h>
-#include <qbuttongroup.h>
-#include <qobjectlist.h>
-#include <qcheckbox.h>
-#include <qhbox.h>
+#include <QLineEdit>
+#include <QGroupBox>
+#include <QLabel>
+#include <QPushButton>
+#include <QGridLayout>
+#include <QDoubleValidator>
+#include <QCheckBox>
#include <vtkCallbackCommand.h>
myEventCallbackCommand(vtkCallbackCommand::New()),
myRWInteractor(theParent->GetInteractor())
{
- setCaption(tr("DLG_TITLE"));
+ setWindowTitle(tr("DLG_TITLE"));
setSizeGripEnabled(TRUE);
// Create layout for this dialog
layoutDlg->setMargin(11);
// Create check box "Use Bounding Box Center"
- QHBox* aCheckBox = new QHBox(this);
+ QHBoxLayout* aCheckBox = new QHBoxLayout(this);
- myIsBBCenter = new QCheckBox(tr("USE_BBCENTER"), aCheckBox);
+ myIsBBCenter = new QCheckBox(tr("USE_BBCENTER"));
myIsBBCenter->setChecked(true);
+ aCheckBox->addWidget(myIsBBCenter);
connect(myIsBBCenter, SIGNAL(stateChanged(int)), SLOT(onBBCenterChecked()));
// Create croup button with radio buttons
- myGroupSelButton = new QButtonGroup(2,Qt::Vertical,"",this);
- myGroupSelButton->setMargin(11);
+ myGroupBoxSel = new QGroupBox( "", this );
+ QVBoxLayout *vbox = new QVBoxLayout;
+ vbox->setMargin(11);
+ vbox->addStretch(1);
// Create "Set to Origin" button
- myToOrigin = new QPushButton(myGroupSelButton);
+ myToOrigin = new QPushButton(myGroupBoxSel);
myToOrigin->setText(tr("LBL_TOORIGIN"));
+ vbox->addWidget(myToOrigin);
connect(myToOrigin, SIGNAL(clicked()), this, SLOT(onToOrigin()));
// Create "Select Point from View" button
- mySelectPoint = new QPushButton(myGroupSelButton);
+ mySelectPoint = new QPushButton(myGroupBoxSel);
mySelectPoint->setText(tr("LBL_SELECTPOINT"));
- mySelectPoint->setToggleButton(true);
+ mySelectPoint->setCheckable(true);
+ vbox->addWidget(mySelectPoint);
connect(mySelectPoint, SIGNAL(clicked()), this, SLOT(onSelectPoint()));
+ myGroupBoxSel->setLayout(vbox);
+
// Create croup box with grid layout
- myGroupBoxCoord = new QGroupBox(this, "GroupBox");
+ myGroupBoxCoord = new QGroupBox(this);
+ myGroupBoxCoord->setObjectName("GroupBox");
QHBoxLayout* aHBoxLayout = new QHBoxLayout(myGroupBoxCoord);
aHBoxLayout->setMargin(11);
aHBoxLayout->setSpacing(6);
// "X" coordinate
- QLabel* TextLabelX = new QLabel (tr("LBL_X"), myGroupBoxCoord, "TextLabelX");
+ QLabel* TextLabelX = new QLabel (tr("LBL_X"), myGroupBoxCoord );
+ TextLabelX->setObjectName("TextLabelX");
TextLabelX->setFixedWidth(15);
myX = new QLineEdit(myGroupBoxCoord);
myX->setValidator(new QDoubleValidator(myX));
connect(myX, SIGNAL(textChanged(const QString&)), this, SLOT(onCoordChanged()));
// "Y" coordinate
- QLabel* TextLabelY = new QLabel (tr("LBL_Y"), myGroupBoxCoord, "TextLabelY");
+ QLabel* TextLabelY = new QLabel (tr("LBL_Y"), myGroupBoxCoord );
+ TextLabelY->setObjectName("TextLabelY");
TextLabelY->setFixedWidth(15);
myY = new QLineEdit(myGroupBoxCoord);
myY->setValidator(new QDoubleValidator(myY));
connect(myY, SIGNAL(textChanged(const QString&)), this, SLOT(onCoordChanged()));
// "Z" coordinate
- QLabel* TextLabelZ = new QLabel (tr("LBL_Z"), myGroupBoxCoord, "TextLabelZ");
+ QLabel* TextLabelZ = new QLabel (tr("LBL_Z"), myGroupBoxCoord );
+ TextLabelZ->setObjectName("TextLabelZ");
TextLabelZ->setFixedWidth(15);
myZ = new QLineEdit(myGroupBoxCoord);
myZ->setValidator(new QDoubleValidator(myZ));
aHBoxLayout2->setMargin(11);
aHBoxLayout2->setSpacing(6);
- QPushButton* m_bClose = new QPushButton(tr("&Close"), aGroupBox, "m_bClose");
+ QPushButton* m_bClose = new QPushButton(tr("&Close"), aGroupBox );
+ m_bClose->setObjectName("m_bClose");
m_bClose->setAutoDefault(TRUE);
m_bClose->setFixedSize(m_bClose->sizeHint());
connect(m_bClose, SIGNAL(clicked()), this, SLOT(onClickClose()));
aHBoxLayout2->addWidget(m_bClose);
// Layout top level widgets
- layoutDlg->addWidget(aCheckBox,0,0);
- layoutDlg->addWidget(myGroupSelButton,1,0);
+ layoutDlg->addLayout(aCheckBox,0,0);
+ layoutDlg->addWidget(myGroupBoxSel,1,0);
layoutDlg->addWidget(myGroupBoxCoord,2,0);
layoutDlg->addWidget(aGroupBox,3,0);
- setEnabled(myGroupSelButton,!myIsBBCenter->isChecked());
+ setEnabled(myGroupBoxSel,!myIsBBCenter->isChecked());
setEnabled(myGroupBoxCoord,!myIsBBCenter->isChecked());
this->resize(400, this->sizeHint().height());
SVTK_SetRotationPointDlg
::setEnabled(QGroupBox* theGrp, const bool theState)
{
- QObjectList aChildren(*theGrp->children());
+ QObjectList aChildren(theGrp->children());
QObject* anObj;
- for(anObj = aChildren.first(); anObj !=0; anObj = aChildren.next())
+ for(int i = 0; i < aChildren.size(); i++)
{
+ anObj = aChildren.at(i);
if (anObj !=0 && anObj->inherits("QLineEdit"))
((QLineEdit*)anObj)->setReadOnly(!theState);
if (anObj !=0 && anObj->inherits("QPushButton"))
SVTK_SetRotationPointDlg
::onBBCenterChecked()
{
- setEnabled(myGroupSelButton,!myIsBBCenter->isChecked());
+ setEnabled(myGroupBoxSel,!myIsBBCenter->isChecked());
setEnabled(myGroupBoxCoord,!myIsBBCenter->isChecked());
if ( myIsBBCenter->isChecked() )
{
- if ( mySelectPoint->state() == QButton::On )
+ if ( mySelectPoint->isChecked() )
mySelectPoint->toggle();
// activate mode : the rotation point is the center of the bounding box
// send the data to the SVTK_InteractorStyle: set the type of the rotation point
SVTK_SetRotationPointDlg
::onToOrigin()
{
- if ( mySelectPoint->state() == QButton::On )
+ if ( mySelectPoint->isChecked() )
mySelectPoint->toggle();
myX->setText(QString::number(0.0));
myY->setText(QString::number(0.0));
SVTK_SetRotationPointDlg
::onSelectPoint()
{
- if ( mySelectPoint->state() == QButton::On )
+ if ( mySelectPoint->isChecked() )
myMainWindow->activateStartPointSelection();
else
mySelectPoint->toggle();
::onCoordChanged()
{
if ( !myIsBBCenter->isChecked() ) {
- if ( mySelectPoint->state() == QButton::On
+ if ( mySelectPoint->isChecked()
&&
( myX->hasFocus() || myY->hasFocus() || myZ->hasFocus() ) )
mySelectPoint->toggle();
class QLineEdit;
class QPushButton;
class QGroupBox;
-class QButtonGroup;
class QCheckBox;
class vtkCallbackCommand;
QCheckBox* myIsBBCenter;
- QButtonGroup* myGroupSelButton;
+ QGroupBox * myGroupBoxSel;
QPushButton* myToOrigin;
QPushButton* mySelectPoint;
#include "VTKViewer_Algorithm.h"
#include "SALOME_Actor.h"
-#include "QtxDblSpinBox.h"
+#include "QtxDoubleSpinBox.h"
#include "QtxAction.h"
#include <sstream>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qlayout.h>
-#include <qlineedit.h>
+#include <QGroupBox>
+#include <QLabel>
+#include <QPushButton>
+#include <QGridLayout>
+#include <QLineEdit>
#include <vtkGenericRenderWindowInteractor.h>
#include <vtkCallbackCommand.h>
vtkRenderWindowInteractor* aRWI = myRWInteractor->GetDevice();
bool anIsEnabledUpdateRate = false;
- setCaption(tr("DLG_TITLE"));
- QVBoxLayout* aVBoxLayout = new QVBoxLayout(this, 5, 5);
+ setWindowTitle(tr("DLG_TITLE"));
+ QVBoxLayout* aVBoxLayout = new QVBoxLayout(this);
+ aVBoxLayout->setMargin(5);
+ aVBoxLayout->setSpacing(5);
{
QGroupBox* aGroupBox = new QGroupBox(tr("INPUT_FRAME_TITLE"), this);
- aGroupBox->setColumnLayout(0, Qt::Vertical );
- aGroupBox->layout()->setSpacing( 6 );
- aGroupBox->layout()->setMargin( 11 );
aGroupBox->setCheckable(true);
aGroupBox->setChecked(anIsEnabledUpdateRate);
myIsEnableUpdateRateGroupBox = aGroupBox;
- QGridLayout* aGridLayout = new QGridLayout(aGroupBox->layout());
+ QGridLayout* aGridLayout = new QGridLayout(aGroupBox);
+ aGridLayout->setSpacing( 6 );
+ aGridLayout->setMargin( 11 );
{
QLabel* aLabel = new QLabel(tr("DESIRED"), aGroupBox);
aLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
aGridLayout->addWidget(aLabel, 0, 0);
- QtxDblSpinBox* aDblSpinBox = new QtxDblSpinBox(OFF_UPDATE_RATE, VTK_LARGE_FLOAT, 2, aGroupBox);
+ QtxDoubleSpinBox* aDblSpinBox = new QtxDoubleSpinBox(OFF_UPDATE_RATE, VTK_LARGE_FLOAT, 2, aGroupBox);
aDblSpinBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
aGridLayout->addWidget(aDblSpinBox, 0, 1);
aLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
aGridLayout->addWidget(aLabel, 1, 0);
- QtxDblSpinBox* aDblSpinBox = new QtxDblSpinBox(OFF_UPDATE_RATE, VTK_LARGE_FLOAT, 2, aGroupBox);
+ QtxDoubleSpinBox* aDblSpinBox = new QtxDoubleSpinBox(OFF_UPDATE_RATE, VTK_LARGE_FLOAT, 2, aGroupBox);
aDblSpinBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
aGridLayout->addWidget(aDblSpinBox, 1, 1);
}
{
QGroupBox* aGroupBox = new QGroupBox(tr("INFORMATION_FRAME_TITLE"), this);
- aGroupBox->setColumnLayout(0, Qt::Vertical );
- aGroupBox->layout()->setSpacing( 6 );
- aGroupBox->layout()->setMargin( 11 );
-
- QGridLayout* aGridLayout = new QGridLayout(aGroupBox->layout());
+
+ QGridLayout* aGridLayout = new QGridLayout(aGroupBox);
+ aGridLayout->layout()->setSpacing( 6 );
+ aGridLayout->layout()->setMargin( 11 );
{
QLabel* aLabel = new QLabel(tr("CURRENT_FPS"), aGroupBox);
aLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
class SVTK_MainWindow;
class SVTK_RenderWindowInteractor;
-class QtxDblSpinBox;
+class QtxDoubleSpinBox;
class QtxAction;
class QGroupBox;
protected:
SVTK_RenderWindowInteractor* myRWInteractor;
- QtxDblSpinBox* myDesiredUpdateRateSblSpinBox;
- QtxDblSpinBox* myStillUpdateRateSblSpinBox;
+ QtxDoubleSpinBox* myDesiredUpdateRateSblSpinBox;
+ QtxDoubleSpinBox* myStillUpdateRateSblSpinBox;
QGroupBox* myIsEnableUpdateRateGroupBox;
QLineEdit* myCurrentUpdateRateLineEdit;
using namespace SVTK;
ForEachIf<SALOME_Actor>(getRenderer()->GetActors(),
TIsSameIObject<SALOME_Actor>(theIObject),
- TSetFunction<SALOME_Actor,const char*,QString>
- (&SALOME_Actor::setName,theName.latin1()));
+ TSetFunction<SALOME_Actor,const char*,const char*>
+ (&SALOME_Actor::setName,theName.toLatin1().data()));
}
/*!
#include "SVTK.h"
#include "SALOME_InteractiveObject.hxx"
-#include <qobject.h>
+#include <QObject>
class vtkActorCollection;
class vtkRenderer;
class SALOME_Actor;
+class QMouseEvent;
+class QWheelEvent;
+class QKeyEvent;
+class QContextMenuEvent;
+class QColor;
+
+
//! Main purpose of the class is to provide a way to customize #SVTK_MainWindow.
/*!
This class is initialized by #SVTK_MainWindow and just pass Qt signals from
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include <qpopupmenu.h>
-#include <qcolordialog.h>
+#include <QMenu>
+#include <QColorDialog>
+#include <QToolBar>
#include <vtkCamera.h>
#include <vtkRenderer.h>
#include <vtkActorCollection.h>
-#include "SUIT_Session.h"
+//#include "SUIT_Session.h"
+#include "SUIT_ViewModel.h"
+#include "SUIT_ViewManager.h"
#include "SVTK_Selection.h"
#include "SVTK_ViewModel.h"
#include "VTKViewer_ViewModel.h"
#include <SALOME_Actor.h>
-#include <SALOME_InteractiveObject.hxx>
// in order NOT TO link with SalomeApp, here the code returns SALOMEDS_Study.
// SalomeApp_Study::studyDS() does it as well, but -- here it is retrieved from
if ( !theColor.isValid() )
return;
- QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
+ QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
if(SUIT_ViewWindow* aViewWindow = aViews.at(i)){
if(TViewWindow* aView = dynamic_cast<TViewWindow*>(aViewWindow)){
myTrihedronRelative = theRelative;
if (SUIT_ViewManager* aViewManager = getViewManager()) {
- QPtrVector<SUIT_ViewWindow> aViews = aViewManager->getViews();
+ QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
for ( uint i = 0; i < aViews.count(); i++ )
{
if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
*/
void
SVTK_Viewer
-::contextMenuPopup( QPopupMenu* thePopup )
+::contextMenuPopup( QMenu* thePopup )
{
- thePopup->insertItem( VTKViewer_Viewer::tr( "MEN_DUMP_VIEW" ), this, SLOT( onDumpView() ) );
- thePopup->insertItem( VTKViewer_Viewer::tr( "MEN_CHANGE_BACKGROUD" ), this, SLOT( onChangeBgColor() ) );
+ thePopup->addAction( VTKViewer_Viewer::tr( "MEN_DUMP_VIEW" ), this, SLOT( onDumpView() ) );
+ thePopup->addAction( VTKViewer_Viewer::tr( "MEN_CHANGE_BACKGROUD" ), this, SLOT( onChangeBgColor() ) );
- thePopup->insertSeparator();
+ thePopup->addSeparator();
if(TViewWindow* aView = dynamic_cast<TViewWindow*>(myViewManager->getActiveView())){
if ( !aView->getMainWindow()->getToolBar()->isVisible() ){
- thePopup->insertItem( VTKViewer_Viewer::tr( "MEN_SHOW_TOOLBAR" ), this, SLOT( onShowToolbar() ) );
+ thePopup->addAction( VTKViewer_Viewer::tr( "MEN_SHOW_TOOLBAR" ), this, SLOT( onShowToolbar() ) );
}
aView->RefreshDumpImage();
}
SVTK_Viewer
::onShowToolbar()
{
- QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
+ QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
if(TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at(i))){
aView->getMainWindow()->getToolBar()->show();
// ToolsGUI::SetVisibility(aStudy,anObj->getEntry(),true,this);
//}
// just display the object
- QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
+ QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
if(SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(aViews.at(i))){
if(SVTK_View* aView = aViewWindow->getView()){
// ToolsGUI::SetVisibility(aStudy,anObj->getEntry(),false,this);
//}
// just display the object
- QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
+ QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
if(SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(aViews.at(i)))
if(SVTK_View* aView = aViewWindow->getView())
// TODO: better mechanism of storing display/erse status in a study
// should be provided...
//_PTR(Study) aStudy(getStudyDS());
- QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
+ QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
if(SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(aViews.at(i)))
if(SVTK_View* aView = aViewWindow->getView()){
SVTK_Viewer
::isVisible( const Handle(SALOME_InteractiveObject)& io )
{
- QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
+ QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
for(int i = 0, iEnd = aViews.size(); i < iEnd; i++)
if(SUIT_ViewWindow* aViewWindow = aViews.at(i))
if(TViewWindow* aViewWnd = dynamic_cast<TViewWindow*>(aViewWindow))
::Repaint()
{
// if (theUpdateTrihedron) onAdjustTrihedron();
- QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
+ QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
for(int i = 0, iEnd = aViews.size(); i < iEnd; i++)
if(TViewWindow* aViewWindow = dynamic_cast<TViewWindow*>(aViews.at(i)))
if(SVTK_View* aView = aViewWindow->getView())
#define SVTK_VIEWMODEL_H
#include "SVTK.h"
-#include "SUIT_ViewModel.h"
#include "SVTK_ViewModelBase.h"
#include "SALOME_Prs.h"
#include "SALOME_InteractiveObject.hxx"
-#include <qcolor.h>
+#include <QColor>
+
+class QMouseEvent;
class SVTK_ViewWindow;
virtual void setViewManager(SUIT_ViewManager* theViewManager);
//! See #SUIT_ViewModel::contextMenuPopup
- virtual void contextMenuPopup( QPopupMenu* );
+ virtual void contextMenuPopup( QMenu* );
//! See #SUIT_ViewModel::getType
virtual QString getType() const { return Type(); }
//
#include "SALOME_Actor.h"
-#include <qapplication.h>
-#include <qimage.h>
+#include <QToolBar>
+#include <QEvent>
#include <vtkTextProperty.h>
#include <vtkActorCollection.h>
::setBackgroundColor( const QColor& color )
{
myMainWindow->SetBackgroundColor( color );
- SUIT_ViewWindow::setBackgroundColor( color );
+
+ QPalette palette;
+ palette.setColor(backgroundRole(), color);
+ setPalette(palette);
}
/*!
QImage
SVTK_ViewWindow
::dumpView()
-{
- if ( myMainWindow->getToolBar()->hasMouse() || myDumpImage.isNull() )
+{
+ if ( myMainWindow->getToolBar()->testAttribute(Qt::WA_UnderMouse) || myDumpImage.isNull() )
return myMainWindow->dumpView();
return myDumpImage;
shadow = txtProp->GetShadow();
}
params.sprintf( "* Graduated Axis: * Name *%u*%s*%.2f*%.2f*%.2f*%u*%u*%u*%u", isVisible,
- title.latin1(), color[0], color[1], color[2], font, bold, italic, shadow );
+ title.toLatin1().data(), color[0], color[1], color[2], font, bold, italic, shadow );
// Labels
isVisible = actor->GetLabelVisibility();
if ( !actor )
return;
- QStringList paramsLst = QStringList::split( '*', params, true );
+ QStringList paramsLst = params.split( '*' );
if ( paramsLst.size() == nGradAxisParams ) { // altogether name, lable, ticks parameters make up 25 values
int shadow = paramsLst[10].toInt();
actor->SetTitleVisibility( isVisible );
- actor->SetTitle( title.latin1() );
+ actor->SetTitle( title.toLatin1() );
vtkTextProperty* txtProp = actor->GetTitleTextProperty();
if ( txtProp ) {
txtProp->SetColor( color );
SVTK_ViewWindow
::doSetVisualParameters( const QString& parameters )
{
- QStringList paramsLst = QStringList::split( '*', parameters, true );
+ QStringList paramsLst = parameters.split( '*' );
if ( paramsLst.size() >= nNormalParams ) {
// 'reading' list of parameters
double pos[3], focalPnt[3], viewUp[3], parScale, scale[3];
#include "SVTK.h"
#include "SVTK_Selection.h"
#include "SUIT_ViewWindow.h"
+
#include "SALOME_InteractiveObject.hxx"
-#include <qimage.h>
+#include <QImage>
class SUIT_Desktop;
class SVTK_Selector;
class SVTK_View;
-class SVTK_InteractorStyle;
class SVTK_CubeAxesActor2D;
-class SVTK_RenderWindow;
-class SVTK_RenderWindowInteractor;
-
class vtkRenderer;
class vtkRenderWindow;
class vtkRenderWindowInteractor;
SUBDIRS += Prs
SUBDIRS += OBJECT
SUBDIRS += VTKViewer
+SUBDIRS += SVTK
SUBDIRS += OCCViewer
SUBDIRS += SOCC
SUBDIRS += Event