Back to index

salome-gui  6.5.0
SPlot2d_ViewModel.h
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //  File   : SPlot2d_ViewModel.h
00024 //  Author : Sergey RUIN
00025 //  Module : SUIT
00026 //
00027 #ifndef SPlot2d_ViewModel_H
00028 #define SPlot2d_ViewModel_H
00029 
00030 #include "SPlot2d.h"
00031 #include "SPlot2d_Curve.h"
00032 #include "Plot2d_ViewModel.h"
00033 #include "Plot2d_ViewFrame.h"
00034 #include "Plot2d_ViewWindow.h"
00035 
00036 #include <SALOME_Prs.h>
00037 #include <SALOME_InteractiveObject.hxx>
00038 #include <SALOME_ListIO.hxx>
00039 
00040 class SPLOT2D_EXPORT SPlot2d_Viewer : public Plot2d_Viewer, public SALOME_View
00041 { 
00042   Q_OBJECT
00043 
00044 public:
00045   static QString Type() { return "Plot2d"; }
00046 
00047   /* Construction/destruction */
00048   SPlot2d_Viewer( bool theAutoDel = false );
00049   virtual ~SPlot2d_Viewer();
00050 
00051 public:
00052   virtual QString          getType() const { return Type(); }
00053 
00054   /*  interactive object management */
00055   void highlight( const Handle(SALOME_InteractiveObject)& IObject, bool highlight, bool update = true ) {}
00056   void unHighlightAll() {}
00057   void rename( const Handle(SALOME_InteractiveObject)&, const QString&, Plot2d_ViewFrame* = 0 );
00058   void renameAll( const Handle(SALOME_InteractiveObject)&, const QString& );
00059   bool isInViewer( const Handle(SALOME_InteractiveObject)& IObject );
00060 
00061   virtual   SUIT_ViewWindow* createView(SUIT_Desktop* theDesktop);
00062   
00063   /* display */         
00064   void Display( const Handle(SALOME_InteractiveObject)& IObject, bool update = true );
00065   void DisplayOnly( const Handle(SALOME_InteractiveObject)& IObject );
00066   void Erase( const Handle(SALOME_InteractiveObject)& IObject, bool update = true );
00067 
00068   /* Reimplemented from SALOME_View */
00069   void                 Display( const SALOME_Prs2d* );
00070   void                 Erase( const SALOME_Prs2d*, const bool = false );
00071   virtual void         EraseAll(const bool = false);
00072   virtual void         Repaint();
00073   virtual SALOME_Prs*  CreatePrs( const char* entry = 0 );
00074 
00075   virtual bool         isVisible( const Handle(SALOME_InteractiveObject)& IObject );
00076   virtual void         GetVisible( SALOME_ListIO& theList );
00077 
00078   virtual void         setObjectsSelected(  SALOME_ListIO& theList );
00079 
00080 
00081   /* operations */
00082   SPlot2d_Curve*                   getCurveByIO( const Handle(SALOME_InteractiveObject)&, Plot2d_ViewFrame* = 0 );
00083   Plot2d_ViewFrame*                getActiveViewFrame();
00084   Handle(SALOME_InteractiveObject) FindIObject( const char* Entry );
00085 
00086 protected slots:
00087   virtual void onLegendClicked( QwtPlotItem* plotItem );
00088 
00089 signals:
00090   void legendSelected( const QString& );
00091   void clearSelected();
00092 private:
00093   bool myDeselectAnalytical;
00094 };
00095 
00096 
00097 #endif // SPlot2d_ViewModel_H
00098 
00099 
00100 
00101