![]() |
Langmuir
Simulation
|
A class to represent a point cloud. More...
#include <pointcloud.h>
Public Types | |
| enum | Mode { Points = 1, Squares = 2, Cubes = 3 } |
| The rendering mode for the cloud. More... | |
Public Slots | |
| virtual void | makeConnections () |
| make signal/slot connections More... | |
| void | setMaxPoints (unsigned int value) |
| change the maximum number of points allowed More... | |
| void | setMaxRender (unsigned int value) |
| change the maximum number of points to render More... | |
| void | setPointSize (float value) |
| set the point size More... | |
| void | setColor (QColor color) |
| set the color More... | |
| void | setMode (Mode mode) |
| set the mode More... | |
| void | updateVBO () |
| update the GPU memory using CPU vertices More... | |
| static QString | modeToQString (Mode mode) |
| convert Mode to string More... | |
| static Mode | QStringToMode (QString string) |
| convert string to Mode enum More... | |
Public Slots inherited from LangmuirView::SceneObject | |
| void | toggleVisible () |
| toggle visibility More... | |
| void | setVisible (bool draw=true) |
| set the visibility More... | |
| virtual void | makeConnections () |
| make signal/slot connections More... | |
Signals | |
| void | maxPointsChanged (unsigned int value) |
| signal that the maximum number of points has changed More... | |
| void | maxRenderChanged (unsigned int value) |
| signal that the maximum number of points rendered has changed More... | |
| void | pointSizeChanged (float value) |
| signal that the point size has changed More... | |
| void | colorChanged (QColor color) |
| signal that the color of has changed More... | |
| void | modeChanged (PointCloud::Mode mode) |
| signal that the render mode has changed More... | |
| void | modeChanged (QString mode) |
| signal that the render mode has changed More... | |
Signals inherited from LangmuirView::SceneObject | |
| void | visibleChanged (bool drawn) |
| signal that the visibility has changed More... | |
Public Member Functions | |
| PointCloud (LangmuirViewer &viewer, QObject *parent=0) | |
| create the PointCloud More... | |
| ~PointCloud () | |
| destroy the PointCloud More... | |
| const QColor & | getColor () const |
| get color More... | |
| float | getPointSize () const |
| get x length More... | |
| Mode | getMode () const |
| get render mode More... | |
| QVector< float > & | vertices () |
| get the list of vertices (CPU memory) More... | |
| unsigned int | getMaxPoints () |
| get the maximum number of points that can be rendered More... | |
| unsigned int | getMaxRender () |
| get the number of points currently being rendered More... | |
Public Member Functions inherited from LangmuirView::SceneObject | |
| SceneObject (LangmuirViewer &viewer, QObject *parent=0) | |
| create the SceneObject More... | |
| bool | isVisible () |
| true if object is drawn More... | |
| void | render () |
| calls OpenGL drawing commands. More... | |
Protected Member Functions | |
| virtual void | init () |
| initialize object More... | |
| virtual void | draw () |
| perform OpenGL drawing operations More... | |
| void | initShaders () |
| load the shaders More... | |
| void | drawFallback () |
| render function More... | |
| void | drawPoints () |
| render function More... | |
| void | drawSquares () |
| render function More... | |
| void | drawCubes () |
| render function More... | |
Protected Member Functions inherited from LangmuirView::SceneObject | |
| virtual void | preDraw () |
| perform OpenGL drawing operations before draw() More... | |
| virtual void | postDraw () |
| perform OpenGL drawing operations after draw() More... | |
Protected Attributes | |
| QOpenGLShaderProgram | m_shader1 |
| OpenGL shading pipeline for points. More... | |
| QOpenGLShaderProgram | m_shader2 |
| OpenGL shading pipeline for squares. More... | |
| QOpenGLShaderProgram | m_shader3 |
| OpenGL shading pipeline for cubes. More... | |
| QOpenGLBuffer * | m_verticesVBO |
| vertices buffer (GPU) More... | |
| QVector< float > | m_vertices |
| vertices buffer (CPU) More... | |
| unsigned int | m_maxPoints |
| maximum number of points allowed (# vertices / 3) More... | |
| unsigned int | m_maxRender |
| maximum number of points rendered (less than or equal to max points) More... | |
| float | m_pointSize |
| the size of points More... | |
| QColor | m_color |
| color of points More... | |
| Mode | m_mode |
| rendering mode More... | |
| bool | m_shader1OK |
| shader1 ok to use More... | |
| bool | m_shader2OK |
| shader2 ok to use More... | |
| bool | m_shader3OK |
| shader3 ok to use More... | |
Protected Attributes inherited from LangmuirView::SceneObject | |
| LangmuirViewer & | m_viewer |
| reference to OpenGL widget More... | |
| bool | visible_ |
| visibility More... | |
A class to represent a point cloud.
|
explicit |
create the PointCloud
| viewer | the viewer |
| parent | QObject this belongs to |
| LangmuirView::PointCloud::~PointCloud | ( | ) |
destroy the PointCloud
|
signal |
signal that the color of has changed
| color | value of color |
|
protectedvirtual |
perform OpenGL drawing operations
Reimplemented from LangmuirView::SceneObject.
|
protected |
render function
|
protected |
render function
|
protected |
render function
|
protected |
render function
| const QColor& LangmuirView::PointCloud::getColor | ( | ) | const |
get color
| unsigned int LangmuirView::PointCloud::getMaxPoints | ( | ) |
get the maximum number of points that can be rendered
| unsigned int LangmuirView::PointCloud::getMaxRender | ( | ) |
get the number of points currently being rendered
| Mode LangmuirView::PointCloud::getMode | ( | ) | const |
get render mode
| float LangmuirView::PointCloud::getPointSize | ( | ) | const |
get x length
|
protectedvirtual |
initialize object
Reimplemented from LangmuirView::SceneObject.
|
protected |
load the shaders
|
virtualslot |
make signal/slot connections
|
signal |
signal that the maximum number of points has changed
| value | value of max |
|
signal |
signal that the maximum number of points rendered has changed
| value | value of max |
|
signal |
signal that the render mode has changed
| mode | value of rendering mode |
|
signal |
signal that the render mode has changed
| mode | value of rendering mode |
|
staticslot |
convert Mode to string
| mode | mode enum |
|
signal |
signal that the point size has changed
| value | value of point size |
|
staticslot |
convert string to Mode enum
| string | mode string |
|
slot |
set the color
| color | color to set |
|
slot |
change the maximum number of points allowed
| value | max points to set |
This deletes the GPU memory and creates a new buffer. Do not do it often.
|
slot |
change the maximum number of points to render
| value | max points to render |
Make sure this is less than the max points allowed.
|
slot |
set the mode
| mode | mode to set |
|
slot |
set the point size
| value | point size to set |
|
slot |
update the GPU memory using CPU vertices
First alter the CPU vertices, set the max render, then update the VBO.
| QVector<float>& LangmuirView::PointCloud::vertices | ( | ) |
get the list of vertices (CPU memory)
|
protected |
color of points
|
protected |
maximum number of points allowed (# vertices / 3)
|
protected |
maximum number of points rendered (less than or equal to max points)
|
protected |
rendering mode
|
protected |
the size of points
|
protected |
OpenGL shading pipeline for points.
|
protected |
shader1 ok to use
|
protected |
OpenGL shading pipeline for squares.
|
protected |
shader2 ok to use
|
protected |
OpenGL shading pipeline for cubes.
|
protected |
shader3 ok to use
|
protected |
vertices buffer (CPU)
|
protected |
vertices buffer (GPU)