Version: 9.16.0
SPV3D_ViewWindow.h
Go to the documentation of this file.
1// Copyright (C) 2023-2026 CEA, EDF
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, or (at your option) any later version.
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
20#pragma once
21
22#ifdef WIN32
23#pragma warning( disable:4251 )
24#endif
25
26#include "SPV3D.h"
27#include "Qtx.h"
29#include "SPV3D_Prs.h"
30
32#include "SALOME_ListIO.hxx"
33
34#include <list>
35#include <memory>
36
37class SPV3D_ViewModel;
39
42{
43 Q_OBJECT
44
45 public:
47 SPV3D_ViewWindow(SUIT_Desktop* theDesktop, SPV3D_ViewModel* theModel);
48
49 SPV3D_Prs *findOrCreatePrs( const char* entry );
50
51 unsigned int isEntryAlreadyExist( const char* entry ) const;
52
53 void ExportToSPV3D(vtkPolyData* ds, const char*);
54
55 void init();
56
57 virtual ~SPV3D_ViewWindow();
58
59 bool isVisible(const Handle(SALOME_InteractiveObject)& theIObject);
60
61 /* display */
62 //----------------------------------------------------------------------------
64 virtual void Display(const Handle(SALOME_InteractiveObject)& theIObject,
65 bool theImmediatly = true);
66
68 virtual void DisplayOnly(const Handle(SALOME_InteractiveObject)& theIObject);
69
71 virtual void Erase(const Handle(SALOME_InteractiveObject)& theIObject,
72 bool theImmediatly = true);
73
75 virtual void DisplayAll();
76
78 virtual void EraseAll();
79
81 virtual void Repaint(bool theUpdateTrihedron = true);
82
84 virtual void SetSelectionEnabled( bool );
85
86 signals:
87 void Show( QShowEvent * );
88 void Hide( QHideEvent * );
89
90public slots:
91 virtual void showEvent( QShowEvent * );
92 virtual void hideEvent( QHideEvent * );
93 void showCenterAxes(bool);
94 void pickCenterOfRotation(int posx, int posy);
95 void goSelect(bool val);
96
97protected slots:
98 void onKeyPressed(QKeyEvent* event);
99 void onKeyReleased(QKeyEvent* event);
100 void onMousePressed(QMouseEvent* event);
101 void onMouseDoubleClicked(QMouseEvent* event);
102 void onMouseReleased(QMouseEvent* event);
103 void onMouseMoving(QMouseEvent* event);
104
105protected:
106 SPV3D_CADSelection *mySelection = nullptr;
107 int myToolBar = -1;
109 //std::list< std::pair<std::string, std::unique_ptr<SPV3D_EXPORTSPV3DData> > > myPrs;
110 std::list< std::pair<std::string, SPV3D_Prs* > > Prs;
111 std::unique_ptr<SPV3D_EXPORTSPV3DData> myPrs;
112};
113
114#ifdef WIN32
115#pragma warning( default:4251 )
116#endif
Handle(TDocStd_Application) CAF_Application
Get OCAF application.
Definition: CAF_Application.cxx:97
#define SPV3D_EXPORT
Definition: SPV3D.h:33
Definition: PV3DViewer_ViewWindow.h:33
SPV3D_CADSelection handles various selection modes available on RenderViews.
Definition: SPV3D_CADSelection.h:50
Definition: SPV3D_Prs.h:71
Extends two interfaces #SPV3D_ViewModelBase and SALOME_View.
Definition: SPV3D_ViewModel.h:38
Define a container for SALOME PV3D view window.
Definition: SPV3D_ViewWindow.h:42
void Show(QShowEvent *)
std::unique_ptr< SPV3D_EXPORTSPV3DData > myPrs
Definition: SPV3D_ViewWindow.h:111
void Hide(QHideEvent *)
SPV3D_ViewModel * myModel
Definition: SPV3D_ViewWindow.h:108
std::list< std::pair< std::string, SPV3D_Prs * > > Prs
Definition: SPV3D_ViewWindow.h:110
Definition: SUIT_Desktop.h:47