Go to the documentation of this file.
33 #ifndef vtkContext2D_h
34 #define vtkContext2D_h
36 #include "vtkRenderingContext2DModule.h"
108 void DrawLine(
float x1,
float y1,
float x2,
float y2);
146 unsigned char *colors,
int nc_comps);
200 unsigned char *colors,
int nc_comps);
224 unsigned char *colors,
int nc_comps);
240 void DrawQuad(
float x1,
float y1,
float x2,
float y2,
241 float x3,
float y3,
float x4,
float y4);
428 const char *fallback);
430 const char *fallback);
517 static int FloatToInt(
float x);
540 void operator=(const
vtkContext2D &) VTK_DELETE_FUNCTION;
570 float tol = 0.00390625;
571 tol = (x >= 0 ? tol : -tol);
572 return static_cast<int>(x + tol);
575 #endif //vtkContext2D_h
provides a brush that fills shapes drawn by vtkContext2D.
represent and manipulate 2D points
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 angl...
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 (express...
void DrawPolygon(vtkPoints2D *points)
Draw a polygon defined by the specified points - fastest code path due to memory layout of the coordi...
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 ar...
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 DrawMathTextString(vtkPoints2D *point, const vtkStdString &string, const vtkStdString &fallback)
Draw a MathText formatted equation to the screen.
void DrawLine(float x1, float y1, float x2, float y2)
Draw a line between the specified points.
void ComputeStringBounds(const vtkStdString &string, vtkPoints2D *bounds)
Compute the bounds of the supplied string.
void DrawStringRect(vtkPoints2D *rect, const vtkStdString &string)
Draw some text to the screen in a bounding rectangle with the alignment of the text properties respec...
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 a...
void ApplyPen(vtkPen *pen)
Apply the supplied pen which controls the outlines of shapes, as well as lines, points and related pr...
void DrawString(vtkPoints2D *point, const char *string)
static vtkContext2D * New()
Creates a 2D Painter object.
void DrawLines(vtkPoints2D *points)
Draw multiple lines between the specified pairs of points.
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 ar...
void DrawString(vtkPoints2D *point, const vtkUnicodeString &string)
virtual void DrawMarkers(int shape, bool highlight, vtkPoints2D *points)
dynamic, self-adjusting array of unsigned char
void DrawMathTextString(float x, float y, const vtkStdString &string, const vtkStdString &fallback)
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 ...
abstract base class for most VTK objects
int ComputeFontSizeForBoundedString(const vtkStdString &string, float width, float height)
Calculate the largest possible font size where the supplied string will fit within the specified boun...
void ApplyId(vtkIdType id)
Apply id as a color.
void DrawMathTextString(float x, float y, const char *string)
void DrawPoint(float x, float y)
Draw a point at the supplied x and y coordinate.
Class for drawing 2D primitives to a graphical context.
void ComputeStringBounds(const vtkUnicodeString &string, vtkPoints2D *bounds)
void ApplyBrush(vtkBrush *brush)
Apply the supplied brush which controls the outlines of shapes, as well as lines, points and related ...
bool MathTextIsSupported()
Return true if MathText rendering available on the current device.
void DrawLine(float p[4])
Draw a line between the specified points.
void SetTransform(vtkTransform2D *transform)
Set the transform for the context, the underlying device will use the matrix of the transform.
void ComputeStringBounds(const char *string, float bounds[4])
void DrawPoints(vtkPoints2D *points)
Draw a poly line between the specified points - fastest code path due to memory layout of the coordin...
void DrawStringRect(vtkPoints2D *rect, const char *string)
vtkTransform2D * GetTransform()
Compute the current transform applied to the context.
window superclass for vtkRenderWindow
bool Begin(vtkContextDevice2D *device)
Begin painting on a vtkContextDevice2D, no painting can occur before this call has been made.
void DrawMathTextString(float x, float y, const char *string, const char *fallback)
void DrawRect(float x, float y, float w, float h)
Draw a rectangle with origin at x, y and width w, height h.
2D array of ids, used for picking.
void DrawString(float x, float y, const vtkStdString &string)
void ComputeStringBounds(const vtkStdString &string, float bounds[4])
void DrawLine(vtkPoints2D *points)
Draw a line between the specified points.
void DrawQuadStrip(vtkPoints2D *points)
Draw a strip of quads.
void DrawLines(float *points, int n)
Draw multiple lines between the specified pairs of points.
virtual void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
void DrawPolygon(float *x, float *y, int n)
Draw a polygon specified specified by the points using the x and y arrays supplied.
void DrawPoints(float *x, float *y, int n)
Draw the specified number of points using the x and y arrays supplied.
void DrawPoly(vtkPoints2D *points)
Draw a poly line between the specified points - fastest code path due to memory layout of the coordin...
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,...
void DrawMathTextString(vtkPoints2D *point, const char *string, const char *fallback)
vtkTextProperty * GetTextProp()
Get the text properties object for the vtkContext2D.
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 ar...
void DrawString(float x, float y, const vtkUnicodeString &string)
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.
topologically and geometrically regular array of data
a simple class to control print indentation
String class that stores Unicode text.
void DrawString(vtkPoints2D *point, const vtkStdString &string)
Draw some text to the screen.
void AppendTransform(vtkTransform2D *transform)
Append the transform for the context, the underlying device will use the matrix of the transform.
virtual void DrawMarkers(int shape, bool highlight, float *points, int n)
virtual void DrawMarkers(int shape, bool highlight, vtkPoints2D *points, vtkUnsignedCharArray *colors)
void DrawImage(float x, float y, vtkImageData *image)
Draw the supplied image at the given x, y location (bottom corner).
void BufferIdModeEnd()
Finalize BufferId creation Mode.
void DrawMathTextString(float x, float y, const vtkStdString &string)
Abstract class for drawing 2D primitives.
represent text properties.
void DrawEllipse(float x, float y, float rx, float ry)
Draw an ellipse with center at x, y and radii rx, ry.
vtkBrush * GetBrush()
Get the pen which controls the outlines of shapes as well as lines, points and related primitives.
void ComputeJustifiedStringBounds(const char *string, float bounds[4])
Compute the bounds of the supplied string while taking into account the justification of the currentl...
vtkPen * GetPen()
Get the pen which controls the outlines of shapes, as well as lines, points and related primitives.
void DrawMathTextString(vtkPoints2D *point, const char *string)
void ComputeStringBounds(const char *string, vtkPoints2D *bounds)
void DrawPointSprites(vtkImageData *sprite, vtkPoints2D *points)
Draw a series of point sprites, images centred at the points supplied.
void DrawStringRect(vtkPoints2D *rect, const vtkUnicodeString &string)
void DrawString(float x, float y, const char *string)
Class for drawing 3D primitives to a graphical context.
void DrawMathTextString(vtkPoints2D *point, const vtkStdString &string)
Draw a MathText formatted equation to the screen.
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Wrapper around std::string to keep symbols short.
void ApplyTextProp(vtkTextProperty *prop)
Apply the supplied text property which controls how text is rendered.
void ComputeStringBounds(const vtkUnicodeString &string, float bounds[4])
void DrawPointSprites(vtkImageData *sprite, vtkPoints2D *points, vtkUnsignedCharArray *colors)
Draw a series of point sprites, images centred at the points supplied.
void DrawQuadStrip(float *p, int n)
void DrawPoly(float *x, float *y, int n)
Draw a poly line between the specified points.
void DrawImage(float x, float y, float scale, vtkImageData *image)
Draw the supplied image at the given x, y location (bottom corner).
bool GetBufferIdMode() const
Tell if the context is in BufferId creation mode.
void DrawPointSprites(vtkImageData *sprite, float *points, int n, unsigned char *colors, int nc_comps)
void DrawImage(const vtkRectf &pos, vtkImageData *image)
Draw the supplied image at the given position.
void DrawPointSprites(vtkImageData *sprite, float *points, int n)
Draw a series of point sprites, images centred at the points supplied.
void PushMatrix()
Push/pop the transformation matrix for the painter (sets the underlying matrix for the device when av...
bool End()
Ends painting on the device, you would not usually need to call this as it should be called by the de...
void BufferIdModeBegin(vtkAbstractContextBufferId *bufferId)
Start BufferId creation Mode.