SHAPER  9.12.0
XGUI_ViewerProxy Class Reference

Proxy class which repersents or AppElements_Viewer or Salome Viewer dependently on current launching environment. More...

Inheritance diagram for XGUI_ViewerProxy:
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 enterViewPort ()
 Emits by mouse entering the view port. More...
 
void leaveViewPort ()
 Emits by mouse leaving of the view port. More...
 
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

 XGUI_ViewerProxy (XGUI_Workshop *theParent)
 Constructor. More...
 
void connectViewProxy ()
 Connects some signals to the viewer from the module connector. More...
 
virtual HandleAAISContext () const
 Returns AIS_InteractiveContext from current OCCViewer. More...
 
virtual Handlettrihedron () const
 Trihedron 3d object shown in the viewer. More...
 
virtual Handlevv3dViewer () const
 Retrurns V3d_Vioewer from current viewer. More...
 
virtual HandleaactiveView () const
 Returns Vsd_View object from currently active view window. More...
 
virtual QWidgetactiveViewPort () const
 Returns currently active view port widget. More...
 
virtual void enableSelection (bool isEnabled)
 Enable or disable selection in the viewer. More...
 
virtual bool isSelectionEnabled () const
 Returns true if selection is enabled. More...
 
virtual void enableMultiselection (bool isEnable)
 Enable or disable multiselection in the viewer. More...
 
virtual bool isMultiSelectionEnabled () const
 Returns true if multiselection is enabled. More...
 
virtual bool enableDrawMode (bool isEnabled)
 Enable or disable draw mode in the viewer. More...
 
virtual void setViewProjection (double theX, double theY, double theZ, double theTwist)
 Sets the view projection. More...
 
virtual void fitAll ()
 Sets the view fitted all. More...
 
virtual void eraseAll ()
 Erases all presentations from the viewer. More...
 
void connectToViewer ()
 Connects to a viewer according to current environment. More...
 
virtual void addSelectionFilter (const Handle &&theFilter)
 Add selection filter to the viewer. More...
 
virtual void removeSelectionFilter (const Handle &&theFilter)
 Remove selection filter from the viewer. More...
 
virtual bool hasSelectionFilter (const Handle &&theFilter)
 Returns true if the selection filter is set to the viewer. More...
 
virtual void clearSelectionFilters ()
 Remove all selection filters from the viewer. More...
 
virtual void update ()
 Update current viewer. 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...
 
virtual bool isColorScaleVisible () const
 Returns True if ColorScale is visible. More...
 
virtual void setColorScaleShown (bool on)
 Show/Hide ColorScale object. More...
 
virtual void setColorScalePosition (double theX, double theY)
 Set position of color scale. More...
 
virtual void setColorScaleSize (double theW, double theH)
 Set size of color scale. More...
 
virtual void setColorScaleRange (double theMin, double theMax)
 Set range of color scale. More...
 
virtual void setColorScaleIntervals (int theNb)
 Set number of intervals of color scale. More...
 
virtual void setColorScaleTextHeigth (int theH)
 Set text heigth of color scale. More...
 
virtual void setColorScaleTextColor (const QColor &theColor)
 Set color of text of color scale. More...
 
virtual void setColorScaleTitle (const QString &theText)
 Set title of color scale. More...
 
void setupColorScale ()
 Set color scale parameters according to user preferences and window size. More...
 
virtual void setText (const ModuleBase_IViewer::TextColor &theText, const int theSize)
 Sets the text displayed in right-top corner of the 3D view. More...
 
virtual void setFitter (AppElements_Fitter *theFitter)
 
virtual AppElements_Fitterfitter () const
 
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...
 
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...
 
void showSelectionHighlight ()
 Switches On additional highlight for objects preselection. More...
 
void hideSelectionHighlight ()
 Switches Off additional highlight for objects preselection. More...
 

Static Public Attributes

static HandleDDefaultHighlightDrawer
 

Protected Member Functions

bool eventFilter (QObject *theObject, QEvent *theEvent)
 processes the application signals to catch the mouse leaving state of the main window More...
 

Protected Attributes

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

Detailed Description

Proxy class which repersents or AppElements_Viewer or Salome Viewer dependently on current launching environment.

It is reccomennded to use this class in operation for accessing to viewer functionality instead of direct access to a viewer

Member Typedef Documentation

◆ TextColor

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

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

Constructor & Destructor Documentation

◆ XGUI_ViewerProxy()

XGUI_ViewerProxy::XGUI_ViewerProxy ( XGUI_Workshop theParent)

Constructor.

Parameters
theParenta parent object

Member Function Documentation

◆ connectViewProxy()

void XGUI_ViewerProxy::connectViewProxy ( )

Connects some signals to the viewer from the module connector.

◆ HandleAAISContext()

virtual XGUI_ViewerProxy::HandleAAISContext ( ) const
virtual

Returns AIS_InteractiveContext from current OCCViewer.

Implements ModuleBase_IViewer.

◆ Handlettrihedron()

virtual XGUI_ViewerProxy::Handlettrihedron ( ) const
virtual

Trihedron 3d object shown in the viewer.

Implements ModuleBase_IViewer.

◆ Handlevv3dViewer()

virtual XGUI_ViewerProxy::Handlevv3dViewer ( ) const
virtual

Retrurns V3d_Vioewer from current viewer.

Implements ModuleBase_IViewer.

◆ HandleaactiveView()

virtual XGUI_ViewerProxy::HandleaactiveView ( ) const
virtual

Returns Vsd_View object from currently active view window.

Implements ModuleBase_IViewer.

◆ activeViewPort()

QWidget * XGUI_ViewerProxy::activeViewPort ( ) const
virtual

Returns currently active view port widget.

Implements ModuleBase_IViewer.

◆ enableSelection()

void XGUI_ViewerProxy::enableSelection ( bool  isEnabled)
virtual

Enable or disable selection in the viewer.

Implements ModuleBase_IViewer.

◆ isSelectionEnabled()

bool XGUI_ViewerProxy::isSelectionEnabled ( ) const
virtual

Returns true if selection is enabled.

Implements ModuleBase_IViewer.

◆ enableMultiselection()

void XGUI_ViewerProxy::enableMultiselection ( bool  isEnable)
virtual

Enable or disable multiselection in the viewer.

Implements ModuleBase_IViewer.

◆ isMultiSelectionEnabled()

bool XGUI_ViewerProxy::isMultiSelectionEnabled ( ) const
virtual

Returns true if multiselection is enabled.

Implements ModuleBase_IViewer.

◆ enableDrawMode()

bool XGUI_ViewerProxy::enableDrawMode ( bool  isEnabled)
virtual

Enable or disable draw mode in the viewer.

Implements ModuleBase_IViewer.

◆ setViewProjection()

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

Sets the view projection.

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

Implements ModuleBase_IViewer.

◆ fitAll()

void XGUI_ViewerProxy::fitAll ( )
virtual

Sets the view fitted all.

Implements ModuleBase_IViewer.

◆ eraseAll()

void XGUI_ViewerProxy::eraseAll ( )
virtual

Erases all presentations from the viewer.

Implements ModuleBase_IViewer.

◆ connectToViewer()

void XGUI_ViewerProxy::connectToViewer ( )

Connects to a viewer according to current environment.

◆ addSelectionFilter()

void XGUI_ViewerProxy::addSelectionFilter ( const Handle &&  theFilter)
virtual

Add selection filter to the viewer.

Implements ModuleBase_IViewer.

◆ removeSelectionFilter()

void XGUI_ViewerProxy::removeSelectionFilter ( const Handle &&  theFilter)
virtual

Remove selection filter from the viewer.

Implements ModuleBase_IViewer.

◆ hasSelectionFilter()

bool XGUI_ViewerProxy::hasSelectionFilter ( const Handle &&  theFilter)
virtual

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

Parameters
theFiltera selection filter

Implements ModuleBase_IViewer.

◆ clearSelectionFilters()

void XGUI_ViewerProxy::clearSelectionFilters ( )
virtual

Remove all selection filters from the viewer.

◆ update()

void XGUI_ViewerProxy::update ( )
virtual

Update current viewer.

Implements ModuleBase_IViewer.

◆ canDragByMouse()

bool XGUI_ViewerProxy::canDragByMouse ( ) const
virtual

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

If this is impossible thet it has to return False.

Reimplemented from ModuleBase_IViewer.

◆ updateHighlight()

void XGUI_ViewerProxy::updateHighlight ( )
virtual

Fit all along Z (perpendicular to display)

Show highlight for pre-highlighted sub-shape

Reimplemented from ModuleBase_IViewer.

◆ isColorScaleVisible()

bool XGUI_ViewerProxy::isColorScaleVisible ( ) const
virtual

Returns True if ColorScale is visible.

Implements ModuleBase_IViewer.

◆ setColorScaleShown()

void XGUI_ViewerProxy::setColorScaleShown ( bool  on)
virtual

Show/Hide ColorScale object.

Implements ModuleBase_IViewer.

◆ setColorScalePosition()

void XGUI_ViewerProxy::setColorScalePosition ( double  theX,
double  theY 
)
virtual

Set position of color scale.

Implements ModuleBase_IViewer.

◆ setColorScaleSize()

void XGUI_ViewerProxy::setColorScaleSize ( double  theW,
double  theH 
)
virtual

Set size of color scale.

Implements ModuleBase_IViewer.

◆ setColorScaleRange()

void XGUI_ViewerProxy::setColorScaleRange ( double  theMin,
double  theMax 
)
virtual

Set range of color scale.

Implements ModuleBase_IViewer.

◆ setColorScaleIntervals()

void XGUI_ViewerProxy::setColorScaleIntervals ( int  theNb)
virtual

Set number of intervals of color scale.

Implements ModuleBase_IViewer.

◆ setColorScaleTextHeigth()

void XGUI_ViewerProxy::setColorScaleTextHeigth ( int  theH)
virtual

Set text heigth of color scale.

Implements ModuleBase_IViewer.

◆ setColorScaleTextColor()

void XGUI_ViewerProxy::setColorScaleTextColor ( const QColor &  theColor)
virtual

Set color of text of color scale.

Implements ModuleBase_IViewer.

◆ setColorScaleTitle()

void XGUI_ViewerProxy::setColorScaleTitle ( const QString &  theText)
virtual

Set title of color scale.

Implements ModuleBase_IViewer.

◆ setupColorScale()

void XGUI_ViewerProxy::setupColorScale ( )

Set color scale parameters according to user preferences and window size.

◆ setText()

void XGUI_ViewerProxy::setText ( const ModuleBase_IViewer::TextColor theText,
const int  theSize 
)
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

Implements ModuleBase_IViewer.

◆ enterViewPort

void XGUI_ViewerProxy::enterViewPort ( )
signal

Emits by mouse entering the view port.

◆ leaveViewPort

void XGUI_ViewerProxy::leaveViewPort ( )
signal

Emits by mouse leaving of the view port.

◆ eventFilter()

bool XGUI_ViewerProxy::eventFilter ( QObject theObject,
QEvent theEvent 
)
protected

processes the application signals to catch the mouse leaving state of the main window

Parameters
theObject
theEvent

◆ Scale()

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

Returns a scale factor of the given view.

Parameters
theViewa view object

◆ SetScale()

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

Remember a scale factor for the view object.

Parameters
theViewa view object
theVala scale factor

◆ set2dMode()

void ModuleBase_IViewer::set2dMode ( bool  is2d)
inlineinherited

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

Parameters
is2da new 2d mode state

◆ is2dMode()

bool ModuleBase_IViewer::is2dMode ( ) const
inlineinherited

Returns current state of 2d mode flag.

◆ showSelectionHighlight()

void ModuleBase_IViewer::showSelectionHighlight ( )
inlineinherited

Switches On additional highlight for objects preselection.

◆ hideSelectionHighlight()

void ModuleBase_IViewer::hideSelectionHighlight ( )
inlineinherited

Switches Off additional highlight for objects preselection.

◆ lastViewClosed

void ModuleBase_IViewer::lastViewClosed ( )
signalinherited

Signal emited when last view window is closed.

◆ tryCloseView

void ModuleBase_IViewer::tryCloseView ( ModuleBase_IViewWindow theWnd)
signalinherited

Signal emited before view window is closed.

◆ deleteView

void ModuleBase_IViewer::deleteView ( ModuleBase_IViewWindow theWnd)
signalinherited

Signal emited on delete view window.

◆ viewCreated

void ModuleBase_IViewer::viewCreated ( ModuleBase_IViewWindow theWnd)
signalinherited

Signal emited on creation of view window.

◆ activated

void ModuleBase_IViewer::activated ( ModuleBase_IViewWindow theWnd)
signalinherited

Signal emited on key release.

◆ mousePress

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

Signal emited on mouse press.

◆ mouseRelease

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

Signal emited on mouse release.

◆ mouseDoubleClick

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

Signal emited on mouse double click.

◆ mouseMove

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

Signal emited on mouse move.

◆ keyPress

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

Signal emited on key press.

◆ keyRelease

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

Signal emited on key release.

◆ selectionChanged

void ModuleBase_IViewer::selectionChanged ( )
signalinherited

Signal emited on selection changed.

◆ contextMenuRequested

void ModuleBase_IViewer::contextMenuRequested ( QContextMenuEvent *  )
signalinherited

Signal emited on selection changed.

◆ viewTransformed

void ModuleBase_IViewer::viewTransformed ( int  theTransformation)
signalinherited

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)
signalinherited

Signal emited on selection changed.

Field Documentation

◆ myWindowScale

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

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