VTK
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtkOpenGLContextDevice2D Class Reference

Class for drawing 2D primitives using OpenGL 1.1+. More...

#include <vtkOpenGLContextDevice2D.h>

Inheritance diagram for vtkOpenGLContextDevice2D:
[legend]
Collaboration diagram for vtkOpenGLContextDevice2D:
[legend]

Classes

class  Private
 

Public Types

typedef vtkContextDevice2D Superclass
 
typedef vtkContextDevice2D Superclass
 
- Public Types inherited from vtkContextDevice2D
enum  TextureProperty { Nearest = 0x01, Linear = 0x02, Stretch = 0x04, Repeat = 0x08 }
 
typedef vtkObject Superclass
 

Public Member Functions

virtual int IsA (const char *type)
 Return 1 if this class is the same type of (or a subclass of) the named class. More...
 
vtkOpenGLContextDevice2DNewInstance () const
 
virtual void PrintSelf (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses. More...
 
virtual void DrawPoly (float *f, int n, unsigned char *colors=0, int nc_comps=0)
 Draw a poly line using the points - fastest code path due to memory layout of the coordinates. More...
 
virtual void DrawLines (float *f, int n, unsigned char *colors=0, int nc_comps=0)
 Draw lines using the points - memory layout is as follows: l1p1,l1p2,l2p1,l2p2... More...
 
virtual void DrawPoints (float *points, int n, unsigned char *colors=0, int nc_comps=0)
 Draw a series of points - fastest code path due to memory layout of the coordinates. More...
 
virtual void DrawPointSprites (vtkImageData *sprite, float *points, int n, unsigned char *colors=0, int nc_comps=0)
 Draw a series of point sprites, images centred at the points supplied. More...
 
virtual void DrawMarkers (int shape, bool highlight, float *points, int n, unsigned char *colors=0, int nc_comps=0)
 Draw a series of markers centered at the points supplied. More...
 
virtual void DrawQuad (float *points, int n)
 Draws a rectangle. More...
 
virtual void DrawQuadStrip (float *points, int n)
 Draws a rectangle. More...
 
virtual void DrawPolygon (float *, int)
 Draw a polygon using the specified number of points. More...
 
virtual void DrawEllipseWedge (float x, float y, float outRx, float outRy, float inRx, float inRy, float startAngle, float stopAngle)
 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). More...
 
virtual void DrawEllipticArc (float x, float y, float rX, float rY, float startAngle, float stopAngle)
 Draw an elliptic arc with center at x,y with radii rX and rY between angles startAngle and stopAngle (expressed in degrees). More...
 
virtual void DrawString (float *point, const vtkStdString &string)
 Draw some text to the screen! More...
 
virtual void ComputeStringBounds (const vtkStdString &string, float bounds[4])
 Compute the bounds of the supplied string. More...
 
virtual void DrawString (float *point, const vtkUnicodeString &string)
 Draw some text to the screen. More...
 
virtual void ComputeStringBounds (const vtkUnicodeString &string, float bounds[4])
 Compute the bounds of the supplied string. More...
 
virtual void ComputeJustifiedStringBounds (const char *string, float bounds[4])
 Compute the bounds of the supplied string while taking into account the justification of the currently applied text property. More...
 
virtual void DrawMathTextString (float point[2], const vtkStdString &string)
 Draw text using MathText markup for mathematical equations. More...
 
virtual void DrawImage (float p[2], float scale, vtkImageData *image)
 Draw the supplied image at the given x, y (p[0], p[1]) (bottom corner), scaled by scale (1.0 would match the image). More...
 
void DrawImage (const vtkRectf &pos, vtkImageData *image)
 Draw the supplied image at the given position. More...
 
virtual void SetColor4 (unsigned char color[4])
 Set the color for the device using unsigned char of length 4, RGBA. More...
 
virtual void SetColor (unsigned char color[3])
 Set the color for the device using unsigned char of length 3, RGB. More...
 
virtual void SetTexture (vtkImageData *image, int properties=0)
 Set the texture for the device, it is used to fill the polygons. More...
 
virtual void SetPointSize (float size)
 Set the point size for glyphs/sprites. More...
 
virtual void SetLineWidth (float width)
 Set the line width for glyphs/sprites. More...
 
virtual void SetLineType (int type)
 Set the line type type (using anonymous enum in vtkPen). More...
 
virtual void MultiplyMatrix (vtkMatrix3x3 *m)
 Multiply the current model view matrix by the supplied one. More...
 
virtual void SetMatrix (vtkMatrix3x3 *m)
 Set the model view matrix for the display. More...
 
virtual void GetMatrix (vtkMatrix3x3 *m)
 Set the model view matrix for the display. More...
 
virtual void PushMatrix ()
 Push the current matrix onto the stack. More...
 
virtual void PopMatrix ()
 Pop the current matrix off of the stack. More...
 
virtual void SetClipping (int *x)
 Supply an int array of length 4 with x1, y1, width, height specifying clipping for the display. More...
 
virtual void EnableClipping (bool enable)
 Disable clipping of the display. More...
 
virtual void Begin (vtkViewport *viewport)
 Begin drawing, pass in the viewport to set up the view. More...
 
virtual void End ()
 End drawing, clean up the view. More...
 
virtual void BufferIdModeBegin (vtkAbstractContextBufferId *bufferId)
 Start BufferId creation Mode. More...
 
virtual void BufferIdModeEnd ()
 Finalize BufferId creation Mode. More...
 
bool SetStringRendererToFreeType ()
 Force the use of the freetype based render strategy. More...
 
bool SetStringRendererToQt ()
 Force the use of the Qt based string render strategy. More...
 
bool HasGLSL ()
 Check whether the current context device has support for GLSL. More...
 
virtual void ReleaseGraphicsResources (vtkWindow *window)
 Release any graphics resources that are being consumed by this device. More...
 
virtual int IsA (const char *type)
 Return 1 if this class is the same type of (or a subclass of) the named class. More...
 
vtkOpenGLContextDevice2DNewInstance () const
 
virtual void PrintSelf (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses. More...
 
virtual void DrawPoly (float *f, int n, unsigned char *colors=0, int nc_comps=0)
 Draw a poly line using the points - fastest code path due to memory layout of the coordinates. More...
 
virtual void DrawLines (float *f, int n, unsigned char *colors=0, int nc_comps=0)
 Draw lines using the points - memory layout is as follows: l1p1,l1p2,l2p1,l2p2... More...
 
virtual void DrawPoints (float *points, int n, unsigned char *colors=0, int nc_comps=0)
 Draw a series of points - fastest code path due to memory layout of the coordinates. More...
 
virtual void DrawPointSprites (vtkImageData *sprite, float *points, int n, unsigned char *colors=0, int nc_comps=0)
 Draw a series of point sprites, images centred at the points supplied. More...
 
virtual void DrawMarkers (int shape, bool highlight, float *points, int n, unsigned char *colors=0, int nc_comps=0)
 Draw a series of markers centered at the points supplied. More...
 
virtual void DrawQuad (float *points, int n)
 Draws a rectangle. More...
 
virtual void DrawQuadStrip (float *points, int n)
 Draws a rectangle. More...
 
virtual void DrawPolygon (float *, int)
 Draw a polygon using the specified number of points. More...
 
virtual void DrawEllipseWedge (float x, float y, float outRx, float outRy, float inRx, float inRy, float startAngle, float stopAngle)
 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). More...
 
virtual void DrawEllipticArc (float x, float y, float rX, float rY, float startAngle, float stopAngle)
 Draw an elliptic arc with center at x,y with radii rX and rY between angles startAngle and stopAngle (expressed in degrees). More...
 
virtual void DrawString (float *point, const vtkStdString &string)
 Draw some text to the screen! More...
 
virtual void ComputeStringBounds (const vtkStdString &string, float bounds[4])
 Compute the bounds of the supplied string. More...
 
virtual void DrawString (float *point, const vtkUnicodeString &string)
 Draw some text to the screen. More...
 
virtual void ComputeStringBounds (const vtkUnicodeString &string, float bounds[4])
 Compute the bounds of the supplied string. More...
 
virtual void ComputeJustifiedStringBounds (const char *string, float bounds[4])
 Compute the bounds of the supplied string while taking into account the justification of the currently applied text property. More...
 
virtual void DrawMathTextString (float point[2], const vtkStdString &string)
 Draw text using MathText markup for mathematical equations. More...
 
virtual void DrawImage (float p[2], float scale, vtkImageData *image)
 Draw the supplied image at the given x, y (p[0], p[1]) (bottom corner), scaled by scale (1.0 would match the image). More...
 
void DrawImage (const vtkRectf &pos, vtkImageData *image)
 Draw the supplied image at the given position. More...
 
virtual void SetColor4 (unsigned char color[4])
 Set the color for the device using unsigned char of length 4, RGBA. More...
 
virtual void SetColor (unsigned char color[3])
 Set the color for the device using unsigned char of length 3, RGB. More...
 
virtual void SetTexture (vtkImageData *image, int properties=0)
 Set the texture for the device, it is used to fill the polygons. More...
 
virtual void SetPointSize (float size)
 Set the point size for glyphs/sprites. More...
 
virtual void SetLineWidth (float width)
 Set the line width for glyphs/sprites. More...
 
virtual void SetLineType (int type)
 Set the line type type (using anonymous enum in vtkPen). More...
 
virtual void MultiplyMatrix (vtkMatrix3x3 *m)
 Multiply the current model view matrix by the supplied one. More...
 
virtual void SetMatrix (vtkMatrix3x3 *m)
 Set the model view matrix for the display. More...
 
virtual void GetMatrix (vtkMatrix3x3 *m)
 Set the model view matrix for the display. More...
 
virtual void PushMatrix ()
 Push the current matrix onto the stack. More...
 
virtual void PopMatrix ()
 Pop the current matrix off of the stack. More...
 
virtual void SetClipping (int *x)
 Supply an int array of length 4 with x1, y1, x2, y2 specifying clipping for the display. More...
 
virtual void EnableClipping (bool enable)
 Disable clipping of the display. More...
 
virtual void Begin (vtkViewport *viewport)
 Begin drawing, pass in the viewport to set up the view. More...
 
virtual void End ()
 End drawing, clean up the view. More...
 
virtual void BufferIdModeBegin (vtkAbstractContextBufferId *bufferId)
 Start BufferId creation Mode. More...
 
virtual void BufferIdModeEnd ()
 Finalize BufferId creation Mode. More...
 
bool SetStringRendererToFreeType ()
 Force the use of the freetype based render strategy. More...
 
bool SetStringRendererToQt ()
 Force the use of the Qt based string render strategy. More...
 
bool HasGLSL ()
 Check whether the current context device has support for GLSL. More...
 
virtual void ReleaseGraphicsResources (vtkWindow *window)
 Release any graphics resources that are being consumed by this device. More...
 
virtual void SetMaximumMarkerCacheSize (int)
 Adjust the size of the MarkerCache. More...
 
virtual int GetMaximumMarkerCacheSize ()
 Adjust the size of the MarkerCache. More...
 
virtual vtkOpenGLRenderWindowGetRenderWindow ()
 Get the active RenderWindow of the device. More...
 
virtual void SetMaximumMarkerCacheSize (int)
 Adjust the size of the MarkerCache. More...
 
virtual int GetMaximumMarkerCacheSize ()
 Adjust the size of the MarkerCache. More...
 
virtual vtkOpenGLRenderWindowGetRenderWindow ()
 Get the active RenderWindow of the device. More...
 
vtkMatrix4x4GetProjectionMatrix ()
 Get the projection matrix this is needed. More...
 
vtkMatrix4x4GetModelMatrix ()
 Get the projection matrix this is needed. More...
 
- Public Member Functions inherited from vtkContextDevice2D
vtkContextDevice2DNewInstance () const
 
virtual void DrawMathTextString (float *point, const vtkStdString &string)=0
 Draw text using MathText markup for mathematical equations. More...
 
virtual bool MathTextIsSupported ()
 Return true if MathText rendering available on this device. More...
 
virtual void ApplyPen (vtkPen *pen)
 Apply the supplied pen which controls the outlines of shapes, as well as lines, points and related primitives. More...
 
virtual void ApplyBrush (vtkBrush *brush)
 Apply the supplied brush which controls the outlines of shapes, as well as lines, points and related primitives. More...
 
virtual void ApplyTextProp (vtkTextProperty *prop)
 Apply the supplied text property which controls how text is rendered. More...
 
virtual int GetWidth ()
 Get the width of the device in pixels. More...
 
virtual int GetHeight ()
 Get the width of the device in pixels. More...
 
virtual void DisableClipping ()
 Disable clipping of the display. More...
 
virtual bool GetBufferIdMode () const
 Tell if the device context is in BufferId creation mode. More...
 
virtual void SetViewportSize (const vtkVector2i &size)
 
virtual vtkVector2i GetViewportSize ()
 
virtual void SetViewportRect (const vtkRecti &rect)
 
virtual vtkRecti GetViewportRect ()
 
virtual vtkPenGetPen ()
 Get the pen which controls the outlines of shapes, as well as lines, points and related primitives. More...
 
virtual vtkBrushGetBrush ()
 Get the pen which controls the outlines of shapes as well as lines, points and related primitives. More...
 
virtual vtkTextPropertyGetTextProp ()
 Get the text properties object for the vtkContext2D. More...
 
- Public Member Functions inherited from vtkObject
 vtkBaseTypeMacro (vtkObject, vtkObjectBase)
 
virtual void DebugOn ()
 Turn debugging output on. More...
 
virtual void DebugOff ()
 Turn debugging output off. More...
 
bool GetDebug ()
 Get the value of the debug flag. More...
 
void SetDebug (bool debugFlag)
 Set the value of the debug flag. More...
 
virtual void Modified ()
 Update the modification time for this object. More...
 
virtual vtkMTimeType GetMTime ()
 Return this object's modified time. More...
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
int HasObserver (unsigned long event)
 
int HasObserver (const char *event)
 
int InvokeEvent (unsigned long event)
 
int InvokeEvent (const char *event)
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
vtkCommandGetCommand (unsigned long tag)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
void RemoveObserver (vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
void RemoveObservers (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
void RemoveObservers (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
int HasObserver (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
int HasObserver (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 Overloads to AddObserver that allow developers to add class member functions as callbacks for events. More...
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 Overloads to AddObserver that allow developers to add class member functions as callbacks for events. More...
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 Allow user to set the AbortFlagOn() with the return value of the callback method. More...
 
int InvokeEvent (unsigned long event, void *callData)
 This method invokes an event and return whether the event was aborted or not. More...
 
int InvokeEvent (const char *event, void *callData)
 This method invokes an event and return whether the event was aborted or not. More...
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 Return the class name as a string. More...
 
virtual void Delete ()
 Delete a VTK object. More...
 
virtual void FastDelete ()
 Delete a reference to this object. More...
 
void InitializeObjectBase ()
 
void Print (ostream &os)
 Print an object to an ostream. More...
 
virtual void Register (vtkObjectBase *o)
 Increase the reference count (mark as used by another object). More...
 
virtual void UnRegister (vtkObjectBase *o)
 Decrease the reference count (release by another object). More...
 
int GetReferenceCount ()
 Return the current reference count of this object. More...
 
void SetReferenceCount (int)
 Sets the reference count. More...
 
void PrintRevisions (ostream &)
 Legacy. More...
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses. More...
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses. More...
 

Static Public Member Functions

static int IsTypeOf (const char *type)
 
static vtkOpenGLContextDevice2DSafeDownCast (vtkObjectBase *o)
 
static vtkOpenGLContextDevice2DNew ()
 Creates a 2D Painter object. More...
 
static int IsTypeOf (const char *type)
 
static vtkOpenGLContextDevice2DSafeDownCast (vtkObjectBase *o)
 
static vtkOpenGLContextDevice2DNew ()
 Creates a 2D Painter object. More...
 
- Static Public Member Functions inherited from vtkContextDevice2D
static int IsTypeOf (const char *type)
 
static vtkContextDevice2DSafeDownCast (vtkObjectBase *o)
 
static vtkContextDevice2DNew ()
 
- Static Public Member Functions inherited from vtkObject
static vtkObjectNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More...
 
static void BreakOnError ()
 This method is called when vtkErrorMacro executes. More...
 
static void SetGlobalWarningDisplay (int val)
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static void GlobalWarningDisplayOn ()
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static void GlobalWarningDisplayOff ()
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static int GetGlobalWarningDisplay ()
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
- Static Public Member Functions inherited from vtkObjectBase
static vtkTypeBool IsTypeOf (const char *name)
 Return 1 if this class type is the same type of (or a subclass of) the named class. More...
 
static vtkObjectBaseNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More...
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkOpenGLContextDevice2D ()
 
virtual ~vtkOpenGLContextDevice2D ()
 
int GetNumberOfArcIterations (float rX, float rY, float startAngle, float stopAngle)
 Factorized code called by DrawEllipseWedge() and DrawEllipticArc() to figure out the number of iterations required to make an arc smooth. More...
 
virtual bool LoadExtensions (vtkOpenGLExtensionManager *m)
 Load the OpenGL extensions we need. More...
 
virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkOpenGLContextDevice2D ()
 
virtual ~vtkOpenGLContextDevice2D ()
 
int GetNumberOfArcIterations (float rX, float rY, float startAngle, float stopAngle)
 Factorized code called by DrawEllipseWedge() and DrawEllipticArc() to figure out the number of iterations required to make an arc smooth. More...
 
void ReadyLinesCBOProgram ()
 
void ReadyLinesBOProgram ()
 
void ReadyVCBOProgram ()
 
void ReadyVBOProgram ()
 
void ReadyVTBOProgram ()
 
void ReadySCBOProgram ()
 
void ReadySBOProgram ()
 
void SetMatrices (vtkShaderProgram *prog)
 
void BuildVBO (vtkOpenGLHelper *cbo, float *v, int nv, unsigned char *coolors, int nc, float *tcoords)
 
void CoreDrawTriangles (std::vector< float > &tverts)
 
void DrawMathTextStringGL2PS (float point[2], const vtkStdString &string)
 Implement DrawMathTextString for the GL2PS exporter. More...
 
void AddEllipseToPath (vtkPath *path, float x, float y, float rx, float ry, bool reverse)
 Add an ellipse to a vtkPath. More...
 
void TransformPath (vtkPath *path) const
 Transform the path using the current modelview matrix. More...
 
void TransformPoint (float &x, float &y) const
 Transform the 2D point using the current modelview matrix. More...
 
void TransformSize (float &dx, float &dy) const
 Transform the width and height from pixels to data units. More...
 
void DrawMarkersGL2PS (int shape, bool highlight, float *points, int n, unsigned char *colors, int nc_comps)
 Draw the markers as paths/polydata instead of sprites for detailed GL2PS capture. More...
 
void DrawCrossMarkersGL2PS (bool highlight, float *points, int n, unsigned char *colors, int nc_comps)
 Draw the markers as paths/polydata instead of sprites for detailed GL2PS capture. More...
 
void DrawPlusMarkersGL2PS (bool highlight, float *points, int n, unsigned char *colors, int nc_comps)
 Draw the markers as paths/polydata instead of sprites for detailed GL2PS capture. More...
 
void DrawSquareMarkersGL2PS (bool highlight, float *points, int n, unsigned char *colors, int nc_comps)
 Draw the markers as paths/polydata instead of sprites for detailed GL2PS capture. More...
 
void DrawCircleMarkersGL2PS (bool highlight, float *points, int n, unsigned char *colors, int nc_comps)
 Draw the markers as paths/polydata instead of sprites for detailed GL2PS capture. More...
 
void DrawDiamondMarkersGL2PS (bool highlight, float *points, int n, unsigned char *colors, int nc_comps)
 Draw the markers as paths/polydata instead of sprites for detailed GL2PS capture. More...
 
void DrawImageGL2PS (float p[2], vtkImageData *image)
 Embed an RGBA image in the GL2PS output at the supplied point. More...
 
void DrawImageGL2PS (float p[2], float scale, vtkImageData *image)
 Embed an RGBA image in the GL2PS output at the supplied point. More...
 
void DrawImageGL2PS (const vtkRectf &rect, vtkImageData *image)
 Embed an RGBA image in the GL2PS output at the supplied point. More...
 
void DrawCircleGL2PS (float x, float y, float rX, float rY)
 Inject smooth primitives into the GL2PS stream. More...
 
void DrawWedgeGL2PS (float x, float y, float outRx, float outRy, float inRx, float inRy)
 Inject smooth primitives into the GL2PS stream. More...
 
- Protected Member Functions inherited from vtkContextDevice2D
 vtkContextDevice2D ()
 
 ~vtkContextDevice2D ()
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
 ~vtkObject () override
 
void RegisterInternal (vtkObjectBase *, vtkTypeBool check) override
 
void UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) override
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 These methods allow a command to exclusively grab all events. More...
 
void InternalReleaseFocus ()
 These methods allow a command to exclusively grab all events. More...
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void CollectRevisions (ostream &)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Protected Attributes

int Geometry [2]
 Store the width and height of the display devicen (in pixels). More...
 
vtkRendererRenderer
 We need to store a pointer to the renderer for the text rendering. More...
 
vtkStringToImageTextRenderer
 We also need a label render strategy. More...
 
bool InRender
 Is the device currently rendering? Prevent multiple End() calls. More...
 
vtkOpenGLRenderWindowRenderWindow
 The OpenGL render window being used by the device. More...
 
vtkOpenGLHelperLinesCBO
 
vtkOpenGLHelperLinesBO
 
vtkOpenGLHelperVCBO
 
vtkOpenGLHelperVBO
 
vtkOpenGLHelperVTBO
 
vtkOpenGLHelperSCBO
 
vtkOpenGLHelperSBO
 
unsigned short LinePattern
 
PrivateStorage
 
- Protected Attributes inherited from vtkContextDevice2D
int Geometry [2]
 Store the width and height of the device in pixels. More...
 
vtkVector2i ViewportSize
 Store the size of the total viewport. More...
 
vtkRecti ViewportRect
 Store our origin and size in the total viewport. More...
 
vtkAbstractContextBufferIdBufferId
 
vtkPenPen
 
vtkBrushBrush
 
vtkTextPropertyTextProp
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
vtkAtomicInt32 ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Detailed Description

Class for drawing 2D primitives using OpenGL 1.1+.

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.

See also
vtkOpenGL2ContextDevice2D
Tests:
vtkOpenGLContextDevice2D (Tests)

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.

See also
vtkOpenGL2ContextDevice2D

Definition at line 48 of file vtkOpenGLContextDevice2D.h.

Member Typedef Documentation

Definition at line 51 of file vtkOpenGLContextDevice2D.h.

Definition at line 54 of file vtkOpenGLContextDevice2D.h.

Constructor & Destructor Documentation

vtkOpenGLContextDevice2D::vtkOpenGLContextDevice2D ( )
protected
virtual vtkOpenGLContextDevice2D::~vtkOpenGLContextDevice2D ( )
protectedvirtual
vtkOpenGLContextDevice2D::vtkOpenGLContextDevice2D ( )
protected
virtual vtkOpenGLContextDevice2D::~vtkOpenGLContextDevice2D ( )
protectedvirtual

Member Function Documentation

static int vtkOpenGLContextDevice2D::IsTypeOf ( const char *  type)
static
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.

Reimplemented in vtkOpenGL2ContextDevice2D, and vtkGL2PSContextDevice2D.

static vtkOpenGLContextDevice2D* vtkOpenGLContextDevice2D::SafeDownCast ( vtkObjectBase o)
static
virtual vtkObjectBase* vtkOpenGLContextDevice2D::NewInstanceInternal ( ) const
protectedvirtual

Reimplemented from vtkContextDevice2D.

Reimplemented in vtkOpenGL2ContextDevice2D, and vtkGL2PSContextDevice2D.

vtkOpenGLContextDevice2D* vtkOpenGLContextDevice2D::NewInstance ( ) const
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.

Reimplemented in vtkOpenGL2ContextDevice2D, and vtkGL2PSContextDevice2D.

static vtkOpenGLContextDevice2D* vtkOpenGLContextDevice2D::New ( )
static

Creates a 2D Painter object.

virtual void vtkOpenGLContextDevice2D::DrawPoly ( float f,
int  n,
unsigned char *  colors = 0,
int  nc_comps = 0 
)
virtual

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

The line will be colored by colors array which has nc_comps components.

See also
DrawLines()

Implements vtkContextDevice2D.

Reimplemented in vtkGL2PSContextDevice2D.

virtual void vtkOpenGLContextDevice2D::DrawLines ( float f,
int  n,
unsigned char *  colors = 0,
int  nc_comps = 0 
)
virtual

Draw lines using the points - memory layout is as follows: l1p1,l1p2,l2p1,l2p2...

The lines will be colored by colors array which has nc_comps components.

See also
DrawPoly()

Implements vtkContextDevice2D.

virtual void vtkOpenGLContextDevice2D::DrawPoints ( float points,
int  n,
unsigned char *  colors = 0,
int  nc_comps = 0 
)
virtual

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

Points are colored by colors array which has nc_comps components.

Implements vtkContextDevice2D.

Reimplemented in vtkGL2PSContextDevice2D.

virtual void vtkOpenGLContextDevice2D::DrawPointSprites ( vtkImageData sprite,
float points,
int  n,
unsigned char *  colors = 0,
int  nc_comps = 0 
)
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. Points are colored by colors array which has nc_comps components - this part is optional.

Implements vtkContextDevice2D.

Reimplemented in vtkGL2PSContextDevice2D, and vtkOpenGL2ContextDevice2D.

virtual void vtkOpenGLContextDevice2D::DrawMarkers ( int  shape,
bool  highlight,
float points,
int  n,
unsigned char *  colors = 0,
int  nc_comps = 0 
)
virtual

Draw a series of markers centered at the points supplied.

The shape argument controls the marker shape, and can be one of

  • VTK_MARKER_CROSS
  • VTK_MARKER_PLUS
  • VTK_MARKER_SQUARE
  • VTK_MARKER_CIRCLE
  • VTK_MARKER_DIAMOND
    Parameters
    colorsis an optional array of colors.
    nc_compsis the number of components for the color.

Reimplemented from vtkContextDevice2D.

Reimplemented in vtkGL2PSContextDevice2D.

virtual void vtkOpenGLContextDevice2D::SetMaximumMarkerCacheSize ( int  )
virtual

Adjust the size of the MarkerCache.

This implementation generates point sprites for each mark size/shape and uses DrawPointSprites to render them. The number of cached markers can be accessed with this function.

virtual int vtkOpenGLContextDevice2D::GetMaximumMarkerCacheSize ( )
virtual

Adjust the size of the MarkerCache.

This implementation generates point sprites for each mark size/shape and uses DrawPointSprites to render them. The number of cached markers can be accessed with this function.

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

Draws a rectangle.

Reimplemented from vtkContextDevice2D.

Reimplemented in vtkGL2PSContextDevice2D.

virtual void vtkOpenGLContextDevice2D::DrawQuadStrip ( float points,
int  n 
)
virtual

Draws a rectangle.

Reimplemented from vtkContextDevice2D.

Reimplemented in vtkGL2PSContextDevice2D.

virtual void vtkOpenGLContextDevice2D::DrawPolygon ( float ,
int   
)
virtual

Draw a polygon using the specified number of points.

Reimplemented from vtkContextDevice2D.

Reimplemented in vtkGL2PSContextDevice2D.

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.

Reimplemented in vtkGL2PSContextDevice2D.

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.

Reimplemented in vtkGL2PSContextDevice2D.

virtual void vtkOpenGLContextDevice2D::DrawString ( float point,
const vtkStdString string 
)
virtual

Draw some text to the screen!

Implements vtkContextDevice2D.

Reimplemented in vtkGL2PSContextDevice2D.

virtual void vtkOpenGLContextDevice2D::ComputeStringBounds ( const vtkStdString string,
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. An empty bounding box (0, 0, 0, 0) is returned for an empty string or string with only characters that cannot be rendered. NOTE: This function does not take account of the text rotation.

Implements vtkContextDevice2D.

virtual void vtkOpenGLContextDevice2D::DrawString ( float point,
const vtkUnicodeString string 
)
virtual

Draw some text to the screen.

Implements vtkContextDevice2D.

Reimplemented in vtkGL2PSContextDevice2D.

virtual void vtkOpenGLContextDevice2D::ComputeStringBounds ( const vtkUnicodeString string,
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. An empty bounding box (0, 0, 0, 0) is returned for an empty string or string with only characters that cannot be rendered. NOTE: This function does not take account of the text rotation.

Implements vtkContextDevice2D.

virtual void vtkOpenGLContextDevice2D::ComputeJustifiedStringBounds ( const char *  string,
float  bounds[4] 
)
virtual

Compute the bounds of the supplied string while taking into account the justification of the currently applied text property.

Simple rotations (0, 90, 180, 270 degrees) are also propertly taken into account.

Implements vtkContextDevice2D.

virtual void vtkOpenGLContextDevice2D::DrawMathTextString ( float  point[2],
const vtkStdString string 
)
virtual

Draw text using MathText markup for mathematical equations.

See http://matplotlib.sourceforge.net/users/mathtext.html for more information.

Reimplemented in vtkGL2PSContextDevice2D.

virtual void vtkOpenGLContextDevice2D::DrawImage ( float  p[2],
float  scale,
vtkImageData image 
)
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).

Implements vtkContextDevice2D.

Reimplemented in vtkOpenGL2ContextDevice2D.

void vtkOpenGLContextDevice2D::DrawImage ( const vtkRectf pos,
vtkImageData image 
)
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.

Implements vtkContextDevice2D.

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

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

Implements vtkContextDevice2D.

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

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

virtual void vtkOpenGLContextDevice2D::SetTexture ( vtkImageData image,
int  properties = 0 
)
virtual

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

Implements vtkContextDevice2D.

virtual void vtkOpenGLContextDevice2D::SetPointSize ( float  size)
virtual

Set the point size for glyphs/sprites.

Implements vtkContextDevice2D.

Reimplemented in vtkGL2PSContextDevice2D.

virtual void vtkOpenGLContextDevice2D::SetLineWidth ( float  width)
virtual

Set the line width for glyphs/sprites.

Implements vtkContextDevice2D.

Reimplemented in vtkGL2PSContextDevice2D.

virtual void vtkOpenGLContextDevice2D::SetLineType ( int  type)
virtual

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

Implements vtkContextDevice2D.

Reimplemented in vtkGL2PSContextDevice2D.

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::GetMatrix ( 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, width, height specifying clipping for the display.

Implements vtkContextDevice2D.

virtual void vtkOpenGLContextDevice2D::EnableClipping ( bool  enable)
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.

Reimplemented in vtkOpenGL2ContextDevice2D.

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
virtual bool vtkOpenGLContextDevice2D::LoadExtensions ( vtkOpenGLExtensionManager m)
protectedvirtual

Load the OpenGL extensions we need.

Reimplemented in vtkOpenGL2ContextDevice2D.

static int vtkOpenGLContextDevice2D::IsTypeOf ( const char *  type)
static
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.

Reimplemented in vtkOpenGL2ContextDevice2D, and vtkGL2PSContextDevice2D.

static vtkOpenGLContextDevice2D* vtkOpenGLContextDevice2D::SafeDownCast ( vtkObjectBase o)
static
virtual vtkObjectBase* vtkOpenGLContextDevice2D::NewInstanceInternal ( ) const
protectedvirtual

Reimplemented from vtkContextDevice2D.

Reimplemented in vtkOpenGL2ContextDevice2D, and vtkGL2PSContextDevice2D.

vtkOpenGLContextDevice2D* vtkOpenGLContextDevice2D::NewInstance ( ) const
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.

Reimplemented in vtkOpenGL2ContextDevice2D, and vtkGL2PSContextDevice2D.

static vtkOpenGLContextDevice2D* vtkOpenGLContextDevice2D::New ( )
static

Creates a 2D Painter object.

virtual void vtkOpenGLContextDevice2D::DrawPoly ( float f,
int  n,
unsigned char *  colors = 0,
int  nc_comps = 0 
)
virtual

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

The line will be colored by colors array which has nc_comps components

Implements vtkContextDevice2D.

Reimplemented in vtkGL2PSContextDevice2D.

virtual void vtkOpenGLContextDevice2D::DrawLines ( float f,
int  n,
unsigned char *  colors = 0,
int  nc_comps = 0 
)
virtual

Draw lines using the points - memory layout is as follows: l1p1,l1p2,l2p1,l2p2...

The lines will be colored by colors array which has nc_comps components.

See also
DrawPoly()

Implements vtkContextDevice2D.

virtual void vtkOpenGLContextDevice2D::DrawPoints ( float points,
int  n,
unsigned char *  colors = 0,
int  nc_comps = 0 
)
virtual

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

Points are colored by colors array which has nc_comps components

Implements vtkContextDevice2D.

Reimplemented in vtkGL2PSContextDevice2D.

virtual void vtkOpenGLContextDevice2D::DrawPointSprites ( vtkImageData sprite,
float points,
int  n,
unsigned char *  colors = 0,
int  nc_comps = 0 
)
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. Points are colored by colors array which has nc_comps components - this part is optional.

Implements vtkContextDevice2D.

Reimplemented in vtkGL2PSContextDevice2D, and vtkOpenGL2ContextDevice2D.

virtual void vtkOpenGLContextDevice2D::DrawMarkers ( int  shape,
bool  highlight,
float points,
int  n,
unsigned char *  colors = 0,
int  nc_comps = 0 
)
virtual

Draw a series of markers centered at the points supplied.

The shape argument controls the marker shape, and can be one of

  • VTK_MARKER_CROSS
  • VTK_MARKER_PLUS
  • VTK_MARKER_SQUARE
  • VTK_MARKER_CIRCLE
  • VTK_MARKER_DIAMOND
    Parameters
    colorsis an optional array of colors.
    nc_compsis the number of components for the color.

Reimplemented from vtkContextDevice2D.

Reimplemented in vtkGL2PSContextDevice2D.

virtual void vtkOpenGLContextDevice2D::SetMaximumMarkerCacheSize ( int  )
virtual

Adjust the size of the MarkerCache.

This implementation generates point sprites for each mark size/shape and uses DrawPointSprites to render them. The number of cached markers can be accessed with this function.

virtual int vtkOpenGLContextDevice2D::GetMaximumMarkerCacheSize ( )
virtual

Adjust the size of the MarkerCache.

This implementation generates point sprites for each mark size/shape and uses DrawPointSprites to render them. The number of cached markers can be accessed with this function.

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

Draws a rectangle.

Reimplemented from vtkContextDevice2D.

Reimplemented in vtkGL2PSContextDevice2D.

virtual void vtkOpenGLContextDevice2D::DrawQuadStrip ( float points,
int  n 
)
virtual

Draws a rectangle.

Reimplemented from vtkContextDevice2D.

Reimplemented in vtkGL2PSContextDevice2D.

virtual void vtkOpenGLContextDevice2D::DrawPolygon ( float ,
int   
)
virtual

Draw a polygon using the specified number of points.

Reimplemented from vtkContextDevice2D.

Reimplemented in vtkGL2PSContextDevice2D.

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.

Reimplemented in vtkGL2PSContextDevice2D.

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.

Reimplemented in vtkGL2PSContextDevice2D.

virtual void vtkOpenGLContextDevice2D::DrawString ( float point,
const vtkStdString string 
)
virtual

Draw some text to the screen!

Implements vtkContextDevice2D.

Reimplemented in vtkGL2PSContextDevice2D.

virtual void vtkOpenGLContextDevice2D::ComputeStringBounds ( const vtkStdString string,
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. An empty bounding box (0, 0, 0, 0) is returned for an empty string or string with only characters that cannot be rendered. NOTE: This function does not take account of the text rotation.

Implements vtkContextDevice2D.

virtual void vtkOpenGLContextDevice2D::DrawString ( float point,
const vtkUnicodeString string 
)
virtual

Draw some text to the screen.

Implements vtkContextDevice2D.

Reimplemented in vtkGL2PSContextDevice2D.

virtual void vtkOpenGLContextDevice2D::ComputeStringBounds ( const vtkUnicodeString string,
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. An empty bounding box (0, 0, 0, 0) is returned for an empty string or string with only characters that cannot be rendered. NOTE: This function does not take account of the text rotation.

Implements vtkContextDevice2D.

virtual void vtkOpenGLContextDevice2D::ComputeJustifiedStringBounds ( const char *  string,
float  bounds[4] 
)
virtual

Compute the bounds of the supplied string while taking into account the justification of the currently applied text property.

Simple rotations (0, 90, 180, 270 degrees) are also propertly taken into account.

Implements vtkContextDevice2D.

virtual void vtkOpenGLContextDevice2D::DrawMathTextString ( float  point[2],
const vtkStdString string 
)
virtual

Draw text using MathText markup for mathematical equations.

See http://matplotlib.sourceforge.net/users/mathtext.html for more information.

Reimplemented in vtkGL2PSContextDevice2D.

virtual void vtkOpenGLContextDevice2D::DrawImage ( float  p[2],
float  scale,
vtkImageData image 
)
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).

Implements vtkContextDevice2D.

Reimplemented in vtkOpenGL2ContextDevice2D.

void vtkOpenGLContextDevice2D::DrawImage ( const vtkRectf pos,
vtkImageData image 
)
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.

Implements vtkContextDevice2D.

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

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

Implements vtkContextDevice2D.

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

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

virtual void vtkOpenGLContextDevice2D::SetTexture ( vtkImageData image,
int  properties = 0 
)
virtual

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

Implements vtkContextDevice2D.

virtual void vtkOpenGLContextDevice2D::SetPointSize ( float  size)
virtual

Set the point size for glyphs/sprites.

Implements vtkContextDevice2D.

Reimplemented in vtkGL2PSContextDevice2D.

virtual void vtkOpenGLContextDevice2D::SetLineWidth ( float  width)
virtual

Set the line width for glyphs/sprites.

Implements vtkContextDevice2D.

Reimplemented in vtkGL2PSContextDevice2D.

virtual void vtkOpenGLContextDevice2D::SetLineType ( int  type)
virtual

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

Implements vtkContextDevice2D.

Reimplemented in vtkGL2PSContextDevice2D.

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::GetMatrix ( 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::EnableClipping ( bool  enable)
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.

Reimplemented in vtkOpenGL2ContextDevice2D.

vtkMatrix4x4* vtkOpenGLContextDevice2D::GetProjectionMatrix ( )

Get the projection matrix this is needed.

vtkMatrix4x4* vtkOpenGLContextDevice2D::GetModelMatrix ( )

Get the projection matrix this is needed.

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
void vtkOpenGLContextDevice2D::ReadyLinesCBOProgram ( )
protected
void vtkOpenGLContextDevice2D::ReadyLinesBOProgram ( )
protected
void vtkOpenGLContextDevice2D::ReadyVCBOProgram ( )
protected
void vtkOpenGLContextDevice2D::ReadyVBOProgram ( )
protected
void vtkOpenGLContextDevice2D::ReadyVTBOProgram ( )
protected
void vtkOpenGLContextDevice2D::ReadySCBOProgram ( )
protected
void vtkOpenGLContextDevice2D::ReadySBOProgram ( )
protected
void vtkOpenGLContextDevice2D::SetMatrices ( vtkShaderProgram prog)
protected
void vtkOpenGLContextDevice2D::BuildVBO ( vtkOpenGLHelper cbo,
float v,
int  nv,
unsigned char *  coolors,
int  nc,
float tcoords 
)
protected
void vtkOpenGLContextDevice2D::CoreDrawTriangles ( std::vector< float > &  tverts)
protected
void vtkOpenGLContextDevice2D::DrawMarkersGL2PS ( int  shape,
bool  highlight,
float points,
int  n,
unsigned char *  colors,
int  nc_comps 
)
protected

Draw the markers as paths/polydata instead of sprites for detailed GL2PS capture.

void vtkOpenGLContextDevice2D::DrawCrossMarkersGL2PS ( bool  highlight,
float points,
int  n,
unsigned char *  colors,
int  nc_comps 
)
protected

Draw the markers as paths/polydata instead of sprites for detailed GL2PS capture.

void vtkOpenGLContextDevice2D::DrawPlusMarkersGL2PS ( bool  highlight,
float points,
int  n,
unsigned char *  colors,
int  nc_comps 
)
protected

Draw the markers as paths/polydata instead of sprites for detailed GL2PS capture.

void vtkOpenGLContextDevice2D::DrawSquareMarkersGL2PS ( bool  highlight,
float points,
int  n,
unsigned char *  colors,
int  nc_comps 
)
protected

Draw the markers as paths/polydata instead of sprites for detailed GL2PS capture.

void vtkOpenGLContextDevice2D::DrawCircleMarkersGL2PS ( bool  highlight,
float points,
int  n,
unsigned char *  colors,
int  nc_comps 
)
protected

Draw the markers as paths/polydata instead of sprites for detailed GL2PS capture.

void vtkOpenGLContextDevice2D::DrawDiamondMarkersGL2PS ( bool  highlight,
float points,
int  n,
unsigned char *  colors,
int  nc_comps 
)
protected

Draw the markers as paths/polydata instead of sprites for detailed GL2PS capture.

void vtkOpenGLContextDevice2D::DrawImageGL2PS ( float  p[2],
vtkImageData image 
)
protected

Embed an RGBA image in the GL2PS output at the supplied point.

void vtkOpenGLContextDevice2D::DrawImageGL2PS ( float  p[2],
float  scale,
vtkImageData image 
)
protected

Embed an RGBA image in the GL2PS output at the supplied point.

void vtkOpenGLContextDevice2D::DrawImageGL2PS ( const vtkRectf rect,
vtkImageData image 
)
protected

Embed an RGBA image in the GL2PS output at the supplied point.

void vtkOpenGLContextDevice2D::DrawCircleGL2PS ( float  x,
float  y,
float  rX,
float  rY 
)
protected

Inject smooth primitives into the GL2PS stream.

void vtkOpenGLContextDevice2D::DrawWedgeGL2PS ( float  x,
float  y,
float  outRx,
float  outRy,
float  inRx,
float  inRy 
)
protected

Inject smooth primitives into the GL2PS stream.

void vtkOpenGLContextDevice2D::DrawMathTextStringGL2PS ( float  point[2],
const vtkStdString string 
)
protected

Implement DrawMathTextString for the GL2PS exporter.

void vtkOpenGLContextDevice2D::AddEllipseToPath ( vtkPath path,
float  x,
float  y,
float  rx,
float  ry,
bool  reverse 
)
protected

Add an ellipse to a vtkPath.

Used during GL2PS export.

void vtkOpenGLContextDevice2D::TransformPath ( vtkPath path) const
protected

Transform the path using the current modelview matrix.

void vtkOpenGLContextDevice2D::TransformPoint ( float x,
float y 
) const
protected

Transform the 2D point using the current modelview matrix.

void vtkOpenGLContextDevice2D::TransformSize ( float dx,
float dy 
) const
protected

Transform the width and height from pixels to data units.

Member Data Documentation

int vtkOpenGLContextDevice2D::Geometry
protected

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

Definition at line 361 of file vtkOpenGLContextDevice2D.h.

vtkRenderer * vtkOpenGLContextDevice2D::Renderer
protected

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

Definition at line 366 of file vtkOpenGLContextDevice2D.h.

vtkStringToImage * vtkOpenGLContextDevice2D::TextRenderer
protected

We also need a label render strategy.

Definition at line 371 of file vtkOpenGLContextDevice2D.h.

bool vtkOpenGLContextDevice2D::InRender
protected

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

Definition at line 376 of file vtkOpenGLContextDevice2D.h.

Private * vtkOpenGLContextDevice2D::Storage
protected

Definition at line 382 of file vtkOpenGLContextDevice2D.h.

vtkOpenGLRenderWindow * vtkOpenGLContextDevice2D::RenderWindow
protected

The OpenGL render window being used by the device.

Definition at line 394 of file vtkOpenGLContextDevice2D.h.

vtkOpenGLHelper* vtkOpenGLContextDevice2D::LinesCBO
protected

Definition at line 401 of file vtkOpenGLContextDevice2D.h.

vtkOpenGLHelper* vtkOpenGLContextDevice2D::LinesBO
protected

Definition at line 403 of file vtkOpenGLContextDevice2D.h.

vtkOpenGLHelper* vtkOpenGLContextDevice2D::VCBO
protected

Definition at line 405 of file vtkOpenGLContextDevice2D.h.

vtkOpenGLHelper* vtkOpenGLContextDevice2D::VBO
protected

Definition at line 407 of file vtkOpenGLContextDevice2D.h.

vtkOpenGLHelper* vtkOpenGLContextDevice2D::VTBO
protected

Definition at line 409 of file vtkOpenGLContextDevice2D.h.

vtkOpenGLHelper* vtkOpenGLContextDevice2D::SCBO
protected

Definition at line 411 of file vtkOpenGLContextDevice2D.h.

vtkOpenGLHelper* vtkOpenGLContextDevice2D::SBO
protected

Definition at line 413 of file vtkOpenGLContextDevice2D.h.

unsigned short vtkOpenGLContextDevice2D::LinePattern
protected

Definition at line 424 of file vtkOpenGLContextDevice2D.h.


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