1 // Copyright (C) 2023 CEA/DEN, EDF 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, 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 #pragma warning( disable:4251 )
28 #include "PV3DViewer_ViewWindow.h"
29 #include "SPV3D_Prs.h"
31 #include "SALOME_InteractiveObject.hxx"
32 #include "SALOME_ListIO.hxx"
37 class SPV3D_ViewModel;
38 class SPV3D_CADSelection;
40 //! Define a container for SALOME PV3D view window
41 class SPV3D_EXPORT SPV3D_ViewWindow : public PV3DViewer_ViewWindow
46 //! To construct #SPV3D_ViewWindow instance
47 SPV3D_ViewWindow(SUIT_Desktop* theDesktop, SPV3D_ViewModel* theModel);
49 SPV3D_Prs *findOrCreatePrs( const char* entry );
51 SPV3D_EXPORTSPV3DData *isEntryAlreadyExist( const char* entry ) const;
55 virtual ~SPV3D_ViewWindow();
57 bool isVisible(const Handle(SALOME_InteractiveObject)& theIObject);
60 //----------------------------------------------------------------------------
61 //! Redirect the request to #SPV3D_View::Display (to support old code)
62 virtual void Display(const Handle(SALOME_InteractiveObject)& theIObject,
63 bool theImmediatly = true);
65 //! Redirect the request to #SPV3D_View::DisplayOnly (to support old code)
66 virtual void DisplayOnly(const Handle(SALOME_InteractiveObject)& theIObject);
68 //! Redirect the request to #SPV3D_View::Erase (to support old code)
69 virtual void Erase(const Handle(SALOME_InteractiveObject)& theIObject,
70 bool theImmediatly = true);
72 //! Redirect the request to #SPV3D_View::DisplayAll (to support old code)
73 virtual void DisplayAll();
75 //! Redirect the request to #SPV3D_View::EraseAll (to support old code)
76 virtual void EraseAll();
78 //! To repaint the viewer
79 virtual void Repaint(bool theUpdateTrihedron = true);
81 //! Enable/disable selection
82 virtual void SetSelectionEnabled( bool );
85 void Show( QShowEvent * );
86 void Hide( QHideEvent * );
89 virtual void showEvent( QShowEvent * );
90 virtual void hideEvent( QHideEvent * );
91 void showCenterAxes(bool);
92 void pickCenterOfRotation(int posx, int posy);
93 void goSelect(bool val);
96 void onKeyPressed(QKeyEvent* event);
97 void onKeyReleased(QKeyEvent* event);
98 void onMousePressed(QMouseEvent* event);
99 void onMouseDoubleClicked(QMouseEvent* event);
100 void onMouseReleased(QMouseEvent* event);
101 void onMouseMoving(QMouseEvent* event);
104 SPV3D_CADSelection *mySelection = nullptr;
106 SPV3D_ViewModel* myModel;
107 std::list< std::pair<std::string, std::unique_ptr<SPV3D_EXPORTSPV3DData> > > myPrs;
111 #pragma warning( default:4251 )