1 // Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // File : SPlot2d_ViewModel.h
20 // Author : Sergey RUIN
23 #ifndef SPlot2d_ViewModel_H
24 #define SPlot2d_ViewModel_H
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"
35 class SPLOT2D_EXPORT SPlot2d_Viewer : public Plot2d_Viewer, public SALOME_View
40 static QString Type() { return "Plot2d"; }
42 /* Construction/destruction */
43 SPlot2d_Viewer( bool theAutoDel = false );
44 virtual ~SPlot2d_Viewer();
47 virtual QString getType() const { return Type(); }
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 );
56 virtual SUIT_ViewWindow* createView(SUIT_Desktop* theDesktop);
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 );
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 );
75 SPlot2d_Curve* getCurveByIO( const Handle(SALOME_InteractiveObject)&, Plot2d_ViewFrame* = 0 );
76 Plot2d_ViewFrame* getActiveViewFrame();
77 Handle(SALOME_InteractiveObject) FindIObject( const char* Entry );
80 virtual void onCloneView( Plot2d_ViewFrame*, Plot2d_ViewFrame* );
84 #endif // SPlot2d_ViewModel_H