Version: 9.12.0
GLViewer_ViewPort Class Referenceabstract

#include <GLViewer_ViewPort.h>

Inheritance diagram for GLViewer_ViewPort:
Inheritance graph

Signals

void vpKeyEvent (QKeyEvent *)
 
void vpMouseEvent (QMouseEvent *)
 
void vpWheelEvent (QWheelEvent *)
 
void vpDrawExternal (QPainter *)
 
void contextMenuRequested (QContextMenuEvent *)
 

Public Member Functions

 GLViewer_ViewPort (QWidget *parent)
 
 ~GLViewer_ViewPort ()
 
void setSketchingEnabled (bool)
 Activates/deactivates sketching. More...
 
bool isSketchingEnabled () const
 Checks active status of sketcher. More...
 
void setTransformEnabled (bool)
 Activates/deactivates transformer. More...
 
bool isTransformEnabled () const
 Checks active status of transformer. More...
 
virtual QColor backgroundColor () const
 Returns background color. More...
 
virtual void setBackgroundColor (const QColor &)
 Sets background color. More...
 
void redrawPainters ()
 Redraw external pa inters. More...
 
virtual void onUpdate ()
 Updates view. More...
 
virtual BlockStatus currentBlock ()
 Returns blocking status for current started operations. More...
 

Static Public Member Functions

static QCursor * getDefaultCursor ()
 
static void setDefaultCursor (const QCursor &newCursor)
 
static QCursor * getRotCursor ()
 
static void setRotCursor (const QCursor &newCursor)
 
static QCursor * getSketchCursor ()
 
static void setSketchCursor (const QCursor &newCursor)
 

Protected Types

enum  ViewType { Type2D , Type3D }
 

Protected Slots

virtual void onChangeBgColor ()
 

Protected Member Functions

void selectVisualId (ViewType)
 
virtual QPaintDevice * getPaintDevice ()
 
virtual void contextMenuEvent (QContextMenuEvent *e)
 
virtual void paintEvent (QPaintEvent *)
 EVENTS. More...
 
virtual void mouseMoveEvent (QMouseEvent *)
 
virtual void mouseReleaseEvent (QMouseEvent *)
 
virtual void mousePressEvent (QMouseEvent *)
 
virtual void mouseDoubleClickEvent (QMouseEvent *)
 
virtual void keyPressEvent (QKeyEvent *)
 
virtual void keyReleaseEvent (QKeyEvent *)
 
virtual void wheelEvent (QWheelEvent *)
 
virtual void reset ()=0
 TO BE REDEFINED. More...
 
virtual void pan (int, int)=0
 
virtual void setCenter (int, int)=0
 
virtual void zoom (int, int, int, int)=0
 
virtual void fitRect (const QRect &)=0
 
virtual void fitSelect ()=0
 
virtual void fitAll (bool keepScale=false, bool withZ=true)=0
 

Static Protected Member Functions

static void createCursors ()
 STATICS. More...
 
static void destroyCursors ()
 
static QCursor * getHandCursor ()
 
static void setHandCursor (const QCursor &newCursor)
 
static QCursor * getPanCursor ()
 
static void setPanCursor (const QCursor &newCursor)
 
static QCursor * getPanglCursor ()
 
static void setPanglCursor (const QCursor &newCursor)
 
static QCursor * getZoomCursor ()
 
static void setZoomCursor (const QCursor &newCursor)
 

Protected Attributes

bool myEnableSketching
 
bool myEnableTransform
 
bool myPaintersRedrawing
 

Private Member Functions

void initialize ()
 
void cleanup ()
 

Static Private Attributes

static int nCounter = 0
 
static QCursor * defCursor = 0
 
static QCursor * panglCursor = 0
 
static QCursor * handCursor = 0
 
static QCursor * panCursor = 0
 
static QCursor * zoomCursor = 0
 
static QCursor * rotCursor = 0
 
static QCursor * sketchCursor = 0
 

Friends

class GLViewer_ViewSketcher
 
class GLViewer_ViewTransformer
 

Detailed Description

Visualisation canvas of GLViewer

Member Enumeration Documentation

◆ ViewType

Enumerator
Type2D 
Type3D 

Constructor & Destructor Documentation

◆ GLViewer_ViewPort()

GLViewer_ViewPort::GLViewer_ViewPort ( QWidget parent)

Constructor

References initialize().

◆ ~GLViewer_ViewPort()

GLViewer_ViewPort::~GLViewer_ViewPort ( )

Destructor

References cleanup().

Member Function Documentation

◆ backgroundColor()

QColor GLViewer_ViewPort::backgroundColor ( ) const
virtual

Returns background color.

Returns the background color. [ virtual ]

Reimplemented in GLViewer_ViewPort2d.

◆ cleanup()

void GLViewer_ViewPort::cleanup ( )
private

Cleans up the viewport. [ private ]

References destroyCursors(), and nCounter.

◆ contextMenuEvent()

void GLViewer_ViewPort::contextMenuEvent ( QContextMenuEvent *  e)
protectedvirtual

Custom context menu event handler

References contextMenuRequested().

◆ contextMenuRequested

void GLViewer_ViewPort::contextMenuRequested ( QContextMenuEvent *  )
signal

◆ createCursors()

void GLViewer_ViewPort::createCursors ( )
staticprotected

◆ currentBlock()

virtual BlockStatus GLViewer_ViewPort::currentBlock ( )
inlinevirtual

Returns blocking status for current started operations.

Reimplemented in GLViewer_ViewPort2d.

References BS_NoBlock.

◆ destroyCursors()

void GLViewer_ViewPort::destroyCursors ( )
staticprotected

Destroys the viewport cursors. [ static ]

References defCursor, handCursor, panCursor, panglCursor, rotCursor, sketchCursor, and zoomCursor.

◆ fitAll()

virtual void GLViewer_ViewPort::fitAll ( bool  keepScale = false,
bool  withZ = true 
)
protectedpure virtual

Implemented in GLViewer_ViewPort2d.

◆ fitRect()

virtual void GLViewer_ViewPort::fitRect ( const QRect &  )
protectedpure virtual

Implemented in GLViewer_ViewPort2d.

◆ fitSelect()

virtual void GLViewer_ViewPort::fitSelect ( )
protectedpure virtual

Implemented in GLViewer_ViewPort2d.

◆ getDefaultCursor()

static QCursor* GLViewer_ViewPort::getDefaultCursor ( )
inlinestatic

◆ getHandCursor()

static QCursor* GLViewer_ViewPort::getHandCursor ( )
inlinestaticprotected

◆ getPaintDevice()

virtual QPaintDevice* GLViewer_ViewPort::getPaintDevice ( )
inlineprotectedvirtual

Reimplemented in GLViewer_ViewPort2d.

◆ getPanCursor()

static QCursor* GLViewer_ViewPort::getPanCursor ( )
inlinestaticprotected

◆ getPanglCursor()

static QCursor* GLViewer_ViewPort::getPanglCursor ( )
inlinestaticprotected

◆ getRotCursor()

static QCursor* GLViewer_ViewPort::getRotCursor ( )
inlinestatic

◆ getSketchCursor()

static QCursor* GLViewer_ViewPort::getSketchCursor ( )
inlinestatic

◆ getZoomCursor()

static QCursor* GLViewer_ViewPort::getZoomCursor ( )
inlinestaticprotected

◆ initialize()

void GLViewer_ViewPort::initialize ( )
private

Initializes viewport. [ private ]

References createCursors(), myEnableSketching, myEnableTransform, myPaintersRedrawing, and nCounter.

◆ isSketchingEnabled()

bool GLViewer_ViewPort::isSketchingEnabled ( ) const

Checks active status of sketcher.

Returns 'true' if sketching is enabled in this viewport. [ public ]

References myEnableSketching.

◆ isTransformEnabled()

bool GLViewer_ViewPort::isTransformEnabled ( ) const

Checks active status of transformer.

Returns 'true' if transformations ( rotation, zoom etc. ) are enabled in this viewport. [ public ]

References myEnableTransform.

◆ keyPressEvent()

void GLViewer_ViewPort::keyPressEvent ( QKeyEvent *  e)
protectedvirtual

Emits 'keyEvent' signal. [ virtual protected ]

References vpKeyEvent().

◆ keyReleaseEvent()

void GLViewer_ViewPort::keyReleaseEvent ( QKeyEvent *  e)
protectedvirtual

Emits 'keyEvent' signal. [ virtual protected ]

References vpKeyEvent().

◆ mouseDoubleClickEvent()

void GLViewer_ViewPort::mouseDoubleClickEvent ( QMouseEvent *  e)
protectedvirtual

Emits 'mouseEvent' signal. [ virtual protected ]

Reimplemented in GLViewer_ViewPort2d.

References vpMouseEvent().

◆ mouseMoveEvent()

void GLViewer_ViewPort::mouseMoveEvent ( QMouseEvent *  e)
protectedvirtual

Emits 'mouseEvent' signal. [ virtual protected ]

Reimplemented in GLViewer_ViewPort2d.

References vpMouseEvent().

◆ mousePressEvent()

void GLViewer_ViewPort::mousePressEvent ( QMouseEvent *  e)
protectedvirtual

Emits 'mouseEvent' signal. [ virtual protected ]

Reimplemented in GLViewer_ViewPort2d.

References vpMouseEvent().

◆ mouseReleaseEvent()

void GLViewer_ViewPort::mouseReleaseEvent ( QMouseEvent *  e)
protectedvirtual

Emits 'mouseEvent' signal. [ virtual protected ]

Reimplemented in GLViewer_ViewPort2d.

References vpMouseEvent().

◆ onChangeBgColor

void GLViewer_ViewPort::onChangeBgColor ( )
protectedvirtualslot

Sets the background color with color selection dialog. [ virtual protected slot ]

References backgroundColor(), and setBackgroundColor().

◆ onUpdate()

void GLViewer_ViewPort::onUpdate ( )
virtual

Updates view.

Updates this view. Does nothing by default. [ virtual public ]

◆ paintEvent()

void GLViewer_ViewPort::paintEvent ( QPaintEvent *  )
protectedvirtual

EVENTS.

Repaints the viewport. [ virtual protected ]

Reimplemented in GLViewer_ViewPort2d.

References myPaintersRedrawing, and vpDrawExternal().

◆ pan()

virtual void GLViewer_ViewPort::pan ( int  ,
int   
)
protectedpure virtual

Implemented in GLViewer_ViewPort2d.

◆ redrawPainters()

void GLViewer_ViewPort::redrawPainters ( )

Redraw external pa inters.

Forces to redraw the viewport by an external painter. [ public ]

References myPaintersRedrawing.

◆ reset()

virtual void GLViewer_ViewPort::reset ( )
protectedpure virtual

TO BE REDEFINED.

Implemented in GLViewer_ViewPort2d.

◆ selectVisualId()

void GLViewer_ViewPort::selectVisualId ( ViewType  type)
protected

Selects visual ID for OpenGL window ( X11 specific ). [ protected ]

References backgroundColor(), choose_cmap(), Plot2d::None, Type2D, Type3D, and Window.

◆ setBackgroundColor()

void GLViewer_ViewPort::setBackgroundColor ( const QColor &  color)
virtual

Sets background color.

Sets the background 'color'. [ virtual ]

Reimplemented in GLViewer_ViewPort2d.

References OCCViewer::color().

◆ setCenter()

virtual void GLViewer_ViewPort::setCenter ( int  ,
int   
)
protectedpure virtual

Implemented in GLViewer_ViewPort2d.

◆ setDefaultCursor()

void GLViewer_ViewPort::setDefaultCursor ( const QCursor &  newCursor)
static

Sets new default cursor. [ static ]

References defCursor.

◆ setHandCursor()

void GLViewer_ViewPort::setHandCursor ( const QCursor &  newCursor)
staticprotected

Sets new cursor for drawing rectangle in the viewport. [ static ]

References handCursor.

◆ setPanCursor()

void GLViewer_ViewPort::setPanCursor ( const QCursor &  newCursor)
staticprotected

Sets new cursor for panning. [ static ]

References panCursor.

◆ setPanglCursor()

void GLViewer_ViewPort::setPanglCursor ( const QCursor &  newCursor)
staticprotected

Sets new cursor for global panning. [ static ]

References panglCursor.

◆ setRotCursor()

void GLViewer_ViewPort::setRotCursor ( const QCursor &  newCursor)
static

Sets new cursor for rotating. [ static ]

References rotCursor.

◆ setSketchCursor()

void GLViewer_ViewPort::setSketchCursor ( const QCursor &  newCursor)
static

Sets new cursor for rotating. [ static ]

References rotCursor, and sketchCursor.

◆ setSketchingEnabled()

void GLViewer_ViewPort::setSketchingEnabled ( bool  enable)

Activates/deactivates sketching.

Enables / disables sketching [ public ]

References myEnableSketching.

◆ setTransformEnabled()

void GLViewer_ViewPort::setTransformEnabled ( bool  enable)

Activates/deactivates transformer.

Enables / disables transformations. [ public ]

References myEnableTransform.

◆ setZoomCursor()

void GLViewer_ViewPort::setZoomCursor ( const QCursor &  newCursor)
staticprotected

Sets new cursor for zooming. [ static ]

References zoomCursor.

◆ vpDrawExternal

void GLViewer_ViewPort::vpDrawExternal ( QPainter *  )
signal

◆ vpKeyEvent

void GLViewer_ViewPort::vpKeyEvent ( QKeyEvent *  )
signal

◆ vpMouseEvent

void GLViewer_ViewPort::vpMouseEvent ( QMouseEvent *  )
signal

◆ vpWheelEvent

void GLViewer_ViewPort::vpWheelEvent ( QWheelEvent *  )
signal

◆ wheelEvent()

void GLViewer_ViewPort::wheelEvent ( QWheelEvent *  e)
protectedvirtual

Emits 'mouseEvent' signal. [ virtual protected ]

References vpWheelEvent().

◆ zoom()

virtual void GLViewer_ViewPort::zoom ( int  ,
int  ,
int  ,
int   
)
protectedpure virtual

Implemented in GLViewer_ViewPort2d.

Friends And Related Function Documentation

◆ GLViewer_ViewSketcher

friend class GLViewer_ViewSketcher
friend

◆ GLViewer_ViewTransformer

friend class GLViewer_ViewTransformer
friend

Member Data Documentation

◆ defCursor

QCursor * GLViewer_ViewPort::defCursor = 0
staticprivate

◆ handCursor

QCursor * GLViewer_ViewPort::handCursor = 0
staticprivate

◆ myEnableSketching

bool GLViewer_ViewPort::myEnableSketching
protected

◆ myEnableTransform

bool GLViewer_ViewPort::myEnableTransform
protected

◆ myPaintersRedrawing

bool GLViewer_ViewPort::myPaintersRedrawing
protected

◆ nCounter

int GLViewer_ViewPort::nCounter = 0
staticprivate

◆ panCursor

QCursor * GLViewer_ViewPort::panCursor = 0
staticprivate

◆ panglCursor

QCursor * GLViewer_ViewPort::panglCursor = 0
staticprivate

◆ rotCursor

QCursor * GLViewer_ViewPort::rotCursor = 0
staticprivate

◆ sketchCursor

QCursor * GLViewer_ViewPort::sketchCursor = 0
staticprivate

◆ zoomCursor

QCursor * GLViewer_ViewPort::zoomCursor = 0
staticprivate

The documentation for this class was generated from the following files: