#include <vtkPerspectiveTransform.h>
#include <vtkMatrix4x4.h>
+#include <QtxRubberBand.h>
+
#include <QPixmap>
#include <QWidget>
-#include <QRubberBand>
#include <QPolygon>
#include <algorithm>
*/
void SVTK_InteractorStyle::drawRect()
{
- if ( !myRectBand ) {
- myRectBand = new QRubberBand( QRubberBand::Rectangle, GetRenderWidget() );
- QPalette palette;
- palette.setColor(myRectBand->foregroundRole(), Qt::white);
- myRectBand->setPalette(palette);
- }
- myRectBand->hide();
+ if ( !myRectBand )
+ myRectBand = new QtxRectRubberBand( GetRenderWidget() );
+ myRectBand->setUpdatesEnabled ( false );
QRect aRect = SUIT_Tools::makeRect(myPoint.x(), myPoint.y(), myOtherPoint.x(), myOtherPoint.y());
- myRectBand->setGeometry( aRect );
- myRectBand->setVisible( aRect.isValid() );
+ myRectBand->initGeometry( aRect );
+
+ if ( !myRectBand->isVisible() )
+ myRectBand->show();
+
+ myRectBand->setUpdatesEnabled ( true );
+}
+
+/*!
+ \brief Delete rubber band on the end on the dragging operation.
+*/
+void SVTK_InteractorStyle::endDrawRect()
+{
+ if ( myRectBand ) {
+ myRectBand->clearGeometry();
+ myRectBand->hide();
+ }
}
bool isIntersect( const QPoint& theStart1, const QPoint& theEnd1,
}
}
-/*!
- \brief Delete rubber band on the end on the dragging operation.
-*/
-void SVTK_InteractorStyle::endDrawRect()
-{
- if ( myRectBand ) myRectBand->hide();
-
- delete myRectBand;
- myRectBand = 0;
-}
-
/*!
\brief Delete rubber band on the end on the dragging operation.
*/
class SVTK_GenericRenderWindowInteractor;
class SVTK_Actor;
-class QRubberBand;
+class QtxRectRubberBand;
#define VTK_INTERACTOR_STYLE_CAMERA_NONE 0
#define VTK_INTERACTOR_STYLE_CAMERA_ROTATE 1
double myBBCenter[3];
bool myBBFirstCheck;
- QRubberBand* myRectBand; //!< selection rectangle rubber band
+ QtxRectRubberBand* myRectBand; //!< selection rectangle rubber band
QtxPolyRubberBand* myPolygonBand; //!< polygonal selection
QVector<QPoint> myPolygonPoints;
PolygonState myPoligonState;