Salome HOME
Join modifications from branch BR_DEBUG_3_2_0b1
[modules/gui.git] / src / SOCC / SOCC_ViewModel.h
1 // Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
2 // 
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.
7 // 
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 #ifndef SOCC_VIEWMODEL_H
20 #define SOCC_VIEWMODEL_H
21
22 #ifdef WIN32
23 #pragma warning( disable:4251 )
24 #endif
25
26 #include "SOCC.h"
27 #include "SALOME_Prs.h"
28 #include "OCCViewer_ViewModel.h"
29 #include "SALOME_InteractiveObject.hxx"
30
31 class SOCC_EXPORT SOCC_Viewer: public OCCViewer_Viewer, public SALOME_View
32 {
33   Q_OBJECT
34
35 public:
36   SOCC_Viewer( bool DisplayTrihedron = true );
37   virtual ~SOCC_Viewer();
38
39   /* Selection management */
40   bool      highlight( const Handle(SALOME_InteractiveObject)&, bool, bool=true );
41   bool      isInViewer( const Handle(SALOME_InteractiveObject)&, bool=false );
42
43   void      setColor( const Handle(SALOME_InteractiveObject)&, const QColor&, bool=true );
44   void      switchRepresentation( const Handle(SALOME_InteractiveObject)&, int, bool=true );
45   void      setTransparency( const Handle(SALOME_InteractiveObject)&, float, bool=true );
46
47   void      rename( const Handle(SALOME_InteractiveObject)&, const QString& );
48
49   virtual   SUIT_ViewWindow* createView(SUIT_Desktop* theDesktop);
50
51   /* Reimplemented from SALOME_View */
52   virtual void                Display( const SALOME_OCCPrs* );
53   virtual void                Erase( const SALOME_OCCPrs*, const bool = false );
54   virtual void                EraseAll( const bool = false );
55   virtual SALOME_Prs*         CreatePrs( const char* entry = 0 );
56   virtual void                BeforeDisplay( SALOME_Displayer* d );
57   virtual void                AfterDisplay ( SALOME_Displayer* d );
58   virtual void                LocalSelection( const SALOME_OCCPrs*, const int );
59   virtual void                GlobalSelection( const bool = false ) const;
60   virtual bool                isVisible( const Handle(SALOME_InteractiveObject)& );
61   virtual void                Repaint();
62
63   // a utility function, used by SALOME_View_s methods
64   bool                        getTrihedronSize( double& theNewSize, double& theSize );
65
66 };
67
68 #ifdef WIN32
69 #pragma warning( default:4251 )
70 #endif
71
72 #endif