]> SALOME platform Git repositories - modules/gui.git/blob - src/SPlot2d/SPlot2d_ViewModel.h
Salome HOME
7182def582893641f2b72880c7e3f65035c49691
[modules/gui.git] / src / SPlot2d / SPlot2d_ViewModel.h
1 // Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
2 // 
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either 
6 // version 2.1 of the License.
7 // 
8 // This library is distributed in the hope that it will be useful 
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public  
14 // License along with this library; if not, write to the Free Software 
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 //  File   : SPlot2d_ViewModel.h
20 //  Author : Sergey RUIN
21 //  Module : SUIT
22
23 #ifndef SPlot2d_ViewModel_H
24 #define SPlot2d_ViewModel_H
25
26 #include "SPlot2d.h"  
27
28 #include "SALOME_Prs.h"
29 #include "Plot2d_ViewModel.h"
30 #include "SALOME_InteractiveObject.hxx"
31 #include "Plot2d_ViewFrame.h"
32 #include "Plot2d_ViewWindow.h"
33 #include "SPlot2d_Curve.h"
34
35 class SPLOT2D_EXPORT SPlot2d_Viewer : public Plot2d_Viewer, public SALOME_View
36
37   Q_OBJECT
38
39 public:
40   static QString Type() { return "Plot2d"; }
41
42   /* Construction/destruction */
43   SPlot2d_Viewer( bool theAutoDel = false );
44   virtual ~SPlot2d_Viewer();
45
46 public:
47   virtual QString          getType() const { return Type(); }
48
49   /*  interactive object management */
50   void highlight( const Handle(SALOME_InteractiveObject)& IObject, bool highlight, bool update = true ) {}
51   void unHighlightAll() {}
52   void rename( const Handle(SALOME_InteractiveObject)&, const QString&, Plot2d_ViewFrame* = 0 );
53   void renameAll( const Handle(SALOME_InteractiveObject)&, const QString& );
54   bool isInViewer( const Handle(SALOME_InteractiveObject)& IObject );
55
56   virtual   SUIT_ViewWindow* createView(SUIT_Desktop* theDesktop);
57   
58   /* display */         
59   void Display( const Handle(SALOME_InteractiveObject)& IObject, bool update = true );
60   void DisplayOnly( const Handle(SALOME_InteractiveObject)& IObject );
61   void Erase( const Handle(SALOME_InteractiveObject)& IObject, bool update = true );
62
63   /* Reimplemented from SALOME_View */
64   void                 Display( const SALOME_Prs2d* );
65   void                 Erase( const SALOME_Prs2d*, const bool = false );
66   virtual void         EraseAll(const bool = false);
67   virtual void         Repaint();
68   virtual SALOME_Prs*  CreatePrs( const char* entry = 0 );
69   virtual void         BeforeDisplay( SALOME_Displayer* d );
70   virtual void         AfterDisplay ( SALOME_Displayer* d );
71   virtual bool         isVisible( const Handle(SALOME_InteractiveObject)& IObject );
72
73
74   /* operations */
75   SPlot2d_Curve*                   getCurveByIO( const Handle(SALOME_InteractiveObject)&, Plot2d_ViewFrame* = 0 );
76   Plot2d_ViewFrame*                getActiveViewFrame();
77   Handle(SALOME_InteractiveObject) FindIObject( const char* Entry );
78
79 protected slots:
80   virtual void onCloneView( Plot2d_ViewFrame*, Plot2d_ViewFrame* );
81 };
82
83
84 #endif // SPlot2d_ViewModel_H
85
86
87
88