vtkOpenGLContextDevice2D Class Reference

#include <vtkOpenGLContextDevice2D.h>

Inheritance diagram for vtkOpenGLContextDevice2D:

Inheritance graph
[legend]
Collaboration diagram for vtkOpenGLContextDevice2D:

Collaboration graph
[legend]

List of all members.


Detailed Description

Class for drawing 2D primitives using OpenGL.

This class takes care of drawing the 2D primitives for the vtkContext2D class. In general this class should not be used directly, but called by vtkContext2D which takes care of many of the higher level details.

Tests:
vtkOpenGLContextDevice2D (Tests)

Definition at line 40 of file vtkOpenGLContextDevice2D.h.


Public Types

typedef vtkContextDevice2D Superclass

Public Member Functions

virtual const char * GetClassName ()
virtual int IsA (const char *type)
virtual void PrintSelf (ostream &os, vtkIndent indent)
virtual void DrawPoly (float *points, int n)
virtual void DrawPoints (float *points, int n)
virtual void DrawPointSprites (vtkImageData *sprite, float *points, int n)
virtual void DrawQuad (float *points, int n)
virtual void DrawImage (float *p, int n, vtkImageData *image)
virtual void SetColor4 (unsigned char *color)
virtual void SetColor (unsigned char *color)
virtual void SetPointSize (float size)
virtual void SetLineWidth (float width)
virtual void SetLineType (int type)
virtual void MultiplyMatrix (vtkMatrix3x3 *m)
virtual void SetMatrix (vtkMatrix3x3 *m)
virtual void PushMatrix ()
virtual void PopMatrix ()
virtual void SetClipping (int *x)
virtual void DisableClipping ()
virtual void Begin (vtkViewport *viewport)
virtual void End ()
virtual void BufferIdModeBegin (vtkAbstractContextBufferId *bufferId)
virtual void BufferIdModeEnd ()
bool SetStringRendererToFreeType ()
bool SetStringRendererToQt ()
bool HasGLSL ()
virtual void ReleaseGraphicsResources (vtkWindow *window)
virtual void DrawEllipseWedge (float x, float y, float outRx, float outRy, float inRx, float inRy, float startAngle, float stopAngle)
virtual void DrawEllipticArc (float x, float y, float rX, float rY, float startAngle, float stopAngle)
virtual void DrawString (float *point, vtkTextProperty *tprop, const vtkStdString &string)
virtual void ComputeStringBounds (const vtkStdString &string, vtkTextProperty *tprop, float bounds[4])
virtual vtkOpenGLRenderWindowGetRenderWindow ()

Static Public Member Functions

static int IsTypeOf (const char *type)
static vtkOpenGLContextDevice2DSafeDownCast (vtkObject *o)
static vtkOpenGLContextDevice2DNew ()

Protected Member Functions

 vtkOpenGLContextDevice2D ()
virtual ~vtkOpenGLContextDevice2D ()
bool LoadExtensions (vtkOpenGLExtensionManager *m)
int GetNumberOfArcIterations (float rX, float rY, float startAngle, float stopAngle)

Protected Attributes

int Geometry [2]
vtkRendererRenderer
vtkLabelRenderStrategyTextRenderer
bool IsTextDrawn
bool InRender
vtkOpenGLRenderWindowRenderWindow
Private * Storage

Member Typedef Documentation

Reimplemented from vtkContextDevice2D.

Definition at line 43 of file vtkOpenGLContextDevice2D.h.


Constructor & Destructor Documentation

vtkOpenGLContextDevice2D::vtkOpenGLContextDevice2D (  )  [protected]

virtual vtkOpenGLContextDevice2D::~vtkOpenGLContextDevice2D (  )  [protected, virtual]


Member Function Documentation

virtual const char* vtkOpenGLContextDevice2D::GetClassName (  )  [virtual]

Reimplemented from vtkContextDevice2D.

static int vtkOpenGLContextDevice2D::IsTypeOf ( const char *  name  )  [static]

Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkContextDevice2D.

virtual int vtkOpenGLContextDevice2D::IsA ( const char *  name  )  [virtual]

Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkContextDevice2D.

static vtkOpenGLContextDevice2D* vtkOpenGLContextDevice2D::SafeDownCast ( vtkObject o  )  [static]

Reimplemented from vtkContextDevice2D.

virtual void vtkOpenGLContextDevice2D::PrintSelf ( ostream &  os,
vtkIndent  indent 
) [virtual]

Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkContextDevice2D.

static vtkOpenGLContextDevice2D* vtkOpenGLContextDevice2D::New (  )  [static]

Creates a 2D Painter object.

Reimplemented from vtkObject.

virtual void vtkOpenGLContextDevice2D::DrawPoly ( float *  points,
int  n 
) [virtual]

Draw a poly line using the points - fastest code path due to memory layout of the coordinates.

Implements vtkContextDevice2D.

virtual void vtkOpenGLContextDevice2D::DrawPoints ( float *  points,
int  n 
) [virtual]

Draw a series of points - fastest code path due to memory layout of the coordinates.

Implements vtkContextDevice2D.

virtual void vtkOpenGLContextDevice2D::DrawPointSprites ( vtkImageData sprite,
float *  points,
int  n 
) [virtual]

Draw a series of point sprites, images centred at the points supplied. The supplied vtkImageData is the sprite to be drawn, only squares will be drawn and the size is set using SetPointSize.

Implements vtkContextDevice2D.

virtual void vtkOpenGLContextDevice2D::DrawQuad ( float *  points,
int  n 
) [virtual]

Draws a rectangle

Reimplemented from vtkContextDevice2D.

virtual void vtkOpenGLContextDevice2D::DrawEllipseWedge ( float  x,
float  y,
float  outRx,
float  outRy,
float  inRx,
float  inRy,
float  startAngle,
float  stopAngle 
) [virtual]

Draw an elliptic wedge with center at x, y, outer radii outRx, outRy, inner radii inRx, inRy between angles startAngle and stopAngle (expressed in degrees).

Precondition:
positive_outRx: outRx>=0

positive_outRy: outRy>=0

positive_inRx: inRx>=0

positive_inRy: inRy>=0

ordered_rx: inRx<=outRx

ordered_ry: inRy<=outRy

Implements vtkContextDevice2D.

virtual void vtkOpenGLContextDevice2D::DrawEllipticArc ( float  x,
float  y,
float  rX,
float  rY,
float  startAngle,
float  stopAngle 
) [virtual]

Draw an elliptic arc with center at x,y with radii rX and rY between angles startAngle and stopAngle (expressed in degrees).

Precondition:
positive_rX: rX>=0

positive_rY: rY>=0

Implements vtkContextDevice2D.

virtual void vtkOpenGLContextDevice2D::DrawString ( float *  point,
vtkTextProperty tprop,
const vtkStdString string 
) [virtual]

Draw some text to the screen!

Implements vtkContextDevice2D.

virtual void vtkOpenGLContextDevice2D::ComputeStringBounds ( const vtkStdString string,
vtkTextProperty tprop,
float  bounds[4] 
) [virtual]

Compute the bounds of the supplied string. The bounds will be copied to the supplied bounds variable, the first two elements are the bottom corner of the string, and the second two elements are the width and height of the bounding box. NOTE: This function does not take account of the text rotation.

Implements vtkContextDevice2D.

virtual void vtkOpenGLContextDevice2D::DrawImage ( float *  p,
int  n,
vtkImageData image 
) [virtual]

Draw the supplied image at the given x, y (p[0], p[1]) location(s) (bottom corner).

Reimplemented from vtkContextDevice2D.

virtual void vtkOpenGLContextDevice2D::SetColor4 ( unsigned char *  color  )  [virtual]

Set the color for the device using unsigned char of length 4, RGBA.

Implements vtkContextDevice2D.

virtual void vtkOpenGLContextDevice2D::SetColor ( unsigned char *  color  )  [virtual]

Set the color for the device using unsigned char of length 3, RGB.

Implements vtkContextDevice2D.

virtual void vtkOpenGLContextDevice2D::SetPointSize ( float  size  )  [virtual]

Set the point size for glyphs/sprites.

Implements vtkContextDevice2D.

virtual void vtkOpenGLContextDevice2D::SetLineWidth ( float  width  )  [virtual]

Set the line width for glyphs/sprites.

Implements vtkContextDevice2D.

virtual void vtkOpenGLContextDevice2D::SetLineType ( int  type  )  [virtual]

Set the line type type (using anonymous enum in vtkPen).

Implements vtkContextDevice2D.

virtual void vtkOpenGLContextDevice2D::MultiplyMatrix ( vtkMatrix3x3 m  )  [virtual]

Multiply the current model view matrix by the supplied one.

Implements vtkContextDevice2D.

virtual void vtkOpenGLContextDevice2D::SetMatrix ( vtkMatrix3x3 m  )  [virtual]

Set the model view matrix for the display

Implements vtkContextDevice2D.

virtual void vtkOpenGLContextDevice2D::PushMatrix (  )  [virtual]

Push the current matrix onto the stack.

Implements vtkContextDevice2D.

virtual void vtkOpenGLContextDevice2D::PopMatrix (  )  [virtual]

Pop the current matrix off of the stack.

Implements vtkContextDevice2D.

virtual void vtkOpenGLContextDevice2D::SetClipping ( int *  x  )  [virtual]

Supply an int array of length 4 with x1, y1, x2, y2 specifying clipping for the display.

Implements vtkContextDevice2D.

virtual void vtkOpenGLContextDevice2D::DisableClipping (  )  [virtual]

Disable clipping of the display.

Implements vtkContextDevice2D.

virtual void vtkOpenGLContextDevice2D::Begin ( vtkViewport viewport  )  [virtual]

Begin drawing, pass in the viewport to set up the view.

Reimplemented from vtkContextDevice2D.

virtual void vtkOpenGLContextDevice2D::End (  )  [virtual]

End drawing, clean up the view.

Reimplemented from vtkContextDevice2D.

virtual void vtkOpenGLContextDevice2D::BufferIdModeBegin ( vtkAbstractContextBufferId bufferId  )  [virtual]

Start BufferId creation Mode. The default implementation is empty.

Precondition:
not_yet: !GetBufferIdMode()

bufferId_exists: bufferId!=0

Postcondition:
started: GetBufferIdMode()

Reimplemented from vtkContextDevice2D.

virtual void vtkOpenGLContextDevice2D::BufferIdModeEnd (  )  [virtual]

Finalize BufferId creation Mode. It makes sure that the content of the bufferId passed in argument of BufferIdModeBegin() is correctly set. The default implementation is empty.

Precondition:
started: GetBufferIdMode()
Postcondition:
done: !GetBufferIdMode()

Reimplemented from vtkContextDevice2D.

bool vtkOpenGLContextDevice2D::SetStringRendererToFreeType (  ) 

Force the use of the freetype based render strategy. If Qt is available then freetype will be used preferentially, otherwise this has no effect. Returns true on success.

bool vtkOpenGLContextDevice2D::SetStringRendererToQt (  ) 

Force the use of the Qt based string render strategy. If Qt is not available then freetype will be used and this will return false.

bool vtkOpenGLContextDevice2D::HasGLSL (  ) 

Check whether the current context device has support for GLSL.

virtual vtkOpenGLRenderWindow* vtkOpenGLContextDevice2D::GetRenderWindow (  )  [virtual]

Get the active RenderWindow of the device. Will return null if not active.

virtual void vtkOpenGLContextDevice2D::ReleaseGraphicsResources ( vtkWindow window  )  [virtual]

Release any graphics resources that are being consumed by this device. The parameter window could be used to determine which graphic resources to release.

int vtkOpenGLContextDevice2D::GetNumberOfArcIterations ( float  rX,
float  rY,
float  startAngle,
float  stopAngle 
) [protected]

Factorized code called by DrawEllipseWedge() and DrawEllipticArc() to figure out the number of iterations required to make an arc smooth.

Precondition:
positive_rX: rX>=0.0f

positive_rY: rY>=0.0f

not_both_null: rX>0.0 || rY>0.0

bool vtkOpenGLContextDevice2D::LoadExtensions ( vtkOpenGLExtensionManager m  )  [protected]

Load the OpenGL extensions we need.


Member Data Documentation

Store the width and height of the display devicen (in pixels).

Reimplemented from vtkContextDevice2D.

Definition at line 200 of file vtkOpenGLContextDevice2D.h.

We need to store a pointer to the renderer for the text rendering

Definition at line 203 of file vtkOpenGLContextDevice2D.h.

We also need a label render strategy

Definition at line 206 of file vtkOpenGLContextDevice2D.h.

Store whether any text has been drawn to control Start frame end frame

Definition at line 210 of file vtkOpenGLContextDevice2D.h.

Is the device currently rendering? Prevent multiple End() calls.

Definition at line 213 of file vtkOpenGLContextDevice2D.h.

Private* vtkOpenGLContextDevice2D::Storage [protected]

Definition at line 217 of file vtkOpenGLContextDevice2D.h.

The OpenGL render window being used by the device

Definition at line 225 of file vtkOpenGLContextDevice2D.h.


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

Generated on Mon Sep 27 18:36:54 2010 for VTK by  doxygen 1.5.6