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

A tapered cylinder drawing class. More...

#include <drawables.h>

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

Public Member Functions

 DrawCylinder ()
 Constructor. More...
 
virtual ~DrawCylinder ()
 Destructor. More...
 
virtual unsigned int getType () const
 
void setOrigin (const Point3D &pt)
 Set the location of the base of the cylinder. More...
 
void setSlices (unsigned int i)
 Number of cuts perpendicular to axis - ie disks. More...
 
void setStacks (unsigned int i)
 Number of cuts along axis - ie segments. More...
 
Point3D getOrigin () const
 Gets the location of the origin. More...
 
Point3D getDirection () const
 Gets the cylinder axis direction. More...
 
void setRadius (float val)
 Set end radius. More...
 
float getRadius () const
 get the radius More...
 
void setDirection (const Point3D &pt)
 Set the orientation of cylinder. More...
 
void setLength (float len)
 Set the length of cylinder. More...
 
void setColour (float r, float g, float b, float a)
 Set the color of the cylinder. More...
 
void draw () const
 Draw the clyinder. More...
 
void getBoundingBox (BoundCube &b) const
 Get the bounding box that encapuslates this object. 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...
 
virtual bool needsDepthSorting () const
 Do we need to do element based depth sorting? More...
 
void lockRadii (bool doLock=true)
 Lock (or unlock) the radius to the start radius (i.e. synch the two) More...
 
- Public Member Functions inherited from DrawableObj
virtual bool isOverlay () const
 Is this an overlay? By default, no. More...
 
 DrawableObj ()
 Constructor. More...
 
virtual DrawableObjclone () const
 
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

GLUquadricObj * q
 Pointer to quadric, required for glu. Note the caps are defined as well. More...
 
GLUquadricObj * qCap [2]
 
float r
 Colours for cylinder. More...
 
float g
 
float b
 
float a
 
float radius
 Cylinder start and end radii. More...
 
float length
 Length of the cylinder. More...
 
Point3D origin
 Origin of base and direction of cylinder. More...
 
Point3D direction
 
unsigned int slices
 number of sectors (pie slices) More...
 
unsigned int stacks
 number of vertical slices (should be 1 if endradius equals start radius More...
 
bool radiiLocked
 Do we lock the drawing to only use the first radius? More...
 
- 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 tapered cylinder drawing class.

Constructor & Destructor Documentation

◆ DrawCylinder()

DrawCylinder::DrawCylinder ( )

Constructor.

References q, qCap, and radiiLocked.

◆ ~DrawCylinder()

DrawCylinder::~DrawCylinder ( )
virtual

Destructor.

References q, and qCap.

Member Function Documentation

◆ draw()

void DrawCylinder::draw ( ) const
virtual

◆ getBoundingBox()

void DrawCylinder::getBoundingBox ( BoundCube b) const
virtual

Get the bounding box that encapuslates this object.

Implements DrawableObj.

References direction, Point3D::dotProd(), Point3D::normalise(), origin, radius, and BoundCube::setBounds().

Referenced by IonClipFilter::setPropFromBinding().

Here is the caller graph for this function:

◆ getDirection()

Point3D DrawCylinder::getDirection ( ) const
inline

Gets the cylinder axis direction.

◆ getOrigin()

Point3D DrawCylinder::getOrigin ( ) const
inline

Gets the location of the origin.

◆ getRadius()

float DrawCylinder::getRadius ( ) const
inline

get the radius

◆ getType()

virtual unsigned int DrawCylinder::getType ( ) const
inlinevirtual

Implements DrawableObj.

References DRAW_TYPE_CYLINDER.

◆ lockRadii()

void DrawCylinder::lockRadii ( bool  doLock = true)
inline

Lock (or unlock) the radius to the start radius (i.e. synch the two)

◆ needsDepthSorting()

bool DrawCylinder::needsDepthSorting ( ) const
virtual

Do we need to do element based depth sorting?

Reimplemented from DrawableObj.

◆ recomputeParams()

void DrawCylinder::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, direction, DRAW_CYLINDER_BIND_DIRECTION, DRAW_CYLINDER_BIND_ORIGIN, DRAW_CYLINDER_BIND_RADIUS, origin, and radius.

◆ setColour()

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

Set the color of the cylinder.

References a, b, g, and r.

◆ setDirection()

void DrawCylinder::setDirection ( const Point3D pt)

Set the orientation of cylinder.

References direction.

Referenced by IonClipFilter::setPropFromBinding().

Here is the caller graph for this function:

◆ setLength()

void DrawCylinder::setLength ( float  len)

Set the length of cylinder.

References ASSERT, direction, Point3D::normalise(), and Point3D::sqrMag().

Referenced by IonClipFilter::setPropFromBinding().

Here is the caller graph for this function:

◆ setOrigin()

void DrawCylinder::setOrigin ( const Point3D pt)

Set the location of the base of the cylinder.

References origin.

Referenced by IonClipFilter::refresh(), ProfileFilter::refresh(), and IonClipFilter::setPropFromBinding().

Here is the caller graph for this function:

◆ setRadius()

void DrawCylinder::setRadius ( float  val)

Set end radius.

References radius.

Referenced by IonClipFilter::setPropFromBinding().

Here is the caller graph for this function:

◆ setSlices()

void DrawCylinder::setSlices ( unsigned int  i)

Number of cuts perpendicular to axis - ie disks.

References slices.

◆ setStacks()

void DrawCylinder::setStacks ( unsigned int  i)

Number of cuts along axis - ie segments.

References stacks.

Member Data Documentation

◆ a

float DrawCylinder::a
protected

Referenced by draw(), and setColour().

◆ b

float DrawCylinder::b
protected

Referenced by draw(), and setColour().

◆ direction

Point3D DrawCylinder::direction
protected

◆ g

float DrawCylinder::g
protected

Referenced by draw(), and setColour().

◆ length

float DrawCylinder::length
protected

Length of the cylinder.

Referenced by draw().

◆ origin

Point3D DrawCylinder::origin
protected

Origin of base and direction of cylinder.

Referenced by draw(), getBoundingBox(), recomputeParams(), and setOrigin().

◆ q

GLUquadricObj* DrawCylinder::q
protected

Pointer to quadric, required for glu. Note the caps are defined as well.

Referenced by draw(), DrawCylinder(), and ~DrawCylinder().

◆ qCap

GLUquadricObj * DrawCylinder::qCap[2]
protected

Referenced by draw(), DrawCylinder(), and ~DrawCylinder().

◆ r

float DrawCylinder::r
protected

Colours for cylinder.

Referenced by draw(), and setColour().

◆ radiiLocked

bool DrawCylinder::radiiLocked
protected

Do we lock the drawing to only use the first radius?

Referenced by draw(), and DrawCylinder().

◆ radius

float DrawCylinder::radius
protected

Cylinder start and end radii.

Referenced by draw(), getBoundingBox(), recomputeParams(), and setRadius().

◆ slices

unsigned int DrawCylinder::slices
protected

number of sectors (pie slices)

Referenced by draw(), and setSlices().

◆ stacks

unsigned int DrawCylinder::stacks
protected

number of vertical slices (should be 1 if endradius equals start radius

Referenced by draw(), and setStacks().


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