1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : SPlot2d_ViewModel.h
23 // Author : Sergey RUIN
26 #ifndef SPlot2d_ViewModel_H
27 #define SPlot2d_ViewModel_H
31 #include "SALOME_Prs.h"
32 #include "Plot2d_ViewModel.h"
33 #include "SALOME_InteractiveObject.hxx"
34 #include "Plot2d_ViewFrame.h"
35 #include "Plot2d_ViewWindow.h"
36 #include "SPlot2d_Curve.h"
38 class SPLOT2D_EXPORT SPlot2d_Viewer : public Plot2d_Viewer, public SALOME_View
43 static QString Type() { return "Plot2d"; }
45 /* Construction/destruction */
46 SPlot2d_Viewer( bool theAutoDel = false );
47 virtual ~SPlot2d_Viewer();
50 virtual QString getType() const { return Type(); }
52 /* interactive object management */
53 void highlight( const Handle(SALOME_InteractiveObject)& IObject, bool highlight, bool update = true ) {}
54 void unHighlightAll() {}
55 void rename( const Handle(SALOME_InteractiveObject)&, const QString&, Plot2d_ViewFrame* = 0 );
56 void renameAll( const Handle(SALOME_InteractiveObject)&, const QString& );
57 bool isInViewer( const Handle(SALOME_InteractiveObject)& IObject );
59 virtual SUIT_ViewWindow* createView(SUIT_Desktop* theDesktop);
62 void Display( const Handle(SALOME_InteractiveObject)& IObject, bool update = true );
63 void DisplayOnly( const Handle(SALOME_InteractiveObject)& IObject );
64 void Erase( const Handle(SALOME_InteractiveObject)& IObject, bool update = true );
66 /* Reimplemented from SALOME_View */
67 void Display( const SALOME_Prs2d* );
68 void Erase( const SALOME_Prs2d*, const bool = false );
69 virtual void EraseAll(const bool = false);
70 virtual void Repaint();
71 virtual SALOME_Prs* CreatePrs( const char* entry = 0 );
72 virtual void BeforeDisplay( SALOME_Displayer* d );
73 virtual void AfterDisplay ( SALOME_Displayer* d );
74 virtual bool isVisible( const Handle(SALOME_InteractiveObject)& IObject );
78 SPlot2d_Curve* getCurveByIO( const Handle(SALOME_InteractiveObject)&, Plot2d_ViewFrame* = 0 );
79 Plot2d_ViewFrame* getActiveViewFrame();
80 Handle(SALOME_InteractiveObject) FindIObject( const char* Entry );
83 virtual void onLegendClicked( QwtPlotItem* plotItem );
86 void legendSelected( const QString& );
90 #endif // SPlot2d_ViewModel_H