Salome HOME
Updated copyright comment
[modules/gui.git] / src / SPlot2d / SPlot2d_ViewModel.h
1 // Copyright (C) 2007-2024  CEA, EDF, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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, or (at your option) any later version.
10 //
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.
15 //
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
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 //  File   : SPlot2d_ViewModel.h
24 //  Author : Sergey RUIN
25 //  Module : SUIT
26 //
27 #ifndef SPlot2d_ViewModel_H
28 #define SPlot2d_ViewModel_H
29
30 #include "SPlot2d.h"
31 #include "SPlot2d_Curve.h"
32 #include "Plot2d_ViewModel.h"
33 #include "Plot2d_ViewFrame.h"
34 #include "Plot2d_ViewWindow.h"
35
36 #include <SALOME_Prs.h>
37 #include <SALOME_InteractiveObject.hxx>
38 #include <SALOME_ListIO.hxx>
39
40 class SPLOT2D_EXPORT SPlot2d_Viewer : public Plot2d_Viewer, public SALOME_View
41
42   Q_OBJECT
43
44 public:
45   static QString Type() { return "Plot2d"; }
46
47   /* Construction/destruction */
48   SPlot2d_Viewer( bool theAutoDel = false );
49   virtual ~SPlot2d_Viewer();
50
51 public:
52   virtual QString          getType() const { return Type(); }
53
54   /*  interactive object management */
55   void highlight( const Handle(SALOME_InteractiveObject)& /*IObject*/, bool /*highlight*/, bool /*update*/ = true ) {}
56   void unHighlightAll() {}
57   void rename( const Handle(SALOME_InteractiveObject)&, const QString&, Plot2d_ViewFrame* = 0 );
58   void renameAll( const Handle(SALOME_InteractiveObject)&, const QString& );
59   bool isInViewer( const Handle(SALOME_InteractiveObject)& IObject );
60
61   virtual   SUIT_ViewWindow* createView(SUIT_Desktop* theDesktop);
62   
63   /* display */         
64   void Display( const Handle(SALOME_InteractiveObject)& IObject, bool update = true );
65   void DisplayOnly( const Handle(SALOME_InteractiveObject)& IObject );
66   void Erase( const Handle(SALOME_InteractiveObject)& IObject, bool update = true );
67
68   /* Reimplemented from SALOME_View */
69   void                 Display( const SALOME_Prs2d* );
70   void                 Erase( const SALOME_Prs2d*, const bool = false );
71   virtual void         EraseAll(SALOME_Displayer*, const bool = false);
72   virtual void         Repaint();
73   virtual SALOME_Prs*  CreatePrs( const char* entry = 0 );
74
75   virtual bool         isVisible( const Handle(SALOME_InteractiveObject)& IObject );
76   virtual void         GetVisible( SALOME_ListIO& theList );
77
78   virtual void         setObjectsSelected(  SALOME_ListIO& theList );
79
80
81   /* operations */
82   SPlot2d_Curve*                   getCurveByIO( const Handle(SALOME_InteractiveObject)&, Plot2d_ViewFrame* = 0 );
83   Plot2d_ViewFrame*                getActiveViewFrame();
84   Handle(SALOME_InteractiveObject) FindIObject( const char* Entry );
85
86 protected slots:
87   virtual void onClicked( const QVariant&, int );
88
89 signals:
90   void legendSelected( const QString& );
91   void clearSelected();
92 private:
93   bool myDeselectAnalytical;
94 };
95
96
97 #endif // SPlot2d_ViewModel_H
98
99
100
101