#include "VTKViewer_Actor.h"
#include "VTKViewer_Utilities.h"
#include "VTKViewer_Trihedron.h"
-#include "VTKViewer_RectPicker.h"
#include "VTKViewer_ViewWindow.h"
#include "VTKViewer_RenderWindow.h"
-#include "VTKViewer_CellRectPicker.h"
#include "VTKViewer_RenderWindowInteractor.h"
//#include "SALOME_Actor.h"
return anEdgeId;
}
*/
-//----------------------------------------------------------------------------
+
vtkStandardNewMacro(VTKViewer_InteractorStyle);
-//----------------------------------------------------------------------------
+
/*!Constructor.*/
VTKViewer_InteractorStyle::VTKViewer_InteractorStyle()
{
OnSelectionModeChanged();
}
-//----------------------------------------------------------------------------
+
/*!Destructor.*/
VTKViewer_InteractorStyle::~VTKViewer_InteractorStyle()
{
m_ViewWnd->RemoveActor(myPreSelectionActor);
}
-//----------------------------------------------------------------------------
+
/*!Set preselection properties.
*\param theRed - red color.
*\param theGreen - green color.
myPreSelectionActor->GetProperty()->SetPointSize(theWidth);
}
-//----------------------------------------------------------------------------
+
/*!Set render window interactor
*\param theInteractor - interactor.
*/
Superclass::SetInteractor(theInteractor);
}
-//----------------------------------------------------------------------------
+
/*!Set view window.
*\param theViewWnd - SALOME VTKViewer_ViewWindow
*/
myPreSelectionActor->Delete();
}
-//----------------------------------------------------------------------------
+
/*!Set GUI window.
*\param theWindow - QWidget window.
*/
myGUIWindow = theWindow;
}
-//----------------------------------------------------------------------------
-/*!Set triedron.
+
+/*!Set trihedron.
*\param theTrihedron - SALOME VTKViewer_Trihedron
*/
void VTKViewer_InteractorStyle::setTriedron(VTKViewer_Trihedron* theTrihedron){
m_Trihedron = theTrihedron;
}
-//----------------------------------------------------------------------------
/*!Rotate camera.
*\param dx -
*\param dy -
myGUIWindow->update();
}
-//----------------------------------------------------------------------------
void VTKViewer_InteractorStyle::PanXY(int x, int y, int oldX, int oldY)
{
TranslateView(x, y, oldX, oldY);
}
-//----------------------------------------------------------------------------
/*! Move the position of the camera along the direction of projection. (dx,dy)*/
void VTKViewer_InteractorStyle::DollyXY(int dx, int dy)
{
myGUIWindow->update();
}
-//----------------------------------------------------------------------------
-/*!*/
void VTKViewer_InteractorStyle::SpinXY(int x, int y, int oldX, int oldY)
{
vtkCamera *cam;
}
-//----------------------------------------------------------------------------
/*!On mouse move event.
*\param ctrl - CTRL (not used)
*\param shift - SHIFT (on/off - integer 0/1)
}
-//----------------------------------------------------------------------------
/*!On Left button down event.
*\param ctrl - CTRL (on/off - integer 0/1)
*\param shift - SHIFT (on/off - integer 0/1)
}
-//----------------------------------------------------------------------------
/*!On left button up event.
*\param ctrl - CTRL (not used)
*\param shift - SHIFT (on/off - integer 0/1)
}
-//----------------------------------------------------------------------------
/*!On left button up event.
*\param ctrl - CTRL (on/off - integer 0/1)
*\param shift - SHIFT (on/off - integer 0/1)
}
-//----------------------------------------------------------------------------
/*!On middle button up event.
*\param ctrl - CTRL (not used)
*\param shift - SHIFT (on/off - integer 0/1)
}
-//----------------------------------------------------------------------------
/*!On right button down event.
*\param ctrl - CTRL (on/off - integer 0/1)
*\param shift - SHIFT (on/off - integer 0/1)
}
}
-//----------------------------------------------------------------------------
/*!On right button up event.
*\param ctrl - CTRL (not used)
*\param shift - SHIFT (on/off - integer 0/1)
}
}
-//----------------------------------------------------------------------------
-/** @name XPM - x pixmaps. */
+/*! @name XPM - x pixmaps. */
//@{
/*!Image Zoom cursor*/
const char* imageZoomCursor[] = {
"................................"};
//@}
-//----------------------------------------------------------------------------
/*! Loads cursors for viewer operations - zoom, pan, etc...*/
void VTKViewer_InteractorStyle::loadCursors()
{
}
-//----------------------------------------------------------------------------
/*! event filter - controls mouse and keyboard events during viewer operations*/
bool VTKViewer_InteractorStyle::eventFilter(QObject* object, QEvent* event)
{
}
-//----------------------------------------------------------------------------
/*! starts Zoom operation (e.g. through menu command)*/
void VTKViewer_InteractorStyle::startZoom()
{
}
-//----------------------------------------------------------------------------
/*! starts Pan operation (e.g. through menu command)*/
void VTKViewer_InteractorStyle::startPan()
{
qApp->installEventFilter(this);
}
-//----------------------------------------------------------------------------
/*! starts Rotate operation (e.g. through menu command)*/
void VTKViewer_InteractorStyle::startRotate()
{
}
-//----------------------------------------------------------------------------
/*! starts Spin operation (e.g. through menu command)*/
void VTKViewer_InteractorStyle::startSpin()
{
-//----------------------------------------------------------------------------
/*! starts Fit Area operation (e.g. through menu command)*/
void VTKViewer_InteractorStyle::startFitArea()
{
}
-//----------------------------------------------------------------------------
/*!View fit all.*/
void VTKViewer_InteractorStyle::ViewFitAll() {
int aTriedronWasVisible = false;
}
-//----------------------------------------------------------------------------
/*! starts Global Panning operation (e.g. through menu command)*/
void VTKViewer_InteractorStyle::startGlobalPan()
{
}
-//----------------------------------------------------------------------------
/*!\retval TRUE if needs redrawing*/
bool VTKViewer_InteractorStyle::needsRedrawing()
{
}
-//----------------------------------------------------------------------------
/*! fits viewer contents to rectangle
*\param left - left side
*\param top - top side
}
-//----------------------------------------------------------------------------
/*! starts viewer operation (!internal usage!)*/
void VTKViewer_InteractorStyle::startOperation(int operation)
{
}
-//----------------------------------------------------------------------------
/*! sets proper cursor for window when viewer operation is activated*/
void VTKViewer_InteractorStyle::setCursor(const int operation)
{
}
-//----------------------------------------------------------------------------
/*! called when viewer operation started (!put necessary initialization here!)*/
void VTKViewer_InteractorStyle::onStartOperation()
{
}
-//----------------------------------------------------------------------------
/*! called when viewer operation finished (!put necessary post-processing here!)*/
void VTKViewer_InteractorStyle::onFinishOperation()
{
void VTKViewer_InteractorStyle::TranslateView(int toX, int toY, int fromX, int fromY)
{
vtkCamera *cam = this->CurrentRenderer->GetActiveCamera();
- double viewFocus[4], focalDepth, viewPoint[3];
- float newPickPoint[4], oldPickPoint[4], motionVector[3];
+ vtkFloatingPointType viewFocus[4], focalDepth, viewPoint[3];
+ vtkFloatingPointType newPickPoint[4], oldPickPoint[4], motionVector[3];
cam->GetFocalPoint(viewFocus);
this->ComputeWorldToDisplay(viewFocus[0], viewFocus[1],
viewFocus[2], viewFocus);
focalDepth = viewFocus[2];
- this->ComputeDisplayToWorld(double(toX), double(toY),
+ this->ComputeDisplayToWorld(vtkFloatingPointType(toX), vtkFloatingPointType(toY),
focalDepth, newPickPoint);
- this->ComputeDisplayToWorld(double(fromX),double(fromY),
+ this->ComputeDisplayToWorld(vtkFloatingPointType(fromX),vtkFloatingPointType(fromY),
focalDepth, oldPickPoint);
// camera motion is reversed
const int left, const int top,
const int right, const int bottom)
{
- float* aBounds = theActor->GetBounds();
- float aMin[3], aMax[3];
+ vtkFloatingPointType* aBounds = theActor->GetBounds();
+ vtkFloatingPointType aMin[3], aMax[3];
ComputeWorldToDisplay(aBounds[0], aBounds[2], aBounds[4], aMin);
ComputeWorldToDisplay(aBounds[1], aBounds[3], aBounds[5], aMax);
if (aMin[0] > aMax[0]) {
- float aBuf = aMin[0];
+ vtkFloatingPointType aBuf = aMin[0];
aMin[0] = aMax[0];
aMax[0] = aBuf;
}
if (aMin[1] > aMax[1]) {
- float aBuf = aMin[1];
+ vtkFloatingPointType aBuf = aMin[1];
aMin[1] = aMax[1];
aMax[1] = aBuf;
}
const int left, const int top,
const int right, const int bottom)
{
- float* aBounds = theCell->GetBounds();
- float aMin[3], aMax[3];
+ vtkFloatingPointType* aBounds = theCell->GetBounds();
+ vtkFloatingPointType aMin[3], aMax[3];
ComputeWorldToDisplay(aBounds[0], aBounds[2], aBounds[4], aMin);
ComputeWorldToDisplay(aBounds[1], aBounds[3], aBounds[5], aMax);
if (aMin[0] > aMax[0]) {
- float aBuf = aMin[0];
+ vtkFloatingPointType aBuf = aMin[0];
aMin[0] = aMax[0];
aMax[0] = aBuf;
}
if (aMin[1] > aMax[1]) {
- float aBuf = aMin[1];
+ vtkFloatingPointType aBuf = aMin[1];
aMin[1] = aMax[1];
aMax[1] = aBuf;
}
}
/*!Checks: is given point \a thePoint in rectangle*/
-bool VTKViewer_InteractorStyle::IsInRect(float* thePoint,
- const int left, const int top,
- const int right, const int bottom)
+bool VTKViewer_InteractorStyle::IsInRect(vtkFloatingPointType* thePoint,
+ const int left, const int top,
+ const int right, const int bottom)
{
- float aPnt[3];
+ vtkFloatingPointType aPnt[3];
ComputeWorldToDisplay(thePoint[0], thePoint[1], thePoint[2], aPnt);
return ((aPnt[0]>left) && (aPnt[0]<right) && (aPnt[1]>bottom) && (aPnt[1]<top));