3Depict
|
A tapered cylinder drawing class. More...
#include <drawables.h>
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... | |
![]() | |
virtual bool | isOverlay () const |
Is this an overlay? By default, no. More... | |
DrawableObj () | |
Constructor. More... | |
virtual DrawableObj * | clone () 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... | |
![]() | |
bool | active |
Is the drawable active? More... | |
bool | haveChanged |
Is the object changed since last set? More... | |
Additional Inherited Members | |
![]() | |
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) |
![]() | |
bool | canSelect |
Can be selected from openGL viewport interactively? More... | |
bool | wantsLight |
Wants lighting calculations active during render? More... | |
![]() | |
static float | getHighContrastValue () |
![]() | |
static const Camera * | curCamera = 0 |
Pointer to current scene camera. More... | |
static float | backgroundR |
static float | backgroundG |
static float | backgroundB |
static TexturePool * | texPool =0 |
static bool | useAlphaBlend |
static unsigned int | winX |
static unsigned int | winY |
A tapered cylinder drawing class.
DrawCylinder::DrawCylinder | ( | ) |
Constructor.
References q, qCap, and radiiLocked.
|
virtual |
Draw the clyinder.
Implements DrawableObj.
References a, Point3D::angle(), ASSERT, b, Point3D::crossProd(), direction, g, length, M_PI, Point3D::normalise(), origin, q, qCap, r, radiiLocked, radius, slices, Point3D::sqrMag(), and stacks.
|
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().
|
inline |
Gets the cylinder axis direction.
|
inline |
Gets the location of the origin.
|
inline |
get the radius
|
inlinevirtual |
Implements DrawableObj.
References DRAW_TYPE_CYLINDER.
|
inline |
Lock (or unlock) the radius to the start radius (i.e. synch the two)
|
virtual |
Do we need to do element based depth sorting?
Reimplemented from DrawableObj.
|
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.
void DrawCylinder::setColour | ( | float | r, |
float | g, | ||
float | b, | ||
float | a | ||
) |
void DrawCylinder::setDirection | ( | const Point3D & | pt | ) |
Set the orientation of cylinder.
References direction.
Referenced by IonClipFilter::setPropFromBinding().
void DrawCylinder::setLength | ( | float | len | ) |
Set the length of cylinder.
References ASSERT, direction, Point3D::normalise(), and Point3D::sqrMag().
Referenced by IonClipFilter::setPropFromBinding().
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().
void DrawCylinder::setRadius | ( | float | val | ) |
Set end radius.
References radius.
Referenced by IonClipFilter::setPropFromBinding().
void DrawCylinder::setSlices | ( | unsigned int | i | ) |
Number of cuts perpendicular to axis - ie disks.
References slices.
void DrawCylinder::setStacks | ( | unsigned int | i | ) |
Number of cuts along axis - ie segments.
References stacks.
|
protected |
Referenced by draw(), and setColour().
|
protected |
Referenced by draw(), and setColour().
|
protected |
Referenced by draw(), getBoundingBox(), recomputeParams(), setDirection(), and setLength().
|
protected |
Referenced by draw(), and setColour().
|
protected |
Length of the cylinder.
Referenced by draw().
|
protected |
Origin of base and direction of cylinder.
Referenced by draw(), getBoundingBox(), recomputeParams(), and setOrigin().
|
protected |
Pointer to quadric, required for glu. Note the caps are defined as well.
Referenced by draw(), DrawCylinder(), and ~DrawCylinder().
|
protected |
Referenced by draw(), DrawCylinder(), and ~DrawCylinder().
|
protected |
Colours for cylinder.
Referenced by draw(), and setColour().
|
protected |
Do we lock the drawing to only use the first radius?
Referenced by draw(), and DrawCylinder().
|
protected |
Cylinder start and end radii.
Referenced by draw(), getBoundingBox(), recomputeParams(), and setRadius().
|
protected |
number of sectors (pie slices)
Referenced by draw(), and setSlices().
|
protected |
number of vertical slices (should be 1 if endradius equals start radius
Referenced by draw(), and setStacks().