Back to index

salome-gui  6.5.0
SOCC_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 #ifndef SOCC_VIEWMODEL_H
00024 #define SOCC_VIEWMODEL_H
00025 
00026 #ifdef WIN32
00027 #pragma warning( disable:4251 )
00028 #endif
00029 
00030 #include "SOCC.h"
00031 #include "SALOME_Prs.h"
00032 #include "OCCViewer_ViewModel.h"
00033 
00034 class SALOME_ListIO;
00035 class Handle(SALOME_InteractiveObject);
00036 
00037 class SOCC_EXPORT SOCC_Viewer: public OCCViewer_Viewer, public SALOME_View
00038 {
00039   Q_OBJECT
00040 
00041 public:
00042   SOCC_Viewer( bool DisplayTrihedron = true );
00043   virtual ~SOCC_Viewer();
00044 
00045   /* Selection management */
00046   bool      highlight( const Handle(SALOME_InteractiveObject)&, bool, bool=true );
00047   bool      isInViewer( const Handle(SALOME_InteractiveObject)&, bool=false );
00048 
00049   void      setColor( const Handle(SALOME_InteractiveObject)&, const QColor&, bool=true );
00050   void      switchRepresentation( const Handle(SALOME_InteractiveObject)&, int, bool=true );
00051   void      setTransparency( const Handle(SALOME_InteractiveObject)&, float, bool=true );
00052 
00053   void      rename( const Handle(SALOME_InteractiveObject)&, const QString& );
00054 
00055   //virtual   SUIT_ViewWindow* createView(SUIT_Desktop* theDesktop);
00056   virtual OCCViewer_ViewWindow* createSubWindow();
00057 
00058   /* Reimplemented from SALOME_View */
00059   virtual void                Display( const SALOME_OCCPrs* );
00060   virtual void                Erase( const SALOME_OCCPrs*, const bool = false );
00061   virtual void                EraseAll( const bool = false );
00062   virtual SALOME_Prs*         CreatePrs( const char* entry = 0 );
00063 
00064   virtual void                LocalSelection( const SALOME_OCCPrs*, const int );
00065   virtual void                GlobalSelection( const bool = false ) const;
00066   virtual bool                isVisible( const Handle(SALOME_InteractiveObject)& );
00067   virtual void                GetVisible( SALOME_ListIO& );
00068   virtual void                Repaint();
00069 
00070   //a map to store AIS objects associated to a SALOME entry
00071   std::map< std::string , std::vector<Handle(AIS_InteractiveObject)> > entry2aisobjects;
00072 };
00073 
00074 #ifdef WIN32
00075 #pragma warning( default:4251 )
00076 #endif
00077 
00078 #endif