From: apo Date: Mon, 24 Oct 2005 13:43:13 +0000 (+0000) Subject: To provide documentation X-Git-Tag: TG-D5-38-2003_D2005-29-12~50 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=85e2bef156547620e6b3ff351e015edb95762a26;p=modules%2Fgui.git To provide documentation --- diff --git a/src/SVTK/SVTK_GenericRenderWindowInteractor.h b/src/SVTK/SVTK_GenericRenderWindowInteractor.h index 9cb106612..5e1396ce7 100644 --- a/src/SVTK/SVTK_GenericRenderWindowInteractor.h +++ b/src/SVTK/SVTK_GenericRenderWindowInteractor.h @@ -41,13 +41,18 @@ class QWidget; 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 @@ -58,42 +63,55 @@ class SVTK_EXPORT QVTK_GenericRenderWindowInteractor: 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); @@ -101,8 +119,8 @@ class SVTK_EXPORT SVTK_GenericRenderWindowInteractor: public QVTK_GenericRenderW SVTK_GenericRenderWindowInteractor(); ~SVTK_GenericRenderWindowInteractor(); - vtkSmartPointer mySelector; - QWidget* myRenderWidget; + vtkSmartPointer mySelector; //!< Keeps a pointer to SVTK_Selector + QWidget* myRenderWidget; //!< Keeps a pointer to QWidget, where vtkRenderWindow maps to. }; #endif diff --git a/src/SVTK/SVTK_InteractorStyle.cxx b/src/SVTK/SVTK_InteractorStyle.cxx index aa59a165e..b2e4b60e0 100644 --- a/src/SVTK/SVTK_InteractorStyle.cxx +++ b/src/SVTK/SVTK_InteractorStyle.cxx @@ -140,14 +140,6 @@ SVTK_InteractorStyle return myInteractor->GetSelector(); } -//---------------------------------------------------------------------------- -int -SVTK_InteractorStyle -::GetState() -{ - return State | ForcedState; -} - //---------------------------------------------------------------------------- SVTK_SelectionEvent* SVTK_InteractorStyle diff --git a/src/SVTK/SVTK_InteractorStyle.h b/src/SVTK/SVTK_InteractorStyle.h index c292310fe..7a351917e 100644 --- a/src/SVTK/SVTK_InteractorStyle.h +++ b/src/SVTK/SVTK_InteractorStyle.h @@ -58,35 +58,35 @@ class SVTK_GenericRenderWindowInteractor; #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 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();