Salome HOME
09005da78ee20fa0e95bf802a9843b08d1f433e8
[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/
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   /* display */         
57   void Display( const Handle(SALOME_InteractiveObject)& IObject, bool update = true );
58   void DisplayOnly( const Handle(SALOME_InteractiveObject)& IObject );
59   void Erase( const Handle(SALOME_InteractiveObject)& IObject, bool update = true );
60
61   /* Reimplemented from SALOME_View */
62   void                 Display( const SALOME_Prs2d* );
63   void                 Erase( const SALOME_Prs2d*, const bool = false );
64   virtual void         EraseAll(const bool = false);
65   virtual void         Repaint();
66   virtual SALOME_Prs*  CreatePrs( const char* entry = 0 );
67   virtual void         BeforeDisplay( SALOME_Displayer* d );
68   virtual void         AfterDisplay ( SALOME_Displayer* d );
69   virtual bool         isVisible( const Handle(SALOME_InteractiveObject)& IObject );
70
71
72   /* operations */
73   SPlot2d_Curve*                   getCurveByIO( const Handle(SALOME_InteractiveObject)&, Plot2d_ViewFrame* = 0 );
74   Plot2d_ViewFrame*                getActiveViewFrame();
75   Handle(SALOME_InteractiveObject) FindIObject( const char* Entry );
76
77 protected slots:
78   virtual void onCloneView( Plot2d_ViewFrame*, Plot2d_ViewFrame* );
79 };
80
81
82 #endif // SPlot2d_ViewModel_H
83
84
85
86