CGAL 5.0.2 - Three
|
#include <CGAL/Three/Viewer_interface.h>
QGLViewer.
Base class to interact with the viewer from the plugins, the items and the scene.
Public Slots | |
virtual void | setAntiAliasing (bool b)=0 |
Sets the antialiasing to true or false. More... | |
virtual void | setTwoSides (bool b)=0 |
If b is true, faces will be ligted from both internal and external side. More... | |
virtual void | setFastDrawing (bool b)=0 |
Sets the fast drawing mode. More... | |
virtual void | turnCameraBy180Degres ()=0 |
Makes the camera turn around. | |
virtual QString | dumpCameraCoordinates ()=0 |
virtual bool | moveCameraToCoordinates (QString target, float animation_duration=0.5f)=0 |
Moves the camera to the new coordinates. More... | |
virtual void | SetOrthoProjection (bool b)=0 |
Setter for the orthogonal projection of the viewer. | |
Signals | |
void | selected (int id) |
Emit this to signal that the id th item has been picked. | |
void | requestContextMenu (QPoint global_pos) |
Emit this to require a contextual menu to appear at global_pos . | |
void | selectedPoint (double x, double y, double z) |
Emit this to signal that the point at (x , y , z ) has been picked. | |
void | selectionRay (double sx, double sy, double sz, double tx, double ty, double tz) |
Emit this to request the currently selected item to perform a selection based on an AABB_Tree and a raycasting. | |
Public Member Functions | |
virtual QPainter * | getPainter ()=0 |
The viewer's QPainter. More... | |
virtual bool | testDisplayId (double x, double y, double z)=0 |
Tests if an id should be displayed or not. More... | |
virtual void | updateIds (CGAL::Three::Scene_item *)=0 |
Updates the item's displayed ids. More... | |
virtual bool | hasText () const |
Specifies if the items ids are being displayed. More... | |
Viewer_interface (QWidget *parent) | |
Constructor. More... | |
Viewer_interface (QWidget *parent, QOpenGLWidget *shared_widget) | |
Constructor for the secondary viewers. More... | |
virtual void | setScene (CGAL::Three::Scene_draw_interface *scene)=0 |
Sets the scene for the viewer. | |
virtual bool | antiAliasing () const =0 |
The antialiasing state. More... | |
virtual bool | inFastDrawing () const =0 |
The fastDrawing state. More... | |
virtual bool | inDrawWithNames () const =0 |
The drawWithNames state. More... | |
virtual void | attribBuffers (int program_name) const =0 |
Passes all the uniform data to the shaders. More... | |
virtual void | enableClippingBox (QVector4D box[6])=0 |
Enables the clipping box. More... | |
virtual void | disableClippingBox ()=0 |
Disables the clipping box. More... | |
virtual QOpenGLShaderProgram * | getShaderProgram (int name) const =0 |
Returns a program according to name. More... | |
virtual TextRenderer * | textRenderer ()=0 |
TextRenderer is used to display text on the screen. More... | |
typedef | void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDARBPROC)(GLenum mode |
Allows OpenGL ES 2.0 context to get access to glDrawArraysInstanced. | |
typedef | void (APIENTRYP PFNGLVERTEXATTRIBDIVISORARBPROC)(GLuint index |
Allows OpenGL ES 2.0 context to get access to glVertexAttribDivisor. | |
typedef | void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC)(GLuint target |
Allows OpenGL ES 2.0 context to get access to glVertexAttribDivisor. | |
virtual bool | isExtensionFound ()=0 |
Used by the items to avoid SEGFAULT. More... | |
virtual void | setBindingSelect ()=0 |
Allows to perform picking from the keyboard and mouse. More... | |
virtual void | setNoBinding ()=0 |
Disable the picking from the keyboard and mouse. More... | |
virtual void | set2DSelectionMode (bool)=0 |
If this mode is ON, the viewer will display the content of staticImage() instead of drawing the cene. More... | |
virtual void | setStaticImage (QImage image)=0 |
Setter for the image to be displayed in 2D selection mode. | |
virtual const QImage & | staticImage () const =0 |
Returns the static image to be displayed in 2D selection mode. | |
virtual float | total_pass ()=0 |
The number of passes that are performed for the scene transparency. More... | |
virtual QOpenGLFunctions_4_3_Core * | openGL_4_3_functions ()=0 |
Gives acces to recent openGL(4.3) features, allowing use of things like Geometry Shaders or Depth Textures. More... | |
virtual const GLfloat & | getGlPointSize () const =0 |
getter for point size under old openGL context; | |
virtual void | setGlPointSize (const GLfloat &p)=0 |
setter for point size under old openGL context; | |
Static Public Member Functions | |
static bool | readFrame (QString s, CGAL::qglviewer::Frame &frame) |
Sets the position and orientation of a frame using a QString. More... | |
static QString | dumpFrame (const CGAL::qglviewer::Frame &) |
Gives information about a frame. More... | |
The OpenGL_program_IDs enum.
This enum holds the OpenGL programs IDs that are given to getShaderProgram() and attribBuffers().
CGAL::Three::Viewer_interface::Viewer_interface | ( | QWidget * | parent | ) |
Constructor.
Creates a valid context for OpenGL ES 2.0.
parent | the parent widget. It usually is the MainWindow. |
CGAL::Three::Viewer_interface::Viewer_interface | ( | QWidget * | parent, |
QOpenGLWidget * | shared_widget | ||
) |
Constructor for the secondary viewers.
parent | the parent widget. It usually is the MainWindow. |
shared_widget | the main viewer of the Application. This will share the context and allow synchronized rendering of multiple views. |
|
pure virtual |
The antialiasing state.
|
pure virtual |
Passes all the uniform data to the shaders.
According to program_name, this data may change. This should be called in every Scene_item::draw() call.
|
pure virtual |
|
pure virtualslot |
|
static |
Gives information about a frame.
|
pure virtual |
Enables the clipping box.
Each Vector4 of box
contains the equation of a plane of the clipping box. Everything that is located on the positive side of one of those planes will not be displayed.
|
pure virtual |
The viewer's QPainter.
The painter is the element that draws everything on screen, but you should only need this if you want to draw 2D things on top of the scene, like a selection rectangle. See QPainter's documentation for details.
|
pure virtual |
Returns a program according to name.
If the program does not exist yet, it is created and stored in shader_programs.
|
virtual |
Specifies if the items ids are being displayed.
|
pure virtual |
The drawWithNames state.
In draw with name mode, the scene is not displayed, but a name is given to each Scene_item. It is used for picking.
|
pure virtual |
The fastDrawing state.
In fast drawing mode, some items will be simplified while the camera is moving to gain in performance.
|
pure virtual |
Used by the items to avoid SEGFAULT.
|
pure virtualslot |
Moves the camera to the new coordinates.
The movement is performed through an animation.
target | is usually gotten by dumpCameraCoordinates() and is of the form "Px Py Pz O1 O2 O3 O4 ", with
|
animation_duration | is the duration of the animation of the movement. |
|
pure virtual |
Gives acces to recent openGL(4.3) features, allowing use of things like Geometry Shaders or Depth Textures.
isOpenGL_4_3()
is true
isOpenGL_4_3()
is false
|
static |
Sets the position and orientation of a frame using a QString.
s | is usually gotten by dumpFrame() and is of the form "Px Py Pz O1 O2 O3 O4 ", with
|
frame | is the frame that will be moved |
|
pure virtual |
If this mode is ON, the viewer will display the content of staticImage()
instead of drawing the cene.
This is used when drawing 2D lines over the viewer.
staticImage()
setStaticImage()
|
pure virtualslot |
Sets the antialiasing to true or false.
|
pure virtual |
Allows to perform picking from the keyboard and mouse.
Sets the combination SHIFT+LEFT CLICK to perform a selection on the screen. This is used to perform picking.
|
pure virtualslot |
Sets the fast drawing mode.
|
pure virtual |
Disable the picking from the keyboard and mouse.
Unbinds the combination SHIFT+LEFT CLICK. It allows to avoid conflicts in the selection_tool, for example.
|
pure virtualslot |
If b is true, faces will be ligted from both internal and external side.
If b is false, only the side that is exposed to the light source will be lighted.
|
pure virtual |
Tests if an id should be displayed or not.
x,y,z | the coordinates of the id's position. |
|
pure virtual |
TextRenderer is used to display text on the screen.
The textRenderer uses the painter to display 2D text over the 3D Scene.
|
pure virtual |
The number of passes that are performed for the scene transparency.
Customizable from the MainWindow or the SubViewer menu.
|
pure virtual |
Updates the item's displayed ids.
Call this after the mesh or its ids have changed.