20 #ifndef SHAPERGUI_SalomeViewer_H
21 #define SHAPERGUI_SalomeViewer_H
23 #include "SHAPER_SHAPERGUI.h"
25 #include <ModuleBase_IViewer.h>
26 #include <ModuleBase_IViewWindow.h>
28 #include <OCCViewer_ViewWindow.h>
30 #include <V3d_View.hxx>
31 #include <AIS_Trihedron.hxx>
33 class SUIT_ViewWindow;
38 class OCCViewer_Viewer;
39 class SUIT_ViewManager;
54 virtual Handle(V3d_View) v3dView()
const;
61 void setViewer(OCCViewer_Viewer* theViewer) { myViewer = theViewer; }
64 OCCViewer_Viewer*
viewer()
const {
return myViewer; }
71 OCCViewer_Viewer* myViewer;
72 SUIT_ViewWindow* myCurrentView;
95 virtual Handle(V3d_Viewer) v3dViewer()
const;
98 virtual Handle(AIS_Trihedron) trihedron()
const;
101 virtual Handle(V3d_View) activeView()
const;
122 void reconnectActions(SUIT_ViewWindow* theWindow,
const bool theUseSHAPERSlot);
217 virtual void setFitter(OCCViewer_Fitter* theFitter);
218 virtual OCCViewer_Fitter* fitter()
const;
221 void onMousePress(SUIT_ViewWindow*, QMouseEvent*);
222 void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*);
223 void onMouseDoubleClick(SUIT_ViewWindow*, QMouseEvent*);
224 void onMouseMove(SUIT_ViewWindow*, QMouseEvent*);
225 void onKeyPress(SUIT_ViewWindow*, QKeyEvent*);
226 void onKeyRelease(SUIT_ViewWindow*, QKeyEvent*);
228 void onTryCloseView(SUIT_ViewWindow*);
229 void onDeleteView(SUIT_ViewWindow*);
230 void onViewCreated(SUIT_ViewWindow*);
231 void onActivated(SUIT_ViewManager*);
233 void onSelectionChanged();
234 void onViewTransformed(OCCViewer_ViewWindow::OperationType);
239 void onViewPortMapped();
242 void onAfterViewCreated();
247 bool myIsSelectionChanged;
250 NCollection_List<Handle(AIS_TextLabel)> myText;
Interface to ViewWindow object which contains 3d scene.
Definition: ModuleBase_IViewWindow.h:34
A Base object for definition of connector object to Salome Viewer.
Definition: ModuleBase_IViewer.h:47
std::list< std::pair< std::wstring, std::vector< int > > > TextColor
Type for mapping from text to color to display the names lines in different colors.
Definition: ModuleBase_IViewer.h:191
Redefinition of standard OCC selector in order to adapt it to SHAPER needs.
Definition: SHAPERGUI_OCCSelector.h:32
A class for providing access of SHAPERGUI functionality to SALOME view window functionality.
Definition: SHAPERGUI_SalomeViewer.h:48
OCCViewer_Viewer * viewer() const
Returns current viewer.
Definition: SHAPERGUI_SalomeViewer.h:64
void setCurrentView(SUIT_ViewWindow *theView)
Sets the current view.
Definition: SHAPERGUI_SalomeViewer.h:67
void setViewer(OCCViewer_Viewer *theViewer)
Set the current viewer.
Definition: SHAPERGUI_SalomeViewer.h:61
SHAPERGUI_SalomeView(OCCViewer_Viewer *theViewer)
Constructor.
Definition: SHAPERGUI_SalomeViewer.cpp:45
virtual QWidget * viewPort() const
Returns the view window view port.
Definition: SHAPERGUI_SalomeViewer.cpp:62
A class for providing access of SHAPERGUI functionality to SALOME viewer functionality.
Definition: SHAPERGUI_SalomeViewer.h:82
virtual bool isMultiSelectionEnabled() const
Returns true if multiselection is enabled.
Definition: SHAPERGUI_SalomeViewer.cpp:338
SHAPERGUI_OCCSelector * selector() const
Returns current selector.
Definition: SHAPERGUI_SalomeViewer.h:156
virtual void enableSelection(bool isEnabled)
Enable or disable selection in the viewer.
Definition: SHAPERGUI_SalomeViewer.cpp:311
virtual void fitAll()
Perfroms the fit all for the active view.
Definition: SHAPERGUI_SalomeViewer.cpp:381
virtual void setColorScaleSize(double theW, double theH)
Set size of color scale.
Definition: SHAPERGUI_SalomeViewer.cpp:555
virtual void setColorScaleRange(double theMin, double theMax)
Set range of color scale.
Definition: SHAPERGUI_SalomeViewer.cpp:564
virtual void setColorScaleTextColor(const QColor &theColor)
Set color of text of color scale.
Definition: SHAPERGUI_SalomeViewer.cpp:585
virtual bool isColorScaleVisible() const
Returns True if ColorScale is visible.
Definition: SHAPERGUI_SalomeViewer.cpp:531
void activateViewer(bool toActivate)
Activate or deactivate viewer.
Definition: SHAPERGUI_SalomeViewer.cpp:497
void setSelector(SHAPERGUI_OCCSelector *theSel)
Set selector.
Definition: SHAPERGUI_SalomeViewer.cpp:140
virtual void eraseAll()
Erases all presentations from the viewer.
Definition: SHAPERGUI_SalomeViewer.cpp:393
virtual void setViewProjection(double theX, double theY, double theZ, double theTwist)
Sets the view projection.
Definition: SHAPERGUI_SalomeViewer.cpp:412
void reconnectActions(SUIT_ViewWindow *theWindow, const bool theUseSHAPERSlot)
For some signals it disconnects the window from usual signal and connect it to the module ones.
Definition: SHAPERGUI_SalomeViewer.cpp:355
virtual void clearSelectionFilters()
Remove all selection filters from the viewer.
Definition: SHAPERGUI_SalomeViewer.cpp:467
virtual bool hasSelectionFilter(const Handle &&theFilter)
Returns true if the selection filter is set to the viewer.
Definition: SHAPERGUI_SalomeViewer.cpp:452
virtual void setColorScalePosition(double theX, double theY)
Set position of color scale.
Definition: SHAPERGUI_SalomeViewer.cpp:546
virtual void setColorScaleIntervals(int theNb)
Set number of intervals of color scale.
Definition: SHAPERGUI_SalomeViewer.cpp:571
virtual bool canDragByMouse() const
Method returns True if the viewer can process editing objects by mouse drugging.
Definition: SHAPERGUI_SalomeViewer.cpp:229
virtual void setColorScaleTextHeigth(int theH)
Set text heigth of color scale.
Definition: SHAPERGUI_SalomeViewer.cpp:578
virtual void setColorScaleShown(bool on)
Show/Hide ColorScale object.
Definition: SHAPERGUI_SalomeViewer.cpp:539
virtual void removeSelectionFilter(const Handle &&theFilter)
Remove selection filter from the viewer.
Definition: SHAPERGUI_SalomeViewer.cpp:443
virtual QWidget * activeViewPort() const
Returns viewer view port.
Definition: SHAPERGUI_SalomeViewer.cpp:127
virtual bool isSelectionEnabled() const
Returns true if selection is enabled.
Definition: SHAPERGUI_SalomeViewer.cpp:323
virtual void setText(const ModuleBase_IViewer::TextColor &theText, const int theSize)
Sets the text displayed in right-top corner of the 3D view.
Definition: SHAPERGUI_SalomeViewer.cpp:600
virtual void addSelectionFilter(const Handle &&theFilter)
Add selection filter to the viewer.
Definition: SHAPERGUI_SalomeViewer.cpp:434
virtual bool enableDrawMode(bool isEnabled)
Enable or disable draw mode in the viewer.
Definition: SHAPERGUI_SalomeViewer.cpp:346
SHAPERGUI_SalomeViewer(QObject *theParent)
Constructor.
Definition: SHAPERGUI_SalomeViewer.cpp:78
virtual void enableMultiselection(bool isEnable)
Enable or disable multiselection in the viewer.
Definition: SHAPERGUI_SalomeViewer.cpp:331
virtual void setColorScaleTitle(const QString &theText)
Set title of color scale.
Definition: SHAPERGUI_SalomeViewer.cpp:593
virtual void update()
Update current viewer.
Definition: SHAPERGUI_SalomeViewer.cpp:476