1 // SALOME VTKViewer : build VTK viewer into Salome desktop
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
29 #ifndef VVTK_Renderer_h
30 #define VVTK_Renderer_h
34 #include "SVTK_Renderer.h"
36 class VISU_WidgetCtrl;
37 class VISU_InsideCursorSettings;
38 class VISU_OutsideCursorSettings;
39 class VISU_PickingSettings;
43 class vtkImplicitFunction;
45 //----------------------------------------------------------------------------
46 //! To customize SVTK_Renderer according to VVTK functionality
47 class VVTK_EXPORT VVTK_Renderer : public SVTK_Renderer
50 vtkTypeMacro(VVTK_Renderer,SVTK_Renderer);
51 static VVTK_Renderer* New();
53 //! Reimplement SVTK_Renderer::AddActor
55 Perform an additional action - apply picking settings on the published VISU_GaussPtsAct actors
59 AddActor(VTKViewer_Actor* theActor);
61 //! Reimplement SVTK_Renderer::RemoveActor (remove additional settings)
64 RemoveActor(VTKViewer_Actor* theActor);
66 //! To set VISU_PickingSettings to share them among all VISU_GaussPtsAct actors published into the view
68 SetInsideCursorSettings(VISU_InsideCursorSettings* theInsideCursorSettings);
71 SetPickingSettings(VISU_PickingSettings* thePickingSettings);
77 VISU_PickingSettings* myPickingSettings; //! Keeps reference of the VISU_PickingSettings
78 VISU_InsideCursorSettings* myInsideCursorSettings; //! Keeps reference of the VISU_InsideCursorSettings
79 vtkSmartPointer<VISU_FPSActor> myFPSActor; //!< To show FPS of the rendering at run-time
81 vtkSmartPointer<vtkPointPicker> myGaussPointPicker;
82 vtkSmartPointer<vtkProperty> myGaussPreHighlightProperty;
83 vtkSmartPointer<vtkProperty> myGaussHighlightProperty;
87 //----------------------------------------------------------------------------
88 //! To extend VVTK_Renderer to implement base view functionality
89 class VVTK_EXPORT VVTK_Renderer1 : public VVTK_Renderer
92 vtkTypeMacro(VVTK_Renderer1,VVTK_Renderer);
93 static VVTK_Renderer1* New();
95 //! Reimplement SVTK_Renderer::Initialize
98 Initialize(vtkRenderWindowInteractor* theInteractor,
99 SVTK_Selector* theSelector);
101 //! Reimplement VVTK_Renderer::AddActor to apply to the actor additional settings
104 AddActor(VTKViewer_Actor* theActor);
106 //! Reimplement VVTK_Renderer::RemoveActor
109 RemoveActor(VTKViewer_Actor* theActor);
111 //! To set VISU_PickingSettings to share them among all VISU_GaussPtsAct1 actors published into the view
113 SetOutsideCursorSettings(VISU_OutsideCursorSettings* theOutsideCursorSettings);
115 VISU_WidgetCtrl* GetWidgetCtrl();
121 //! Reimplement VVTK_Renderer::OnAdjustActors
126 void AdjustWidgetCtrl();
128 vtkSmartPointer<VISU_WidgetCtrl> myWidgetCtrl;
129 VISU_OutsideCursorSettings* myOutsideCursorSettings;
130 vtkSmartPointer<VISU_FPSActor> myTextActor;
134 //----------------------------------------------------------------------------
135 class VVTK_EXPORT VVTK_Renderer2 : public VVTK_Renderer
138 vtkTypeMacro(VVTK_Renderer2,VVTK_Renderer);
139 static VVTK_Renderer2* New();
141 //! Reimplement VVTK_Renderer::AddActor to apply to the actor additional settings
144 AddActor(VTKViewer_Actor* theActor);
146 //! Reimplement VVTK_Renderer::RemoveActor
149 RemoveActor(VTKViewer_Actor* theActor);
151 void SetWidgetCtrl(VISU_WidgetCtrl* theWidgetCtrl);
153 //! To handle vtkCommand::EndInteractionEvent to redraw the view
155 OnEndInteractionEvent();
161 //! Main process VTK event method
164 ProcessEvents(vtkObject* theObject,
165 unsigned long theEvent,
169 //! Used to process VTK events
170 vtkSmartPointer<vtkCallbackCommand> myEventCallbackCommand;
172 //! Priority at which events are processed
175 VISU_WidgetCtrl* myWidgetCtrl;