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

A single colour triangle. More...

#include <drawables.h>

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

Public Member Functions

 DrawTriangle ()
 Constructor. More...
 
virtual ~DrawTriangle ()
 Destructor. More...
 
virtual DrawableObjclone () const
 
virtual unsigned int getType () const
 
void setVertex (unsigned int, const Point3D &)
 Set one of three vertices (0-2) locations. More...
 
void setVertexNorm (unsigned int, const Point3D &)
 Set the vertex normals. More...
 
void setColour (float r, float g, float b, float a)
 Set the colour of the triangle. More...
 
void draw () const
 Draw the triangle. More...
 
void getBoundingBox (BoundCube &b) const
 Get bounding cube. 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 void recomputeParams (const std::vector< Point3D > &vecs, const std::vector< float > &scalars, unsigned int mode)
 If we offer any kind of external pointer interface; use this to do a recomputation as needed. This is needed for selection binding behaviour. More...
 
virtual Point3D getCentroid () const
 Get the centre of the object. Only valid if object is simple. More...
 

Protected Attributes

Point3D vertices [3]
 The vertices of the triangle. More...
 
Point3D vertNorm [3]
 
float r
 Colour data - red, green, blue, alpha. More...
 
float g
 
float b
 
float a
 
- 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 single colour triangle.

Constructor & Destructor Documentation

◆ DrawTriangle()

DrawTriangle::DrawTriangle ( )

Constructor.

Referenced by clone().

Here is the caller graph for this function:

◆ ~DrawTriangle()

DrawTriangle::~DrawTriangle ( )
virtual

Destructor.

Member Function Documentation

◆ clone()

DrawableObj * DrawTriangle::clone ( ) const
virtual

Reimplemented from DrawableObj.

References DrawTriangle().

◆ draw()

void DrawTriangle::draw ( ) const
virtual

Draw the triangle.

Implements DrawableObj.

References a, b, g, r, and vertices.

◆ getBoundingBox()

void DrawTriangle::getBoundingBox ( BoundCube b) const
inlinevirtual

Get bounding cube.

Implements DrawableObj.

References BoundCube::setBounds().

◆ getType()

virtual unsigned int DrawTriangle::getType ( ) const
inlinevirtual

Implements DrawableObj.

References DRAW_TYPE_TRIANGLE.

◆ setColour()

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

Set the colour of the triangle.

References a, b, g, and r.

◆ setVertex()

void DrawTriangle::setVertex ( unsigned int  ui,
const Point3D pt 
)

Set one of three vertices (0-2) locations.

References ASSERT, and vertices.

◆ setVertexNorm()

void DrawTriangle::setVertexNorm ( unsigned  int,
const Point3D  
)

Set the vertex normals.

Member Data Documentation

◆ a

float DrawTriangle::a
protected

◆ b

float DrawTriangle::b
protected

◆ g

float DrawTriangle::g
protected

◆ r

float DrawTriangle::r
protected

Colour data - red, green, blue, alpha.

Referenced by draw(), setColour(), and DrawQuad::setColour().

◆ vertices

Point3D DrawTriangle::vertices[3]
protected

◆ vertNorm

Point3D DrawTriangle::vertNorm[3]
protected

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