VTK  9.4.20241230
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtkContextDevice2D Class Referenceabstract

Abstract class for drawing 2D primitives. More...

#include <vtkContextDevice2D.h>

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

Public Types

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

Public Member Functions

virtual vtkTypeBool IsA (const char *type)
 Return 1 if this class is the same type of (or a subclass of) the named class.
 
vtkContextDevice2DNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent) override
 Methods invoked by print to print information about the object including superclasses.
 
virtual void DrawPoly (float *points, int n, unsigned char *colors=nullptr, int nc_comps=0)=0
 Draw a poly line using the points - fastest code path due to memory layout of the coordinates.
 
virtual void DrawLines (float *f, int n, unsigned char *colors=nullptr, int nc_comps=0)=0
 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 (defining a single color).
 
virtual void DrawPoints (float *points, int n, unsigned char *colors=nullptr, int nc_comps=0)=0
 Draw a series of points - fastest code path due to memory layout of the coordinates.
 
virtual void DrawPoints (vtkDataArray *positions, vtkUnsignedCharArray *colors, std::uintptr_t vtkNotUsed(cacheIdentifier))
 
virtual void DrawPointSprites (vtkImageData *sprite, float *points, int n, unsigned char *colors=nullptr, int nc_comps=0)=0
 Draw a series of point sprites, images centred at the points supplied.
 
virtual void DrawPointSprites (vtkImageData *sprite, vtkDataArray *positions, vtkUnsignedCharArray *colors, std::uintptr_t vtkNotUsed(cacheIdentifier))
 
virtual void DrawMarkers (int shape, bool highlight, float *points, int n, unsigned char *colors=nullptr, int nc_comps=0)
 Draw a series of markers centered at the points supplied.
 
virtual void DrawMarkers (int shape, bool highlight, vtkDataArray *positions, vtkUnsignedCharArray *colors, std::uintptr_t vtkNotUsed(cacheIdentifier))
 
virtual void DrawQuad (float *, int)
 Draw a quad using the specified number of points.
 
virtual void DrawQuadStrip (float *, int)
 Draw a quad using the specified number of points.
 
virtual void DrawEllipseWedge (float x, float y, float outRx, float outRy, float inRx, float inRy, float startAngle, float stopAngle)=0
 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).
 
virtual void DrawEllipticArc (float x, float y, float rX, float rY, float startAngle, float stopAngle)=0
 Draw an elliptic arc with center at x,y with radii rX and rY between angles startAngle and stopAngle (expressed in degrees).
 
virtual void DrawString (float *point, const vtkStdString &string)=0
 Draw some text to the screen.
 
virtual void ComputeStringBounds (const vtkStdString &string, float bounds[4])=0
 Compute the bounds of the supplied string.
 
virtual void ComputeJustifiedStringBounds (const char *string, float bounds[4])=0
 Compute the bounds of the supplied string while taking into account the justification of the currently applied text property.
 
virtual void DrawMathTextString (float *point, const vtkStdString &string)=0
 Draw text using MathText markup for mathematical equations.
 
virtual bool MathTextIsSupported ()
 Return true if MathText rendering available on this device.
 
virtual void DrawImage (float p[2], float scale, vtkImageData *image)=0
 Draw the supplied image at the given x, y (p[0], p[1]) (bottom corner), scaled by scale (1.0 would match the image).
 
virtual void DrawImage (const vtkRectf &pos, vtkImageData *image)=0
 Draw the supplied image at the given position.
 
virtual void DrawPolyData (float p[2], float scale, vtkPolyData *polyData, vtkUnsignedCharArray *colors, int scalarMode)
 Draw the supplied PolyData at the given x, y (p[0], p[1]) (bottom corner), scaled by scale (1.0 would match the actual dataset).
 
virtual void ApplyPen (vtkPen *pen)
 Apply the supplied pen which controls the outlines of shapes, as well as lines, points and related primitives.
 
virtual void ApplyBrush (vtkBrush *brush)
 Apply the supplied brush which controls the outlines of shapes, as well as lines, points and related primitives.
 
virtual void ApplyTextProp (vtkTextProperty *prop)
 Apply the supplied text property which controls how text is rendered.
 
virtual void SetColor4 (unsigned char color[4])=0
 Set the color for the device using unsigned char of length 4, RGBA.
 
virtual void SetTexture (vtkImageData *image, int properties)=0
 Set the texture for the device, it is used to fill the polygons.
 
virtual void SetPointSize (float size)=0
 Set the point size for glyphs/sprites.
 
virtual void SetLineWidth (float width)=0
 Set the line width.
 
virtual void SetLineType (int type)=0
 Set the line type type (using anonymous enum in vtkPen).
 
virtual int GetWidth ()
 Get the width of the device in pixels.
 
virtual int GetHeight ()
 Get the width of the device in pixels.
 
virtual void SetMatrix (vtkMatrix3x3 *m)=0
 Set the model view matrix for the display.
 
virtual void GetMatrix (vtkMatrix3x3 *m)=0
 Set the model view matrix for the display.
 
virtual void MultiplyMatrix (vtkMatrix3x3 *m)=0
 Multiply the current model view matrix by the supplied one.
 
virtual void PushMatrix ()=0
 Push the current matrix onto the stack.
 
virtual void PopMatrix ()=0
 Pop the current matrix off of the stack.
 
virtual void SetClipping (int *x)=0
 Supply an int array of length 4 with x1, y1, width, height specifying clipping region for the device in pixels.
 
virtual void DisableClipping ()
 Disable clipping of the display.
 
virtual void EnableClipping (bool enable)=0
 Enable or disable the clipping of the scene.
 
virtual void Begin (vtkViewport *)
 Begin drawing, pass in the viewport to set up the view.
 
virtual void End ()
 End drawing, clean up the view.
 
virtual bool GetBufferIdMode () const
 Tell if the device context is in BufferId creation mode.
 
virtual void BufferIdModeBegin (vtkAbstractContextBufferId *bufferId)
 Start BufferId creation Mode.
 
virtual void BufferIdModeEnd ()
 Finalize BufferId creation Mode.
 
virtual void SetViewportSize (const vtkVector2i &size)
 
virtual vtkVector2i GetViewportSize ()
 
virtual void SetViewportRect (const vtkRecti &rect)
 
virtual vtkRecti GetViewportRect ()
 
virtual void ReleaseCache (std::uintptr_t vtkNotUsed(cacheIdentifier))
 Concrete graphics implementations maintain a cache of heavy-weight buffer objects to achieve higher interactive framerates.
 
virtual void DrawPolygon (float *p, int n)
 Draw a polygon using the specified number of points.
 
virtual void DrawColoredPolygon (float *points, int numPoints, unsigned char *colors=nullptr, int nc_comps=0)
 Draw a polygon using the specified number of points.
 
virtual vtkPenGetPen ()
 Get the pen which controls the outlines of shapes, as well as lines, points and related primitives.
 
virtual vtkBrushGetBrush ()
 Get the pen which controls the outlines of shapes as well as lines, points and related primitives.
 
virtual vtkTextPropertyGetTextProp ()
 Get the text properties object for the vtkContext2D.
 
- Public Member Functions inherited from vtkObject
 vtkBaseTypeMacro (vtkObject, vtkObjectBase)
 
virtual void DebugOn ()
 Turn debugging output on.
 
virtual void DebugOff ()
 Turn debugging output off.
 
bool GetDebug ()
 Get the value of the debug flag.
 
void SetDebug (bool debugFlag)
 Set the value of the debug flag.
 
virtual void Modified ()
 Update the modification time for this object.
 
virtual vtkMTimeType GetMTime ()
 Return this object's modified time.
 
void PrintSelf (ostream &os, vtkIndent indent) override
 Methods invoked by print to print information about the object including superclasses.
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
vtkTypeBool HasObserver (unsigned long event)
 
vtkTypeBool HasObserver (const char *event)
 
vtkTypeBool InvokeEvent (unsigned long event)
 
vtkTypeBool InvokeEvent (const char *event)
 
std::string GetObjectDescription () const override
 The object description printed in messages and PrintSelf output.
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
vtkCommandGetCommand (unsigned long tag)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
void RemoveObserver (vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
void RemoveObservers (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
void RemoveObservers (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
vtkTypeBool HasObserver (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
vtkTypeBool HasObserver (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
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.
 
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.
 
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.
 
vtkTypeBool InvokeEvent (unsigned long event, void *callData)
 This method invokes an event and return whether the event was aborted or not.
 
vtkTypeBool InvokeEvent (const char *event, void *callData)
 This method invokes an event and return whether the event was aborted or not.
 
virtual void SetObjectName (const std::string &objectName)
 Set/get the name of this object for reporting purposes.
 
virtual std::string GetObjectName () const
 Set/get the name of this object for reporting purposes.
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 Return the class name as a string.
 
virtual std::string GetObjectDescription () const
 The object description printed in messages and PrintSelf output.
 
virtual vtkTypeBool IsA (const char *name)
 Return 1 if this class is the same type of (or a subclass of) the named class.
 
virtual vtkIdType GetNumberOfGenerationsFromBase (const char *name)
 Given the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class).
 
virtual void Delete ()
 Delete a VTK object.
 
virtual void FastDelete ()
 Delete a reference to this object.
 
void InitializeObjectBase ()
 
void Print (ostream &os)
 Print an object to an ostream.
 
void Register (vtkObjectBase *o)
 Increase the reference count (mark as used by another object).
 
virtual void UnRegister (vtkObjectBase *o)
 Decrease the reference count (release by another object).
 
int GetReferenceCount ()
 Return the current reference count of this object.
 
void SetReferenceCount (int)
 Sets the reference count.
 
bool GetIsInMemkind () const
 A local state flag that remembers whether this object lives in the normal or extended memory space.
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses.
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses.
 
virtual bool UsesGarbageCollector () const
 Indicate whether the class uses vtkGarbageCollector or not.
 

Static Public Member Functions

static vtkTypeBool 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.
 
static void BreakOnError ()
 This method is called when vtkErrorMacro executes.
 
static void SetGlobalWarningDisplay (vtkTypeBool val)
 This is a global flag that controls whether any debug, warning or error messages are displayed.
 
static void GlobalWarningDisplayOn ()
 This is a global flag that controls whether any debug, warning or error messages are displayed.
 
static void GlobalWarningDisplayOff ()
 This is a global flag that controls whether any debug, warning or error messages are displayed.
 
static vtkTypeBool GetGlobalWarningDisplay ()
 This is a global flag that controls whether any debug, warning or error messages are displayed.
 
- 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.
 
static vtkIdType GetNumberOfGenerationsFromBaseType (const char *name)
 Given a the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class).
 
static vtkObjectBaseNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
 
static void SetMemkindDirectory (const char *directoryname)
 The name of a directory, ideally mounted -o dax, to memory map an extended memory space within.
 
static bool GetUsingMemkind ()
 A global state flag that controls whether vtkObjects are constructed in the usual way (the default) or within the extended memory space.
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkContextDevice2D ()
 
 ~vtkContextDevice2D () override
 
- 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=nullptr)
 These methods allow a command to exclusively grab all events.
 
void InternalReleaseFocus ()
 These methods allow a command to exclusively grab all events.
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void RegisterInternal (vtkObjectBase *, vtkTypeBool check)
 
virtual void UnRegisterInternal (vtkObjectBase *, vtkTypeBool check)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
virtual void ObjectFinalize ()
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Protected Attributes

int Geometry [2]
 Store the width and height of the device in pixels.
 
vtkVector2i ViewportSize
 Store the size of the total viewport.
 
vtkRecti ViewportRect
 Store our origin and size in the total viewport.
 
vtkAbstractContextBufferIdBufferId
 
vtkPenPen
 
vtkBrushBrush
 
vtkTextPropertyTextProp
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
std::string ObjectName
 
- Protected Attributes inherited from vtkObjectBase
std::atomic< int32_t > ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Additional Inherited Members

- Static Protected Member Functions inherited from vtkObjectBase
static vtkMallocingFunction GetCurrentMallocFunction ()
 
static vtkReallocingFunction GetCurrentReallocFunction ()
 
static vtkFreeingFunction GetCurrentFreeFunction ()
 
static vtkFreeingFunction GetAlternateFreeFunction ()
 

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.

Tests:
vtkContextDevice2D (Tests)

Definition at line 43 of file vtkContextDevice2D.h.

Member Typedef Documentation

◆ Superclass

Definition at line 46 of file vtkContextDevice2D.h.

Member Enumeration Documentation

◆ TextureProperty

Enumerator
Nearest 
Linear 
Stretch 
Repeat 

Definition at line 272 of file vtkContextDevice2D.h.

Constructor & Destructor Documentation

◆ vtkContextDevice2D()

vtkContextDevice2D::vtkContextDevice2D ( )
protected

◆ ~vtkContextDevice2D()

vtkContextDevice2D::~vtkContextDevice2D ( )
overrideprotected

Member Function Documentation

◆ IsTypeOf()

static vtkTypeBool vtkContextDevice2D::IsTypeOf ( const char *  type)
static

◆ IsA()

virtual vtkTypeBool 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 vtkObjectBase.

Reimplemented in vtkSVGContextDevice2D, vtkPDFContextDevice2D, and vtkOpenGLContextDevice2D.

◆ SafeDownCast()

static vtkContextDevice2D * vtkContextDevice2D::SafeDownCast ( vtkObjectBase o)
static

◆ NewInstanceInternal()

virtual vtkObjectBase * vtkContextDevice2D::NewInstanceInternal ( ) const
protectedvirtual

◆ NewInstance()

vtkContextDevice2D * vtkContextDevice2D::NewInstance ( ) const

◆ PrintSelf()

void vtkContextDevice2D::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
overridevirtual

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 vtkObjectBase.

Reimplemented in vtkSVGContextDevice2D, vtkPDFContextDevice2D, and vtkOpenGLContextDevice2D.

◆ New()

static vtkContextDevice2D * vtkContextDevice2D::New ( )
static

◆ DrawPoly()

virtual void vtkContextDevice2D::DrawPoly ( float *  points,
int  n,
unsigned char *  colors = nullptr,
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).

See also
DrawLines()

Implemented in vtkOpenGLContextDevice2D, vtkSVGContextDevice2D, and vtkPDFContextDevice2D.

◆ DrawLines()

virtual void vtkContextDevice2D::DrawLines ( float *  f,
int  n,
unsigned char *  colors = nullptr,
int  nc_comps = 0 
)
pure 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 (defining a single color).

See also
DrawPoly()

Implemented in vtkSVGContextDevice2D, vtkPDFContextDevice2D, and vtkOpenGLContextDevice2D.

◆ DrawPoints() [1/2]

virtual void vtkContextDevice2D::DrawPoints ( float *  points,
int  n,
unsigned char *  colors = nullptr,
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 vtkSVGContextDevice2D, vtkPDFContextDevice2D, vtkOpenGLContextDevice2D, vtkSVGContextDevice2D, and vtkPDFContextDevice2D.

◆ DrawPoints() [2/2]

virtual void vtkContextDevice2D::DrawPoints ( vtkDataArray positions,
vtkUnsignedCharArray colors,
std::uintptr_t   vtkNotUsedcacheIdentifier 
)
virtual

◆ DrawPointSprites() [1/2]

virtual void vtkContextDevice2D::DrawPointSprites ( vtkImageData sprite,
float *  points,
int  n,
unsigned char *  colors = nullptr,
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
spritethe image to draw
pointswhere to draw the sprites
nthe number of points
colorsis an optional array of colors.
nc_compsis the number of components for the color.

Implemented in vtkSVGContextDevice2D, vtkPDFContextDevice2D, vtkOpenGLContextDevice2D, vtkSVGContextDevice2D, and vtkPDFContextDevice2D.

◆ DrawPointSprites() [2/2]

virtual void vtkContextDevice2D::DrawPointSprites ( vtkImageData sprite,
vtkDataArray positions,
vtkUnsignedCharArray colors,
std::uintptr_t   vtkNotUsedcacheIdentifier 
)
virtual

◆ DrawMarkers() [1/2]

virtual void vtkContextDevice2D::DrawMarkers ( int  shape,
bool  highlight,
float *  points,
int  n,
unsigned char *  colors = nullptr,
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
    shapethe shape of the marker
    highlightwhether to highlight the marker or not
    pointswhere to draw the sprites
    nthe number of points
    colorsis an optional array of colors.
    nc_compsis the number of components for the color.

Reimplemented in vtkSVGContextDevice2D, vtkPDFContextDevice2D, vtkSVGContextDevice2D, vtkPDFContextDevice2D, and vtkOpenGLContextDevice2D.

◆ DrawMarkers() [2/2]

virtual void vtkContextDevice2D::DrawMarkers ( int  shape,
bool  highlight,
vtkDataArray positions,
vtkUnsignedCharArray colors,
std::uintptr_t   vtkNotUsedcacheIdentifier 
)
virtual

◆ DrawQuad()

virtual void vtkContextDevice2D::DrawQuad ( float *  ,
int   
)
inlinevirtual

Draw a quad using the specified number of points.

Reimplemented in vtkSVGContextDevice2D, vtkPDFContextDevice2D, and vtkOpenGLContextDevice2D.

Definition at line 116 of file vtkContextDevice2D.h.

◆ DrawQuadStrip()

virtual void vtkContextDevice2D::DrawQuadStrip ( float *  ,
int   
)
inlinevirtual

Draw a quad using the specified number of points.

Reimplemented in vtkSVGContextDevice2D, vtkPDFContextDevice2D, and vtkOpenGLContextDevice2D.

Definition at line 121 of file vtkContextDevice2D.h.

◆ DrawPolygon()

virtual void vtkContextDevice2D::DrawPolygon ( float *  p,
int  n 
)
inlinevirtual

Draw a polygon using the specified number of points.

Reimplemented in vtkSVGContextDevice2D, vtkPDFContextDevice2D, and vtkOpenGLContextDevice2D.

Definition at line 127 of file vtkContextDevice2D.h.

◆ DrawColoredPolygon()

virtual void vtkContextDevice2D::DrawColoredPolygon ( float *  points,
int  numPoints,
unsigned char *  colors = nullptr,
int  nc_comps = 0 
)
virtual

Draw a polygon using the specified number of points.

Reimplemented in vtkSVGContextDevice2D, vtkPDFContextDevice2D, and vtkOpenGLContextDevice2D.

◆ DrawEllipseWedge()

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 vtkSVGContextDevice2D, vtkPDFContextDevice2D, and vtkOpenGLContextDevice2D.

◆ DrawEllipticArc()

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 vtkSVGContextDevice2D, vtkPDFContextDevice2D, and vtkOpenGLContextDevice2D.

◆ DrawString()

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

Draw some text to the screen.

Implemented in vtkSVGContextDevice2D, vtkPDFContextDevice2D, and vtkOpenGLContextDevice2D.

◆ ComputeStringBounds()

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 or justification.

Implemented in vtkSVGContextDevice2D, vtkPDFContextDevice2D, and vtkOpenGLContextDevice2D.

◆ ComputeJustifiedStringBounds()

virtual void vtkContextDevice2D::ComputeJustifiedStringBounds ( const char *  string,
float  bounds[4] 
)
pure 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) are also correctly taken into account.

Implemented in vtkSVGContextDevice2D, vtkPDFContextDevice2D, and vtkOpenGLContextDevice2D.

◆ DrawMathTextString()

virtual void vtkContextDevice2D::DrawMathTextString ( float *  point,
const vtkStdString string 
)
pure virtual

Draw text using MathText markup for mathematical equations.

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

Implemented in vtkSVGContextDevice2D, and vtkPDFContextDevice2D.

◆ MathTextIsSupported()

virtual bool vtkContextDevice2D::MathTextIsSupported ( )
virtual

Return true if MathText rendering available on this device.

◆ DrawImage() [1/2]

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 vtkSVGContextDevice2D, vtkPDFContextDevice2D, and vtkOpenGLContextDevice2D.

◆ DrawImage() [2/2]

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 vtkSVGContextDevice2D, vtkPDFContextDevice2D, and vtkOpenGLContextDevice2D.

◆ DrawPolyData()

virtual void vtkContextDevice2D::DrawPolyData ( float  p[2],
float  scale,
vtkPolyData polyData,
vtkUnsignedCharArray colors,
int  scalarMode 
)
virtual

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

Only lines and polys are rendered. Only the x/y coordinates of the polydata are used.

Parameters
pOffset to apply to polydata.
scaleIsotropic scale for polydata. Applied after offset.
polyDataDraw lines and polys from this dataset.
colorsRGBA for points or cells, depending on value of scalarMode. Must not be NULL.
scalarModeMust be either VTK_SCALAR_MODE_USE_POINT_DATA or VTK_SCALAR_MODE_USE_CELL_DATA.

The base implementation breaks the polydata apart and renders each polygon individually using the device API. Subclasses should override this method with a batch-drawing implementation if performance is a concern.

Reimplemented in vtkPDFContextDevice2D, and vtkOpenGLContextDevice2D.

◆ ApplyPen()

virtual void vtkContextDevice2D::ApplyPen ( vtkPen pen)
virtual

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.

◆ GetPen()

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.

◆ ApplyBrush()

virtual void vtkContextDevice2D::ApplyBrush ( vtkBrush brush)
virtual

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.

◆ GetBrush()

virtual vtkBrush * vtkContextDevice2D::GetBrush ( )
virtual

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

◆ ApplyTextProp()

virtual void vtkContextDevice2D::ApplyTextProp ( vtkTextProperty prop)
virtual

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.

◆ GetTextProp()

virtual vtkTextProperty * vtkContextDevice2D::GetTextProp ( )
virtual

Get the text properties object for the vtkContext2D.

◆ SetColor4()

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 vtkSVGContextDevice2D, vtkPDFContextDevice2D, and vtkOpenGLContextDevice2D.

◆ SetTexture()

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 vtkSVGContextDevice2D, vtkPDFContextDevice2D, and vtkOpenGLContextDevice2D.

◆ SetPointSize()

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

Set the point size for glyphs/sprites.

Implemented in vtkSVGContextDevice2D, vtkPDFContextDevice2D, and vtkOpenGLContextDevice2D.

◆ SetLineWidth()

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

Set the line width.

Implemented in vtkSVGContextDevice2D, vtkPDFContextDevice2D, and vtkOpenGLContextDevice2D.

◆ SetLineType()

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

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

Implemented in vtkSVGContextDevice2D, vtkPDFContextDevice2D, and vtkOpenGLContextDevice2D.

◆ GetWidth()

virtual int vtkContextDevice2D::GetWidth ( )
inlinevirtual

Get the width of the device in pixels.

Definition at line 302 of file vtkContextDevice2D.h.

◆ GetHeight()

virtual int vtkContextDevice2D::GetHeight ( )
inlinevirtual

Get the width of the device in pixels.

Definition at line 307 of file vtkContextDevice2D.h.

◆ SetMatrix()

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

Set the model view matrix for the display.

Implemented in vtkSVGContextDevice2D, vtkPDFContextDevice2D, and vtkOpenGLContextDevice2D.

◆ GetMatrix()

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

Set the model view matrix for the display.

Implemented in vtkSVGContextDevice2D, vtkPDFContextDevice2D, and vtkOpenGLContextDevice2D.

◆ MultiplyMatrix()

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

Multiply the current model view matrix by the supplied one.

Implemented in vtkSVGContextDevice2D, vtkPDFContextDevice2D, and vtkOpenGLContextDevice2D.

◆ PushMatrix()

virtual void vtkContextDevice2D::PushMatrix ( )
pure virtual

Push the current matrix onto the stack.

Implemented in vtkSVGContextDevice2D, vtkPDFContextDevice2D, and vtkOpenGLContextDevice2D.

◆ PopMatrix()

virtual void vtkContextDevice2D::PopMatrix ( )
pure virtual

Pop the current matrix off of the stack.

Implemented in vtkSVGContextDevice2D, vtkPDFContextDevice2D, and vtkOpenGLContextDevice2D.

◆ SetClipping()

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

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

Implemented in vtkSVGContextDevice2D, vtkPDFContextDevice2D, and vtkOpenGLContextDevice2D.

◆ DisableClipping()

virtual void vtkContextDevice2D::DisableClipping ( )
inlinevirtual

Disable clipping of the display.

Remove in a future release - retained for API compatibility.

Definition at line 344 of file vtkContextDevice2D.h.

◆ EnableClipping()

virtual void vtkContextDevice2D::EnableClipping ( bool  enable)
pure virtual

Enable or disable the clipping of the scene.

Implemented in vtkSVGContextDevice2D, vtkPDFContextDevice2D, and vtkOpenGLContextDevice2D.

◆ Begin()

virtual void vtkContextDevice2D::Begin ( vtkViewport )
inlinevirtual

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

Reimplemented in vtkSVGContextDevice2D, and vtkOpenGLContextDevice2D.

Definition at line 354 of file vtkContextDevice2D.h.

◆ End()

virtual void vtkContextDevice2D::End ( )
inlinevirtual

End drawing, clean up the view.

Reimplemented in vtkSVGContextDevice2D, and vtkOpenGLContextDevice2D.

Definition at line 359 of file vtkContextDevice2D.h.

◆ GetBufferIdMode()

virtual bool vtkContextDevice2D::GetBufferIdMode ( ) const
virtual

Tell if the device context is in BufferId creation mode.

Initial value is false.

◆ BufferIdModeBegin()

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.

◆ BufferIdModeEnd()

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

◆ SetViewportSize()

virtual void vtkContextDevice2D::SetViewportSize ( const vtkVector2i size)
inlinevirtual

Definition at line 385 of file vtkContextDevice2D.h.

◆ GetViewportSize()

virtual vtkVector2i vtkContextDevice2D::GetViewportSize ( )
virtual

◆ SetViewportRect()

virtual void vtkContextDevice2D::SetViewportRect ( const vtkRecti rect)
inlinevirtual

Definition at line 388 of file vtkContextDevice2D.h.

◆ GetViewportRect()

virtual vtkRecti vtkContextDevice2D::GetViewportRect ( )
virtual

◆ ReleaseCache()

virtual void vtkContextDevice2D::ReleaseCache ( std::uintptr_t   vtkNotUsedcacheIdentifier)
inlinevirtual

Concrete graphics implementations maintain a cache of heavy-weight buffer objects to achieve higher interactive framerates.

This method requests the devices to release the cached objects for a given cache identifier.

Definition at line 396 of file vtkContextDevice2D.h.

Member Data Documentation

◆ Geometry

int vtkContextDevice2D::Geometry[2]
protected

Store the width and height of the device in pixels.

Definition at line 405 of file vtkContextDevice2D.h.

◆ ViewportSize

vtkVector2i vtkContextDevice2D::ViewportSize
protected

Store the size of the total viewport.

Definition at line 410 of file vtkContextDevice2D.h.

◆ ViewportRect

vtkRecti vtkContextDevice2D::ViewportRect
protected

Store our origin and size in the total viewport.

Definition at line 415 of file vtkContextDevice2D.h.

◆ BufferId

vtkAbstractContextBufferId* vtkContextDevice2D::BufferId
protected

Definition at line 417 of file vtkContextDevice2D.h.

◆ Pen

vtkPen* vtkContextDevice2D::Pen
protected

Definition at line 419 of file vtkContextDevice2D.h.

◆ Brush

vtkBrush* vtkContextDevice2D::Brush
protected

Definition at line 420 of file vtkContextDevice2D.h.

◆ TextProp

vtkTextProperty* vtkContextDevice2D::TextProp
protected

Definition at line 421 of file vtkContextDevice2D.h.


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