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

A sphere drawing. More...

#include <drawables.h>

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

Public Member Functions

 DrawSphere ()
 Default Constructor. More...
 
virtual ~DrawSphere ()
 Destructor. More...
 
virtual DrawableObjclone () const
 
virtual unsigned int getType () const
 
void setOrigin (const Point3D &p)
 Sets the location of the sphere's origin. More...
 
Point3D getOrigin () const
 Gets the location of the sphere's origin. More...
 
void setLatSegments (unsigned int)
 Set the number of lateral segments. More...
 
void setLongSegments (unsigned int)
 Set the number of longitudinal segments. More...
 
void setRadius (float)
 Set the radius. More...
 
float getRadius () const
 get the radius More...
 
void setColour (float r, float g, float b, float a)
 Set the colour (rgba) of the object. More...
 
void draw () const
 Draw the sphere. 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...
 
- 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

GLUquadricObj * q
 Pointer to the GLU quadric doohicker. More...
 
Point3D origin
 Origin of the object. More...
 
float r
 Colour data - rgba. More...
 
float g
 
float b
 
float a
 
float radius
 Sphere radius. More...
 
unsigned int latSegments
 Number of lateral and longitudinal segments. More...
 
unsigned int longSegments
 
- 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 sphere drawing.

Constructor & Destructor Documentation

◆ DrawSphere()

DrawSphere::DrawSphere ( )

Default Constructor.

References q.

Referenced by clone().

Here is the caller graph for this function:

◆ ~DrawSphere()

DrawSphere::~DrawSphere ( )
virtual

Destructor.

References q.

Member Function Documentation

◆ clone()

DrawableObj * DrawSphere::clone ( ) const
virtual

Reimplemented from DrawableObj.

References a, b, DrawSphere(), g, latSegments, longSegments, origin, q, r, and radius.

◆ draw()

void DrawSphere::draw ( ) const
virtual

Draw the sphere.

Implements DrawableObj.

References a, b, g, latSegments, longSegments, origin, q, r, and radius.

◆ getBoundingBox()

void DrawSphere::getBoundingBox ( BoundCube b) const
virtual

Get the bounding box that encapuslates this object.

Implements DrawableObj.

References origin, radius, and BoundCube::setBound().

◆ getOrigin()

Point3D DrawSphere::getOrigin ( ) const
inline

Gets the location of the sphere's origin.

Referenced by TransformFilter::numBytesForCache(), IonClipFilter::refresh(), and ProfileFilter::refresh().

Here is the caller graph for this function:

◆ getRadius()

float DrawSphere::getRadius ( ) const
inline

get the radius

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

Here is the caller graph for this function:

◆ getType()

virtual unsigned int DrawSphere::getType ( ) const
inlinevirtual

Implements DrawableObj.

References DRAW_TYPE_SPHERE.

◆ recomputeParams()

void DrawSphere::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_SPHERE_BIND_ORIGIN, DRAW_SPHERE_BIND_RADIUS, origin, and radius.

◆ setColour()

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

Set the colour (rgba) of the object.

References a, b, g, and r.

Referenced by TransformFilter::numBytesForCache(), IonClipFilter::refresh(), AnnotateFilter::refresh(), and ProfileFilter::refresh().

Here is the caller graph for this function:

◆ setLatSegments()

void DrawSphere::setLatSegments ( unsigned int  ui)

Set the number of lateral segments.

References latSegments.

Referenced by TransformFilter::numBytesForCache(), IonClipFilter::refresh(), and ProfileFilter::refresh().

Here is the caller graph for this function:

◆ setLongSegments()

void DrawSphere::setLongSegments ( unsigned int  ui)

Set the number of longitudinal segments.

References longSegments.

Referenced by TransformFilter::numBytesForCache(), IonClipFilter::refresh(), and ProfileFilter::refresh().

Here is the caller graph for this function:

◆ setOrigin()

void DrawSphere::setOrigin ( const Point3D p)

Sets the location of the sphere's origin.

References origin.

Referenced by TransformFilter::numBytesForCache(), IonClipFilter::refresh(), AnnotateFilter::refresh(), and ProfileFilter::refresh().

Here is the caller graph for this function:

◆ setRadius()

void DrawSphere::setRadius ( float  rad)

Set the radius.

References radius.

Referenced by TransformFilter::numBytesForCache(), IonClipFilter::refresh(), AnnotateFilter::refresh(), and ProfileFilter::refresh().

Here is the caller graph for this function:

Member Data Documentation

◆ a

float DrawSphere::a
protected

Referenced by clone(), draw(), and setColour().

◆ b

float DrawSphere::b
protected

Referenced by clone(), draw(), and setColour().

◆ g

float DrawSphere::g
protected

Referenced by clone(), draw(), and setColour().

◆ latSegments

unsigned int DrawSphere::latSegments
protected

Number of lateral and longitudinal segments.

Referenced by clone(), draw(), and setLatSegments().

◆ longSegments

unsigned int DrawSphere::longSegments
protected

Referenced by clone(), draw(), and setLongSegments().

◆ origin

Point3D DrawSphere::origin
protected

Origin of the object.

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

◆ q

GLUquadricObj* DrawSphere::q
protected

Pointer to the GLU quadric doohicker.

Referenced by clone(), draw(), DrawSphere(), and ~DrawSphere().

◆ r

float DrawSphere::r
protected

Colour data - rgba.

Referenced by clone(), draw(), and setColour().

◆ radius

float DrawSphere::radius
protected

Sphere radius.

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


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