Langmuir
Simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LangmuirView::Mesh Class Reference

A class to represent a mesh. More...

#include <mesh.h>

Public Types

enum  Mode {
  Single = 1, SingleAlpha = 2, Double = 3, DoubleAlpha = 4,
  Shader1 = 5, Shader2 = 6
}
 The rendering mode for the cloud. More...
 

Public Slots

virtual void makeConnections ()
 make signal/slot connections More...
 
void setColorA (QColor color)
 set color A More...
 
void setColorB (QColor color)
 set color B More...
 
void setMesh (const QVector< float > &vertices, const QVector< float > &normals, const QVector< unsigned int > &indices)
 set up the mesh on the GPU More...
 
void setMode (Mesh::Mode mode)
 set the mode More...
 
void clear ()
 clear GPU buffers 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 colorAChanged (QColor color)
 signal that color A of has changed More...
 
void colorBChanged (QColor color)
 signal that color B of has changed More...
 
void meshChanged ()
 signal that the mesh has changed More...
 
void modeChanged (Mesh::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

 Mesh (LangmuirViewer &viewer, QObject *parent=0)
 create the Mesh More...
 
 ~Mesh ()
 destroy the Mesh More...
 
const QColor & getColorA () const
 get color A More...
 
const QColor & getColorB () const
 get color B More...
 
Mode getMode () const
 get render mode 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 drawSingle ()
 render function More...
 
void drawSingleAlpha ()
 render function More...
 
void drawDouble ()
 render function More...
 
void drawDoubleAlpha ()
 render function More...
 
void drawShader1 ()
 render function More...
 
void drawShader2 ()
 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
 tesselation shader More...
 
QOpenGLShaderProgram m_shader2
 tesselation shader More...
 
QOpenGLBuffer * m_verticesVBO
 vertices buffer More...
 
QOpenGLBuffer * m_normalsVBO
 normals buffer More...
 
QOpenGLBuffer * m_indexVBO
 index buffer CW More...
 
QColor m_colorA
 color of side A More...
 
QColor m_colorB
 color of side B More...
 
unsigned int m_numVertices
 number of vertices (3 * number of points) More...
 
unsigned int m_numIndices
 index count More...
 
Mode m_mode
 rendering mode More...
 
bool m_shader1OK
 shader1 ok to use More...
 
bool m_shader2OK
 shader2 ok to use More...
 
- Protected Attributes inherited from LangmuirView::SceneObject
LangmuirViewerm_viewer
 reference to OpenGL widget More...
 
bool visible_
 visibility More...
 

Detailed Description

A class to represent a mesh.

Member Enumeration Documentation

The rendering mode for the cloud.

Enumerator
Single 
SingleAlpha 

render mesh using single color

Double 

render mesh using single color with alpha blending

DoubleAlpha 

render mesh using two colors

Shader1 

render mesh using two colors with alpha blending

Shader2 

render mesh with shader1

Constructor & Destructor Documentation

LangmuirView::Mesh::Mesh ( LangmuirViewer viewer,
QObject *  parent = 0 
)
explicit

create the Mesh

Parameters
viewerthe viewer
parentQObject this belongs to
LangmuirView::Mesh::~Mesh ( )

destroy the Mesh

Member Function Documentation

void LangmuirView::Mesh::clear ( )
slot

clear GPU buffers

void LangmuirView::Mesh::colorAChanged ( QColor  color)
signal

signal that color A of has changed

Parameters
colorvalue of color
void LangmuirView::Mesh::colorBChanged ( QColor  color)
signal

signal that color B of has changed

Parameters
colorvalue of color
virtual void LangmuirView::Mesh::draw ( )
protectedvirtual

perform OpenGL drawing operations

Reimplemented from LangmuirView::SceneObject.

void LangmuirView::Mesh::drawDouble ( )
protected

render function

void LangmuirView::Mesh::drawDoubleAlpha ( )
protected

render function

void LangmuirView::Mesh::drawShader1 ( )
protected

render function

void LangmuirView::Mesh::drawShader2 ( )
protected

render function

void LangmuirView::Mesh::drawSingle ( )
protected

render function

void LangmuirView::Mesh::drawSingleAlpha ( )
protected

render function

const QColor& LangmuirView::Mesh::getColorA ( ) const

get color A

const QColor& LangmuirView::Mesh::getColorB ( ) const

get color B

Mode LangmuirView::Mesh::getMode ( ) const

get render mode

virtual void LangmuirView::Mesh::init ( )
protectedvirtual

initialize object

Reimplemented from LangmuirView::SceneObject.

void LangmuirView::Mesh::initShaders ( )
protected

load the shaders

virtual void LangmuirView::Mesh::makeConnections ( )
virtualslot

make signal/slot connections

void LangmuirView::Mesh::meshChanged ( )
signal

signal that the mesh has changed

void LangmuirView::Mesh::modeChanged ( Mesh::Mode  mode)
signal

signal that the render mode has changed

Parameters
modevalue of rendering mode
void LangmuirView::Mesh::modeChanged ( QString  mode)
signal

signal that the render mode has changed

Parameters
modevalue of rendering mode
static QString LangmuirView::Mesh::modeToQString ( Mode  mode)
staticslot

convert Mode to string

Parameters
modemode enum
static Mode LangmuirView::Mesh::QStringToMode ( QString  string)
staticslot

convert string to Mode enum

Parameters
stringmode string
void LangmuirView::Mesh::setColorA ( QColor  color)
slot

set color A

Parameters
colorcolor to set
void LangmuirView::Mesh::setColorB ( QColor  color)
slot

set color B

Parameters
colorcolor to set
void LangmuirView::Mesh::setMesh ( const QVector< float > &  vertices,
const QVector< float > &  normals,
const QVector< unsigned int > &  indices 
)
slot

set up the mesh on the GPU

Parameters
verticesvertex buffer
normalsnormal buffer
indicesindex buffer
void LangmuirView::Mesh::setMode ( Mesh::Mode  mode)
slot

set the mode

Parameters
modemode to set

Member Data Documentation

QColor LangmuirView::Mesh::m_colorA
protected

color of side A

QColor LangmuirView::Mesh::m_colorB
protected

color of side B

QOpenGLBuffer* LangmuirView::Mesh::m_indexVBO
protected

index buffer CW

Mode LangmuirView::Mesh::m_mode
protected

rendering mode

QOpenGLBuffer* LangmuirView::Mesh::m_normalsVBO
protected

normals buffer

unsigned int LangmuirView::Mesh::m_numIndices
protected

index count

unsigned int LangmuirView::Mesh::m_numVertices
protected

number of vertices (3 * number of points)

QOpenGLShaderProgram LangmuirView::Mesh::m_shader1
protected

tesselation shader

bool LangmuirView::Mesh::m_shader1OK
protected

shader1 ok to use

QOpenGLShaderProgram LangmuirView::Mesh::m_shader2
protected

tesselation shader

bool LangmuirView::Mesh::m_shader2OK
protected

shader2 ok to use

QOpenGLBuffer* LangmuirView::Mesh::m_verticesVBO
protected

vertices buffer


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