SHAPER  9.12.0
ModuleBase_IViewer Class Referenceabstract

A Base object for definition of connector object to Salome Viewer. More...

Inheritance diagram for ModuleBase_IViewer:
Inheritance graph

Public Types

typedef 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. More...
 

Signals

void lastViewClosed ()
 Signal emited when last view window is closed. More...
 
void tryCloseView (ModuleBase_IViewWindow *theWnd)
 Signal emited before view window is closed. More...
 
void deleteView (ModuleBase_IViewWindow *theWnd)
 Signal emited on delete view window. More...
 
void viewCreated (ModuleBase_IViewWindow *theWnd)
 Signal emited on creation of view window. More...
 
void activated (ModuleBase_IViewWindow *theWnd)
 Signal emited on key release. More...
 
void mousePress (ModuleBase_IViewWindow *theWnd, QMouseEvent *theEvent)
 Signal emited on mouse press. More...
 
void mouseRelease (ModuleBase_IViewWindow *theWnd, QMouseEvent *theEvent)
 Signal emited on mouse release. More...
 
void mouseDoubleClick (ModuleBase_IViewWindow *theWnd, QMouseEvent *theEvent)
 Signal emited on mouse double click. More...
 
void mouseMove (ModuleBase_IViewWindow *theWnd, QMouseEvent *theEvent)
 Signal emited on mouse move. More...
 
void keyPress (ModuleBase_IViewWindow *theWnd, QKeyEvent *theEvent)
 Signal emited on key press. More...
 
void keyRelease (ModuleBase_IViewWindow *theWnd, QKeyEvent *theEvent)
 Signal emited on key release. More...
 
void selectionChanged ()
 Signal emited on selection changed. More...
 
void contextMenuRequested (QContextMenuEvent *)
 Signal emited on selection changed. More...
 
void viewTransformed (int theTransformation)
 Signal emitted on transformation of view point in view window. More...
 
void trihedronVisibilityChanged (bool theState)
 Signal emited on selection changed. More...
 

Public Member Functions

 ModuleBase_IViewer (QObject *theParent)
 Constructor. More...
 
virtual HandleAAISContext () const =0
 Returns AIS_InteractiveContext from current OCCViewer. More...
 
virtual Handlettrihedron () const =0
 Trihedron 3d object shown in the viewer. More...
 
virtual Handlevv3dViewer () const =0
 Retrurns V3d_Vioewer from current viewer. More...
 
virtual HandleaactiveView () const =0
 Returns Vsd_View object from currently active view window. More...
 
virtual QWidgetactiveViewPort () const =0
 Returns currently active view port widget. More...
 
virtual void enableSelection (bool isEnabled)=0
 Enable or disable selection in the viewer. More...
 
virtual bool isSelectionEnabled () const =0
 Returns true if selection is enabled. More...
 
virtual void enableMultiselection (bool isEnable)=0
 Enable or disable multiselection in the viewer. More...
 
virtual bool isMultiSelectionEnabled () const =0
 Returns true if multiselection is enabled. More...
 
virtual bool enableDrawMode (bool isEnabled)=0
 Enable or disable draw mode in the viewer. More...
 
virtual void fitAll ()=0
 Perfroms the fit all for the active view. More...
 
virtual void eraseAll ()=0
 Erases all presentations from the viewer. More...
 
virtual void setViewProjection (double theX, double theY, double theZ, double theTwist)=0
 Sets the view projection. More...
 
virtual void addSelectionFilter (const Handle &&theFilter)=0
 Add selection filter to the viewer. More...
 
virtual void removeSelectionFilter (const Handle &&theFilter)=0
 Remove selection filter from the viewer. More...
 
virtual bool hasSelectionFilter (const Handle &&theFilter)=0
 Returns true if the selection filter is set to the viewer. More...
 
virtual void update ()=0
 Update current viewer. More...
 
const double Scale (const Handle &&theView)
 Returns a scale factor of the given view. More...
 
void SetScale (const Handle &&theView, const double theVal)
 Remember a scale factor for the view object. More...
 
virtual bool canDragByMouse () const
 Method returns True if the viewer can process editing objects by mouse drugging. More...
 
virtual void updateHighlight ()
 Fit all along Z (perpendicular to display) More...
 
void set2dMode (bool is2d)
 Set flag which indicates that viewer is used for 2d operations. More...
 
bool is2dMode () const
 Returns current state of 2d mode flag. More...
 
virtual bool isColorScaleVisible () const =0
 Returns True if ColorScale is visible. More...
 
virtual void setColorScaleShown (bool on)=0
 Show/Hide ColorScale object. More...
 
virtual void setColorScalePosition (double theX, double theY)=0
 Set position of color scale. More...
 
virtual void setColorScaleSize (double theW, double theH)=0
 Set size of color scale. More...
 
virtual void setColorScaleRange (double theMin, double theMax)=0
 Set range of color scale. More...
 
virtual void setColorScaleIntervals (int theNb)=0
 Set number of intervals of color scale. More...
 
virtual void setColorScaleTextHeigth (int theH)=0
 Set text heigth of color scale. More...
 
virtual void setColorScaleTextColor (const QColor &theColor)=0
 Set color of text of color scale. More...
 
virtual void setColorScaleTitle (const QString &theText)=0
 Set title of color scale. More...
 
virtual void setText (const TextColor &theText, const int theSize)=0
 Sets the text displayed in right-top corner of the 3D view. More...
 
void showSelectionHighlight ()
 Switches On additional highlight for objects preselection. More...
 
void hideSelectionHighlight ()
 Switches Off additional highlight for objects preselection. More...
 
virtual void setFitter (AppElements_Fitter *theFitter)=0
 
virtual AppElements_Fitterfitter () const =0
 

Static Public Attributes

static HandleDDefaultHighlightDrawer
 

Protected Attributes

QMap< Handle,, double > myWindowScale
 A map for storing a scale factors dependent on view object. More...
 
bool myIs2dMode
 
bool myShowHighlight
 

Detailed Description

A Base object for definition of connector object to Salome Viewer.

Reimplemented in SHAPERGUI_SalomeViewer class

Member Typedef Documentation

◆ TextColor

typedef std::list<std::pair<std::wstring, std::vector<int> > > ModuleBase_IViewer::TextColor

Type for mapping from text to color to display the names lines in different colors.

Constructor & Destructor Documentation

◆ ModuleBase_IViewer()

ModuleBase_IViewer::ModuleBase_IViewer ( QObject theParent)

Constructor.

Parameters
theParenta parent object

Member Function Documentation

◆ HandleAAISContext()

virtual ModuleBase_IViewer::HandleAAISContext ( ) const
pure virtual

Returns AIS_InteractiveContext from current OCCViewer.

Implemented in XGUI_ViewerProxy, and SHAPERGUI_SalomeViewer.

◆ Handlettrihedron()

virtual ModuleBase_IViewer::Handlettrihedron ( ) const
pure virtual

Trihedron 3d object shown in the viewer.

Implemented in XGUI_ViewerProxy, and SHAPERGUI_SalomeViewer.

◆ Handlevv3dViewer()

virtual ModuleBase_IViewer::Handlevv3dViewer ( ) const
pure virtual

Retrurns V3d_Vioewer from current viewer.

Implemented in XGUI_ViewerProxy, and SHAPERGUI_SalomeViewer.

◆ HandleaactiveView()

virtual ModuleBase_IViewer::HandleaactiveView ( ) const
pure virtual

Returns Vsd_View object from currently active view window.

Implemented in XGUI_ViewerProxy, and SHAPERGUI_SalomeViewer.

◆ activeViewPort()

virtual QWidget* ModuleBase_IViewer::activeViewPort ( ) const
pure virtual

Returns currently active view port widget.

Implemented in XGUI_ViewerProxy, and SHAPERGUI_SalomeViewer.

◆ enableSelection()

virtual void ModuleBase_IViewer::enableSelection ( bool  isEnabled)
pure virtual

Enable or disable selection in the viewer.

Parameters
isEnabledis enable or disable flag

Implemented in XGUI_ViewerProxy, and SHAPERGUI_SalomeViewer.

◆ isSelectionEnabled()

virtual bool ModuleBase_IViewer::isSelectionEnabled ( ) const
pure virtual

Returns true if selection is enabled.

Implemented in XGUI_ViewerProxy, and SHAPERGUI_SalomeViewer.

◆ enableMultiselection()

virtual void ModuleBase_IViewer::enableMultiselection ( bool  isEnable)
pure virtual

Enable or disable multiselection in the viewer.

Parameters
isEnableis enable or disable flag

Implemented in XGUI_ViewerProxy, and SHAPERGUI_SalomeViewer.

◆ isMultiSelectionEnabled()

virtual bool ModuleBase_IViewer::isMultiSelectionEnabled ( ) const
pure virtual

Returns true if multiselection is enabled.

Implemented in XGUI_ViewerProxy, and SHAPERGUI_SalomeViewer.

◆ enableDrawMode()

virtual bool ModuleBase_IViewer::enableDrawMode ( bool  isEnabled)
pure virtual

Enable or disable draw mode in the viewer.

Implemented in XGUI_ViewerProxy, and SHAPERGUI_SalomeViewer.

◆ fitAll()

virtual void ModuleBase_IViewer::fitAll ( )
pure virtual

Perfroms the fit all for the active view.

Implemented in XGUI_ViewerProxy, and SHAPERGUI_SalomeViewer.

◆ eraseAll()

virtual void ModuleBase_IViewer::eraseAll ( )
pure virtual

Erases all presentations from the viewer.

Implemented in XGUI_ViewerProxy, and SHAPERGUI_SalomeViewer.

◆ setViewProjection()

virtual void ModuleBase_IViewer::setViewProjection ( double  theX,
double  theY,
double  theZ,
double  theTwist 
)
pure virtual

Sets the view projection.

Parameters
theXthe X projection value
theYthe Y projection value
theZthe Z projection value
theTwistthe twist angle in radians

Implemented in XGUI_ViewerProxy, and SHAPERGUI_SalomeViewer.

◆ addSelectionFilter()

virtual void ModuleBase_IViewer::addSelectionFilter ( const Handle &&  theFilter)
pure virtual

Add selection filter to the viewer.

Parameters
theFiltera selection filter

Implemented in XGUI_ViewerProxy, and SHAPERGUI_SalomeViewer.

◆ removeSelectionFilter()

virtual void ModuleBase_IViewer::removeSelectionFilter ( const Handle &&  theFilter)
pure virtual

Remove selection filter from the viewer.

Parameters
theFiltera selection filter

Implemented in XGUI_ViewerProxy, and SHAPERGUI_SalomeViewer.

◆ hasSelectionFilter()

virtual bool ModuleBase_IViewer::hasSelectionFilter ( const Handle &&  theFilter)
pure virtual

Returns true if the selection filter is set to the viewer.

Parameters
theFiltera selection filter

Implemented in XGUI_ViewerProxy, and SHAPERGUI_SalomeViewer.

◆ update()

virtual void ModuleBase_IViewer::update ( )
pure virtual

Update current viewer.

Implemented in XGUI_ViewerProxy, and SHAPERGUI_SalomeViewer.

◆ Scale()

const double ModuleBase_IViewer::Scale ( const Handle &&  theView)
inline

Returns a scale factor of the given view.

Parameters
theViewa view object

◆ SetScale()

void ModuleBase_IViewer::SetScale ( const Handle &&  theView,
const double  theVal 
)
inline

Remember a scale factor for the view object.

Parameters
theViewa view object
theVala scale factor

◆ canDragByMouse()

virtual bool ModuleBase_IViewer::canDragByMouse ( ) const
inlinevirtual

Method returns True if the viewer can process editing objects by mouse drugging.

If this is impossible thet it has to return False.

Reimplemented in XGUI_ViewerProxy, and SHAPERGUI_SalomeViewer.

◆ updateHighlight()

virtual void ModuleBase_IViewer::updateHighlight ( )
inlinevirtual

Fit all along Z (perpendicular to display)

Show highlight for pre-highlighted sub-shape

Reimplemented in XGUI_ViewerProxy.

◆ set2dMode()

void ModuleBase_IViewer::set2dMode ( bool  is2d)
inline

Set flag which indicates that viewer is used for 2d operations.

Parameters
is2da new 2d mode state

◆ is2dMode()

bool ModuleBase_IViewer::is2dMode ( ) const
inline

Returns current state of 2d mode flag.

◆ isColorScaleVisible()

virtual bool ModuleBase_IViewer::isColorScaleVisible ( ) const
pure virtual

Returns True if ColorScale is visible.

Implemented in XGUI_ViewerProxy, and SHAPERGUI_SalomeViewer.

◆ setColorScaleShown()

virtual void ModuleBase_IViewer::setColorScaleShown ( bool  on)
pure virtual

Show/Hide ColorScale object.

Implemented in XGUI_ViewerProxy, and SHAPERGUI_SalomeViewer.

◆ setColorScalePosition()

virtual void ModuleBase_IViewer::setColorScalePosition ( double  theX,
double  theY 
)
pure virtual

Set position of color scale.

Implemented in XGUI_ViewerProxy, and SHAPERGUI_SalomeViewer.

◆ setColorScaleSize()

virtual void ModuleBase_IViewer::setColorScaleSize ( double  theW,
double  theH 
)
pure virtual

Set size of color scale.

Implemented in XGUI_ViewerProxy, and SHAPERGUI_SalomeViewer.

◆ setColorScaleRange()

virtual void ModuleBase_IViewer::setColorScaleRange ( double  theMin,
double  theMax 
)
pure virtual

Set range of color scale.

Implemented in XGUI_ViewerProxy, and SHAPERGUI_SalomeViewer.

◆ setColorScaleIntervals()

virtual void ModuleBase_IViewer::setColorScaleIntervals ( int  theNb)
pure virtual

Set number of intervals of color scale.

Implemented in XGUI_ViewerProxy, and SHAPERGUI_SalomeViewer.

◆ setColorScaleTextHeigth()

virtual void ModuleBase_IViewer::setColorScaleTextHeigth ( int  theH)
pure virtual

Set text heigth of color scale.

Implemented in XGUI_ViewerProxy, and SHAPERGUI_SalomeViewer.

◆ setColorScaleTextColor()

virtual void ModuleBase_IViewer::setColorScaleTextColor ( const QColor &  theColor)
pure virtual

Set color of text of color scale.

Implemented in XGUI_ViewerProxy, and SHAPERGUI_SalomeViewer.

◆ setColorScaleTitle()

virtual void ModuleBase_IViewer::setColorScaleTitle ( const QString &  theText)
pure virtual

Set title of color scale.

Implemented in XGUI_ViewerProxy, and SHAPERGUI_SalomeViewer.

◆ setText()

virtual void ModuleBase_IViewer::setText ( const TextColor theText,
const int  theSize 
)
pure virtual

Sets the text displayed in right-top corner of the 3D view.

Parameters
theTextthe text to display, or empty string to erase presentation; the first item is the font name and text color
theSizesize of the text font

Implemented in XGUI_ViewerProxy, and SHAPERGUI_SalomeViewer.

◆ showSelectionHighlight()

void ModuleBase_IViewer::showSelectionHighlight ( )
inline

Switches On additional highlight for objects preselection.

◆ hideSelectionHighlight()

void ModuleBase_IViewer::hideSelectionHighlight ( )
inline

Switches Off additional highlight for objects preselection.

◆ lastViewClosed

void ModuleBase_IViewer::lastViewClosed ( )
signal

Signal emited when last view window is closed.

◆ tryCloseView

void ModuleBase_IViewer::tryCloseView ( ModuleBase_IViewWindow theWnd)
signal

Signal emited before view window is closed.

◆ deleteView

void ModuleBase_IViewer::deleteView ( ModuleBase_IViewWindow theWnd)
signal

Signal emited on delete view window.

◆ viewCreated

void ModuleBase_IViewer::viewCreated ( ModuleBase_IViewWindow theWnd)
signal

Signal emited on creation of view window.

◆ activated

void ModuleBase_IViewer::activated ( ModuleBase_IViewWindow theWnd)
signal

Signal emited on key release.

◆ mousePress

void ModuleBase_IViewer::mousePress ( ModuleBase_IViewWindow theWnd,
QMouseEvent *  theEvent 
)
signal

Signal emited on mouse press.

◆ mouseRelease

void ModuleBase_IViewer::mouseRelease ( ModuleBase_IViewWindow theWnd,
QMouseEvent *  theEvent 
)
signal

Signal emited on mouse release.

◆ mouseDoubleClick

void ModuleBase_IViewer::mouseDoubleClick ( ModuleBase_IViewWindow theWnd,
QMouseEvent *  theEvent 
)
signal

Signal emited on mouse double click.

◆ mouseMove

void ModuleBase_IViewer::mouseMove ( ModuleBase_IViewWindow theWnd,
QMouseEvent *  theEvent 
)
signal

Signal emited on mouse move.

◆ keyPress

void ModuleBase_IViewer::keyPress ( ModuleBase_IViewWindow theWnd,
QKeyEvent *  theEvent 
)
signal

Signal emited on key press.

◆ keyRelease

void ModuleBase_IViewer::keyRelease ( ModuleBase_IViewWindow theWnd,
QKeyEvent *  theEvent 
)
signal

Signal emited on key release.

◆ selectionChanged

void ModuleBase_IViewer::selectionChanged ( )
signal

Signal emited on selection changed.

◆ contextMenuRequested

void ModuleBase_IViewer::contextMenuRequested ( QContextMenuEvent *  )
signal

Signal emited on selection changed.

◆ viewTransformed

void ModuleBase_IViewer::viewTransformed ( int  theTransformation)
signal

Signal emitted on transformation of view point in view window.

Parameters
theTransformationtype of transformation (see AppElements_ViewWindow::OperationType)

◆ trihedronVisibilityChanged

void ModuleBase_IViewer::trihedronVisibilityChanged ( bool  theState)
signal

Signal emited on selection changed.

Field Documentation

◆ myWindowScale

QMap<Handle,, double> ModuleBase_IViewer::myWindowScale
protected

A map for storing a scale factors dependent on view object.