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

A class to represent a textured box. More...

#include <box.h>

Public Types

enum  Face {
  None = 1, North = 2, South = 4, East = 8,
  West = 16, Front = 32, Back = 64, All = North | South | East | West | Front | Back
}
 the faces to show texture on More...
 

Public Slots

virtual void makeConnections ()
 make signal/slot connections More...
 
void setColor (QColor color)
 set the color More...
 
void setSize (double xvalue, double yvalue, double zvalue, unsigned int tesselate_x=10, unsigned int tesselate_y=10, unsigned int tesselate_z=10)
 set the box size More...
 
void setFaces (Faces faces)
 set the list of faces to show texture on More...
 
void showImage (bool on=true)
 show the texture More...
 
void toggleImage ()
 toggle if texture is shown More...
 
void setTexture (GLuint imageID)
 set texture 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 colorChanged (QColor color)
 signal that the color of has changed More...
 
void sizeChanged (double xvalue, double yvalue, double zvalue)
 signal that the box size has changed More...
 
void imageOnChanged (bool drawn)
 signal that the texture is drawn changed More...
 
void facesChanged (Faces faces)
 signal that which faces the texture appears on changed More...
 
void textureChanged (GLuint imageID)
 signal that the texture has changed More...
 
- Signals inherited from LangmuirView::SceneObject
void visibleChanged (bool drawn)
 signal that the visibility has changed More...
 

Public Member Functions

 Box (LangmuirViewer &viewer, QObject *parent=0)
 create the Box More...
 
 ~Box ()
 destroy the Box More...
 
const QColor & getColor () const
 get color More...
 
int getXSize () const
 get x length More...
 
int getYSize () const
 get y length More...
 
int getZSize () const
 get z length More...
 
bool imageIsOn () const
 true if texture is showing 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 buildGeometry (unsigned int tesselate_x, unsigned int tesselate_y, unsigned int tesselate_z)
 build cube geometry More...
 
virtual void draw ()
 perform OpenGL drawing operations 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

QColor m_color
 color of box More...
 
double m_xsize
 x length More...
 
double m_ysize
 y length More...
 
double m_zsize
 z length More...
 
double m_halfXSize
 half xsize More...
 
double m_halfYSize
 half ysize More...
 
double m_halfZSize
 half zsize More...
 
GLuint m_imageID
 texture ID More...
 
bool m_imageOn
 show texture More...
 
Faces m_faces
 texture faces More...
 
QOpenGLBuffer * m_verticesVBO
 vertices buffer More...
 
QOpenGLBuffer * m_normalsVBO
 normals buffer More...
 
QOpenGLBuffer * m_texturesVBO
 texture buffer More...
 
QOpenGLBuffer * m_indexVBO
 index buffer CW More...
 
unsigned int m_numVertices
 number of vertices (3 * number of points) More...
 
unsigned int m_numIndices
 index count 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 textured box.

Member Enumeration Documentation

the faces to show texture on

Enumerator
None 
North 

do not show texture on any face

South 

show texture on the +y

East 

show texture on the -y

West 

show texture on the +x

Front 

show texture on the -x

Back 

show texture on the +z

All 

show texture on the -z

Constructor & Destructor Documentation

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

create the Box

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

destroy the Box

Member Function Documentation

virtual void LangmuirView::Box::buildGeometry ( unsigned int  tesselate_x,
unsigned int  tesselate_y,
unsigned int  tesselate_z 
)
protectedvirtual

build cube geometry

void LangmuirView::Box::colorChanged ( QColor  color)
signal

signal that the color of has changed

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

perform OpenGL drawing operations

Reimplemented from LangmuirView::SceneObject.

void LangmuirView::Box::facesChanged ( Faces  faces)
signal

signal that which faces the texture appears on changed

Parameters
faceslist of faces
const QColor& LangmuirView::Box::getColor ( ) const

get color

int LangmuirView::Box::getXSize ( ) const

get x length

int LangmuirView::Box::getYSize ( ) const

get y length

int LangmuirView::Box::getZSize ( ) const

get z length

bool LangmuirView::Box::imageIsOn ( ) const

true if texture is showing

void LangmuirView::Box::imageOnChanged ( bool  drawn)
signal

signal that the texture is drawn changed

Parameters
drawntrue if texture is drawn
virtual void LangmuirView::Box::init ( )
protectedvirtual

initialize object

Reimplemented from LangmuirView::SceneObject.

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

make signal/slot connections

void LangmuirView::Box::setColor ( QColor  color)
slot

set the color

Parameters
colorcolor to set
void LangmuirView::Box::setFaces ( Faces  faces)
slot

set the list of faces to show texture on

Parameters
faceslist of faces
void LangmuirView::Box::setSize ( double  xvalue,
double  yvalue,
double  zvalue,
unsigned int  tesselate_x = 10,
unsigned int  tesselate_y = 10,
unsigned int  tesselate_z = 10 
)
slot

set the box size

Parameters
xvaluelength
yvaluewidth
zvalueheight
tesselate_xnumber of divisions
tesselate_ynumber of divisions
tesselate_znumber of divisions
void LangmuirView::Box::setTexture ( GLuint  imageID)
slot

set texture

void LangmuirView::Box::showImage ( bool  on = true)
slot

show the texture

Parameters
ontrue if texture is to be shown
void LangmuirView::Box::sizeChanged ( double  xvalue,
double  yvalue,
double  zvalue 
)
signal

signal that the box size has changed

Parameters
xvaluevalue of length
yvaluevalue of width
zvaluevalue of height
void LangmuirView::Box::textureChanged ( GLuint  imageID)
signal

signal that the texture has changed

Parameters
imageIDtexture ID
void LangmuirView::Box::toggleImage ( )
slot

toggle if texture is shown

Member Data Documentation

QColor LangmuirView::Box::m_color
protected

color of box

Faces LangmuirView::Box::m_faces
protected

texture faces

double LangmuirView::Box::m_halfXSize
protected

half xsize

double LangmuirView::Box::m_halfYSize
protected

half ysize

double LangmuirView::Box::m_halfZSize
protected

half zsize

GLuint LangmuirView::Box::m_imageID
protected

texture ID

bool LangmuirView::Box::m_imageOn
protected

show texture

QOpenGLBuffer* LangmuirView::Box::m_indexVBO
protected

index buffer CW

QOpenGLBuffer* LangmuirView::Box::m_normalsVBO
protected

normals buffer

unsigned int LangmuirView::Box::m_numIndices
protected

index count

unsigned int LangmuirView::Box::m_numVertices
protected

number of vertices (3 * number of points)

QOpenGLBuffer* LangmuirView::Box::m_texturesVBO
protected

texture buffer

QOpenGLBuffer* LangmuirView::Box::m_verticesVBO
protected

vertices buffer

double LangmuirView::Box::m_xsize
protected

x length

double LangmuirView::Box::m_ysize
protected

y length

double LangmuirView::Box::m_zsize
protected

z length


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