1 // Copyright (C) 2007-2014 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, or (at your option) any later version.
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
23 // File : SPlot2d_ViewModel.h
24 // Author : Sergey RUIN
27 #ifndef SPlot2d_ViewModel_H
28 #define SPlot2d_ViewModel_H
31 #include "SPlot2d_Curve.h"
32 #include "Plot2d_ViewModel.h"
33 #include "Plot2d_ViewFrame.h"
34 #include "Plot2d_ViewWindow.h"
36 #include <SALOME_Prs.h>
37 #include <SALOME_InteractiveObject.hxx>
38 #include <SALOME_ListIO.hxx>
40 class SPLOT2D_EXPORT SPlot2d_Viewer : public Plot2d_Viewer, public SALOME_View
45 static QString Type() { return "Plot2d"; }
47 /* Construction/destruction */
48 SPlot2d_Viewer( bool theAutoDel = false );
49 virtual ~SPlot2d_Viewer();
52 virtual QString getType() const { return Type(); }
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 );
61 virtual SUIT_ViewWindow* createView(SUIT_Desktop* theDesktop);
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 );
68 /* Reimplemented from SALOME_View */
69 void Display( const SALOME_Prs2d* );
70 void Erase( const SALOME_Prs2d*, const bool = false );
71 virtual void EraseAll(const bool = false);
72 virtual void Repaint();
73 virtual SALOME_Prs* CreatePrs( const char* entry = 0 );
75 virtual bool isVisible( const Handle(SALOME_InteractiveObject)& IObject );
76 virtual void GetVisible( SALOME_ListIO& theList );
78 virtual void setObjectsSelected( SALOME_ListIO& theList );
82 SPlot2d_Curve* getCurveByIO( const Handle(SALOME_InteractiveObject)&, Plot2d_ViewFrame* = 0 );
83 Plot2d_ViewFrame* getActiveViewFrame();
84 Handle(SALOME_InteractiveObject) FindIObject( const char* Entry );
87 virtual void onLegendClicked( QwtPlotItem* plotItem );
90 void legendSelected( const QString& );
93 bool myDeselectAnalytical;
97 #endif // SPlot2d_ViewModel_H