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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : VTKViewer_ViewFrame.h
25 // Author : Nicolas REJNERI
29 #ifndef VTKViewer_ViewFrame_H
30 #define VTKViewer_ViewFrame_H
33 #include "QAD_ViewFrame.h"
35 #include "VTKViewer_RenderWindowInteractor.h"
36 #include "VTKViewer_RenderWindow.h"
41 class VTKViewer_Trihedron;
43 class QAD_EXPORT VTKViewer_ViewFrame : public QAD_ViewFrame{
46 VTKViewer_ViewFrame(QWidget* parent, const char* name=0 );
47 ~VTKViewer_ViewFrame();
49 ViewType getTypeView() const{ return VIEW_VTK;};
50 QWidget* getViewWidget();
51 vtkRenderer* getRenderer() {return m_Renderer;}
53 VTKViewer_RenderWindow* getRW() {return m_RW;}
54 VTKViewer_RenderWindowInteractor* getRWInteractor() {return m_RWInteractor;}
56 bool isTrihedronDisplayed();
58 void setBackgroundColor( const QColor& );
59 QColor backgroundColor() const;
61 void SetSelectionMode( int mode );
63 /* popup management */
64 void setPopupServer( QAD_Application* );
66 /* interactive object management */
67 void highlight( const Handle(SALOME_InteractiveObject)& IObject,
68 bool highlight, bool immediatly = true );
69 void unHighlightAll();
70 void rename( const Handle(SALOME_InteractiveObject)& IObject,
72 bool isInViewer( const Handle(SALOME_InteractiveObject)& IObject );
73 bool isVisible( const Handle(SALOME_InteractiveObject)& IObject );
75 /* undo/redo management */
76 void undo(SALOMEDS::Study_var aStudy,
77 const char* StudyFrameEntry);
78 void redo(SALOMEDS::Study_var aStudy,
79 const char* StudyFrameEntry);
83 Handle(SALOME_InteractiveObject) FindIObject(const char* Entry);
86 void Display(const Handle(SALOME_InteractiveObject)& IObject, bool immediatly = true);
87 void DisplayOnly(const Handle(SALOME_InteractiveObject)& IObject);
88 void Erase(const Handle(SALOME_InteractiveObject)& IObject, bool immediatly = true);
91 void Repaint(bool theUpdateTrihedron);
92 void Repaint() { Repaint(true); }
94 //apply existing transformation on adding SALOME_Actor
95 void SetScale(double theScale[3]);
96 void GetScale(double theScale[3]);
97 void AddActor(SALOME_Actor*, bool update = false);
98 void RemoveActor(SALOME_Actor*, bool update = false);
104 void onViewFitArea();
105 void onViewGlobalPan();
114 void onViewTrihedron();
115 void onAdjustTrihedron();
119 double m_ViewNormal[3];
123 vtkRenderer* m_Renderer;
124 VTKViewer_RenderWindow* m_RW;
125 VTKViewer_RenderWindowInteractor* m_RWInteractor;
127 VTKViewer_Trihedron *m_Triedron;
128 SALOME_Transform *m_Transform;