3Depict
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Protected Attributes | List of all members
DrawQuad Class Reference

A smooth coloured quad. More...

#include <drawables.h>

Inheritance diagram for DrawQuad:
Inheritance graph
[legend]
Collaboration diagram for DrawQuad:
Collaboration graph
[legend]

Public Member Functions

 DrawQuad ()
 Constructor. More...
 
virtual ~DrawQuad ()
 Destructor. More...
 
virtual DrawableObjclone () const
 
virtual unsigned int getType () const
 
virtual void getBoundingBox (BoundCube &b) const
 Get bounding cube. More...
 
void colourVerticies ()
 sets the vertices to defautl colours (r g b and white ) for each vertex respectively More...
 
void setVertex (unsigned int, const Point3D &)
 Set vertex's location. More...
 
void setVertices (const Point3D *)
 
void setColour (unsigned int, float r, float g, float b, float a)
 Set the colour of a vertex. More...
 
void setColour (float r, float g, float b, float a)
 Set the colour of all vertices. More...
 
void calcNormal ()
 Update the normal to the surface from vertices. More...
 
void draw () const
 Draw the triangle. More...
 
Point3D getOrigin () const
 Gets the arrow axis direction. More...
 
void recomputeParams (const std::vector< Point3D > &vecs, const std::vector< float > &scalars, unsigned int mode)
 Recompute the internal parameters using the input vector information. More...
 
- Public Member Functions inherited from DrawableObj
virtual bool isOverlay () const
 Is this an overlay? By default, no. More...
 
 DrawableObj ()
 Constructor. More...
 
virtual bool needsDepthSorting () const
 Do we need to do element based depth sorting? More...
 
virtual bool isExplodable () const
 Can we break this object down into constituent elements? More...
 
virtual void explode (std::vector< DrawableObj *> &simpleObjects)
 Break object down into simple elements. More...
 
virtual bool hasChanged () const
 
void setActive (bool active)
 Set the active state of the object. More...
 
void setInteract (bool canAct)
 Set if user can interact with object, needed for opengl hit testing. More...
 
virtual ~DrawableObj ()
 Drawable destructor. More...
 
virtual Point3D getCentroid () const
 Get the centre of the object. Only valid if object is simple. More...
 

Protected Attributes

Point3D vertices [4]
 Vertices of the quad. More...
 
Point3D normal
 
float r [4]
 Colours of the vertices (rgba colour model) More...
 
float g [4]
 
float b [4]
 
float a [4]
 
- Protected Attributes inherited from DrawableObj
bool active
 Is the drawable active? More...
 
bool haveChanged
 Is the object changed since last set? More...
 

Additional Inherited Members

- Static Public Member Functions inherited from DrawableObj
static void setUseAlphaBlending (bool willBlend)
 
static void setCurCamera (const Camera *c)
 Set the current camera. More...
 
static void setTexPool (TexturePool *t)
 Set the current camera. More...
 
static void clearTexPool ()
 
static void setWindowSize (unsigned int x, unsigned int y)
 
static void setBackgroundColour (float r, float g, float b)
 
- Public Attributes inherited from DrawableObj
bool canSelect
 Can be selected from openGL viewport interactively? More...
 
bool wantsLight
 Wants lighting calculations active during render? More...
 
- Static Protected Member Functions inherited from DrawableObj
static float getHighContrastValue ()
 
- Static Protected Attributes inherited from DrawableObj
static const CameracurCamera = 0
 Pointer to current scene camera. More...
 
static float backgroundR
 
static float backgroundG
 
static float backgroundB
 
static TexturePooltexPool =0
 
static bool useAlphaBlend
 
static unsigned int winX
 
static unsigned int winY
 

Detailed Description

A smooth coloured quad.

Constructor & Destructor Documentation

◆ DrawQuad()

DrawQuad::DrawQuad ( )
inline

Constructor.

◆ ~DrawQuad()

virtual DrawQuad::~DrawQuad ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ calcNormal()

void DrawQuad::calcNormal ( )

Update the normal to the surface from vertices.

Uses the first 3 vertices to calculate the normal.

◆ clone()

DrawableObj * DrawQuad::clone ( ) const
virtual

Reimplemented from DrawableObj.

◆ colourVerticies()

void DrawQuad::colourVerticies ( )

sets the vertices to defautl colours (r g b and white ) for each vertex respectively

◆ draw()

void DrawQuad::draw ( ) const
virtual

Draw the triangle.

Implements DrawableObj.

Reimplemented in DrawTexturedQuad.

References ASSERT.

◆ getBoundingBox()

void DrawQuad::getBoundingBox ( BoundCube b) const
virtual

Get bounding cube.

Implements DrawableObj.

References BoundCube::setBounds(), and DrawTriangle::vertices.

Referenced by DrawTriangleMesh::setData().

Here is the caller graph for this function:

◆ getOrigin()

Point3D DrawQuad::getOrigin ( ) const

Gets the arrow axis direction.

References Point3D::centroid(), and DrawTriangle::vertices.

Referenced by VoxeliseFilter::refresh().

Here is the caller graph for this function:

◆ getType()

virtual unsigned int DrawQuad::getType ( ) const
inlinevirtual

Implements DrawableObj.

References DRAW_TYPE_QUAD.

◆ recomputeParams()

void DrawQuad::recomputeParams ( const std::vector< Point3D > &  vecs,
const std::vector< float > &  scalars,
unsigned int  mode 
)
virtual

Recompute the internal parameters using the input vector information.

Reimplemented from DrawableObj.

References ASSERT, DRAW_QUAD_BIND_ORIGIN, and DrawTriangle::vertices.

◆ setColour() [1/2]

void DrawQuad::setColour ( unsigned  int,
float  r,
float  g,
float  b,
float  a 
)

Set the colour of a vertex.

Referenced by VoxeliseFilter::refresh().

Here is the caller graph for this function:

◆ setColour() [2/2]

void DrawQuad::setColour ( float  r,
float  g,
float  b,
float  a 
)

Set the colour of all vertices.

References DrawTriangle::a, ASSERT, DrawTriangle::b, DrawTriangle::g, and DrawTriangle::r.

◆ setVertex()

void DrawQuad::setVertex ( unsigned int  v,
const Point3D p 
)

Set vertex's location.

References ASSERT, and DrawTriangle::vertices.

◆ setVertices()

void DrawQuad::setVertices ( const Point3D v)

References DrawTriangle::vertices.

Referenced by VoxeliseFilter::getRefreshUseMask().

Here is the caller graph for this function:

Member Data Documentation

◆ a

float DrawQuad::a[4]
protected

◆ b

float DrawQuad::b[4]
protected

◆ g

float DrawQuad::g[4]
protected

◆ normal

Point3D DrawQuad::normal
protected

Colour data for the quad The lighting normal of the triangle

Lighting for this class is per triangle only no per vertex lighting

Referenced by DrawPolygon::clone().

◆ r

float DrawQuad::r[4]
protected

Colours of the vertices (rgba colour model)

Referenced by DrawPolygon::clone(), DrawTexturedQuad::draw(), DrawPolygon::draw(), and DrawPolygon::setColour().

◆ vertices

Point3D DrawQuad::vertices[4]
protected

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