]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To document the sources
authorapo <apo@opencascade.com>
Fri, 11 Nov 2005 10:12:04 +0000 (10:12 +0000)
committerapo <apo@opencascade.com>
Fri, 11 Nov 2005 10:12:04 +0000 (10:12 +0000)
src/VVTK/VVTK_InteractorStyle.h
src/VVTK/VVTK_MainWindow.h
src/VVTK/VVTK_Renderer.h
src/VVTK/VVTK_ViewManager.h
src/VVTK/VVTK_ViewModel.h
src/VVTK/VVTK_ViewWindow.h

index f180b7882ba3496965293ce019c513c5ad7593a1..5eaf23e92f558ef416f1396dccbd29e357cd5056 100644 (file)
 
 class VISU_PickingSettings;
 
-
+//! Introduce new style of interaction (keyboard free)
 class VVTK_EXPORT VVTK_InteractorStyle : public SVTK_InteractorStyle
 {
  public:
-  // Description:
-  // This class must be supplied with a vtkRenderWindowInteractor wrapper or
-  // parent. This class should not normally be instantiated by application
-  // programmers.
   static VVTK_InteractorStyle *New();
   vtkTypeMacro(VVTK_InteractorStyle,SVTK_InteractorStyle);
 
-  // redefined in order to add an observer (callback) for custorm event (space mouse event)
+  //! Redefined from SVTK_InteractorStyle::SetInteractor in order to add an observer (callback) for custorm event (space mouse event)
   virtual
   void
   SetInteractor( vtkRenderWindowInteractor* );
 
+  //! To share the VISU_PickingSettings
   void
   SetPickingSettings(VISU_PickingSettings* thePickingSettings);
 
@@ -62,14 +59,26 @@ class VVTK_EXPORT VVTK_InteractorStyle : public SVTK_InteractorStyle
   void operator=(const VVTK_InteractorStyle&); // Not implemented
 
   // Generic event bindings must be overridden in subclasses
+
+  //! Redefine SVTK_InteractorStyle::OnLeftButtonDown
   virtual void OnLeftButtonDown(int ctrl, int shift, int x, int y);
+
+  //! Redefine SVTK_InteractorStyle::OnMiddleButtonDown
   virtual void OnMiddleButtonDown(int ctrl, int shift, int x, int y);
+
+  //! Redefine SVTK_InteractorStyle::OnLeftButtonUp
   virtual void OnLeftButtonUp(int ctrl, int shift, int x, int y);
+
+  //! Redefine SVTK_InteractorStyle::OnMiddleButtonUp
   virtual void OnMiddleButtonUp(int ctrl, int shift, int x, int y);
+
+  //! Redefine vtkInteractorStyle::OnKeyDown
   virtual void OnKeyDown();
+
+  //! Redefine SVTK_InteractorStyle::onFinishOperation
   virtual void onFinishOperation();
 
-  // Main process VTK event method
+  //! Main process VTK event method
   static 
   void
   ProcessEvents(vtkObject* object, 
@@ -77,11 +86,16 @@ class VVTK_EXPORT VVTK_InteractorStyle : public SVTK_InteractorStyle
                void* clientData, 
                void* callData );
 
+  //! Redefine SVTK_InteractorStyle::onSpaceMouseButton
   virtual void onSpaceMouseButton( int button );
+  
+  //! To decrease magnification of the Gauss Points
   void DecreaseGaussPointMagnification();
+
+  //! To increase magnification of the Gauss Points
   void IncreaseGaussPointMagnification();
 
-  // SpaceMouse short cuts
+  //! SpaceMouse short cuts
   int mySMDecreaseMagnificationBtn;
   int mySMIncreaseMagnificationBtn;
   
index 4220d5cee2db0acf6555258f1931c3dc399cbc78..718bd29611b9036c6958a0a9025a2dc58e257ae1 100644 (file)
@@ -21,26 +21,33 @@ class VVTK_Renderer1;
 class VVTK_Renderer2;
 
 //----------------------------------------------------------------------------
+//! Customize SVTK_MainWindow to provide VVTK functionality
 class VVTK_EXPORT VVTK_MainWindow: public SVTK_MainWindow
 {
   Q_OBJECT;
 
 public:
+  //! Construct instance of the class
   VVTK_MainWindow(QWidget* theParent, 
                  const char* theName,
                  SUIT_ResourceMgr* theResourceMgr);
+
+  //! Reimplement SVTK_MainWindow::Initialize
   virtual
   void
   Initialize(SVTK_RenderWindowInteractor* theInteractor);
 
+  //! Destroy instance of the class
   virtual
   ~VVTK_MainWindow();
 
  public slots:
+   //! To change active interactor style at run-time
   virtual
   void
   OnInteractorStyleSwitch(bool theIsGaussStyleOn); 
 
+   //! To change active selection mode at run-time
   virtual
   void
   OnSelectionModeSwitch(bool theIsSelectionOn); 
@@ -55,73 +62,91 @@ public:
 
 
 //----------------------------------------------------------------------------
+//! Extend VVTK_MainWindow to implement functionality for base view
 class VVTK_EXPORT VVTK_MainWindow1: public VVTK_MainWindow
 {
   Q_OBJECT;
 
 public:
+  //! Construct instance of the class
   VVTK_MainWindow1(QSplitter* theParent, 
                   const char* theName,
                   SUIT_ResourceMgr* theResourceMgr);
+
+  //! Reimplement VVTK_MainWindow::Initialize
   virtual
   void
   Initialize(SVTK_RenderWindowInteractor* theInteractor,
             VVTK_Renderer1* theRenderer);
 
-  
+  //! Destroy instance of the class
   virtual
   ~VVTK_MainWindow1();
 
+  //! Create instance of the segmented VVTK_MainWindow
+  /*!
+    The two views (VVTK_MainWindow1 and VVTK_MainWindow2) should change its behaviour in the same time.
+    So, it is necessary to synhronize them through sharing some common pointers.
+  */
   VVTK_MainWindow2*
   CreateMainWindow2(QWidget* theParent, 
                    const char* theName,
                    SUIT_ResourceMgr* theResourceMgr,
                    VISU_PickingSettings* thePickingSettings);
 
+  //! Get contained VISU_ImplicitFunctionWidget
   VISU_ImplicitFunctionWidget*
   GetImplicitFunctionWidget();
 
+  //! Get contained VISU_OutsideCursorSettings
   VISU_OutsideCursorSettings*
   GetOutsideCursorSettings();
 
+  //! Get contained VISU_PickingSettings
   VISU_PickingSettings* 
   GetPickingSettings();
 
  public slots:
+  //! To activate/ deactivate the segementation cursor at run-time
   void
   OnPlaneSegmentationSwitch(bool theIsPlaneSegmentationOn); 
 
+  //! Customize VVTK_MainWindow::OnSelectionModeSwitch
   virtual
   void
   OnSelectionModeSwitch(bool theIsSelectionOn); 
 
  protected:
-  VVTK_Renderer1* myRenderer;
+  VVTK_Renderer1* myRenderer; //!< Keeps extended version of SVTK_Renderer
 
-  VVTK_MainWindow2* myMainWindow2;
+  VVTK_MainWindow2* myMainWindow2; //!< Refer to segmented view
 
-  QtxAction* myStyleSwitchAction;
-  QToolBar* myPtsToolBar;
-  QSplitter* mySplitter;
+  QtxAction* myStyleSwitchAction; //!< Action for switch interactor style
+  QToolBar* myPtsToolBar; //!< Additional tool bar
+  //! To implement show/hide segmented view on acttivate/ deactivate segementation cursor
+  QSplitter* mySplitter; 
 
-  VVTK_SegmentationCursorDlg* mySegmentationCursorDlg;
-  VVTK_PickingDlg* myPickingDlg;
+  VVTK_SegmentationCursorDlg* mySegmentationCursorDlg; //!< Keep reference to VVTK_SegmentationCursorDlg
+  VVTK_PickingDlg* myPickingDlg; //!< Keep reference to VVTK_PickingDlg
 };
 
 
 //----------------------------------------------------------------------------
+//! Extend VVTK_MainWindow to implement functionality for segmented view
 class VVTK_EXPORT VVTK_MainWindow2: public VVTK_MainWindow
 {
   Q_OBJECT;
 
   friend class VVTK_MainWindow1;
 
+  //! Construct instance of the class
   VVTK_MainWindow2(QWidget* theParent, 
                   const char* theName,
                   SUIT_ResourceMgr* theResourceMgr,
                   VISU_PickingSettings* thePickingSettings,
                   QtxAction* theStyleSwitchAction);
 public:
+  //! Destroy instance of the class
   virtual
   ~VVTK_MainWindow2();
 };
index 0c50b277384f6126c2272b6cdbccdeb3101d0bfc..b23cb02666ae843af6a1879c9f745f7afc140078 100644 (file)
@@ -41,20 +41,27 @@ class VISU_FPSActor;
 class vtkImplicitFunction;
 
 //----------------------------------------------------------------------------
+//! To customize SVTK_Renderer according to VVTK functionality
 class VVTK_EXPORT VVTK_Renderer : public SVTK_Renderer
 {
  public:
   vtkTypeMacro(VVTK_Renderer,SVTK_Renderer);
   static VVTK_Renderer* New();
 
+  //! Reimplement SVTK_Renderer::AddActor
+  /*!
+    Perform an additional action - apply picking settings on the published VISU_GaussPtsAct actors
+  */
   virtual
   void 
   AddActor(VTKViewer_Actor* theActor);
 
+  //! Reimplement SVTK_Renderer::RemoveActor (remove additional settings)
   virtual
   void 
   RemoveActor(VTKViewer_Actor* theActor);
 
+  //! To set VISU_PickingSettings to share them among all VISU_GaussPtsAct actors published into the view 
   void
   SetPickingSettings(VISU_PickingSettings* thePickingSettings);
 
@@ -62,34 +69,40 @@ class VVTK_EXPORT VVTK_Renderer : public SVTK_Renderer
   VVTK_Renderer();
   ~VVTK_Renderer();
 
-  VISU_PickingSettings* myPickingSettings;
-  vtkSmartPointer<VISU_FPSActor> myFPSActor;
+  VISU_PickingSettings* myPickingSettings; //! Keeps reference of the VISU_PickingSettings
+  vtkSmartPointer<VISU_FPSActor> myFPSActor; //!< To show FPS of the rendering at run-time
 };
 
 
 //----------------------------------------------------------------------------
+//! To extend VVTK_Renderer to implement base view functionality
 class VVTK_EXPORT VVTK_Renderer1 : public VVTK_Renderer
 {
  public:
   vtkTypeMacro(VVTK_Renderer1,VVTK_Renderer);
   static VVTK_Renderer1* New();
 
+  //! Reimplement SVTK_Renderer::Initialize
   virtual
   void 
   Initialize(vtkRenderWindowInteractor* theInteractor,
             SVTK_Selector* theSelector);
 
+  //! Reimplement VVTK_Renderer::AddActor to apply to the actor additional settings
   virtual
   void 
   AddActor(VTKViewer_Actor* theActor);
 
+  //! Reimplement VVTK_Renderer::RemoveActor
   virtual
   void 
   RemoveActor(VTKViewer_Actor* theActor);
 
+  //! To set VISU_PickingSettings to share them among all VISU_GaussPtsAct1 actors published into the view 
   void
   SetOutsideCursorSettings(VISU_OutsideCursorSettings* theOutsideCursorSettings);
 
+  //! Get VISU_ImplicitFunctionWidget
   VISU_ImplicitFunctionWidget*
   GetImplicitFunctionWidget();
 
@@ -97,10 +110,12 @@ class VVTK_EXPORT VVTK_Renderer1 : public VVTK_Renderer
   VVTK_Renderer1();
   ~VVTK_Renderer1();
 
+  //! Reimplement VVTK_Renderer::OnAdjustActors
   virtual
   bool
   OnAdjustActors();
 
+  //! To adjust the VISU_ImplicitFunctionWidget to the current bounding box
   void AdjustImplicitFunctionWidget();
 
   vtkSmartPointer<VISU_ImplicitFunctionWidget> myImplicitFunctionWidget;
@@ -116,17 +131,21 @@ class VVTK_EXPORT VVTK_Renderer2 : public VVTK_Renderer
   vtkTypeMacro(VVTK_Renderer2,VVTK_Renderer);
   static VVTK_Renderer2* New();
 
+  //! Reimplement VVTK_Renderer::AddActor to apply to the actor additional settings
   virtual
   void 
   AddActor(VTKViewer_Actor* theActor);
 
+  //! Reimplement VVTK_Renderer::RemoveActor
   virtual
   void 
   RemoveActor(VTKViewer_Actor* theActor);
 
+  //! Set VISU_ImplicitFunctionWidget
   void
   SetImplicitFunctionWidget(VISU_ImplicitFunctionWidget* theWidget);
 
+  //! To handle vtkCommand::EndInteractionEvent to redraw the view
   void
   OnEndInteractionEvent();
 
@@ -134,7 +153,7 @@ class VVTK_EXPORT VVTK_Renderer2 : public VVTK_Renderer
   VVTK_Renderer2();
   ~VVTK_Renderer2();
 
-  // Main process VTK event method
+  //! Main process VTK event method
   static
   void
   ProcessEvents(vtkObject* theObject, 
@@ -142,10 +161,10 @@ class VVTK_EXPORT VVTK_Renderer2 : public VVTK_Renderer
                void* theClientData, 
                void* theCallData);
 
-  // Used to process VTK events
+  //! Used to process VTK events
   vtkSmartPointer<vtkCallbackCommand> myEventCallbackCommand;
 
-  // Priority at which events are processed
+  //! Priority at which events are processed
   float myPriority;
 
   VISU_ImplicitFunctionWidget* myWidget;
index 9e70cbc4535e9b5efdfb9ae40039633182fc8120..101fa583c4ce08922420fae5ecd0f3d46c1d7243 100644 (file)
@@ -6,12 +6,15 @@
 
 class SUIT_Desktop;
 
+//! Extend SUIT_ViewManager to deal with VVTK_Viewer
 class VVTK_EXPORT VVTK_ViewManager : public SUIT_ViewManager
 {
   Q_OBJECT;
 public:
-
+  //! Construct the view manager
   VVTK_ViewManager( SUIT_Study* study, SUIT_Desktop* );
+
+  //! Destroy the view manager
   virtual ~VVTK_ViewManager();
 
 protected:
index 6c2453b15df2c86aa45e162fe59cd111ccece48b..0846edcd0a3618c46bfb8597a30392ad6f6df0ab 100644 (file)
@@ -11,6 +11,7 @@
 
 class VVTK_ViewWindow;
 
+//! Extends two interfaces #SVTK_ViewModelBase and #SALOME_View 
 class VVTK_EXPORT VVTK_Viewer : public SVTK_ViewModelBase, public SALOME_View
 {
   Q_OBJECT;
@@ -22,20 +23,32 @@ public:
   VVTK_Viewer();
   virtual ~VVTK_Viewer();
 
+  //! Redefine SUIT_ViewModel::createView
   virtual SUIT_ViewWindow* createView(SUIT_Desktop*);
 
-  virtual void             setViewManager(SUIT_ViewManager* theViewManager);
-  virtual void             contextMenuPopup( QPopupMenu* );
-  virtual QString          getType() const { return Type(); }
+  //! Redefine SUIT_ViewModel::setViewManager
+  virtual void setViewManager(SUIT_ViewManager* theViewManager);
+  //! Redefine SUIT_ViewModel::contextMenuPopup
+  virtual void contextMenuPopup( QPopupMenu* );
+  //! See SUIT_ViewModel::getType
+  virtual QString getType() const { return Type(); }
 
+  //! Redefine SALOME_View::Repaint
   virtual void Repaint();
 
-  virtual bool             isVisible( const Handle(SALOME_InteractiveObject)& );
+  //! Redefine SALOME_View::isVisible
+  virtual bool isVisible( const Handle(SALOME_InteractiveObject)& );
 
+  //! Get background color of the viewer
   QColor backgroundColor() const;
+
+  //! Set background color to the viewer
   void   setBackgroundColor( const QColor& );
 
+  //! Get size of trihedron of the viewer (see SVTK_Renderer::SetTrihedronSize)
   int    trihedronSize() const;
+
+  //! Set size of trihedron of the viewer (see SVTK_Renderer::SetTrihedronSize)
   void   setTrihedronSize( const int );
 
 protected slots:
index a6ddca69637cc150036057e0a99b14585526d9ab..8f952ab964723edf06a807cefebd6372df966c8f 100755 (executable)
@@ -15,63 +15,84 @@ class VVTK_MainWindow2;
 class SVTK_View;
 
 //----------------------------------------------------------------------------
+//! Customize the SVTK_ViewWindow in order to manage two SVTK_View (base and segmented one)
 class VVTK_EXPORT VVTK_ViewWindow : public SVTK_ViewWindow
 {
   Q_OBJECT;
 
 public:
+  //! To construct the class
   VVTK_ViewWindow(SUIT_Desktop* theDesktop);
 
+  //! Destroy
   virtual
   ~VVTK_ViewWindow();
 
+  //! To initialize
   virtual
   void
   Initialize(SVTK_ViewModelBase* theModel);
 
   //----------------------------------------------------------------------------
+  //! Get access to base SVTK_MainWindow
   VVTK_MainWindow1* 
   getMainWindow1();
 
+  //! Get access to segmented SVTK_MainWindow
   VVTK_MainWindow2* 
   getMainWindow2();
 
   //----------------------------------------------------------------------------
+  //! Redefine SVTK_ViewWindow::AddActor method
+  /*!
+    This is an entry point for publication the presentation into the viewer.
+    Pointed actor published into the basic MainWindow. If the actor is
+    a Gauss Points one second actor is created from initial actor and 
+    is put into segemented MainWindow.
+  */
   virtual
   void
   AddActor(VTKViewer_Actor* theActor,
           bool theIsUpdate = false);
 
+  //! Redefine SVTK_ViewWindow::RemoveActor method
   virtual
   void
   RemoveActor(VTKViewer_Actor* theActor,
              bool theIsUpdate = false);
 
+  //! Redefine SVTK_ViewWindow::Repaint method
   virtual
   void
   Repaint(bool theUpdateTrihedron = true);
 
   //----------------------------------------------------------------------------
   /*  interactive object management */
+  //! Redefine SVTK_ViewWindow::highlight method
   virtual
   void
   highlight(const Handle(SALOME_InteractiveObject)& theIO, 
            bool theIsHighlight = true, 
            bool theIsUpdate = true);
+
+  //! Redefine SVTK_ViewWindow::unHighlightAll method
   virtual
   void
   unHighlightAll();
 
   //----------------------------------------------------------------------------
 public slots:
+  //! Redefine SVTK_ViewWindow::onSelectionChanged method
   virtual
   void
   onSelectionChanged();
 
+  //! Redefine SVTK_ViewWindow::onResetView method
   virtual
   void
   onResetView();     
 
+  //! Redefine SVTK_ViewWindow::onFitAll method
   virtual
   void 
   onFitAll();
@@ -82,11 +103,11 @@ protected:
   void
   action( const int );
 
-  VVTK_MainWindow1* myMainWindow1;
-  SVTK_View* myView1;
+  VVTK_MainWindow1* myMainWindow1; //!< The manage base view
+  SVTK_View* myView1; //!< The manage base view
 
-  VVTK_MainWindow2* myMainWindow2;
-  SVTK_View* myView2;
+  VVTK_MainWindow2* myMainWindow2; //!< The manage segmented view
+  SVTK_View* myView2; //!< The manage segmented view
 };
 
 #ifdef WIN32