class SVTK_Selector;
class SVTK_Renderer;
-// ------------------------------------------------------------
-// :TRICKY: Fri Apr 21 22:19:27 2000 Pagey
-// The Signal/Slot mechanism used by Qt requires that QObject
-// appear as the first class when using multiple inheritance.
-// Hence the order of the two classes QObject and vtkRenderWindowInteractor
-// matters here. Be careful not to change it by accident.
-// ------------------------------------------------------------
+
+//============================================================================
+//! Implemementation of the class is intended to implement Qt based CreateTimer and DestroyTimer functionality.
+/*!
+ The class intendes to implement platform indepenedant subclass of vtkRenderWindowInteractor.
+ This is done by usage of Qt library.
+ \note
+ The Signal/Slot mechanism used by Qt requires that QObject
+ appear as the first class when using multiple inheritance.
+ Hence the order of the two classes QObject and vtkRenderWindowInteractor
+ matters here. So, be careful, not to change the sequence of the inheritance by accident.
+*/
class SVTK_EXPORT QVTK_GenericRenderWindowInteractor:
public QObject,
public vtkGenericRenderWindowInteractor
static QVTK_GenericRenderWindowInteractor* New();
vtkTypeMacro(QVTK_GenericRenderWindowInteractor,vtkGenericRenderWindowInteractor);
+ //! Starts the QTimer instance on defined microseconds
virtual
int
CreateTimer( int ) ;
+ //! Stops the QTimer instance
virtual
int
DestroyTimer() ;
protected slots:
+ //! The slot connects to QTimer::timeout signal to invoke vtkCommand::TimerEvent
void
OnTimeOut();
protected:
- QVTK_GenericRenderWindowInteractor();
- ~QVTK_GenericRenderWindowInteractor();
+ QVTK_GenericRenderWindowInteractor(); //!< Instatiate QTimer
+ ~QVTK_GenericRenderWindowInteractor(); //!< Destroy the instance of QTimer
- QTimer* myTimer ;
+ QTimer* myTimer; //!< Qt timer device
};
-// ------------------------------------------------------------
+//============================================================================
+//! This class introduce SALOME specific to the base class
+/*!
+ In this class new members is added (#mySelector and #myRenderWidget).
+ They are used for initialization of #SVTK_InteractorStyle by redefinition of
+ #SVTK_InteractorStyle::SetInteractor method
+*/
class SVTK_EXPORT SVTK_GenericRenderWindowInteractor: public QVTK_GenericRenderWindowInteractor
{
public:
static SVTK_GenericRenderWindowInteractor* New();
vtkTypeMacro(SVTK_GenericRenderWindowInteractor,QVTK_GenericRenderWindowInteractor);
+ //! To get access to SVTK_Selector
SVTK_Selector*
- GetSelector();
+ GetSelector();
+ //! To initialize mySelector field
void
SetSelector(SVTK_Selector* theSelector);
+ //! To get access to QWidget, where vtkRenderWindow maps to.
QWidget*
GetRenderWidget();
+ //! To initialize myRenderWidget field.
void
SetRenderWidget(QWidget* theRenderWidget);
SVTK_GenericRenderWindowInteractor();
~SVTK_GenericRenderWindowInteractor();
- vtkSmartPointer<SVTK_Selector> mySelector;
- QWidget* myRenderWidget;
+ vtkSmartPointer<SVTK_Selector> mySelector; //!< Keeps a pointer to SVTK_Selector
+ QWidget* myRenderWidget; //!< Keeps a pointer to QWidget, where vtkRenderWindow maps to.
};
#endif
#define VTK_INTERACTOR_STYLE_CAMERA_SELECT 6
#define VTK_INTERACTOR_STYLE_CAMERA_GLOBAL_PAN 7
+//! Introduce SALOME way of user interaction
+/*!
+ This class defines SALOME way of user interaction for VTK viewer, as well,
+ as introduce a new selection mechanism
+*/
class SVTK_EXPORT SVTK_InteractorStyle: public vtkInteractorStyle
{
public:
- // Description:
- // This class must be supplied with a vtkRenderWindowInteractor wrapper or
- // parent. This class should not normally be instantiated by application
- // programmers.
static SVTK_InteractorStyle *New();
vtkTypeMacro(SVTK_InteractorStyle, vtkInteractorStyle);
- virtual
- int
- GetState();
-
typedef boost::shared_ptr<SVTK_SelectionEvent> PSelectionEvent;
+ //! Generate special #SVTK_SelectionEvent
virtual
SVTK_SelectionEvent*
GetSelectionEvent();
+ //! Generate special #SVTK_SelectionEvent with flipped Y coordinate
virtual
SVTK_SelectionEvent*
GetSelectionEventFlipY();
- // redefined in order to add an observer (callback) for custorm event (space mouse event)
+ //! Redefined in order to add an observer (callback) for custorm event (space mouse event)
virtual
void
SetInteractor( vtkRenderWindowInteractor* );
+ //!
virtual
void
Render();