Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

Enumerator
Type2D 
Type3D 

Constructor & Destructor Documentation

GLViewer_ViewPort::GLViewer_ViewPort ( QWidget parent)

Constructor

References initialize().

GLViewer_ViewPort::~GLViewer_ViewPort ( )

Destructor

References cleanup().

Member Function Documentation

QColor GLViewer_ViewPort::backgroundColor ( ) const
virtual

Returns the background color. [ virtual ]

Reimplemented in GLViewer_ViewPort2d.

void GLViewer_ViewPort::cleanup ( )
private

Cleans up the viewport. [ private ]

References destroyCursors(), and nCounter.

void GLViewer_ViewPort::contextMenuEvent ( QContextMenuEvent *  e)
protectedvirtual

Custom context menu event handler

References contextMenuRequested().

void GLViewer_ViewPort::contextMenuRequested ( QContextMenuEvent *  )
signal
void GLViewer_ViewPort::createCursors ( )
staticprotected
virtual BlockStatus GLViewer_ViewPort::currentBlock ( )
inlinevirtual

Reimplemented in GLViewer_ViewPort2d.

References BS_NoBlock.

void GLViewer_ViewPort::destroyCursors ( )
staticprotected

Destroys the viewport cursors. [ static ]

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

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

Implemented in GLViewer_ViewPort2d.

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

Implemented in GLViewer_ViewPort2d.

virtual void GLViewer_ViewPort::fitSelect ( )
protectedpure virtual

Implemented in GLViewer_ViewPort2d.

static QCursor* GLViewer_ViewPort::getDefaultCursor ( )
inlinestatic
static QCursor* GLViewer_ViewPort::getHandCursor ( )
inlinestaticprotected
virtual QPaintDevice* GLViewer_ViewPort::getPaintDevice ( )
inlineprotectedvirtual

Reimplemented in GLViewer_ViewPort2d.

static QCursor* GLViewer_ViewPort::getPanCursor ( )
inlinestaticprotected
static QCursor* GLViewer_ViewPort::getPanglCursor ( )
inlinestaticprotected
static QCursor* GLViewer_ViewPort::getRotCursor ( )
inlinestatic
static QCursor* GLViewer_ViewPort::getSketchCursor ( )
inlinestatic
static QCursor* GLViewer_ViewPort::getZoomCursor ( )
inlinestaticprotected
void GLViewer_ViewPort::initialize ( )
private

Initializes viewport. [ private ]

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

bool GLViewer_ViewPort::isSketchingEnabled ( ) const

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

References myEnableSketching.

bool GLViewer_ViewPort::isTransformEnabled ( ) const

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

References myEnableTransform.

void GLViewer_ViewPort::keyPressEvent ( QKeyEvent *  e)
protectedvirtual

Emits 'keyEvent' signal. [ virtual protected ]

References vpKeyEvent().

void GLViewer_ViewPort::keyReleaseEvent ( QKeyEvent *  e)
protectedvirtual

Emits 'keyEvent' signal. [ virtual protected ]

References vpKeyEvent().

void GLViewer_ViewPort::mouseDoubleClickEvent ( QMouseEvent *  e)
protectedvirtual

Emits 'mouseEvent' signal. [ virtual protected ]

Reimplemented in GLViewer_ViewPort2d.

References vpMouseEvent().

void GLViewer_ViewPort::mouseMoveEvent ( QMouseEvent *  e)
protectedvirtual

Emits 'mouseEvent' signal. [ virtual protected ]

Reimplemented in GLViewer_ViewPort2d.

References vpMouseEvent().

void GLViewer_ViewPort::mousePressEvent ( QMouseEvent *  e)
protectedvirtual

Emits 'mouseEvent' signal. [ virtual protected ]

Reimplemented in GLViewer_ViewPort2d.

References vpMouseEvent().

void GLViewer_ViewPort::mouseReleaseEvent ( QMouseEvent *  e)
protectedvirtual

Emits 'mouseEvent' signal. [ virtual protected ]

Reimplemented in GLViewer_ViewPort2d.

References vpMouseEvent().

void GLViewer_ViewPort::onChangeBgColor ( )
protectedvirtualslot

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

References backgroundColor(), and setBackgroundColor().

void GLViewer_ViewPort::onUpdate ( )
virtual

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

void GLViewer_ViewPort::paintEvent ( QPaintEvent *  )
protectedvirtual

Repaints the viewport. [ virtual protected ]

Reimplemented in GLViewer_ViewPort2d.

References myPaintersRedrawing, and vpDrawExternal().

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

Implemented in GLViewer_ViewPort2d.

void GLViewer_ViewPort::redrawPainters ( )

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

References myPaintersRedrawing.

virtual void GLViewer_ViewPort::reset ( )
protectedpure virtual

Implemented in GLViewer_ViewPort2d.

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.

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

Sets the background 'color'. [ virtual ]

Reimplemented in GLViewer_ViewPort2d.

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

Implemented in GLViewer_ViewPort2d.

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

Sets new default cursor. [ static ]

References defCursor.

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

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

References handCursor.

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

Sets new cursor for panning. [ static ]

References panCursor.

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

Sets new cursor for global panning. [ static ]

References panglCursor.

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

Sets new cursor for rotating. [ static ]

References rotCursor.

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

Sets new cursor for rotating. [ static ]

References rotCursor, and sketchCursor.

void GLViewer_ViewPort::setSketchingEnabled ( bool  enable)

Enables / disables sketching [ public ]

References myEnableSketching.

void GLViewer_ViewPort::setTransformEnabled ( bool  enable)

Enables / disables transformations. [ public ]

References myEnableTransform.

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

Sets new cursor for zooming. [ static ]

References zoomCursor.

void GLViewer_ViewPort::vpDrawExternal ( QPainter *  )
signal
void GLViewer_ViewPort::vpKeyEvent ( QKeyEvent *  )
signal
void GLViewer_ViewPort::vpMouseEvent ( QMouseEvent *  )
signal
void GLViewer_ViewPort::vpWheelEvent ( QWheelEvent *  )
signal
void GLViewer_ViewPort::wheelEvent ( QWheelEvent *  e)
protectedvirtual

Emits 'mouseEvent' signal. [ virtual protected ]

References vpWheelEvent().

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

Implemented in GLViewer_ViewPort2d.

Friends And Related Function Documentation

friend class GLViewer_ViewSketcher
friend
friend class GLViewer_ViewTransformer
friend

Member Data Documentation

QCursor * GLViewer_ViewPort::defCursor = 0
staticprivate
QCursor * GLViewer_ViewPort::handCursor = 0
staticprivate
bool GLViewer_ViewPort::myEnableSketching
protected
bool GLViewer_ViewPort::myEnableTransform
protected
bool GLViewer_ViewPort::myPaintersRedrawing
protected
int GLViewer_ViewPort::nCounter = 0
staticprivate
QCursor * GLViewer_ViewPort::panCursor = 0
staticprivate
QCursor * GLViewer_ViewPort::panglCursor = 0
staticprivate
QCursor * GLViewer_ViewPort::rotCursor = 0
staticprivate
QCursor * GLViewer_ViewPort::sketchCursor = 0
staticprivate
QCursor * GLViewer_ViewPort::zoomCursor = 0
staticprivate

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