VTK
9.4.20241220
|
Class for drawing 2D primitives to a graphical context. More...
#include <vtkContext2D.h>
Public Types | |
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. | |
vtkContext2D * | NewInstance () const |
void | PrintSelf (ostream &os, vtkIndent indent) override |
Methods invoked by print to print information about the object including superclasses. | |
bool | Begin (vtkContextDevice2D *device) |
Begin painting on a vtkContextDevice2D, no painting can occur before this call has been made. | |
virtual vtkContextDevice2D * | GetDevice () |
bool | End () |
Ends painting on the device, you would not usually need to call this as it should be called by the destructor. | |
bool | GetBufferIdMode () const |
Tell if the context is in BufferId creation mode. | |
void | BufferIdModeBegin (vtkAbstractContextBufferId *bufferId) |
Start BufferId creation Mode. | |
void | BufferIdModeEnd () |
Finalize BufferId creation Mode. | |
void | DrawLine (float x1, float y1, float x2, float y2) |
Draw a line between the specified points. | |
void | DrawLine (float p[4]) |
Draw a line between the specified points. | |
void | DrawLine (vtkPoints2D *points) |
Draw a line between the specified points. | |
void | DrawPoly (float *x, float *y, int n) |
Draw a poly line between the specified points. | |
void | DrawPoly (vtkPoints2D *points) |
Draw a poly line between the specified points - fastest code path due to memory layout of the coordinates. | |
void | DrawPoly (float *points, int n) |
Draw a poly line between the specified points, where the float array is of size 2*n and the points are packed x1, y1, x2, y2 etc. | |
void | DrawPoly (float *points, int n, unsigned char *colors, int nc_comps) |
Draw a poly line between the specified points, where the float array is of size 2*n and the points are packed x1, y1, x2, y2 etc. | |
void | DrawLines (vtkPoints2D *points) |
Draw multiple lines between the specified pairs of points. | |
void | DrawLines (float *points, int n) |
Draw multiple lines between the specified pairs of points. | |
void | DrawPoint (float x, float y) |
Draw a point at the supplied x and y coordinate. | |
void | DrawPoints (float *x, float *y, int n) |
Draw the specified number of points using the x and y arrays supplied. | |
void | DrawPoints (vtkPoints2D *points) |
Draw a poly line between the specified points - fastest code path due to memory layout of the coordinates. | |
void | DrawPoints (vtkDataArray *positions, vtkUnsignedCharArray *colors, std::uintptr_t cacheIdentifier) |
void | DrawPoints (float *points, int n) |
Draw a poly line between the specified points, where the float array is of size 2*n and the points are packed x1, y1, x2, y2 etc. | |
void | DrawPointSprites (vtkImageData *sprite, vtkPoints2D *points) |
Draw a series of point sprites, images centred at the points supplied. | |
void | DrawPointSprites (vtkImageData *sprite, float *points, int n) |
Draw a series of point sprites, images centred at the points supplied. | |
virtual void | DrawMarkers (int shape, bool highlight, vtkDataArray *positions, vtkUnsignedCharArray *colors, std::uintptr_t cacheIdentifier) |
Cached draw command for markers. | |
void | DrawRect (float x, float y, float w, float h) |
Draw a rectangle with origin at x, y and width w, height h. | |
void | DrawPolygon (float *x, float *y, int n) |
Draw a polygon specified specified by the points using the x and y arrays supplied. | |
void | DrawPolygon (vtkPoints2D *points) |
Draw a polygon defined by the specified points - fastest code path due to memory layout of the coordinates. | |
void | DrawPolygon (float *points, int n) |
Draw a polygon defined by the specified points, where the float array is of size 2*n and the points are packed x1, y1, x2, y2 etc. | |
void | DrawPolygon (float *x, float *y, int n, unsigned char *color, int nc_comps) |
Draw a polygon specified specified by the points using the x and y arrays supplied. | |
void | DrawPolygon (vtkPoints2D *points, unsigned char *color, int nc_comps) |
Draw a polygon defined by the specified points - fastest code path due to memory layout of the coordinates. | |
void | DrawPolygon (float *points, int n, unsigned char *color, int nc_comps) |
Draw a polygon defined by the specified points, where the float array is of size 2*n and the points are packed x1, y1, x2, y2 etc. | |
void | DrawEllipse (float x, float y, float rx, float ry) |
Draw an ellipse with center at x, y and radii rx, ry. | |
void | DrawWedge (float x, float y, float outRadius, float inRadius, float startAngle, float stopAngle) |
Draw a circular wedge with center at x, y, outer radius outRadius, inner radius inRadius between angles startAngle and stopAngle (expressed in degrees). | |
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). | |
void | DrawArc (float x, float y, float r, float startAngle, float stopAngle) |
Draw a circular arc with center at x,y with radius r between angles startAngle and stopAngle (expressed in degrees). | |
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). | |
void | DrawImage (float x, float y, vtkImageData *image) |
Draw the supplied image at the given x, y location (bottom corner). | |
void | DrawImage (float x, float y, float scale, vtkImageData *image) |
Draw the supplied image at the given x, y location (bottom corner). | |
void | DrawImage (const vtkRectf &pos, vtkImageData *image) |
Draw the supplied image at the given position. | |
void | DrawPolyData (float x, float y, vtkPolyData *polyData, vtkUnsignedCharArray *colors, int scalarMode) |
Draw the supplied polyData at the given x, y position (bottom corner). | |
void | ComputeJustifiedStringBounds (const char *string, float bounds[4]) |
Compute the bounds of the supplied string while taking into account the justification and rotation of the currently applied text property. | |
int | ComputeFontSizeForBoundedString (const vtkStdString &string, float width, float height) |
Calculate the largest possible font size where the supplied string will fit within the specified bounds. | |
bool | MathTextIsSupported () |
Return true if MathText rendering available on the current device. | |
void | ApplyPen (vtkPen *pen) |
Apply the supplied pen which controls the outlines of shapes, as well as lines, points and related primitives. | |
vtkPen * | GetPen () |
Get the pen which controls the outlines of shapes, as well as lines, points and related primitives. | |
void | ApplyBrush (vtkBrush *brush) |
Apply the supplied brush which controls the outlines of shapes, as well as lines, points and related primitives. | |
vtkBrush * | GetBrush () |
Get the pen which controls the outlines of shapes as well as lines, points and related primitives. | |
void | ApplyTextProp (vtkTextProperty *prop) |
Apply the supplied text property which controls how text is rendered. | |
vtkTextProperty * | GetTextProp () |
Get the text properties object for the vtkContext2D. | |
void | SetTransform (vtkTransform2D *transform) |
Set the transform for the context, the underlying device will use the matrix of the transform. | |
vtkTransform2D * | GetTransform () |
Compute the current transform applied to the context. | |
void | AppendTransform (vtkTransform2D *transform) |
Append the transform for the context, the underlying device will use the matrix of the transform. | |
void | ApplyId (vtkIdType id) |
Apply id as a color. | |
void | DrawPointSprites (vtkImageData *sprite, vtkPoints2D *points, vtkUnsignedCharArray *colors) |
Draw a series of point sprites, images centred at the points supplied. | |
void | DrawPointSprites (vtkImageData *sprite, float *points, int n, unsigned char *colors, int nc_comps) |
Draw a series of point sprites, images centred at the points supplied. | |
void | DrawPointSprites (vtkImageData *sprite, vtkDataArray *positions, vtkUnsignedCharArray *colors, std::uintptr_t cacheIdentifier) |
Draw a series of point sprites, images centred at the points supplied. | |
virtual void | DrawMarkers (int shape, bool highlight, float *points, int n, unsigned char *colors, int nc_comps) |
Draw a series of markers centered at the points supplied. | |
virtual void | DrawMarkers (int shape, bool highlight, float *points, int n) |
Draw a series of markers centered at the points supplied. | |
virtual void | DrawMarkers (int shape, bool highlight, vtkPoints2D *points) |
Draw a series of markers centered at the points supplied. | |
virtual void | DrawMarkers (int shape, bool highlight, vtkPoints2D *points, vtkUnsignedCharArray *colors) |
Draw a series of markers centered at the points supplied. | |
void | DrawQuad (float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4) |
Draw a quadrilateral at the specified points (4 points, 8 floats in x, y). | |
void | DrawQuad (float *p) |
Draw a quadrilateral at the specified points (4 points, 8 floats in x, y). | |
void | DrawQuadStrip (vtkPoints2D *points) |
Draw a strip of quads. | |
void | DrawQuadStrip (float *p, int n) |
Draw a strip of quads. | |
void | DrawStringRect (vtkPoints2D *rect, const vtkStdString &string) |
Draw some text to the screen in a bounding rectangle with the alignment of the text properties respecting the rectangle. | |
void | DrawStringRect (vtkPoints2D *rect, const char *string) |
Draw some text to the screen in a bounding rectangle with the alignment of the text properties respecting the rectangle. | |
void | DrawStringRect (const float rect[4], const vtkStdString &string) |
Draw some text to the screen in a bounding rectangle with the alignment of the text properties respecting the rectangle. | |
void | DrawStringRect (const float rect[4], const char *string) |
Draw some text to the screen in a bounding rectangle with the alignment of the text properties respecting the rectangle. | |
void | DrawString (vtkPoints2D *point, const vtkStdString &string) |
Draw some text to the screen. | |
void | DrawString (float x, float y, const vtkStdString &string) |
Draw some text to the screen. | |
void | DrawString (vtkPoints2D *point, const char *string) |
Draw some text to the screen. | |
void | DrawString (float x, float y, const char *string) |
Draw some text to the screen. | |
void | ComputeStringBounds (const vtkStdString &string, vtkPoints2D *bounds) |
Compute the bounds of the supplied string. | |
void | ComputeStringBounds (const vtkStdString &string, float bounds[4]) |
Compute the bounds of the supplied string. | |
void | ComputeStringBounds (const char *string, vtkPoints2D *bounds) |
Compute the bounds of the supplied string. | |
void | ComputeStringBounds (const char *string, float bounds[4]) |
Compute the bounds of the supplied string. | |
void | DrawMathTextString (vtkPoints2D *point, const vtkStdString &string) |
Draw a MathText formatted equation to the screen. | |
void | DrawMathTextString (float x, float y, const vtkStdString &string) |
Draw a MathText formatted equation to the screen. | |
void | DrawMathTextString (vtkPoints2D *point, const char *string) |
Draw a MathText formatted equation to the screen. | |
void | DrawMathTextString (float x, float y, const char *string) |
Draw a MathText formatted equation to the screen. | |
void | DrawMathTextString (vtkPoints2D *point, const vtkStdString &string, const vtkStdString &fallback) |
Draw a MathText formatted equation to the screen. | |
void | DrawMathTextString (float x, float y, const vtkStdString &string, const vtkStdString &fallback) |
Draw a MathText formatted equation to the screen. | |
void | DrawMathTextString (vtkPoints2D *point, const char *string, const char *fallback) |
Draw a MathText formatted equation to the screen. | |
void | DrawMathTextString (float x, float y, const char *string, const char *fallback) |
Draw a MathText formatted equation to the screen. | |
void | PushMatrix () |
Push/pop the transformation matrix for the painter (sets the underlying matrix for the device when available). | |
void | PopMatrix () |
Push/pop the transformation matrix for the painter (sets the underlying matrix for the device when available). | |
virtual vtkContext3D * | GetContext3D () |
Get the vtkContext3D device, in order to do some 3D rendering. | |
virtual void | SetContext3D (vtkContext3D *context) |
Get the vtkContext3D device, in order to do some 3D rendering. | |
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. | |
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 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 vtkContext2D * | SafeDownCast (vtkObjectBase *o) |
static vtkContext2D * | New () |
Creates a 2D Painter object. | |
static int | FloatToInt (float x) |
Float to int conversion, performs truncation but with a rounding tolerance for float values that are within 1/256 of their closest integer. | |
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 |
vtkContext2D () | |
~vtkContext2D () 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 | |
vtkContextDevice2D * | Device |
vtkTransform2D * | Transform |
vtkAbstractContextBufferId * | BufferId |
vtkContext3D * | Context3D |
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 () |
Class for drawing 2D primitives to a graphical context.
This defines the interface for drawing onto a 2D context. The context must be set up with a vtkContextDevice2D derived class that provides the functions to facilitate the low level calls to the context. Currently only an OpenGL based device is provided, but this could be extended in the future.
Definition at line 68 of file vtkContext2D.h.
typedef vtkObject vtkContext2D::Superclass |
Definition at line 71 of file vtkContext2D.h.
|
protected |
|
overrideprotected |
|
static |
|
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.
|
static |
|
protectedvirtual |
vtkContext2D * vtkContext2D::NewInstance | ( | ) | const |
|
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.
|
static |
Creates a 2D Painter object.
bool vtkContext2D::Begin | ( | vtkContextDevice2D * | device | ) |
Begin painting on a vtkContextDevice2D, no painting can occur before this call has been made.
Only one painter is allowed at a time on any given paint device. Returns true if successful, otherwise false.
|
virtual |
bool vtkContext2D::End | ( | ) |
Ends painting on the device, you would not usually need to call this as it should be called by the destructor.
Returns true if the painter is no longer active, otherwise false.
bool vtkContext2D::GetBufferIdMode | ( | ) | const |
Tell if the context is in BufferId creation mode.
Initial value is false.
void vtkContext2D::BufferIdModeBegin | ( | vtkAbstractContextBufferId * | bufferId | ) |
Start BufferId creation Mode.
void vtkContext2D::BufferIdModeEnd | ( | ) |
Finalize BufferId creation Mode.
It makes sure that the content of the bufferId passed in argument of BufferIdModeBegin() is correctly set.
void vtkContext2D::DrawLine | ( | float | x1, |
float | y1, | ||
float | x2, | ||
float | y2 | ||
) |
Draw a line between the specified points.
void vtkContext2D::DrawLine | ( | float | p[4] | ) |
Draw a line between the specified points.
void vtkContext2D::DrawLine | ( | vtkPoints2D * | points | ) |
Draw a line between the specified points.
Note: Fastest path - points packed in x and y.
void vtkContext2D::DrawPoly | ( | float * | x, |
float * | y, | ||
int | n | ||
) |
Draw a poly line between the specified points.
void vtkContext2D::DrawPoly | ( | vtkPoints2D * | points | ) |
Draw a poly line between the specified points - fastest code path due to memory layout of the coordinates.
void vtkContext2D::DrawPoly | ( | float * | points, |
int | n | ||
) |
Draw a poly line between the specified points, where the float array is of size 2*n and the points are packed x1, y1, x2, y2 etc.
Note: Fastest code path - points packed in x and y.
void vtkContext2D::DrawPoly | ( | float * | points, |
int | n, | ||
unsigned char * | colors, | ||
int | nc_comps | ||
) |
Draw a poly line between the specified points, where the float array is of size 2*n and the points are packed x1, y1, x2, y2 etc.
The line will be colored by the colors array, which must have nc_comps components (defining a single color). Note: Fastest code path - points packed in x and y.
void vtkContext2D::DrawLines | ( | vtkPoints2D * | points | ) |
Draw multiple lines between the specified pairs of points.
void vtkContext2D::DrawLines | ( | float * | points, |
int | n | ||
) |
Draw multiple lines between the specified pairs of points.
void vtkContext2D::DrawPoint | ( | float | x, |
float | y | ||
) |
Draw a point at the supplied x and y coordinate.
void vtkContext2D::DrawPoints | ( | float * | x, |
float * | y, | ||
int | n | ||
) |
Draw the specified number of points using the x and y arrays supplied.
void vtkContext2D::DrawPoints | ( | vtkPoints2D * | points | ) |
Draw a poly line between the specified points - fastest code path due to memory layout of the coordinates.
void vtkContext2D::DrawPoints | ( | vtkDataArray * | positions, |
vtkUnsignedCharArray * | colors, | ||
std::uintptr_t | cacheIdentifier | ||
) |
void vtkContext2D::DrawPoints | ( | float * | points, |
int | n | ||
) |
Draw a poly line between the specified points, where the float array is of size 2*n and the points are packed x1, y1, x2, y2 etc.
Note: Fastest code path - points packed in x and y.
void vtkContext2D::DrawPointSprites | ( | vtkImageData * | sprite, |
vtkPoints2D * | points | ||
) |
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.
void vtkContext2D::DrawPointSprites | ( | vtkImageData * | sprite, |
vtkPoints2D * | points, | ||
vtkUnsignedCharArray * | colors | ||
) |
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 will be colored by the colors array, which must be the same length as points.
void vtkContext2D::DrawPointSprites | ( | vtkImageData * | sprite, |
float * | points, | ||
int | n, | ||
unsigned char * | colors, | ||
int | nc_comps | ||
) |
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 will be colored by the colors array, which must be the same length as points.
void vtkContext2D::DrawPointSprites | ( | vtkImageData * | sprite, |
vtkDataArray * | positions, | ||
vtkUnsignedCharArray * | colors, | ||
std::uintptr_t | cacheIdentifier | ||
) |
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 will be colored by the colors array, which must be the same length as points.
void vtkContext2D::DrawPointSprites | ( | vtkImageData * | sprite, |
float * | points, | ||
int | n | ||
) |
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.
|
virtual |
Draw a series of markers centered at the points supplied.
The shape argument controls the marker shape, and can be one of
shape | the shape of the marker |
highlight | whether to highlight the marker or not |
points | where to draw the markers |
n | number of points |
colors | is an optional array of colors. |
nc_comps | is the number of components for the color. |
|
virtual |
Draw a series of markers centered at the points supplied.
The shape argument controls the marker shape, and can be one of
shape | the shape of the marker |
highlight | whether to highlight the marker or not |
points | where to draw the markers |
n | number of points |
colors | is an optional array of colors. |
nc_comps | is the number of components for the color. |
|
virtual |
Draw a series of markers centered at the points supplied.
The shape argument controls the marker shape, and can be one of
shape | the shape of the marker |
highlight | whether to highlight the marker or not |
points | where to draw the markers |
n | number of points |
colors | is an optional array of colors. |
nc_comps | is the number of components for the color. |
|
virtual |
Draw a series of markers centered at the points supplied.
The shape argument controls the marker shape, and can be one of
shape | the shape of the marker |
highlight | whether to highlight the marker or not |
points | where to draw the markers |
n | number of points |
colors | is an optional array of colors. |
nc_comps | is the number of components for the color. |
|
virtual |
Cached draw command for markers.
VBOs are rebuilt if available.
void vtkContext2D::DrawRect | ( | float | x, |
float | y, | ||
float | w, | ||
float | h | ||
) |
Draw a rectangle with origin at x, y and width w, height h.
void vtkContext2D::DrawQuad | ( | float | x1, |
float | y1, | ||
float | x2, | ||
float | y2, | ||
float | x3, | ||
float | y3, | ||
float | x4, | ||
float | y4 | ||
) |
Draw a quadrilateral at the specified points (4 points, 8 floats in x, y).
void vtkContext2D::DrawQuad | ( | float * | p | ) |
Draw a quadrilateral at the specified points (4 points, 8 floats in x, y).
void vtkContext2D::DrawQuadStrip | ( | vtkPoints2D * | points | ) |
Draw a strip of quads.
void vtkContext2D::DrawQuadStrip | ( | float * | p, |
int | n | ||
) |
Draw a strip of quads.
void vtkContext2D::DrawPolygon | ( | float * | x, |
float * | y, | ||
int | n | ||
) |
Draw a polygon specified specified by the points using the x and y arrays supplied.
void vtkContext2D::DrawPolygon | ( | vtkPoints2D * | points | ) |
Draw a polygon defined by the specified points - fastest code path due to memory layout of the coordinates.
void vtkContext2D::DrawPolygon | ( | float * | points, |
int | n | ||
) |
Draw a polygon defined by the specified points, where the float array is of size 2*n and the points are packed x1, y1, x2, y2 etc.
Note: Fastest code path - points packed in x and y.
void vtkContext2D::DrawPolygon | ( | float * | x, |
float * | y, | ||
int | n, | ||
unsigned char * | color, | ||
int | nc_comps | ||
) |
Draw a polygon specified specified by the points using the x and y arrays supplied.
void vtkContext2D::DrawPolygon | ( | vtkPoints2D * | points, |
unsigned char * | color, | ||
int | nc_comps | ||
) |
Draw a polygon defined by the specified points - fastest code path due to memory layout of the coordinates.
void vtkContext2D::DrawPolygon | ( | float * | points, |
int | n, | ||
unsigned char * | color, | ||
int | nc_comps | ||
) |
Draw a polygon defined by the specified points, where the float array is of size 2*n and the points are packed x1, y1, x2, y2 etc.
Note: Fastest code path - points packed in x and y.
void vtkContext2D::DrawEllipse | ( | float | x, |
float | y, | ||
float | rx, | ||
float | ry | ||
) |
Draw an ellipse with center at x, y and radii rx, ry.
void vtkContext2D::DrawWedge | ( | float | x, |
float | y, | ||
float | outRadius, | ||
float | inRadius, | ||
float | startAngle, | ||
float | stopAngle | ||
) |
Draw a circular wedge with center at x, y, outer radius outRadius, inner radius inRadius between angles startAngle and stopAngle (expressed in degrees).
void vtkContext2D::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).
void vtkContext2D::DrawArc | ( | float | x, |
float | y, | ||
float | r, | ||
float | startAngle, | ||
float | stopAngle | ||
) |
Draw a circular arc with center at x,y with radius r between angles startAngle and stopAngle (expressed in degrees).
void vtkContext2D::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).
void vtkContext2D::DrawImage | ( | float | x, |
float | y, | ||
vtkImageData * | image | ||
) |
Draw the supplied image at the given x, y location (bottom corner).
void vtkContext2D::DrawImage | ( | float | x, |
float | y, | ||
float | scale, | ||
vtkImageData * | image | ||
) |
Draw the supplied image at the given x, y location (bottom corner).
Scale the supplied image by scale.
void vtkContext2D::DrawImage | ( | const vtkRectf & | pos, |
vtkImageData * | image | ||
) |
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.
void vtkContext2D::DrawPolyData | ( | float | x, |
float | y, | ||
vtkPolyData * | polyData, | ||
vtkUnsignedCharArray * | colors, | ||
int | scalarMode | ||
) |
Draw the supplied polyData at the given x, y position (bottom corner).
void vtkContext2D::DrawStringRect | ( | vtkPoints2D * | rect, |
const vtkStdString & | string | ||
) |
Draw some text to the screen in a bounding rectangle with the alignment of the text properties respecting the rectangle.
The points should be supplied as bottom corner (x, y), width, height.
void vtkContext2D::DrawStringRect | ( | vtkPoints2D * | rect, |
const char * | string | ||
) |
Draw some text to the screen in a bounding rectangle with the alignment of the text properties respecting the rectangle.
The points should be supplied as bottom corner (x, y), width, height.
void vtkContext2D::DrawStringRect | ( | const float | rect[4], |
const vtkStdString & | string | ||
) |
Draw some text to the screen in a bounding rectangle with the alignment of the text properties respecting the rectangle.
The points should be supplied as bottom corner (x, y), width, height.
void vtkContext2D::DrawStringRect | ( | const float | rect[4], |
const char * | string | ||
) |
Draw some text to the screen in a bounding rectangle with the alignment of the text properties respecting the rectangle.
The points should be supplied as bottom corner (x, y), width, height.
void vtkContext2D::DrawString | ( | vtkPoints2D * | point, |
const vtkStdString & | string | ||
) |
Draw some text to the screen.
void vtkContext2D::DrawString | ( | float | x, |
float | y, | ||
const vtkStdString & | string | ||
) |
Draw some text to the screen.
void vtkContext2D::DrawString | ( | vtkPoints2D * | point, |
const char * | string | ||
) |
Draw some text to the screen.
void vtkContext2D::DrawString | ( | float | x, |
float | y, | ||
const char * | string | ||
) |
Draw some text to the screen.
void vtkContext2D::ComputeStringBounds | ( | const vtkStdString & | string, |
vtkPoints2D * | bounds | ||
) |
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:the text justification from the current text property is NOT considered when computing these bounds.
void vtkContext2D::ComputeStringBounds | ( | const vtkStdString & | string, |
float | bounds[4] | ||
) |
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:the text justification from the current text property is NOT considered when computing these bounds.
void vtkContext2D::ComputeStringBounds | ( | const char * | string, |
vtkPoints2D * | bounds | ||
) |
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:the text justification from the current text property is NOT considered when computing these bounds.
void vtkContext2D::ComputeStringBounds | ( | const char * | string, |
float | bounds[4] | ||
) |
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:the text justification from the current text property is NOT considered when computing these bounds.
void vtkContext2D::ComputeJustifiedStringBounds | ( | const char * | string, |
float | bounds[4] | ||
) |
Compute the bounds of the supplied string while taking into account the justification and rotation of the currently applied text property.
int vtkContext2D::ComputeFontSizeForBoundedString | ( | const vtkStdString & | string, |
float | width, | ||
float | height | ||
) |
Calculate the largest possible font size where the supplied string will fit within the specified bounds.
In addition to being returned, this font size is also used to update the vtkTextProperty used by this object. NOTE: text rotation is ignored for the purposes of this function.
void vtkContext2D::DrawMathTextString | ( | vtkPoints2D * | point, |
const vtkStdString & | string | ||
) |
Draw a MathText formatted equation to the screen.
See http://matplotlib.sourceforge.net/users/mathtext.html for more information. MathText requires matplotlib and python, and the vtkMatplotlib module must be enabled manually during build configuration. This method will do nothing but print a warning if vtkMathTextUtilities::GetInstance() returns NULL.
void vtkContext2D::DrawMathTextString | ( | float | x, |
float | y, | ||
const vtkStdString & | string | ||
) |
Draw a MathText formatted equation to the screen.
See http://matplotlib.sourceforge.net/users/mathtext.html for more information. MathText requires matplotlib and python, and the vtkMatplotlib module must be enabled manually during build configuration. This method will do nothing but print a warning if vtkMathTextUtilities::GetInstance() returns NULL.
void vtkContext2D::DrawMathTextString | ( | vtkPoints2D * | point, |
const char * | string | ||
) |
Draw a MathText formatted equation to the screen.
See http://matplotlib.sourceforge.net/users/mathtext.html for more information. MathText requires matplotlib and python, and the vtkMatplotlib module must be enabled manually during build configuration. This method will do nothing but print a warning if vtkMathTextUtilities::GetInstance() returns NULL.
void vtkContext2D::DrawMathTextString | ( | float | x, |
float | y, | ||
const char * | string | ||
) |
Draw a MathText formatted equation to the screen.
See http://matplotlib.sourceforge.net/users/mathtext.html for more information. MathText requires matplotlib and python, and the vtkMatplotlib module must be enabled manually during build configuration. This method will do nothing but print a warning if vtkMathTextUtilities::GetInstance() returns NULL.
void vtkContext2D::DrawMathTextString | ( | vtkPoints2D * | point, |
const vtkStdString & | string, | ||
const vtkStdString & | fallback | ||
) |
Draw a MathText formatted equation to the screen.
See http://matplotlib.sourceforge.net/users/mathtext.html for more information. MathText requires matplotlib and python, and the vtkMatplotlib module must be enabled manually during build configuration. If MathText is not available on the target device the non-MathText string in "fallback" is rendered using DrawString.
void vtkContext2D::DrawMathTextString | ( | float | x, |
float | y, | ||
const vtkStdString & | string, | ||
const vtkStdString & | fallback | ||
) |
Draw a MathText formatted equation to the screen.
See http://matplotlib.sourceforge.net/users/mathtext.html for more information. MathText requires matplotlib and python, and the vtkMatplotlib module must be enabled manually during build configuration. If MathText is not available on the target device the non-MathText string in "fallback" is rendered using DrawString.
void vtkContext2D::DrawMathTextString | ( | vtkPoints2D * | point, |
const char * | string, | ||
const char * | fallback | ||
) |
Draw a MathText formatted equation to the screen.
See http://matplotlib.sourceforge.net/users/mathtext.html for more information. MathText requires matplotlib and python, and the vtkMatplotlib module must be enabled manually during build configuration. If MathText is not available on the target device the non-MathText string in "fallback" is rendered using DrawString.
void vtkContext2D::DrawMathTextString | ( | float | x, |
float | y, | ||
const char * | string, | ||
const char * | fallback | ||
) |
Draw a MathText formatted equation to the screen.
See http://matplotlib.sourceforge.net/users/mathtext.html for more information. MathText requires matplotlib and python, and the vtkMatplotlib module must be enabled manually during build configuration. If MathText is not available on the target device the non-MathText string in "fallback" is rendered using DrawString.
bool vtkContext2D::MathTextIsSupported | ( | ) |
Return true if MathText rendering available on the current device.
void vtkContext2D::ApplyPen | ( | vtkPen * | pen | ) |
Apply the supplied pen which controls the outlines of shapes, as well as lines, points and related primitives.
This makes a deep copy of the vtkPen object in the vtkContext2D, it does not hold a pointer to the supplied object.
vtkPen * vtkContext2D::GetPen | ( | ) |
Get the pen which controls the outlines of shapes, as well as lines, points and related primitives.
This object can be modified and the changes will be reflected in subsequent drawing operations.
void vtkContext2D::ApplyBrush | ( | vtkBrush * | brush | ) |
Apply the supplied brush which controls the outlines of shapes, as well as lines, points and related primitives.
This makes a deep copy of the vtkBrush object in the vtkContext2D, it does not hold a pointer to the supplied object.
vtkBrush * vtkContext2D::GetBrush | ( | ) |
Get the pen which controls the outlines of shapes as well as lines, points and related primitives.
void vtkContext2D::ApplyTextProp | ( | vtkTextProperty * | prop | ) |
Apply the supplied text property which controls how text is rendered.
This makes a deep copy of the vtkTextProperty object in the vtkContext2D, it does not hold a pointer to the supplied object.
vtkTextProperty * vtkContext2D::GetTextProp | ( | ) |
Get the text properties object for the vtkContext2D.
void vtkContext2D::SetTransform | ( | vtkTransform2D * | transform | ) |
Set the transform for the context, the underlying device will use the matrix of the transform.
Note, this is set immediately, later changes to the matrix will have no effect until it is set again.
vtkTransform2D * vtkContext2D::GetTransform | ( | ) |
Compute the current transform applied to the context.
void vtkContext2D::AppendTransform | ( | vtkTransform2D * | transform | ) |
Append the transform for the context, the underlying device will use the matrix of the transform.
Note, this is set immediately, later changes to the matrix will have no effect until it is set again. The matrix of the transform will multiply the current context transform.
void vtkContext2D::PushMatrix | ( | ) |
Push/pop the transformation matrix for the painter (sets the underlying matrix for the device when available).
void vtkContext2D::PopMatrix | ( | ) |
Push/pop the transformation matrix for the painter (sets the underlying matrix for the device when available).
void vtkContext2D::ApplyId | ( | vtkIdType | id | ) |
Apply id as a color.
|
inlinestatic |
Float to int conversion, performs truncation but with a rounding tolerance for float values that are within 1/256 of their closest integer.
Definition at line 593 of file vtkContext2D.h.
|
virtual |
Get the vtkContext3D device, in order to do some 3D rendering.
This API is very experimental, and may be moved around.
|
virtual |
Get the vtkContext3D device, in order to do some 3D rendering.
This API is very experimental, and may be moved around.
|
protected |
Definition at line 566 of file vtkContext2D.h.
|
protected |
Definition at line 567 of file vtkContext2D.h.
|
protected |
Definition at line 569 of file vtkContext2D.h.
|
protected |
Definition at line 570 of file vtkContext2D.h.