anatomist 6.0.4
3D neuroimaging data viewer
anatomist::GLWidgetManager Class Referenceabstract

Base class for OpenGL-rendering widget. More...

#include <anatomist/window/glwidgetmanager.h>

Inheritance diagram for anatomist::GLWidgetManager:
Collaboration diagram for anatomist::GLWidgetManager:

Public Types

enum  DrawMode {
  Normal , ZSelect , ObjectSelect , ObjectsSelect ,
  PolygonSelect
}
 

Public Member Functions

virtual QSize sizeHint () const
 
virtual QSize minimumSizeHint () const
 
virtual void updateGL ()
 
void renderBackBuffer (ViewState::glSelectRenderMode selectmode)
 
void copyBackBuffer2Texture (void)
 
virtual void paintScene ()
 basically calls paintGL()
 
virtual void initializeGL ()
 
virtual void resizeGL (int w, int h)
 
virtual void paintGL ()
 
virtual void gestureEvent (QGestureEvent *event)
 
virtual void touchEvent (QTouchEvent *event)
 
virtual void mousePressEvent (QMouseEvent *me)
 
virtual void mouseReleaseEvent (QMouseEvent *me)
 
virtual void mouseMoveEvent (QMouseEvent *me)
 
virtual void mouseDoubleClickEvent (QMouseEvent *)
 
virtual void keyPressEvent (QKeyEvent *ev)
 
virtual void keyReleaseEvent (QKeyEvent *ev)
 
virtual void focusInEvent (QFocusEvent *)
 
virtual void focusOutEvent (QFocusEvent *)
 
virtual void wheelEvent (QWheelEvent *)
 
 GLWidgetManager (anatomist::AWindow *win, QGLWidget *widget)
 
virtual ~GLWidgetManager ()
 
QGLWidget * qglWidget ()
 
QObject * qobject ()
 this QObject is used for slots: updateZBuffer, saveContents, recordStart, recordStop
 
void setPrimitives (const anatomist::GLPrimitives &li)
 
anatomist::GLPrimitives primitives () const
 
void setSelectionPrimitives (const anatomist::GLPrimitives &li)
 
anatomist::GLPrimitives selectionPrimitives () const
 
void clearLists ()
 
void setExtrema (const Point3df &bmin, const Point3df &bmax)
 set objects extrema, this also automatically sets the window bounding box
 
void setWindowExtrema (const Point3df &bmin, const Point3df &bmax)
 set window extrema (in the local orientation)
 
Point3df boundingMin () const
 
Point3df boundingMax () const
 
Point3df windowBoundingMin () const
 
Point3df windowBoundingMax () const
 
void setLightGLList (GLuint l)
 
GLuint lightGLList () const
 
void setPreferredSize (int, int)
 
void setMinimumSizeHint (const QSize &)
 
virtual bool positionFromCursor (int x, int y, Point3df &position)
 
virtual bool cursorFromPosition (const Point3df &position, Point3df &cursor)
 
virtual Point3df objectPositionFromWindow (const Point3df &winpos)
 
virtual void readBackBuffer (int x, int y, GLubyte &red, GLubyte &green, GLubyte &blue)
 
GLubyte * getTextureFromBackBuffer ()
 
virtual bool translateCursorPosition (float x, float y, Point3df &position)
 
virtual std::string name () const
 
void setZoom (float z)
 
float zoom () const
 
const aims::Quaternionquaternion () const
 The quaternion rotates the initial eye direction (0, 0, 1) into the view coordinates, before Z axis inversion.
 
void setQuaternion (const Point4df &q)
 
void setQuaternion (const aims::Quaternion &q)
 
const float * rotation () const
 
void setXDirection (bool invert)
 
void setYDirection (bool invert)
 
void setZDirection (bool invert)
 
bool invertedX () const
 
bool invertedY () const
 
bool invertedZ () const
 
void setRotationCenter (const Point3df &)
 
Point3df rotationCenter () const
 
bool perspectiveEnabled () const
 
void enablePerspective (bool)
 
float perspectiveAngle () const
 
void setPerspectiveAngle (float a)
 
bool perspectiveAutoFarPlane () const
 
void setPerspectiveAutoFarPlane (bool x)
 
float perspectiveFarPlane () const
 
void setPerspectiveFarPlane (float d)
 
float perspectiveNearPlane () const
 
float perspectiveNearPlaneRatio () const
 
void setPerspectiveNearPlaneRatio (float d)
 
void setAutoCentering (bool)
 
bool autoCentering () const
 
virtual void recordStart (const QString &basename, const QString &format=QString(), int width=0, int height=0)
 
void saveContents (const QString &filename, const QString &format, int width=0, int height=0)
 
QImage snapshotImage (int bufmode, int width=0, int height=0)
 
void saveOtherBuffer (const QString &filename, const QString &format, int mode, int width=0, int height=0)
 
void setOtherBuffersSaveMode (int mode)
 
int otherBuffersSaveMode () const
 
bool hasTransparentObjects () const
 
void setTransparentObjects (bool)
 
bool depthPeelingAllowed () const
 
bool depthPeelingEnabled () const
 
void enableDepthPeeling (bool)
 
unsigned depthPeelingPasses () const
 
void setDepthPeelingPasses (unsigned n)
 
unsigned numTextureUnits () const
 
bool recording () const
 
void setBackgroundAlpha (float a)
 
GLWidgetManagerrightEye ()
 
GLWidgetManagerleftEye ()
 
void setRightEye (GLWidgetManager *)
 
void setLeftEye (GLWidgetManager *)
 
AWindowaWindow ()
 
const AWindowaWindow () const
 
virtual int width ()=0
 
virtual int height ()=0
 
virtual void saveContents ()
 
void saveContentsWithCustomSize ()
 
virtual void recordStart ()
 
void recordStartWithCustomSize ()
 
virtual void recordStop ()
 
bool hasCameraChanged () const
 
void bindOtherFramebuffer (DrawMode m)
 
void restoreFramebuffer ()
 
void resizeOtherFramebuffers (int w, int h)
 
- Public Member Functions inherited from anatomist::View
 View (AWindow *win)
 
virtual ~View ()
 
ControlSwitchcontrolSwitch ()
 

Static Public Member Functions

static QGLWidget * sharedWidget ()
 

Protected Member Functions

virtual void project (int virtualWidth=0, int virtualHeight=0)
 
virtual void setupView (int virtualWidth=0, int virtualHeight=0)
 
void drawObjects (DrawMode m=Normal)
 
void depthPeelingRender (DrawMode m=Normal)
 
virtual void paintGL (DrawMode m, int virtualWidth=0, int virtualHeight=0)
 Virtual width and height are used to perform off-screen rendering.
 
void record ()
 
virtual void updateZBuffer ()
 
bool isZBufferUpToDate () const
 
void setZBufferUpdated (bool)
 
void stopZBufferTimer ()
 
bool isRGBBufferUpToDate () const
 
void setRGBBufferUpdated (bool)
 

Protected Attributes

anatomist::GLPrimitives _primitives
 
anatomist::GLPrimitives _selectprimitives
 

Friends

class ::GLWidgetManager_Private_QObject
 
class anatomist::internal::AGraphicsView
 QGraphicsView needs to call event methods.
 

Detailed Description

Base class for OpenGL-rendering widget.

Actually this is not a QWidget (or a QGLWidget) since in some cases we need to separate this implementation from the actual Qt widget which can be an inherited one.

Definition at line 73 of file glwidgetmanager.h.

Member Enumeration Documentation

◆ DrawMode

Enumerator
Normal 
ZSelect 
ObjectSelect 
ObjectsSelect 
PolygonSelect 

Definition at line 76 of file glwidgetmanager.h.

Constructor & Destructor Documentation

◆ GLWidgetManager()

anatomist::GLWidgetManager::GLWidgetManager ( anatomist::AWindow * win,
QGLWidget * widget )

◆ ~GLWidgetManager()

virtual anatomist::GLWidgetManager::~GLWidgetManager ( )
virtual

Member Function Documentation

◆ autoCentering()

bool anatomist::GLWidgetManager::autoCentering ( ) const

◆ aWindow() [1/2]

AWindow * anatomist::GLWidgetManager::aWindow ( )
virtual

Reimplemented from anatomist::View.

◆ aWindow() [2/2]

const AWindow * anatomist::GLWidgetManager::aWindow ( ) const
virtual

Reimplemented from anatomist::View.

◆ bindOtherFramebuffer()

void anatomist::GLWidgetManager::bindOtherFramebuffer ( DrawMode m)

◆ boundingMax()

Point3df anatomist::GLWidgetManager::boundingMax ( ) const

◆ boundingMin()

Point3df anatomist::GLWidgetManager::boundingMin ( ) const

◆ clearLists()

void anatomist::GLWidgetManager::clearLists ( )

◆ copyBackBuffer2Texture()

void anatomist::GLWidgetManager::copyBackBuffer2Texture ( void )

◆ cursorFromPosition()

virtual bool anatomist::GLWidgetManager::cursorFromPosition ( const Point3df & position,
Point3df & cursor )
virtual

◆ depthPeelingAllowed()

bool anatomist::GLWidgetManager::depthPeelingAllowed ( ) const

◆ depthPeelingEnabled()

bool anatomist::GLWidgetManager::depthPeelingEnabled ( ) const

◆ depthPeelingPasses()

unsigned anatomist::GLWidgetManager::depthPeelingPasses ( ) const

◆ depthPeelingRender()

void anatomist::GLWidgetManager::depthPeelingRender ( DrawMode m = Normal)
protected

References Normal.

◆ drawObjects()

void anatomist::GLWidgetManager::drawObjects ( DrawMode m = Normal)
protected

References Normal.

◆ enableDepthPeeling()

void anatomist::GLWidgetManager::enableDepthPeeling ( bool )

◆ enablePerspective()

void anatomist::GLWidgetManager::enablePerspective ( bool )

◆ focusInEvent()

virtual void anatomist::GLWidgetManager::focusInEvent ( QFocusEvent * )
virtual

Reimplemented in QAGLWidget.

◆ focusOutEvent()

virtual void anatomist::GLWidgetManager::focusOutEvent ( QFocusEvent * )
virtual

Reimplemented in QAGLWidget.

◆ gestureEvent()

virtual void anatomist::GLWidgetManager::gestureEvent ( QGestureEvent * event)
virtual

◆ getTextureFromBackBuffer()

GLubyte * anatomist::GLWidgetManager::getTextureFromBackBuffer ( )

◆ hasCameraChanged()

bool anatomist::GLWidgetManager::hasCameraChanged ( ) const

◆ hasTransparentObjects()

bool anatomist::GLWidgetManager::hasTransparentObjects ( ) const

◆ height()

virtual int anatomist::GLWidgetManager::height ( )
pure virtual

◆ initializeGL()

virtual void anatomist::GLWidgetManager::initializeGL ( )
virtual

Reimplemented in QAGLWidget.

◆ invertedX()

bool anatomist::GLWidgetManager::invertedX ( ) const

◆ invertedY()

bool anatomist::GLWidgetManager::invertedY ( ) const

◆ invertedZ()

bool anatomist::GLWidgetManager::invertedZ ( ) const

◆ isRGBBufferUpToDate()

bool anatomist::GLWidgetManager::isRGBBufferUpToDate ( ) const
protected

◆ isZBufferUpToDate()

bool anatomist::GLWidgetManager::isZBufferUpToDate ( ) const
protected

◆ keyPressEvent()

virtual void anatomist::GLWidgetManager::keyPressEvent ( QKeyEvent * ev)
virtual

Reimplemented in QAGLWidget.

◆ keyReleaseEvent()

virtual void anatomist::GLWidgetManager::keyReleaseEvent ( QKeyEvent * ev)
virtual

Reimplemented in QAGLWidget.

◆ leftEye()

GLWidgetManager * anatomist::GLWidgetManager::leftEye ( )

References GLWidgetManager().

◆ lightGLList()

GLuint anatomist::GLWidgetManager::lightGLList ( ) const

◆ minimumSizeHint()

virtual QSize anatomist::GLWidgetManager::minimumSizeHint ( ) const
virtual

Reimplemented in QAGLWidget.

◆ mouseDoubleClickEvent()

virtual void anatomist::GLWidgetManager::mouseDoubleClickEvent ( QMouseEvent * )
virtual

Reimplemented in QAGLWidget.

◆ mouseMoveEvent()

virtual void anatomist::GLWidgetManager::mouseMoveEvent ( QMouseEvent * me)
virtual

Reimplemented in QAGLWidget.

◆ mousePressEvent()

virtual void anatomist::GLWidgetManager::mousePressEvent ( QMouseEvent * me)
virtual

Reimplemented in QAGLWidget.

◆ mouseReleaseEvent()

virtual void anatomist::GLWidgetManager::mouseReleaseEvent ( QMouseEvent * me)
virtual

Reimplemented in QAGLWidget.

◆ name()

virtual std::string anatomist::GLWidgetManager::name ( ) const
virtual

Implements anatomist::View.

Reimplemented in QAGLWidget3D, and QAGLWidget.

◆ numTextureUnits()

unsigned anatomist::GLWidgetManager::numTextureUnits ( ) const

◆ objectPositionFromWindow()

virtual Point3df anatomist::GLWidgetManager::objectPositionFromWindow ( const Point3df & winpos)
virtual

◆ otherBuffersSaveMode()

int anatomist::GLWidgetManager::otherBuffersSaveMode ( ) const

◆ paintGL() [1/2]

virtual void anatomist::GLWidgetManager::paintGL ( )
virtual

Reimplemented in QAGLWidget.

◆ paintGL() [2/2]

virtual void anatomist::GLWidgetManager::paintGL ( DrawMode m,
int virtualWidth = 0,
int virtualHeight = 0 )
protectedvirtual

Virtual width and height are used to perform off-screen rendering.

They are used only in the context of a framebuffer.

◆ paintScene()

virtual void anatomist::GLWidgetManager::paintScene ( )
virtual

basically calls paintGL()

◆ perspectiveAngle()

float anatomist::GLWidgetManager::perspectiveAngle ( ) const

◆ perspectiveAutoFarPlane()

bool anatomist::GLWidgetManager::perspectiveAutoFarPlane ( ) const

◆ perspectiveEnabled()

bool anatomist::GLWidgetManager::perspectiveEnabled ( ) const

◆ perspectiveFarPlane()

float anatomist::GLWidgetManager::perspectiveFarPlane ( ) const

◆ perspectiveNearPlane()

float anatomist::GLWidgetManager::perspectiveNearPlane ( ) const

◆ perspectiveNearPlaneRatio()

float anatomist::GLWidgetManager::perspectiveNearPlaneRatio ( ) const

◆ positionFromCursor()

virtual bool anatomist::GLWidgetManager::positionFromCursor ( int x,
int y,
Point3df & position )
virtual

◆ primitives()

anatomist::GLPrimitives anatomist::GLWidgetManager::primitives ( ) const

◆ project()

virtual void anatomist::GLWidgetManager::project ( int virtualWidth = 0,
int virtualHeight = 0 )
protectedvirtual

◆ qglWidget()

QGLWidget * anatomist::GLWidgetManager::qglWidget ( )

◆ qobject()

QObject * anatomist::GLWidgetManager::qobject ( )

this QObject is used for slots: updateZBuffer, saveContents, recordStart, recordStop

◆ quaternion()

const aims::Quaternion & anatomist::GLWidgetManager::quaternion ( ) const

The quaternion rotates the initial eye direction (0, 0, 1) into the view coordinates, before Z axis inversion.

◆ readBackBuffer()

virtual void anatomist::GLWidgetManager::readBackBuffer ( int x,
int y,
GLubyte & red,
GLubyte & green,
GLubyte & blue )
virtual

◆ record()

void anatomist::GLWidgetManager::record ( )
protected

◆ recording()

bool anatomist::GLWidgetManager::recording ( ) const

◆ recordStart() [1/2]

virtual void anatomist::GLWidgetManager::recordStart ( )
virtual

◆ recordStart() [2/2]

virtual void anatomist::GLWidgetManager::recordStart ( const QString & basename,
const QString & format = QString(),
int width = 0,
int height = 0 )
virtual

References height(), and width().

◆ recordStartWithCustomSize()

void anatomist::GLWidgetManager::recordStartWithCustomSize ( )

◆ recordStop()

virtual void anatomist::GLWidgetManager::recordStop ( )
virtual

◆ renderBackBuffer()

void anatomist::GLWidgetManager::renderBackBuffer ( ViewState::glSelectRenderMode selectmode)

◆ resizeGL()

virtual void anatomist::GLWidgetManager::resizeGL ( int w,
int h )
virtual

Reimplemented in QAGLWidget.

◆ resizeOtherFramebuffers()

void anatomist::GLWidgetManager::resizeOtherFramebuffers ( int w,
int h )

◆ restoreFramebuffer()

void anatomist::GLWidgetManager::restoreFramebuffer ( )

◆ rightEye()

GLWidgetManager * anatomist::GLWidgetManager::rightEye ( )

References GLWidgetManager().

◆ rotation()

const float * anatomist::GLWidgetManager::rotation ( ) const

◆ rotationCenter()

Point3df anatomist::GLWidgetManager::rotationCenter ( ) const

◆ saveContents() [1/2]

virtual void anatomist::GLWidgetManager::saveContents ( )
virtual

◆ saveContents() [2/2]

void anatomist::GLWidgetManager::saveContents ( const QString & filename,
const QString & format,
int width = 0,
int height = 0 )

References height(), and width().

◆ saveContentsWithCustomSize()

void anatomist::GLWidgetManager::saveContentsWithCustomSize ( )

◆ saveOtherBuffer()

void anatomist::GLWidgetManager::saveOtherBuffer ( const QString & filename,
const QString & format,
int mode,
int width = 0,
int height = 0 )

References height(), and width().

◆ selectionPrimitives()

anatomist::GLPrimitives anatomist::GLWidgetManager::selectionPrimitives ( ) const

◆ setAutoCentering()

void anatomist::GLWidgetManager::setAutoCentering ( bool )

◆ setBackgroundAlpha()

void anatomist::GLWidgetManager::setBackgroundAlpha ( float a)

◆ setDepthPeelingPasses()

void anatomist::GLWidgetManager::setDepthPeelingPasses ( unsigned n)

◆ setExtrema()

void anatomist::GLWidgetManager::setExtrema ( const Point3df & bmin,
const Point3df & bmax )

set objects extrema, this also automatically sets the window bounding box

◆ setLeftEye()

void anatomist::GLWidgetManager::setLeftEye ( GLWidgetManager * )

References GLWidgetManager().

◆ setLightGLList()

void anatomist::GLWidgetManager::setLightGLList ( GLuint l)

◆ setMinimumSizeHint()

void anatomist::GLWidgetManager::setMinimumSizeHint ( const QSize & )

◆ setOtherBuffersSaveMode()

void anatomist::GLWidgetManager::setOtherBuffersSaveMode ( int mode)

◆ setPerspectiveAngle()

void anatomist::GLWidgetManager::setPerspectiveAngle ( float a)

◆ setPerspectiveAutoFarPlane()

void anatomist::GLWidgetManager::setPerspectiveAutoFarPlane ( bool x)

◆ setPerspectiveFarPlane()

void anatomist::GLWidgetManager::setPerspectiveFarPlane ( float d)

◆ setPerspectiveNearPlaneRatio()

void anatomist::GLWidgetManager::setPerspectiveNearPlaneRatio ( float d)

◆ setPreferredSize()

void anatomist::GLWidgetManager::setPreferredSize ( int ,
int  )

◆ setPrimitives()

void anatomist::GLWidgetManager::setPrimitives ( const anatomist::GLPrimitives & li)

◆ setQuaternion() [1/2]

void anatomist::GLWidgetManager::setQuaternion ( const aims::Quaternion & q)

◆ setQuaternion() [2/2]

void anatomist::GLWidgetManager::setQuaternion ( const Point4df & q)

◆ setRGBBufferUpdated()

void anatomist::GLWidgetManager::setRGBBufferUpdated ( bool )
protected

◆ setRightEye()

void anatomist::GLWidgetManager::setRightEye ( GLWidgetManager * )

References GLWidgetManager().

◆ setRotationCenter()

void anatomist::GLWidgetManager::setRotationCenter ( const Point3df & )

◆ setSelectionPrimitives()

void anatomist::GLWidgetManager::setSelectionPrimitives ( const anatomist::GLPrimitives & li)

◆ setTransparentObjects()

void anatomist::GLWidgetManager::setTransparentObjects ( bool )

◆ setupView()

virtual void anatomist::GLWidgetManager::setupView ( int virtualWidth = 0,
int virtualHeight = 0 )
protectedvirtual

◆ setWindowExtrema()

void anatomist::GLWidgetManager::setWindowExtrema ( const Point3df & bmin,
const Point3df & bmax )

set window extrema (in the local orientation)

◆ setXDirection()

void anatomist::GLWidgetManager::setXDirection ( bool invert)

◆ setYDirection()

void anatomist::GLWidgetManager::setYDirection ( bool invert)

◆ setZBufferUpdated()

void anatomist::GLWidgetManager::setZBufferUpdated ( bool )
protected

◆ setZDirection()

void anatomist::GLWidgetManager::setZDirection ( bool invert)

◆ setZoom()

void anatomist::GLWidgetManager::setZoom ( float z)

◆ sharedWidget()

static QGLWidget * anatomist::GLWidgetManager::sharedWidget ( )
static

◆ sizeHint()

virtual QSize anatomist::GLWidgetManager::sizeHint ( ) const
virtual

Reimplemented in QAGLWidget.

◆ snapshotImage()

QImage anatomist::GLWidgetManager::snapshotImage ( int bufmode,
int width = 0,
int height = 0 )

References height(), and width().

◆ stopZBufferTimer()

void anatomist::GLWidgetManager::stopZBufferTimer ( )
protected

◆ touchEvent()

virtual void anatomist::GLWidgetManager::touchEvent ( QTouchEvent * event)
virtual

◆ translateCursorPosition()

virtual bool anatomist::GLWidgetManager::translateCursorPosition ( float x,
float y,
Point3df & position )
virtual

◆ updateGL()

virtual void anatomist::GLWidgetManager::updateGL ( )
virtual

◆ updateZBuffer()

virtual void anatomist::GLWidgetManager::updateZBuffer ( )
protectedvirtual

◆ wheelEvent()

virtual void anatomist::GLWidgetManager::wheelEvent ( QWheelEvent * )
virtual

Reimplemented in QAGLWidget.

◆ width()

virtual int anatomist::GLWidgetManager::width ( )
pure virtual

◆ windowBoundingMax()

Point3df anatomist::GLWidgetManager::windowBoundingMax ( ) const

◆ windowBoundingMin()

Point3df anatomist::GLWidgetManager::windowBoundingMin ( ) const

◆ zoom()

float anatomist::GLWidgetManager::zoom ( ) const

Friends And Related Symbol Documentation

◆ ::GLWidgetManager_Private_QObject

friend class ::GLWidgetManager_Private_QObject
friend

Definition at line 112 of file glwidgetmanager.h.

◆ anatomist::internal::AGraphicsView

QGraphicsView needs to call event methods.

Definition at line 240 of file glwidgetmanager.h.

Member Data Documentation

◆ _primitives

anatomist::GLPrimitives anatomist::GLWidgetManager::_primitives
protected

Definition at line 253 of file glwidgetmanager.h.

◆ _selectprimitives

anatomist::GLPrimitives anatomist::GLWidgetManager::_selectprimitives
protected

Definition at line 254 of file glwidgetmanager.h.


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