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/
19 #ifndef SOCC_VIEWMODEL_H
20 #define SOCC_VIEWMODEL_H
23 #pragma warning( disable:4251 )
27 #include "SALOME_Prs.h"
28 #include "OCCViewer_ViewModel.h"
29 #include "SALOME_InteractiveObject.hxx"
31 class SOCC_EXPORT SOCC_Viewer: public OCCViewer_Viewer, public SALOME_View
36 SOCC_Viewer( bool DisplayTrihedron = true );
37 virtual ~SOCC_Viewer();
39 /* Selection management */
40 bool highlight( const Handle(SALOME_InteractiveObject)&, bool, bool=true );
41 bool isInViewer( const Handle(SALOME_InteractiveObject)&, bool=false );
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 );
47 void rename( const Handle(SALOME_InteractiveObject)&, const QString& );
49 virtual SUIT_ViewWindow* createView(SUIT_Desktop* theDesktop);
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();
63 // a utility function, used by SALOME_View_s methods
64 bool getTrihedronSize( double& theNewSize, double& theSize );
69 #pragma warning( default:4251 )