Version: 9.16.0
SOCC_ViewModel.h
Go to the documentation of this file.
1// Copyright (C) 2007-2026 CEA, EDF, OPEN CASCADE
2//
3// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5//
6// This library is free software; you can redistribute it and/or
7// modify it under the terms of the GNU Lesser General Public
8// License as published by the Free Software Foundation; either
9// version 2.1 of the License, or (at your option) any later version.
10//
11// This library is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14// Lesser General Public License for more details.
15//
16// You should have received a copy of the GNU Lesser General Public
17// License along with this library; if not, write to the Free Software
18// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19//
20// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21//
22
23#ifndef SOCC_VIEWMODEL_H
24#define SOCC_VIEWMODEL_H
25
26#ifdef WIN32
27#pragma warning( disable:4251 )
28#endif
29
30#include "SOCC.h"
31#include "SALOME_Prs.h"
32#include "OCCViewer_ViewModel.h"
33
34class SALOME_ListIO;
36
38{
39 Q_OBJECT
40
41public:
42 SOCC_Viewer( bool DisplayTrihedron = true );
43 virtual ~SOCC_Viewer();
44
45 /* Selection management */
46 bool highlight( const Handle(SALOME_InteractiveObject)&, bool, bool=true );
47 bool isInViewer( const Handle(SALOME_InteractiveObject)&, bool=false );
48
49 void setColor( const Handle(SALOME_InteractiveObject)&, const QColor&, bool=true );
50 void switchRepresentation( const Handle(SALOME_InteractiveObject)&, int, bool=true );
51 void setTransparency( const Handle(SALOME_InteractiveObject)&, float, bool=true );
52
53 void rename( const Handle(SALOME_InteractiveObject)&, const QString& );
54
55 //virtual SUIT_ViewWindow* createView(SUIT_Desktop* theDesktop);
57
58 /* Reimplemented from SALOME_View */
59 virtual void Display( const SALOME_OCCPrs* );
60 virtual void Erase( const SALOME_OCCPrs*, const bool = false );
61 virtual void EraseAll( SALOME_Displayer*, const bool = false );
62 virtual SALOME_Prs* CreatePrs( const char* entry = 0 );
63
64 virtual void LocalSelection( const SALOME_OCCPrs*, const int );
65 virtual void LocalSelection( const SALOME_OCCPrs*, const std::list<int> );
66 virtual void GlobalSelection( const bool = false ) const;
67 virtual bool isVisible( const Handle(SALOME_InteractiveObject)& );
68 virtual void GetVisible( SALOME_ListIO& );
69 virtual void Repaint();
70
71 //a map to store AIS objects associated to a SALOME entry
72 std::map< std::string , std::vector<Handle(AIS_InteractiveObject)> > entry2aisobjects;
73};
74
75#ifdef WIN32
76#pragma warning( default:4251 )
77#endif
78
79#endif
#define SOCC_EXPORT
Definition: SOCC.h:30
Definition: OCCViewer_ViewWindow.h:147
Definition: OCCViewer_ViewModel.h:77
void switchRepresentation(const Handle(AIS_InteractiveObject)&, int, bool=true)
Definition: OCCViewer_ViewModel.cxx:1277
bool isVisible(const Handle(AIS_InteractiveObject)&)
Definition: OCCViewer_ViewModel.cxx:1243
Handle(V3d_Viewer) getViewer3d() const
Definition: OCCViewer_ViewModel.h:178
bool highlight(const Handle(AIS_InteractiveObject)&, bool, bool=true)
Definition: OCCViewer_ViewModel.cxx:1190
virtual OCCViewer_ViewWindow * createSubWindow()
Definition: OCCViewer_ViewModel.cxx:1544
void setTransparency(const Handle(AIS_InteractiveObject)&, float, bool=true)
Definition: OCCViewer_ViewModel.cxx:1291
bool isInViewer(const Handle(AIS_InteractiveObject)&, bool=false)
Definition: OCCViewer_ViewModel.cxx:1225
void setColor(const Handle(AIS_InteractiveObject)&, const QColor &, bool=true)
Definition: OCCViewer_ViewModel.cxx:1254
Definition: SALOME_Prs.h:366
Definition: SALOME_ListIO.hxx:29
Definition: SALOME_Prs.h:116
Definition: SALOME_Prs.h:53
Definition: SALOME_Prs.h:292
virtual void GetVisible(SALOME_ListIO &)
Definition: SALOME_Prs.h:358
void Erase(SALOME_Displayer *, const SALOME_Prs *, const bool=false)
This Erase() method should be called to erase given presentation created anywhere by anybody.
Definition: SALOME_Prs.cxx:340
void LocalSelection(const SALOME_Prs *, const int)
This LocalSelection() method should be called to activate sub-shapes selection created anywhere by an...
Definition: SALOME_Prs.cxx:349
void Display(SALOME_Displayer *, const SALOME_Prs *)
This Display() method should be called to display given presentation created anywhere by anybody.
Definition: SALOME_Prs.cxx:331
virtual void GlobalSelection(const bool=false) const
Deactivates selection of sub-shapes (must be redefined with OCC viewer)
Definition: SALOME_Prs.cxx:485
virtual void Repaint()
Null body here.
Definition: SALOME_Prs.h:357
virtual SALOME_Prs * CreatePrs(const char *=0)
Creates empty presentation of corresponding type.
Definition: SALOME_Prs.h:344
virtual void EraseAll(SALOME_Displayer *, const bool=false)
This EraseAll() method should be called to erase all presentations created anywhere by anybody.
Definition: SALOME_Prs.cxx:431
Definition: SOCC_ViewModel.h:38
std::map< std::string, std::vector< Handle(AIS_InteractiveObject)> > entry2aisobjects
Definition: SOCC_ViewModel.h:72