qCC_db version 2.13.alpha (Qt) - 31 May 2022
CloudCompare 3D entities
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 QSize getScreenSize () const =0
 Returns the screen size.
 
virtual void redraw (bool only2D=false, bool resetLOD=true)=0
 Redraws display immediately.
 
virtual void toBeRefreshed ()=0
 Flags display as 'to be refreshed'. More...
 
virtual void refresh (bool only2D=false)=0
 Redraws display only if flagged as 'to be refreshed'. More...
 
virtual void invalidateViewport ()=0
 Invalidates current viewport setup. More...
 
virtual void deprecate3DLayer ()=0
 Invalidates the 3D layer (FBO) More...
 
virtual QFont getTextDisplayFont () const =0
 Returns default text display font. More...
 
virtual QFont getLabelDisplayFont () const =0
 Returns default label display font. More...
 
virtual void displayText (QString text, int x, int y, unsigned char align=ALIGN_DEFAULT, float bkgAlpha=0.0f, const ccColor::Rgba *color=nullptr, const QFont *font=nullptr)=0
 Displays a string at a given 2D position. More...
 
virtual void display3DLabel (const QString &str, const CCVector3 &pos3D, const ccColor::Rgba *color=nullptr, const QFont &font=QFont())=0
 Displays a string at a given 3D position. More...
 
virtual void getGLCameraParameters (ccGLCameraParameters &params)=0
 Returns the current OpenGL camera parameters.
 
virtual QPointF toCenteredGLCoordinates (int x, int y) const =0
 Converts 2D screen coordinates to 'centered' 2D OpenGL context coordinates.
 
virtual QPointF toCornerGLCoordinates (int x, int y) const =0
 Converts 2D screen coordinates to 'corner-based' 2D OpenGL context coordinates.
 
virtual const ccViewportParametersgetViewportParameters () const =0
 Returns viewport parameters (zoom, etc.)
 
virtual void setupProjectiveViewport (const ccGLMatrixd &cameraMatrix, float fov_deg=0.0f, float ar=1.0f, bool viewerBasedPerspective=true, bool bubbleViewMode=false)=0
 Setups a (projective) camera. More...
 
virtual QWidget * asWidget ()
 Returns this window as a proper Qt widget.
 

Detailed Description

Generic interface for GL displays.

Member Function Documentation

◆ deprecate3DLayer()

virtual void ccGenericGLDisplay::deprecate3DLayer ( )
pure virtual

Invalidates the 3D layer (FBO)

On next redraw, the 3D layer will be updated

◆ display3DLabel()

virtual void ccGenericGLDisplay::display3DLabel ( const QString &  str,
const CCVector3 &  pos3D,
const ccColor::Rgba color = nullptr,
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
colorRGBA color (optional: if let to 0, default text rendering color is used)
fontfont (optional)

◆ displayText()

virtual void ccGenericGLDisplay::displayText ( QString  text,
int  x,
int  y,
unsigned char  align = ALIGN_DEFAULT,
float  bkgAlpha = 0.0f,
const ccColor::Rgba color = nullptr,
const QFont *  font = nullptr 
)
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)
colortext color (optional)
fontoptional font (otherwise default one will be used)

◆ getLabelDisplayFont()

virtual QFont ccGenericGLDisplay::getLabelDisplayFont ( ) const
pure virtual

Returns default label display font.

Warning: already takes rendering zoom into account!

◆ getTextDisplayFont()

virtual QFont ccGenericGLDisplay::getTextDisplayFont ( ) const
pure virtual

Returns default text display font.

Warning: already takes rendering zoom into account!

◆ invalidateViewport()

virtual void ccGenericGLDisplay::invalidateViewport ( )
pure virtual

Invalidates current viewport setup.

On next redraw, viewport information will be recomputed.

◆ refresh()

virtual void ccGenericGLDisplay::refresh ( bool  only2D = false)
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.

Parameters
only2Dwhether to redraw everything (false) or only the 2D layer (true)

◆ setupProjectiveViewport()

virtual void ccGenericGLDisplay::setupProjectiveViewport ( const ccGLMatrixd cameraMatrix,
float  fov_deg = 0.0f,
float  ar = 1.0f,
bool  viewerBasedPerspective = true,
bool  bubbleViewMode = false 
)
pure virtual

Setups a (projective) camera.

Parameters
cameraMatrixorientation/position matrix of the camera
fov_degvertical field of view (in degrees). Optional (ignored if 0).
araspect ratio (width/height)
viewerBasedPerspectivewhether the perspective view should be object-centered (false) or camera-centered (true)
bubbleViewModeset whether bubble-view mode should be enabled or not (in which case viewerBasedPerspective is forced by default)

◆ toBeRefreshed()

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: