VTK  9.7.20261112
vtkWebGPUContextDevice2D Class Reference

#include <vtkWebGPUContextDevice2D.h>

Detailed Description

2D context device implementation using WebGPU graphics backend.

vtkWebGPUContextDevice2D provides hardware-accelerated 2D rendering primitives (lines, points, polygons, images, and text) for VTK context actors using WebGPU. Features a high-performance ring-buffer sub-allocator and persistent marker caching.

Definition at line 32 of file vtkWebGPUContextDevice2D.h.

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

Classes

class  Private
 Container for vtkWebGPUContextDevice2D internal state. More...

Public Types

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 vtkTypeBool IsA (const char *type)
 Return 1 if this class is the same type of (or a subclass of) the named class.
vtkWebGPUContextDevice2D * NewInstance () const
void PrintSelf (ostream &os, vtkIndent indent) override
 Methods invoked by print to print information about the object including superclasses.
void Begin (vtkViewport *viewport) override
 Begins the 2D rendering pass for the given viewport.
void End () override
 Ends the 2D rendering pass and cleans up temporary render state.
void Flush ()
 Flushes the internal batched vertex buffer to the WebGPU rendering pipeline.
void DrawPoly (float *points, int n, unsigned char *colors=nullptr, int nc_comps=0) override
 Draw a poly line using the points - fastest code path due to memory layout of the coordinates.
void DrawLines (float *points, int n, unsigned char *colors=nullptr, int nc_comps=0) override
 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.
void DrawPoints (float *points, int n, unsigned char *colors=nullptr, int nc_comps=0) override
 Draw a series of points - fastest code path due to memory layout of the coordinates.
void DrawPoints (vtkDataArray *positions, vtkUnsignedCharArray *colors, std::uintptr_t cacheIdentifier) override
void DrawPointSprites (vtkImageData *sprite, float *points, int n, unsigned char *colors=nullptr, int nc_comps=0) override
 Draw a series of point sprites, images centred at the points supplied.
void DrawPointSprites (vtkImageData *sprite, vtkDataArray *positions, vtkUnsignedCharArray *colors, std::uintptr_t cacheIdentifier) override
void DrawMarkers (int shape, bool highlight, float *points, int n, unsigned char *colors=nullptr, int nc_comps=0) override
 Draw markers of a specified shape at multiple 2D positions.
void DrawMarkers (int shape, bool highlight, vtkDataArray *positions, vtkUnsignedCharArray *colors, std::uintptr_t cacheIdentifier) override
void DrawQuad (float *points, int n) override
 Draw a quad using the 4 specified points.
void DrawQuadStrip (float *points, int n) override
 Draw a quad strip using a sequence of points.
void DrawPolygon (float *points, int n) override
 Draw a filled convex polygon defined by points.
void DrawColoredPolygon (float *points, int numPoints, unsigned char *colors=nullptr, int nc_comps=0) override
 Draw a filled polygon with optional per-vertex or per-polygon colors.
void DrawEllipseWedge (float x, float y, float outRx, float outRy, float inRx, float inRy, float startAngle, float stopAngle) override
 Draw an elliptical wedge (pie slice) defined by radii and angles.
void DrawEllipticArc (float x, float y, float rX, float rY, float startAngle, float stopAngle) override
 Draw an open elliptical arc line segment.
void DrawString (float *point, const vtkStdString &string) override
 Render a text string at the specified world coordinate point.
void ComputeStringBounds (const vtkStdString &string, float bounds[4]) override
 Compute the bounding box dimensions for a given text string.
void ComputeJustifiedStringBounds (const char *string, float bounds[4]) override
 Compute justified bounding box dimensions for a C-style string.
void DrawMathTextString (float point[2], const vtkStdString &string) override
 Render a math equation string (MathText format) at the given point.
void DrawImage (float p[2], float scale, vtkImageData *image) override
 Render an image data object scaled and positioned at a given point.
void DrawImage (const vtkRectf &pos, vtkImageData *image) override
 Render an image data object within a specified 2D rectangle.
void DrawPolyData (float p[2], float scale, vtkPolyData *polyData, vtkUnsignedCharArray *colors, int scalarMode) override
 Render a vtkPolyData geometry mesh (lines and polygons) with offset and scale.
void SetColor4 (unsigned char color[4]) override
 Set the color for the device using unsigned char of length 4, RGBA.
virtual void SetColor (unsigned char color[3])
 Set the color for the device using unsigned char of length 3, RGB.
void SetTexture (vtkImageData *image, int properties=0) override
 Set the texture for the device, it is used to fill the polygons.
void SetPointSize (float size) override
 Set the point size for glyphs/sprites.
void SetLineWidth (float width) override
 Set the line width for glyphs/sprites.
void SetLineType (int type) override
 Set the line type type (using anonymous enum in vtkPen).
void SetClipping (int *x) override
 Set the clipping rectangle for the 2D context.
void EnableClipping (bool enable) override
 Enable or disable clipping.
void MultiplyMatrix (vtkMatrix3x3 *m) override
 Multiply the current model view matrix by the supplied one.
void SetMatrix (vtkMatrix3x3 *m) override
 Set the model view matrix for the display.
void GetMatrix (vtkMatrix3x3 *m) override
 Set the model view matrix for the display.
void PushMatrix () override
 Push the current matrix onto the stack.
void PopMatrix () override
 Pop the current matrix off of the stack.
virtual void ReleaseGraphicsResources (vtkWindow *)
 Release any graphics resources that are being consumed by this device.
bool InitializeDeviceResources ()
 Initialize Device Resources: Uniforms, BindGroups, Pipelines, and Textures.
void InitializeTexture ()
 Initialize Device Resources: Uniforms, BindGroups, Pipelines, and Textures.
void BufferIdModeBegin (vtkAbstractContextBufferId *) override
 Noop method.
void BufferIdModeEnd () override
 Noop method.
void ReleaseCache (std::uintptr_t) override
 Noop method.
Public Member Functions inherited from vtkContextDevice2D
vtkContextDevice2D * NewInstance () const
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 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 int GetWidth ()
 Get the width of the device in pixels.
virtual int GetHeight ()
 Get the width of the device in pixels.
virtual void DisableClipping ()
 Disable clipping of the display.
virtual bool GetBufferIdMode () const
 Tell if the device context is in BufferId creation mode.
virtual void SetViewportSize (const vtkVector2i &size)
virtual vtkVector2i GetViewportSize ()
virtual void SetViewportRect (const vtkRecti &rect)
virtual vtkRecti GetViewportRect ()
virtual vtkPen * GetPen ()
 Get the pen which controls the outlines of shapes, as well as lines, points and related primitives.
virtual vtkBrush * GetBrush ()
 Get the pen which controls the outlines of shapes as well as lines, points and related primitives.
virtual vtkTextProperty * GetTextProp ()
 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 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.
vtkCommand * GetCommand (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 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 vtkWebGPUContextDevice2D * SafeDownCast (vtkObjectBase *o)
static vtkWebGPUContextDevice2D * New ()
 Creates a 2D Painter object.
Static Public Member Functions inherited from vtkContextDevice2D
static vtkTypeBool IsTypeOf (const char *type)
static vtkContextDevice2D * SafeDownCast (vtkObjectBase *o)
static vtkContextDevice2D * New ()
Static Public Member Functions inherited from vtkObject
static vtkObject * New ()
 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 vtkObjectBase * New ()
 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 vtkObjectBase * NewInstanceInternal () const
 vtkWebGPUContextDevice2D ()
 ~vtkWebGPUContextDevice2D () override
Protected Member Functions inherited from vtkContextDevice2D
 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 ReportReferences (vtkGarbageCollector *)
 vtkObjectBase (const vtkObjectBase &)
void operator= (const vtkObjectBase &)

Protected Attributes

vtkRenderer * Renderer = nullptr
vtkWebGPURenderWindow * RenderWindow = nullptr
Private * Storage
vtkTransform * ProjectionMatrix
vtkTransform * ModelMatrix
bool InRender = false
Protected Attributes inherited from vtkContextDevice2D
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.
vtkAbstractContextBufferId * BufferId
vtkPen * Pen
vtkBrush * Brush
vtkTextProperty * TextProp
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 ()

Member Typedef Documentation

◆ Superclass

Constructor & Destructor Documentation

◆ vtkWebGPUContextDevice2D()

vtkWebGPUContextDevice2D::vtkWebGPUContextDevice2D ( )
protected

◆ ~vtkWebGPUContextDevice2D()

vtkWebGPUContextDevice2D::~vtkWebGPUContextDevice2D ( )
overrideprotected

Member Function Documentation

◆ IsTypeOf()

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

◆ IsA()

virtual vtkTypeBool vtkWebGPUContextDevice2D::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.

◆ SafeDownCast()

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

◆ NewInstanceInternal()

virtual vtkObjectBase * vtkWebGPUContextDevice2D::NewInstanceInternal ( ) const
protectedvirtual

Reimplemented from vtkContextDevice2D.

◆ NewInstance()

vtkWebGPUContextDevice2D * vtkWebGPUContextDevice2D::NewInstance ( ) const

◆ PrintSelf()

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

◆ New()

vtkWebGPUContextDevice2D * vtkWebGPUContextDevice2D::New ( )
static

Creates a 2D Painter object.

◆ Begin()

void vtkWebGPUContextDevice2D::Begin ( vtkViewport * viewport)
overridevirtual

Begins the 2D rendering pass for the given viewport.

Resets the vertex ring allocator and configures initial matrices.

Reimplemented from vtkContextDevice2D.

◆ End()

void vtkWebGPUContextDevice2D::End ( )
overridevirtual

Ends the 2D rendering pass and cleans up temporary render state.

Reimplemented from vtkContextDevice2D.

◆ Flush()

void vtkWebGPUContextDevice2D::Flush ( )

Flushes the internal batched vertex buffer to the WebGPU rendering pipeline.

◆ InitializeDeviceResources()

bool vtkWebGPUContextDevice2D::InitializeDeviceResources ( )

Initialize Device Resources: Uniforms, BindGroups, Pipelines, and Textures.

◆ InitializeTexture()

void vtkWebGPUContextDevice2D::InitializeTexture ( )

Initialize Device Resources: Uniforms, BindGroups, Pipelines, and Textures.

◆ BufferIdModeBegin()

void vtkWebGPUContextDevice2D::BufferIdModeBegin ( vtkAbstractContextBufferId * )
inlineoverridevirtual

Noop method.

Reimplemented from vtkContextDevice2D.

Definition at line 71 of file vtkWebGPUContextDevice2D.h.

◆ BufferIdModeEnd()

void vtkWebGPUContextDevice2D::BufferIdModeEnd ( )
inlineoverridevirtual

Noop method.

Reimplemented from vtkContextDevice2D.

Definition at line 72 of file vtkWebGPUContextDevice2D.h.

◆ ReleaseCache()

void vtkWebGPUContextDevice2D::ReleaseCache ( std::uintptr_t )
inlineoverridevirtual

Noop method.

Reimplemented from vtkContextDevice2D.

Definition at line 73 of file vtkWebGPUContextDevice2D.h.

◆ DrawPoly()

void vtkWebGPUContextDevice2D::DrawPoly ( float * points,
int n,
unsigned char * colors = nullptr,
int nc_comps = 0 )
overridevirtual

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.

◆ DrawLines()

void vtkWebGPUContextDevice2D::DrawLines ( float * points,
int n,
unsigned char * colors = nullptr,
int nc_comps = 0 )
overridevirtual

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.

◆ DrawPoints() [1/2]

void vtkWebGPUContextDevice2D::DrawPoints ( float * points,
int n,
unsigned char * colors = nullptr,
int nc_comps = 0 )
overridevirtual

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.

◆ DrawPoints() [2/2]

void vtkWebGPUContextDevice2D::DrawPoints ( vtkDataArray * positions,
vtkUnsignedCharArray * colors,
std::uintptr_t cacheIdentifier )
overridevirtual

Reimplemented from vtkContextDevice2D.

◆ DrawPointSprites() [1/2]

void vtkWebGPUContextDevice2D::DrawPointSprites ( vtkImageData * sprite,
float * points,
int n,
unsigned char * colors = nullptr,
int nc_comps = 0 )
overridevirtual

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.

◆ DrawPointSprites() [2/2]

void vtkWebGPUContextDevice2D::DrawPointSprites ( vtkImageData * sprite,
vtkDataArray * positions,
vtkUnsignedCharArray * colors,
std::uintptr_t cacheIdentifier )
overridevirtual

Reimplemented from vtkContextDevice2D.

◆ DrawMarkers() [1/2]

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

Draw markers of a specified shape at multiple 2D positions.

The size of the markers is determined by the current Pen's width. If the pen width is less than or equal to 0, a default size of 7 pixels is used. The shape is generated into a vtkImageData using vtkMarkerUtilities and rendered via DrawPointSprites.

Reimplemented from vtkContextDevice2D.

◆ DrawMarkers() [2/2]

void vtkWebGPUContextDevice2D::DrawMarkers ( int shape,
bool highlight,
vtkDataArray * positions,
vtkUnsignedCharArray * colors,
std::uintptr_t cacheIdentifier )
overridevirtual

Reimplemented from vtkContextDevice2D.

◆ DrawQuad()

void vtkWebGPUContextDevice2D::DrawQuad ( float * points,
int n )
overridevirtual

Draw a quad using the 4 specified points.

Reimplemented from vtkContextDevice2D.

◆ DrawQuadStrip()

void vtkWebGPUContextDevice2D::DrawQuadStrip ( float * points,
int n )
overridevirtual

Draw a quad strip using a sequence of points.

Reimplemented from vtkContextDevice2D.

◆ DrawPolygon()

void vtkWebGPUContextDevice2D::DrawPolygon ( float * points,
int n )
overridevirtual

Draw a filled convex polygon defined by points.

Reimplemented from vtkContextDevice2D.

◆ DrawColoredPolygon()

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

Draw a filled polygon with optional per-vertex or per-polygon colors.

Reimplemented from vtkContextDevice2D.

◆ DrawEllipseWedge()

void vtkWebGPUContextDevice2D::DrawEllipseWedge ( float x,
float y,
float outRx,
float outRy,
float inRx,
float inRy,
float startAngle,
float stopAngle )
overridevirtual

Draw an elliptical wedge (pie slice) defined by radii and angles.

Implements vtkContextDevice2D.

◆ DrawEllipticArc()

void vtkWebGPUContextDevice2D::DrawEllipticArc ( float x,
float y,
float rX,
float rY,
float startAngle,
float stopAngle )
overridevirtual

Draw an open elliptical arc line segment.

Implements vtkContextDevice2D.

◆ DrawString()

void vtkWebGPUContextDevice2D::DrawString ( float * point,
const vtkStdString & string )
overridevirtual

Render a text string at the specified world coordinate point.

Implements vtkContextDevice2D.

◆ ComputeStringBounds()

void vtkWebGPUContextDevice2D::ComputeStringBounds ( const vtkStdString & string,
float bounds[4] )
overridevirtual

Compute the bounding box dimensions for a given text string.

Implements vtkContextDevice2D.

◆ ComputeJustifiedStringBounds()

void vtkWebGPUContextDevice2D::ComputeJustifiedStringBounds ( const char * string,
float bounds[4] )
overridevirtual

Compute justified bounding box dimensions for a C-style string.

Implements vtkContextDevice2D.

◆ DrawMathTextString()

void vtkWebGPUContextDevice2D::DrawMathTextString ( float point[2],
const vtkStdString & string )
override

Render a math equation string (MathText format) at the given point.

◆ DrawImage() [1/2]

void vtkWebGPUContextDevice2D::DrawImage ( float p[2],
float scale,
vtkImageData * image )
overridevirtual

Render an image data object scaled and positioned at a given point.

Implements vtkContextDevice2D.

◆ DrawImage() [2/2]

void vtkWebGPUContextDevice2D::DrawImage ( const vtkRectf & pos,
vtkImageData * image )
overridevirtual

Render an image data object within a specified 2D rectangle.

Implements vtkContextDevice2D.

◆ DrawPolyData()

void vtkWebGPUContextDevice2D::DrawPolyData ( float p[2],
float scale,
vtkPolyData * polyData,
vtkUnsignedCharArray * colors,
int scalarMode )
overridevirtual

Render a vtkPolyData geometry mesh (lines and polygons) with offset and scale.

Reimplemented from vtkContextDevice2D.

◆ SetColor4()

void vtkWebGPUContextDevice2D::SetColor4 ( unsigned char color[4])
overridevirtual

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

Implements vtkContextDevice2D.

◆ SetColor()

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

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

◆ SetTexture()

void vtkWebGPUContextDevice2D::SetTexture ( vtkImageData * image,
int properties = 0 )
overridevirtual

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

Implements vtkContextDevice2D.

◆ SetPointSize()

void vtkWebGPUContextDevice2D::SetPointSize ( float size)
overridevirtual

Set the point size for glyphs/sprites.

Implements vtkContextDevice2D.

◆ SetLineWidth()

void vtkWebGPUContextDevice2D::SetLineWidth ( float width)
overridevirtual

Set the line width for glyphs/sprites.

Implements vtkContextDevice2D.

◆ SetLineType()

void vtkWebGPUContextDevice2D::SetLineType ( int type)
overridevirtual

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

Implements vtkContextDevice2D.

◆ SetClipping()

void vtkWebGPUContextDevice2D::SetClipping ( int * x)
overridevirtual

Set the clipping rectangle for the 2D context.

This function defines the boundaries for a scissor/clipping box. Any rendering performed while clipping is enabled will be restricted to this rectangle.

Implements vtkContextDevice2D.

◆ EnableClipping()

void vtkWebGPUContextDevice2D::EnableClipping ( bool enable)
overridevirtual

Enable or disable clipping.

When enabled, subsequent 2D rendering primitives will be clipped to the bounds specified by SetClipping().

Implements vtkContextDevice2D.

◆ MultiplyMatrix()

void vtkWebGPUContextDevice2D::MultiplyMatrix ( vtkMatrix3x3 * m)
overridevirtual

Multiply the current model view matrix by the supplied one.

Implements vtkContextDevice2D.

◆ SetMatrix()

void vtkWebGPUContextDevice2D::SetMatrix ( vtkMatrix3x3 * m)
overridevirtual

Set the model view matrix for the display.

Implements vtkContextDevice2D.

◆ GetMatrix()

void vtkWebGPUContextDevice2D::GetMatrix ( vtkMatrix3x3 * m)
overridevirtual

Set the model view matrix for the display.

Implements vtkContextDevice2D.

◆ PushMatrix()

void vtkWebGPUContextDevice2D::PushMatrix ( )
overridevirtual

Push the current matrix onto the stack.

Implements vtkContextDevice2D.

◆ PopMatrix()

void vtkWebGPUContextDevice2D::PopMatrix ( )
overridevirtual

Pop the current matrix off of the stack.

Implements vtkContextDevice2D.

◆ ReleaseGraphicsResources()

virtual void vtkWebGPUContextDevice2D::ReleaseGraphicsResources ( vtkWindow * )
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.

Member Data Documentation

◆ Renderer

vtkRenderer* vtkWebGPUContextDevice2D::Renderer = nullptr
protected

Definition at line 275 of file vtkWebGPUContextDevice2D.h.

◆ RenderWindow

vtkWebGPURenderWindow* vtkWebGPUContextDevice2D::RenderWindow = nullptr
protected

Definition at line 276 of file vtkWebGPUContextDevice2D.h.

◆ Storage

Private* vtkWebGPUContextDevice2D::Storage
protected

Definition at line 279 of file vtkWebGPUContextDevice2D.h.

◆ ProjectionMatrix

vtkTransform* vtkWebGPUContextDevice2D::ProjectionMatrix
protected

Definition at line 281 of file vtkWebGPUContextDevice2D.h.

◆ ModelMatrix

vtkTransform* vtkWebGPUContextDevice2D::ModelMatrix
protected

Definition at line 282 of file vtkWebGPUContextDevice2D.h.

◆ InRender

bool vtkWebGPUContextDevice2D::InRender = false
protected

Definition at line 284 of file vtkWebGPUContextDevice2D.h.


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