qCC_db version 2.13.alpha (Qt) - 31 May 2022
CloudCompare 3D entities
|
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 ¶ms)=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 ccViewportParameters & | getViewportParameters () 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. | |
Generic interface for GL displays.
|
pure virtual |
Invalidates the 3D layer (FBO)
On next redraw, the 3D layer will be updated
|
pure virtual |
Displays a string at a given 3D position.
This method should be called solely during 3D pass rendering (see paintGL).
str | string |
pos3D | 3D position of string origin |
color | RGBA color (optional: if let to 0, default text rendering color is used) |
font | font (optional) |
|
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!).
text | string |
x | horizontal position of string origin |
y | vertical position of string origin |
align | alignment position flags |
bkgAlpha | background transparency (0 by default) |
color | text color (optional) |
font | optional font (otherwise default one will be used) |
|
pure virtual |
Returns default label display font.
Warning: already takes rendering zoom into account!
|
pure virtual |
Returns default text display font.
Warning: already takes rendering zoom into account!
|
pure virtual |
Invalidates current viewport setup.
On next redraw, viewport information will be recomputed.
|
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.
only2D | whether to redraw everything (false) or only the 2D layer (true) |
|
pure virtual |
Setups a (projective) camera.
cameraMatrix | orientation/position matrix of the camera |
fov_deg | vertical field of view (in degrees). Optional (ignored if 0). |
ar | aspect ratio (width/height) |
viewerBasedPerspective | whether the perspective view should be object-centered (false) or camera-centered (true) |
bubbleViewMode | set whether bubble-view mode should be enabled or not (in which case viewerBasedPerspective is forced by default) |
|
pure virtual |
Flags display as 'to be refreshed'.