1 // Copyright (C) 2023 CEA, EDF
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, or (at your option) any later version.
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/ or email : webmaster.salome@opencascade.com
23 #include "PV3DViewer_ViewModel.h"
25 #include <SALOME_Prs.h>
26 #include <SALOME_InteractiveObject.hxx>
27 #include <SALOME_ListIO.hxx>
30 class pqPipelineSource;
33 //! Extends two interfaces #SPV3D_ViewModelBase and #SALOME_View
34 class SPV3D_EXPORT SPV3D_ViewModel : public PV3DViewer_ViewModel, public SALOME_View
38 void setView(pqView *view) { _view = view; }
39 pqView *getView() const;
42 //! Define string representation of the viewer type
43 static QString Type() { return "ParaView3D"; }
46 virtual ~SPV3D_ViewModel();
48 virtual void initialize();
50 //! See #SUIT_ViewModel::createView
51 virtual SUIT_ViewWindow* createView(SUIT_Desktop*);
53 //! See #SUIT_ViewModel::createView
54 virtual void setViewManager(SUIT_ViewManager* theViewManager);
56 //! See #SUIT_ViewModel::contextMenuPopup
57 virtual void contextMenuPopup( QMenu* );
59 //! See #SUIT_ViewModel::getType
60 virtual QString getType() const { return Type(); }
63 void enableSelection(bool isEnabled);
64 bool isSelectionEnabled() const { return mySelectionEnabled; }
66 /* Reimplemented from SALOME_View */
68 //! See #SALOME_View::Display( const SALOME_Prs* )
69 void Display( const SALOME_PV3DPrs* );
71 //! See #SALOME_View::Erase( const SALOME_PV3DPrs*, const bool = false )
72 void Erase( const SALOME_PV3DPrs*, const bool = false );
74 //! See #SALOME_View::EraseAll( SALOME_Displayer*, const bool = false )
75 void EraseAll( SALOME_Displayer*, const bool = false );
77 //! See #SALOME_View::getVisible( SALOME_ListIO& )
78 virtual void GetVisible( SALOME_ListIO& );
80 //! See #SALOME_View::CreatePrs( const char* entry = 0 )
81 SALOME_Prs* CreatePrs( const char* entry = 0 );
83 //! See #SALOME_View::isVisible( const Handle(SALOME_InteractiveObject)& )
84 virtual bool isVisible( const Handle(SALOME_InteractiveObject)& );
86 //! See #SALOME_View::Repaint()
87 virtual void Repaint();
90 void onMousePress(SUIT_ViewWindow*, QMouseEvent*);
91 void onMouseMove(SUIT_ViewWindow*, QMouseEvent*);
92 void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*);
94 void onViewCreated( SUIT_ViewWindow* );
96 void onSourceCreated(pqPipelineSource* source);
97 void showSelectedMode();
100 pqPipelineSource* GeometrySource = nullptr;
101 pqPipelineSource* MeshSource = nullptr;
104 bool mySelectionEnabled;
105 pqView *_view = nullptr;