vtkContextDevice2D Class Reference

#include <vtkContextDevice2D.h>

Inheritance diagram for vtkContextDevice2D:

Inheritance graph
[legend]
Collaboration diagram for vtkContextDevice2D:

Collaboration graph
[legend]

List of all members.


Detailed Description

Abstract class for drawing 2D primitives.

This defines the interface for a vtkContextDevice2D. In this sense a ContextDevice is a class used to paint 2D primitives onto a device, such as an OpenGL context or a QGraphicsView.

Definition at line 43 of file vtkContextDevice2D.h.


Public Types

enum  TextureProperty { Nearest = 0x01, Linear = 0x02, Stretch = 0x04, Repeat = 0x08 }
typedef vtkObject Superclass

Public Member Functions

virtual const char * GetClassName ()
virtual int IsA (const char *type)
virtual void PrintSelf (ostream &os, vtkIndent indent)
virtual void DrawQuad (float *, int)
virtual void DrawQuadStrip (float *, int)
virtual void DrawPolygon (float *, int)
virtual void DrawString (float *point, const vtkStdString &string)=0
virtual void DrawString (float *point, const vtkUnicodeString &string)=0
virtual void DrawImage (float p[2], float scale, vtkImageData *image)=0
virtual void DrawImage (const vtkRectf &pos, vtkImageData *image)=0
void ApplyPen (vtkPen *pen)
void ApplyBrush (vtkBrush *brush)
void ApplyTextProp (vtkTextProperty *prop)
virtual void SetColor4 (unsigned char color[4])=0
virtual void SetTexture (vtkImageData *image, int properties)=0
virtual void SetPointSize (float size)=0
virtual void SetLineWidth (float width)=0
virtual void SetLineType (int type)=0
virtual int GetWidth ()
virtual int GetHeight ()
virtual void SetMatrix (vtkMatrix3x3 *m)=0
virtual void GetMatrix (vtkMatrix3x3 *m)=0
virtual void MultiplyMatrix (vtkMatrix3x3 *m)=0
virtual void PushMatrix ()=0
virtual void PopMatrix ()=0
virtual void SetClipping (int *x)=0
virtual void DisableClipping ()=0
virtual void Begin (vtkViewport *)
virtual void End ()
virtual bool GetBufferIdMode () const
virtual void DrawPoly (float *points, int n, unsigned char *colors=0, int nc_comps=0)=0
virtual void DrawPoints (float *points, int n, unsigned char *colors=0, int nc_comps=0)=0
virtual void DrawPointSprites (vtkImageData *sprite, float *points, int n, unsigned char *colors=0, int nc_comps=0)=0
virtual void DrawEllipseWedge (float x, float y, float outRx, float outRy, float inRx, float inRy, float startAngle, float stopAngle)=0
virtual void DrawEllipticArc (float x, float y, float rX, float rY, float startAngle, float stopAngle)=0
virtual void ComputeStringBounds (const vtkStdString &string, float bounds[4])=0
virtual void ComputeStringBounds (const vtkUnicodeString &string, float bounds[4])=0
virtual vtkPenGetPen ()
virtual vtkBrushGetBrush ()
virtual vtkTextPropertyGetTextProp ()
virtual void BufferIdModeBegin (vtkAbstractContextBufferId *bufferId)
virtual void BufferIdModeEnd ()

Static Public Member Functions

static int IsTypeOf (const char *type)
static vtkContextDevice2DSafeDownCast (vtkObject *o)

Protected Member Functions

 vtkContextDevice2D ()
virtual ~vtkContextDevice2D ()

Protected Attributes

int Geometry [2]
vtkAbstractContextBufferIdBufferId
vtkPenPen
vtkBrushBrush
vtkTextPropertyTextProp

Member Typedef Documentation

Reimplemented from vtkObject.

Reimplemented in vtkOpenGL2ContextDevice2D, and vtkOpenGLContextDevice2D.

Definition at line 46 of file vtkContextDevice2D.h.


Member Enumeration Documentation

Enumerator:
Nearest 
Linear 
Stretch 
Repeat 

Definition at line 177 of file vtkContextDevice2D.h.


Constructor & Destructor Documentation

vtkContextDevice2D::vtkContextDevice2D (  )  [protected]

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


Member Function Documentation

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

Reimplemented from vtkObject.

Reimplemented in vtkOpenGL2ContextDevice2D, and vtkOpenGLContextDevice2D.

static int vtkContextDevice2D::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 vtkObject.

Reimplemented in vtkOpenGL2ContextDevice2D, and vtkOpenGLContextDevice2D.

virtual int vtkContextDevice2D::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 vtkObject.

Reimplemented in vtkOpenGL2ContextDevice2D, and vtkOpenGLContextDevice2D.

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

Reimplemented from vtkObject.

Reimplemented in vtkOpenGL2ContextDevice2D, and vtkOpenGLContextDevice2D.

virtual void vtkContextDevice2D::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 vtkObject.

Reimplemented in vtkOpenGL2ContextDevice2D, and vtkOpenGLContextDevice2D.

virtual void vtkContextDevice2D::DrawPoly ( float *  points,
int  n,
unsigned char *  colors = 0,
int  nc_comps = 0 
) [pure virtual]

Draw a poly line using the points - fastest code path due to memory layout of the coordinates. The line will be colored by the colors array, which must be have nc_comps components (defining a single color).

Implemented in vtkOpenGLContextDevice2D.

virtual void vtkContextDevice2D::DrawPoints ( float *  points,
int  n,
unsigned char *  colors = 0,
int  nc_comps = 0 
) [pure virtual]

Draw a series of points - fastest code path due to memory layout of the coordinates. The colors and nc_comps are optional - color array.

Implemented in vtkOpenGLContextDevice2D.

virtual void vtkContextDevice2D::DrawPointSprites ( vtkImageData sprite,
float *  points,
int  n,
unsigned char *  colors = 0,
int  nc_comps = 0 
) [pure 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.

Parameters:
colors is an optional array of colors.
nc_comps is the number of components for the color.

Implemented in vtkOpenGL2ContextDevice2D, and vtkOpenGLContextDevice2D.

virtual void vtkContextDevice2D::DrawQuad ( float *  ,
int   
) [inline, virtual]

Draw a quad using the specified number of points.

Reimplemented in vtkOpenGLContextDevice2D.

Definition at line 76 of file vtkContextDevice2D.h.

virtual void vtkContextDevice2D::DrawQuadStrip ( float *  ,
int   
) [inline, virtual]

Draw a quad using the specified number of points.

Reimplemented in vtkOpenGLContextDevice2D.

Definition at line 79 of file vtkContextDevice2D.h.

virtual void vtkContextDevice2D::DrawPolygon ( float *  ,
int   
) [inline, virtual]

Draw a polygon using the specified number of points.

Reimplemented in vtkOpenGLContextDevice2D.

Definition at line 82 of file vtkContextDevice2D.h.

virtual void vtkContextDevice2D::DrawEllipseWedge ( float  x,
float  y,
float  outRx,
float  outRy,
float  inRx,
float  inRy,
float  startAngle,
float  stopAngle 
) [pure 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

Implemented in vtkOpenGLContextDevice2D.

virtual void vtkContextDevice2D::DrawEllipticArc ( float  x,
float  y,
float  rX,
float  rY,
float  startAngle,
float  stopAngle 
) [pure 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

Implemented in vtkOpenGLContextDevice2D.

virtual void vtkContextDevice2D::DrawString ( float *  point,
const vtkStdString string 
) [pure virtual]

Draw some text to the screen.

Implemented in vtkOpenGLContextDevice2D.

virtual void vtkContextDevice2D::ComputeStringBounds ( const vtkStdString string,
float  bounds[4] 
) [pure 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.

Implemented in vtkOpenGLContextDevice2D.

virtual void vtkContextDevice2D::DrawString ( float *  point,
const vtkUnicodeString string 
) [pure virtual]

Draw some text to the screen.

Implemented in vtkOpenGLContextDevice2D.

virtual void vtkContextDevice2D::ComputeStringBounds ( const vtkUnicodeString string,
float  bounds[4] 
) [pure 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.

Implemented in vtkOpenGLContextDevice2D.

virtual void vtkContextDevice2D::DrawImage ( float  p[2],
float  scale,
vtkImageData image 
) [pure virtual]

Draw the supplied image at the given x, y (p[0], p[1]) (bottom corner), scaled by scale (1.0 would match the image).

Implemented in vtkOpenGL2ContextDevice2D, and vtkOpenGLContextDevice2D.

virtual void vtkContextDevice2D::DrawImage ( const vtkRectf pos,
vtkImageData image 
) [pure virtual]

Draw the supplied image at the given position. The origin, width, and height are specified by the supplied vtkRectf variable pos. The image will be drawn scaled to that size.

Implemented in vtkOpenGL2ContextDevice2D, and vtkOpenGLContextDevice2D.

void vtkContextDevice2D::ApplyPen ( vtkPen pen  ) 

Apply the supplied pen which controls the outlines of shapes, as well as lines, points and related primitives. This makes a deep copy of the vtkPen object in the vtkContext2D, it does not hold a pointer to the supplied object.

virtual vtkPen* vtkContextDevice2D::GetPen (  )  [virtual]

Get the pen which controls the outlines of shapes, as well as lines, points and related primitives. This object can be modified and the changes will be reflected in subsequent drawing operations.

void vtkContextDevice2D::ApplyBrush ( vtkBrush brush  ) 

Apply the supplied brush which controls the outlines of shapes, as well as lines, points and related primitives. This makes a deep copy of the vtkBrush object in the vtkContext2D, it does not hold a pointer to the supplied object.

virtual vtkBrush* vtkContextDevice2D::GetBrush (  )  [virtual]

Get the pen which controls the outlines of shapes as well as lines, points and related primitives.

void vtkContextDevice2D::ApplyTextProp ( vtkTextProperty prop  ) 

Apply the supplied text property which controls how text is rendered. This makes a deep copy of the vtkTextProperty object in the vtkContext2D, it does not hold a pointer to the supplied object.

virtual vtkTextProperty* vtkContextDevice2D::GetTextProp (  )  [virtual]

Get the text properties object for the vtkContext2D.

virtual void vtkContextDevice2D::SetColor4 ( unsigned char  color[4]  )  [pure virtual]

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

Implemented in vtkOpenGLContextDevice2D.

virtual void vtkContextDevice2D::SetTexture ( vtkImageData image,
int  properties 
) [pure virtual]

Set the texture for the device, it is used to fill the polygons

Implemented in vtkOpenGLContextDevice2D.

virtual void vtkContextDevice2D::SetPointSize ( float  size  )  [pure virtual]

Set the point size for glyphs/sprites.

Implemented in vtkOpenGLContextDevice2D.

virtual void vtkContextDevice2D::SetLineWidth ( float  width  )  [pure virtual]

Set the line width.

Implemented in vtkOpenGLContextDevice2D.

virtual void vtkContextDevice2D::SetLineType ( int  type  )  [pure virtual]

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

Implemented in vtkOpenGLContextDevice2D.

virtual int vtkContextDevice2D::GetWidth (  )  [inline, virtual]

Get the width of the device in pixels.

Definition at line 196 of file vtkContextDevice2D.h.

virtual int vtkContextDevice2D::GetHeight (  )  [inline, virtual]

Get the width of the device in pixels.

Definition at line 199 of file vtkContextDevice2D.h.

virtual void vtkContextDevice2D::SetMatrix ( vtkMatrix3x3 m  )  [pure virtual]

Set the model view matrix for the display

Implemented in vtkOpenGLContextDevice2D.

virtual void vtkContextDevice2D::GetMatrix ( vtkMatrix3x3 m  )  [pure virtual]

Set the model view matrix for the display

Implemented in vtkOpenGLContextDevice2D.

virtual void vtkContextDevice2D::MultiplyMatrix ( vtkMatrix3x3 m  )  [pure virtual]

Multiply the current model view matrix by the supplied one

Implemented in vtkOpenGLContextDevice2D.

virtual void vtkContextDevice2D::PushMatrix (  )  [pure virtual]

Push the current matrix onto the stack.

Implemented in vtkOpenGLContextDevice2D.

virtual void vtkContextDevice2D::PopMatrix (  )  [pure virtual]

Pop the current matrix off of the stack.

Implemented in vtkOpenGLContextDevice2D.

virtual void vtkContextDevice2D::SetClipping ( int *  x  )  [pure virtual]

Supply a float array of length 4 with x1, y1, width, height specifying clipping region for the device in pixels.

Implemented in vtkOpenGLContextDevice2D.

virtual void vtkContextDevice2D::DisableClipping (  )  [pure virtual]

Disable clipping of the display.

Implemented in vtkOpenGLContextDevice2D.

virtual void vtkContextDevice2D::Begin ( vtkViewport  )  [inline, virtual]

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

Reimplemented in vtkOpenGLContextDevice2D.

Definition at line 224 of file vtkContextDevice2D.h.

virtual void vtkContextDevice2D::End (  )  [inline, virtual]

End drawing, clean up the view.

Reimplemented in vtkOpenGLContextDevice2D.

Definition at line 227 of file vtkContextDevice2D.h.

virtual bool vtkContextDevice2D::GetBufferIdMode (  )  const [virtual]

Tell if the device context is in BufferId creation mode. Initial value is false.

virtual void vtkContextDevice2D::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 in vtkOpenGLContextDevice2D.

virtual void vtkContextDevice2D::BufferIdModeEnd (  )  [virtual]

Start BufferId creation Mode. The default implementation is empty.

Precondition:
not_yet: !GetBufferIdMode()

bufferId_exists: bufferId!=0

Postcondition:
started: GetBufferIdMode()

Reimplemented in vtkOpenGLContextDevice2D.


Member Data Documentation

int vtkContextDevice2D::Geometry[2] [protected]

Store the width and height of the device in pixels.

Reimplemented in vtkOpenGLContextDevice2D.

Definition at line 255 of file vtkContextDevice2D.h.

Definition at line 257 of file vtkContextDevice2D.h.

Definition at line 259 of file vtkContextDevice2D.h.

Definition at line 260 of file vtkContextDevice2D.h.

Definition at line 261 of file vtkContextDevice2D.h.


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

Generated on Wed Aug 24 11:32:09 2011 for VTK by  doxygen 1.5.6