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

A point drawing class - for many points of same size & colour. More...

#include <drawables.h>

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

Public Member Functions

 DrawManyPoints ()
 Constructor. More...
 
virtual ~DrawManyPoints ()
 Destructor. More...
 
virtual unsigned int getType () const
 
virtual DrawableObjclone () const
 
void swap (std::vector< Point3D > &)
 Swap out the internal vector with an extenal one. More...
 
void clear ()
 Remove all points. More...
 
void addPoints (const std::vector< Point3D > &)
 Add points into the drawing vector. More...
 
void setPoint (size_t offset, const Point3D &)
 Add a single point into the drawing vector, at a particular offset. More...
 
void resize (size_t newSize)
 Reset the number of many points to draw. More...
 
void setColour (float r, float g, float b, float alpha)
 set the color of the points to be drawn More...
 
void setSize (float)
 Set the display size of the drawn poitns. More...
 
void draw () const
 Draw the points. More...
 
void shuffle ()
 Shuffle the points to remove anisotropic drawing effects. Thus must be done prior to draw call. More...
 
void getBoundingBox (BoundCube &b) const
 Get the bounding box that encapuslates this object. More...
 
size_t getNumPts () const
 return number of points 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

std::vector< Point3Dpts
 Vector of points to draw. More...
 
float r
 Point colours (r,g,b,a) range: [0.0f,1.0f]. More...
 
float g
 
float b
 
float a
 
float size
 Size of the point. More...
 
bool haveCachedBounds
 
BoundCube cachedBounds
 
- 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 point drawing class - for many points of same size & colour.

Constructor & Destructor Documentation

◆ DrawManyPoints()

DrawManyPoints::DrawManyPoints ( )

Constructor.

References DrawableObj::wantsLight.

Referenced by clone().

Here is the caller graph for this function:

◆ ~DrawManyPoints()

DrawManyPoints::~DrawManyPoints ( )
virtual

Destructor.

Member Function Documentation

◆ addPoints()

void DrawManyPoints::addPoints ( const std::vector< Point3D > &  vp)

Add points into the drawing vector.

References haveCachedBounds, and pts.

◆ clear()

void DrawManyPoints::clear ( )

Remove all points.

References pts.

◆ clone()

DrawableObj * DrawManyPoints::clone ( ) const
virtual

Reimplemented from DrawableObj.

References DrawManyPoints().

◆ draw()

void DrawManyPoints::draw ( ) const
virtual

Draw the points.

Implements DrawableObj.

References a, b, g, pts, r, and size.

◆ getBoundingBox()

void DrawManyPoints::getBoundingBox ( BoundCube b) const
virtual

Get the bounding box that encapuslates this object.

Implements DrawableObj.

References cachedBounds, haveCachedBounds, pts, and BoundCube::setBounds().

◆ getNumPts()

size_t DrawManyPoints::getNumPts ( ) const
inline

return number of points

◆ getType()

virtual unsigned int DrawManyPoints::getType ( ) const
inlinevirtual

Implements DrawableObj.

References DRAW_TYPE_MANYPOINT.

◆ resize()

void DrawManyPoints::resize ( size_t  newSize)

Reset the number of many points to draw.

References haveCachedBounds, and pts.

Referenced by VisController::updateScene().

Here is the caller graph for this function:

◆ setColour()

void DrawManyPoints::setColour ( float  r,
float  g,
float  b,
float  alpha 
)

set the color of the points to be drawn

References a, b, g, and r.

Referenced by VisController::updateScene().

Here is the caller graph for this function:

◆ setPoint()

void DrawManyPoints::setPoint ( size_t  offset,
const Point3D p 
)

Add a single point into the drawing vector, at a particular offset.

References ASSERT, haveCachedBounds, and pts.

Referenced by VisController::updateScene().

Here is the caller graph for this function:

◆ setSize()

void DrawManyPoints::setSize ( float  f)

Set the display size of the drawn poitns.

References size.

Referenced by VisController::updateScene().

Here is the caller graph for this function:

◆ shuffle()

void DrawManyPoints::shuffle ( )

Shuffle the points to remove anisotropic drawing effects. Thus must be done prior to draw call.

References pts.

Referenced by VisController::updateScene().

Here is the caller graph for this function:

◆ swap()

void DrawManyPoints::swap ( std::vector< Point3D > &  )

Swap out the internal vector with an extenal one.

Member Data Documentation

◆ a

float DrawManyPoints::a
protected

Referenced by draw(), and setColour().

◆ b

float DrawManyPoints::b
protected

Referenced by draw(), and setColour().

◆ cachedBounds

BoundCube DrawManyPoints::cachedBounds
mutableprotected

Referenced by getBoundingBox().

◆ g

float DrawManyPoints::g
protected

Referenced by draw(), and setColour().

◆ haveCachedBounds

bool DrawManyPoints::haveCachedBounds
mutableprotected

◆ pts

std::vector<Point3D> DrawManyPoints::pts
protected

Vector of points to draw.

Referenced by addPoints(), clear(), draw(), getBoundingBox(), resize(), setPoint(), and shuffle().

◆ r

float DrawManyPoints::r
protected

Point colours (r,g,b,a) range: [0.0f,1.0f].

Referenced by draw(), and setColour().

◆ size

float DrawManyPoints::size
protected

Size of the point.

Referenced by draw(), and setSize().


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