From a017bab653b0b66665ed17308eab032f3a47016e Mon Sep 17 00:00:00 2001 From: apo Date: Tue, 25 Oct 2005 06:21:42 +0000 Subject: [PATCH] Introduce documentation for the sources --- src/SVTK/SVTK_GenericRenderWindowInteractor.h | 2 +- src/SVTK/SVTK_InteractorStyle.h | 21 ++++++++++----- src/SVTK/SVTK_RenderWindowInteractor.h | 26 +++++++++++++++++-- 3 files changed, 39 insertions(+), 10 deletions(-) diff --git a/src/SVTK/SVTK_GenericRenderWindowInteractor.h b/src/SVTK/SVTK_GenericRenderWindowInteractor.h index 5e1396ce7..67c3b846a 100644 --- a/src/SVTK/SVTK_GenericRenderWindowInteractor.h +++ b/src/SVTK/SVTK_GenericRenderWindowInteractor.h @@ -87,7 +87,7 @@ class SVTK_EXPORT QVTK_GenericRenderWindowInteractor: //============================================================================ -//! This class introduce SALOME specific to the base class +//! This class introduce SALOME specific to the base one /*! In this class new members is added (#mySelector and #myRenderWidget). They are used for initialization of #SVTK_InteractorStyle by redefinition of diff --git a/src/SVTK/SVTK_InteractorStyle.h b/src/SVTK/SVTK_InteractorStyle.h index 7a351917e..5667a42cb 100644 --- a/src/SVTK/SVTK_InteractorStyle.h +++ b/src/SVTK/SVTK_InteractorStyle.h @@ -86,49 +86,57 @@ class SVTK_EXPORT SVTK_InteractorStyle: public vtkInteractorStyle void SetInteractor( vtkRenderWindowInteractor* ); - //! + //! To invoke #vtkRenderWindowInteractor::CreateTimer virtual void Render(); - // redefined in order to cach rendering + //! To implement cached rendering virtual void OnTimer(); - // VTK events + //! To reset reset view virtual void OnConfigure(); + //! To handle mouse move event virtual void OnMouseMove(); + //! To handle left mouse button down event (reimplemented from #vtkInteractorStyle) virtual void OnLeftButtonDown(); + //! To handle left mouse button up event (reimplemented from #vtkInteractorStyle) virtual void OnLeftButtonUp(); + //! To handle middle mouse button down event (reimplemented from #vtkInteractorStyle) virtual void OnMiddleButtonDown(); + //! To handle middle mouse button up event (reimplemented from #vtkInteractorStyle) virtual void OnMiddleButtonUp(); + //! To handle right mouse button down event (reimplemented from #vtkInteractorStyle) virtual void OnRightButtonDown(); + //! To handle right mouse button up event (reimplemented from #vtkInteractorStyle) virtual void OnRightButtonUp(); + //! To handle keyboard event (reimplemented from #vtkInteractorStyle) virtual void OnChar(); @@ -169,7 +177,7 @@ class SVTK_EXPORT SVTK_InteractorStyle: public vtkInteractorStyle void IncrementalRotate( const int incrX, const int incrY ); - // custom event handling function (to handle 3d space mouse events) + // Main process event method (reimplemented from #vtkInteractorStyle) static void ProcessEvents(vtkObject* object, @@ -181,7 +189,7 @@ class SVTK_EXPORT SVTK_InteractorStyle: public vtkInteractorStyle float RadianToDegree; // constant: for conv from deg to rad double myScale; - public: + protected: void startZoom(); void startPan(); void startGlobalPan(); @@ -217,7 +225,7 @@ class SVTK_EXPORT SVTK_InteractorStyle: public vtkInteractorStyle bool myShiftState; int ForcedState; - // "increment" for pan/rotate/zoom operations + //! "Increment" for pan/rotate/zoom operations int mySpeedIncrement; // SpaceMouse short cuts @@ -225,7 +233,6 @@ class SVTK_EXPORT SVTK_InteractorStyle: public vtkInteractorStyle int mySMIncreaseSpeedBtn; int mySMDominantCombinedSwitchBtn; - QWidget* myRenderWidget; vtkSmartPointer myInteractor; PSelectionEvent mySelectionEvent; diff --git a/src/SVTK/SVTK_RenderWindowInteractor.h b/src/SVTK/SVTK_RenderWindowInteractor.h index efcb40f8d..23e8939b0 100644 --- a/src/SVTK/SVTK_RenderWindowInteractor.h +++ b/src/SVTK/SVTK_RenderWindowInteractor.h @@ -52,7 +52,13 @@ class vtkObject; class SVTK_Selector; class SVTK_Renderer; -// ------------------------------------------------------------ +//============================================================================ +//! Implemements Qt based vtkRenderWindowInteractor. +/*! + The class inherits #QWidget class in order to be possible process Qt events. + It invokes corresponding VTK events through usage of its device - a #vtkGenericRenderWindowInteractor. + Also, it creates, initialize and holds vtkRenderWindow instance. +*/ class SVTK_EXPORT QVTK_RenderWindowInteractor: public QWidget { Q_OBJECT; @@ -63,6 +69,7 @@ class SVTK_EXPORT QVTK_RenderWindowInteractor: public QWidget ~QVTK_RenderWindowInteractor(); + //! To initialize by #vtkGenericRenderWindowInteractor instance virtual void Initialize(vtkGenericRenderWindowInteractor* theDevice); @@ -73,13 +80,19 @@ class SVTK_EXPORT QVTK_RenderWindowInteractor: public QWidget vtkRenderWindow* getRenderWindow(); + //! Just to simplify usage of its device (#vtkGenericRenderWindowInteractor) virtual void InvokeEvent(unsigned long theEvent, void* theCallData); public slots: + //! Need for initial contents display on Win32 virtual void show(); + + //! To implement final initialization, just before the widget is displayed virtual void polish(); + + //! To adjust widget and vtkRenderWindow size virtual void resize(int w, int h); protected: @@ -103,6 +116,7 @@ class SVTK_EXPORT QVTK_RenderWindowInteractor: public QWidget virtual void focusInEvent( QFocusEvent* ); virtual void focusOutEvent( QFocusEvent* ); + //! To handle native X11 events (from such devices as SpaceMouse) virtual bool x11Event( XEvent *e ); QWidget* myPreviousFocusWidget; @@ -111,7 +125,15 @@ class SVTK_EXPORT QVTK_RenderWindowInteractor: public QWidget }; -// ------------------------------------------------------------ +//============================================================================ +//! Extends QVTK_RenderWindowInteractor functionality. +/*! + Implements such features as + support of selection, + run-time interactor style management, + one render window per one renderer collaboration, + SUIT_ViewWindow events invocation. +*/ class SVTK_EXPORT SVTK_RenderWindowInteractor: public QVTK_RenderWindowInteractor { Q_OBJECT; -- 2.39.2