Version: 6.3.1
Signals | Public Member Functions | Static Public Member Functions | Protected Types | Protected Slots | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Attributes | Friends

GLViewer_ViewPort Class Reference

#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.
bool isSketchingEnabled () const
 Checks active status of sketcher.
void setTransformEnabled (bool)
 Activates/deactivates transformer.
bool isTransformEnabled () const
 Checks active status of transformer.
virtual QColor backgroundColor () const
 Returns background color.
virtual void setBackgroundColor (const QColor &)
 Sets background color.
void redrawPainters ()
 Redraw external pa inters.
virtual void onUpdate ()
 Updates view.
virtual BlockStatus currentBlock ()
 Returns blocking status for current started operations.

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

enum GLViewer_ViewPort::ViewType [protected]
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

void GLViewer_ViewPort::setSketchingEnabled ( bool  enable)

Enables / disables sketching [ public ]

References myEnableSketching.

bool GLViewer_ViewPort::isSketchingEnabled ( ) const

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

References myEnableSketching.

void GLViewer_ViewPort::setTransformEnabled ( bool  enable)

Enables / disables transformations. [ public ]

References myEnableTransform.

bool GLViewer_ViewPort::isTransformEnabled ( ) const

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

References myEnableTransform.

QColor GLViewer_ViewPort::backgroundColor ( ) const [virtual]

Returns the background color. [ virtual ]

Reimplemented in GLViewer_ViewPort2d.

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

Sets the background 'color'. [ virtual ]

Reimplemented in GLViewer_ViewPort2d.

void GLViewer_ViewPort::redrawPainters ( )

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

References myPaintersRedrawing.

void GLViewer_ViewPort::onUpdate ( ) [virtual]

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

virtual BlockStatus GLViewer_ViewPort.currentBlock ( ) [virtual]

Reimplemented in GLViewer_ViewPort2d.

References BS_NoBlock.

void GLViewer_ViewPort::selectVisualId ( ViewType  type) [protected]

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

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

virtual QPaintDevice* GLViewer_ViewPort.getPaintDevice ( ) [protected, virtual]

Reimplemented in GLViewer_ViewPort2d.

void GLViewer_ViewPort::contextMenuEvent ( QContextMenuEvent *  e) [protected, virtual]

Custom context menu event handler

References contextMenuRequested().

void GLViewer_ViewPort::createCursors ( ) [static, protected]
void GLViewer_ViewPort::destroyCursors ( ) [static, protected]

Destroys the viewport cursors. [ static ]

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

static QCursor* GLViewer_ViewPort.getHandCursor ( ) [static, protected]
void GLViewer_ViewPort::setHandCursor ( const QCursor &  newCursor) [static, protected]

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

References handCursor.

static QCursor* GLViewer_ViewPort.getPanCursor ( ) [static, protected]
void GLViewer_ViewPort::setPanCursor ( const QCursor &  newCursor) [static, protected]

Sets new cursor for panning. [ static ]

References panCursor.

static QCursor* GLViewer_ViewPort.getPanglCursor ( ) [static, protected]
void GLViewer_ViewPort::setPanglCursor ( const QCursor &  newCursor) [static, protected]

Sets new cursor for global panning. [ static ]

References panglCursor.

static QCursor* GLViewer_ViewPort.getZoomCursor ( ) [static, protected]
void GLViewer_ViewPort::setZoomCursor ( const QCursor &  newCursor) [static, protected]

Sets new cursor for zooming. [ static ]

References zoomCursor.

static QCursor* GLViewer_ViewPort.getDefaultCursor ( ) [static]
void GLViewer_ViewPort::setDefaultCursor ( const QCursor &  newCursor) [static]

Sets new default cursor. [ static ]

References defCursor.

static QCursor* GLViewer_ViewPort.getRotCursor ( ) [static]
void GLViewer_ViewPort::setRotCursor ( const QCursor &  newCursor) [static]

Sets new cursor for rotating. [ static ]

References rotCursor.

static QCursor* GLViewer_ViewPort.getSketchCursor ( ) [static]
void GLViewer_ViewPort::setSketchCursor ( const QCursor &  newCursor) [static]

Sets new cursor for rotating. [ static ]

References rotCursor, and sketchCursor.

void GLViewer_ViewPort::paintEvent ( QPaintEvent *  ) [protected, virtual]

Repaints the viewport. [ virtual protected ]

Reimplemented in GLViewer_ViewPort2d.

References myPaintersRedrawing, and vpDrawExternal().

void GLViewer_ViewPort::mouseMoveEvent ( QMouseEvent *  e) [protected, virtual]

Emits 'mouseEvent' signal. [ virtual protected ]

Reimplemented in GLViewer_ViewPort2d.

References vpMouseEvent().

void GLViewer_ViewPort::mouseReleaseEvent ( QMouseEvent *  e) [protected, virtual]

Emits 'mouseEvent' signal. [ virtual protected ]

Reimplemented in GLViewer_ViewPort2d.

References vpMouseEvent().

void GLViewer_ViewPort::mousePressEvent ( QMouseEvent *  e) [protected, virtual]

Emits 'mouseEvent' signal. [ virtual protected ]

Reimplemented in GLViewer_ViewPort2d.

References vpMouseEvent().

void GLViewer_ViewPort::mouseDoubleClickEvent ( QMouseEvent *  e) [protected, virtual]

Emits 'mouseEvent' signal. [ virtual protected ]

Reimplemented in GLViewer_ViewPort2d.

References vpMouseEvent().

void GLViewer_ViewPort::keyPressEvent ( QKeyEvent *  e) [protected, virtual]

Emits 'keyEvent' signal. [ virtual protected ]

References vpKeyEvent().

void GLViewer_ViewPort::keyReleaseEvent ( QKeyEvent *  e) [protected, virtual]

Emits 'keyEvent' signal. [ virtual protected ]

References vpKeyEvent().

void GLViewer_ViewPort::wheelEvent ( QWheelEvent *  e) [protected, virtual]

Emits 'mouseEvent' signal. [ virtual protected ]

References vpWheelEvent().

virtual void GLViewer_ViewPort.reset ( ) [protected, pure virtual]

Implemented in GLViewer_ViewPort2d.

virtual void GLViewer_ViewPort.pan ( int  ,
int   
) [protected, pure virtual]

Implemented in GLViewer_ViewPort2d.

virtual void GLViewer_ViewPort.setCenter ( int  ,
int   
) [protected, pure virtual]

Implemented in GLViewer_ViewPort2d.

virtual void GLViewer_ViewPort.zoom ( int  ,
int  ,
int  ,
int   
) [protected, pure virtual]

Implemented in GLViewer_ViewPort2d.

virtual void GLViewer_ViewPort.fitRect ( const QRect &  ) [protected, pure virtual]

Implemented in GLViewer_ViewPort2d.

virtual void GLViewer_ViewPort.fitSelect ( ) [protected, pure virtual]

Implemented in GLViewer_ViewPort2d.

virtual void GLViewer_ViewPort.fitAll ( bool  keepScale = false,
bool  withZ = true 
) [protected, pure virtual]

Implemented in GLViewer_ViewPort2d.

void GLViewer_ViewPort::onChangeBgColor ( ) [protected, virtual, slot]

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

References backgroundColor(), and setBackgroundColor().

void GLViewer_ViewPort.vpKeyEvent ( QKeyEvent *  ) [signal]
void GLViewer_ViewPort.vpMouseEvent ( QMouseEvent *  ) [signal]
void GLViewer_ViewPort.vpWheelEvent ( QWheelEvent *  ) [signal]
void GLViewer_ViewPort.vpDrawExternal ( QPainter *  ) [signal]
void GLViewer_ViewPort.contextMenuRequested ( QContextMenuEvent *  ) [signal]
void GLViewer_ViewPort::initialize ( ) [private]

Initializes viewport. [ private ]

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

void GLViewer_ViewPort::cleanup ( ) [private]

Cleans up the viewport. [ private ]

References destroyCursors(), and nCounter.


Friends And Related Function Documentation

friend class GLViewer_ViewSketcher [friend]
friend class GLViewer_ViewTransformer [friend]

Field Documentation

int GLViewer_ViewPort::nCounter = 0 [static, private]
QCursor * GLViewer_ViewPort::defCursor = 0 [static, private]
QCursor * GLViewer_ViewPort::panglCursor = 0 [static, private]
QCursor * GLViewer_ViewPort::handCursor = 0 [static, private]
QCursor * GLViewer_ViewPort::panCursor = 0 [static, private]
QCursor * GLViewer_ViewPort::zoomCursor = 0 [static, private]
QCursor * GLViewer_ViewPort::rotCursor = 0 [static, private]
QCursor * GLViewer_ViewPort::sketchCursor = 0 [static, private]
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS