qCC_db  version 2.5.4 (Qt) - 19 Apr 2014
 All Classes Functions Variables Typedefs Enumerations Enumerator Pages
Public Types | Public Member Functions | List of all members
ccGenericGLDisplay Class Referenceabstract

Generic interface for GL displays. More...

#include <ccGenericGLDisplay.h>

Public Types

enum  TextAlign {
  ALIGN_HLEFT = 1, ALIGN_HMIDDLE = 2, ALIGN_HRIGHT = 4, ALIGN_VTOP = 8,
  ALIGN_VMIDDLE = 16, ALIGN_VBOTTOM = 32, ALIGN_DEFAULT = 1 | 8
}
 Text alignment.
 

Public Member Functions

virtual void redraw ()=0
 Redraws display immediately.
 
virtual void toBeRefreshed ()=0
 Flags display as 'to be refreshed'. More...
 
virtual void refresh ()=0
 Redraws display only if flagged as 'to be refreshed'. More...
 
virtual void invalidateViewport ()=0
 Invalidates current viewport setup. More...
 
virtual unsigned getTexture (const QImage &image)=0
 Get texture ID from image.
 
virtual void releaseTexture (unsigned texID)=0
 Release texture from context.
 
virtual QFont getTextDisplayFont () const =0
 Returns font. More...
 
virtual void displayText (QString text, int x, int y, unsigned char align=ALIGN_DEFAULT, float bkgAlpha=0, const unsigned char *rgbColor=0, const QFont *font=0)=0
 Displays a string at a given 2D position. More...
 
virtual void display3DLabel (const QString &str, const CCVector3 &pos3D, const unsigned char *rgbColor=0, const QFont &font=QFont())=0
 Displays a string at a given 3D position. More...
 
virtual bool supportOpenGLVersion (unsigned openGLVersionFlag)=0
 Returns whether a given version of OpenGL is supported. More...
 
virtual const double * getModelViewMatd ()=0
 Returns current model view matrix (GL_MODELVIEW)
 
virtual const double * getProjectionMatd ()=0
 Returns current projection matrix (GL_PROJECTION)
 
virtual void getViewportArray (int vp[])=0
 Returns current viewport (GL_VIEWPORT)
 
virtual const
ccViewportParameters
getViewportParameters () const =0
 Returns viewport parameters (zoom, etc.)
 

Detailed Description

Generic interface for GL displays.

Member Function Documentation

virtual void ccGenericGLDisplay::display3DLabel ( const QString &  str,
const CCVector3 &  pos3D,
const unsigned char *  rgbColor = 0,
const QFont &  font = QFont() 
)
pure virtual

Displays a string at a given 3D position.

This method should be called solely during 3D pass rendering (see paintGL).

Parameters
strstring
pos3D3D position of string origin
rgbColorcolor (optional: if let to 0, default text rendering color is used)
fontfont (optional)
virtual void ccGenericGLDisplay::displayText ( QString  text,
int  x,
int  y,
unsigned char  align = ALIGN_DEFAULT,
float  bkgAlpha = 0,
const unsigned char *  rgbColor = 0,
const QFont *  font = 0 
)
pure virtual

Displays a string at a given 2D position.

This method should be called solely during 2D pass rendering. The coordinates are expressed relatively to the current viewport (y = 0 at the top!).

Parameters
textstring
xhorizontal position of string origin
yvertical position of string origin
alignalignment position flags
bkgAlphabackground transparency (0 by default)
rgbColortext color (optional)
fontoptional font (otherwise default one will be used)
virtual QFont ccGenericGLDisplay::getTextDisplayFont ( ) const
pure virtual

Returns font.

Warning: already takes rendering zoom into account!

virtual void ccGenericGLDisplay::invalidateViewport ( )
pure virtual

Invalidates current viewport setup.

On next redraw, viewport information will be recomputed.

virtual void ccGenericGLDisplay::refresh ( )
pure virtual

Redraws display only if flagged as 'to be refreshed'.

See ccGenericGLDisplay::toBeRefreshed. Flag is turned to false after a call to this method.

virtual bool ccGenericGLDisplay::supportOpenGLVersion ( unsigned  openGLVersionFlag)
pure virtual

Returns whether a given version of OpenGL is supported.

Parameters
openGLVersionFlagsee QGLFormat::OpenGLVersionFlag
virtual void ccGenericGLDisplay::toBeRefreshed ( )
pure virtual

Flags display as 'to be refreshed'.

See ccGenericGLDisplay::refresh.


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