20 #ifndef ModuleBase_IViewer_H
21 #define ModuleBase_IViewer_H
23 #include "ModuleBase.h"
27 #include <AIS_InteractiveContext.hxx>
28 #include <V3d_View.hxx>
29 #include <AIS_Trihedron.hxx>
33 class QContextMenuEvent;
36 class OCCViewer_Fitter;
58 virtual Handle(AIS_Trihedron) trihedron()
const = 0;
61 virtual Handle(V3d_Viewer) v3dViewer()
const = 0;
64 virtual Handle(V3d_View) activeView()
const = 0;
98 double theTwist ) = 0;
117 const double Scale(
const Handle(V3d_View)& theView)
119 if (!myWindowScale.contains(theView))
120 myWindowScale.insert(theView, theView->Camera()->Scale());
121 return myWindowScale[theView];
127 void SetScale(
const Handle(V3d_View)& theView,
const double theVal)
128 { myWindowScale[theView] = theVal; }
191 typedef std::list<std::pair<std::wstring, std::vector<int> > >
TextColor;
202 myShowHighlight =
true;
207 myShowHighlight =
false;
211 virtual void setFitter(OCCViewer_Fitter* theFitter) = 0;
212 virtual OCCViewer_Fitter* fitter()
const = 0;
218 static Handle(Prs3d_Drawer) DefaultHighlightDrawer;
274 bool myShowHighlight;
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
virtual bool canDragByMouse() const
Method returns True if the viewer can process editing objects by mouse drugging.
Definition: ModuleBase_IViewer.h:132
virtual void fitAll()=0
Perfroms the fit all for the active view.
virtual void setColorScaleTitle(const QString &theText)=0
Set title of color scale.
virtual void enableSelection(bool isEnabled)=0
Enable or disable selection in the viewer.
const double Scale(const Handle &&theView)
Returns a scale factor of the given view.
Definition: ModuleBase_IViewer.h:117
virtual void setColorScaleShown(bool on)=0
Show/Hide ColorScale object.
virtual void setColorScaleTextHeigth(int theH)=0
Set text heigth of color scale.
virtual void update()=0
Update current viewer.
void mousePress(ModuleBase_IViewWindow *theWnd, QMouseEvent *theEvent)
Signal emited on mouse press.
void contextMenuRequested(QContextMenuEvent *)
Signal emited on selection changed.
void viewTransformed(int theTransformation)
Signal emitted on transformation of view point in view window.
virtual void setColorScaleSize(double theW, double theH)=0
Set size of color scale.
virtual bool enableDrawMode(bool isEnabled)=0
Enable or disable draw mode in the viewer.
virtual void setColorScaleRange(double theMin, double theMax)=0
Set range of color scale.
QMap< Handle,, double > myWindowScale
A map for storing a scale factors dependent on view object.
Definition: ModuleBase_IViewer.h:270
void selectionChanged()
Signal emited on selection changed.
void viewCreated(ModuleBase_IViewWindow *theWnd)
Signal emited on creation of view window.
void SetScale(const Handle &&theView, const double theVal)
Remember a scale factor for the view object.
Definition: ModuleBase_IViewer.h:127
bool is2dMode() const
Returns current state of 2d mode flag.
Definition: ModuleBase_IViewer.h:147
void tryCloseView(ModuleBase_IViewWindow *theWnd)
Signal emited before view window is closed.
void showSelectionHighlight()
Switches On additional highlight for objects preselection.
Definition: ModuleBase_IViewer.h:201
virtual void setColorScaleIntervals(int theNb)=0
Set number of intervals of color scale.
void mouseDoubleClick(ModuleBase_IViewWindow *theWnd, QMouseEvent *theEvent)
Signal emited on mouse double click.
void trihedronVisibilityChanged(bool theState)
Signal emited on selection changed.
virtual void addSelectionFilter(const Handle &&theFilter)=0
Add selection filter to the viewer.
virtual void setColorScaleTextColor(const QColor &theColor)=0
Set color of text of color scale.
void keyPress(ModuleBase_IViewWindow *theWnd, QKeyEvent *theEvent)
Signal emited on key press.
virtual void updateHighlight()
Fit all along Z (perpendicular to display)
Definition: ModuleBase_IViewer.h:138
virtual bool hasSelectionFilter(const Handle &&theFilter)=0
Returns true if the selection filter is set to the viewer.
virtual void setColorScalePosition(double theX, double theY)=0
Set position of color scale.
virtual bool isSelectionEnabled() const =0
Returns true if selection is enabled.
void set2dMode(bool is2d)
Set flag which indicates that viewer is used for 2d operations.
Definition: ModuleBase_IViewer.h:142
void lastViewClosed()
Signal emited when last view window is closed.
virtual void setText(const TextColor &theText, const int theSize)=0
Sets the text displayed in right-top corner of the 3D view.
virtual void removeSelectionFilter(const Handle &&theFilter)=0
Remove selection filter from the viewer.
virtual void eraseAll()=0
Erases all presentations from the viewer.
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
virtual bool isColorScaleVisible() const =0
Returns True if ColorScale is visible.
void mouseRelease(ModuleBase_IViewWindow *theWnd, QMouseEvent *theEvent)
Signal emited on mouse release.
virtual QWidget * activeViewPort() const =0
Returns currently active view port widget.
virtual void setViewProjection(double theX, double theY, double theZ, double theTwist)=0
Sets the view projection.
virtual bool isMultiSelectionEnabled() const =0
Returns true if multiselection is enabled.
void keyRelease(ModuleBase_IViewWindow *theWnd, QKeyEvent *theEvent)
Signal emited on key release.
virtual void enableMultiselection(bool isEnable)=0
Enable or disable multiselection in the viewer.
void activated(ModuleBase_IViewWindow *theWnd)
Signal emited on key release.
void hideSelectionHighlight()
Switches Off additional highlight for objects preselection.
Definition: ModuleBase_IViewer.h:206
void mouseMove(ModuleBase_IViewWindow *theWnd, QMouseEvent *theEvent)
Signal emited on mouse move.
void deleteView(ModuleBase_IViewWindow *theWnd)
Signal emited on delete view window.