1 // SALOME SUPERVGraph : build Supervisor viewer into 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 : SUPERVGraph_ViewFrame.h
25 // Author : Nicolas REJNERI
29 #ifndef SUPERVGraph_ViewFrame_H
30 #define SUPERVGraph_ViewFrame_H
32 #include "SALOME_InteractiveObject.hxx"
34 #include "SALOMEDSClient.hxx"
36 #include "SalomeApp_Application.h"
37 #include "SUIT_PopupClient.h"
38 #include "SUIT_ViewWindow.h"
40 class /*SUPERVGRAPH_EXPORT*/ SUPERVGraph_View: public QWidget, public SUIT_PopupClient {
43 static QString Type() { return "SUPERVGraphViewer"; }
45 SUPERVGraph_View(QWidget* theParent);
46 SUPERVGraph_View(SUPERVGraph_View* theParent);
48 virtual void ActivatePanning() = 0;
49 virtual void ResetView() = 0;
51 /* redefine functions from SUIT_PopupClient */
52 virtual QString popupClientType() const { return Type(); }
53 virtual void contextMenuPopup( QPopupMenu* );
56 void init(QWidget* theParent);
59 class /*SUPERVGRAPH_EXPORT*/ SUPERVGraph_ViewFrame : public SUIT_ViewWindow {
63 SUPERVGraph_ViewFrame(SUIT_Desktop* theDesktop );
64 ~SUPERVGraph_ViewFrame();
66 SUPERVGraph_View* getViewWidget();
67 void setViewWidget(SUPERVGraph_View* theView);
69 void setBackgroundColor( const QColor& );
70 QColor backgroundColor() const;
72 void onAdjustTrihedron( );
74 /* interactive object management */
75 void highlight( const Handle(SALOME_InteractiveObject)& IObject,
76 bool highlight, bool immediatly = true );
77 void unHighlightAll();
78 void rename( const Handle(SALOME_InteractiveObject)& IObject,
80 bool isInViewer( const Handle(SALOME_InteractiveObject)& IObject );
81 bool isVisible( const Handle(SALOME_InteractiveObject)& IObject );
83 /* undo/redo management */
84 void undo(const _PTR(Study)& aStudy, const char* StudyFrameEntry);
85 void redo(const _PTR(Study)& aStudy, const char* StudyFrameEntry);
89 Handle(SALOME_InteractiveObject) FindIObject(const char* Entry) { Handle(SALOME_InteractiveObject) o; return o; };
92 void Display(const Handle(SALOME_InteractiveObject)& IObject, bool immediatly = true){};
93 void DisplayOnly(const Handle(SALOME_InteractiveObject)& IObject){};
94 void Erase(const Handle(SALOME_InteractiveObject)& IObject, bool immediatly = true){};
103 void onViewFitArea();
104 void onViewGlobalPan();
113 void onViewTrihedron();
116 SUPERVGraph_View* myView;
117 SalomeApp_Application* myApp;