 |
VTK
9.0.1
|
Go to the documentation of this file.
30 #ifndef vtkOpenGLContextDevice2D_h
31 #define vtkOpenGLContextDevice2D_h
34 #include "vtkRenderingContextOpenGL2Module.h"
40 class vtkOpenGLExtensionManager;
67 void DrawPoly(
float* f,
int n,
unsigned char* colors =
nullptr,
int nc_comps = 0)
override;
75 void DrawLines(
float* f,
int n,
unsigned char* colors =
nullptr,
int nc_comps = 0)
override;
82 void DrawPoints(
float*
points,
int n,
unsigned char* colors =
nullptr,
int nc_comps = 0)
override;
91 int nc_comps = 0)
override;
104 void DrawMarkers(
int shape,
bool highlight,
float*
points,
int n,
unsigned char* colors =
nullptr,
105 int nc_comps = 0)
override;
113 vtkSetMacro(MaximumMarkerCacheSize,
int);
114 vtkGetMacro(MaximumMarkerCacheSize,
int);
132 float*
points,
int numPoints,
unsigned char* colors =
nullptr,
int nc_comps = 0)
override;
155 float x,
float y,
float rX,
float rY,
float startAngle,
float stopAngle)
override;
218 int scalarMode)
override;
410 vtkOpenGLHelper* cbo,
float* v,
int nv,
unsigned char* coolors,
int nc,
float* tcoords);
412 std::vector<float>& tverts,
unsigned char* colors =
nullptr,
int numComp = 0);
422 int shape,
bool highlight,
float*
points,
int n,
unsigned char* colors,
int nc_comps);
424 bool highlight,
float*
points,
int n,
unsigned char* colors,
int nc_comps);
426 bool highlight,
float*
points,
int n,
unsigned char* colors,
int nc_comps);
428 bool highlight,
float*
points,
int n,
unsigned char* colors,
int nc_comps);
430 bool highlight,
float*
points,
int n,
unsigned char* colors,
int nc_comps);
432 bool highlight,
float*
points,
int n,
unsigned char* colors,
int nc_comps);
449 void DrawWedgeGL2PS(
float x,
float y,
float outRx,
float outRy,
float inRx,
float inRy);
484 class vtkMarkerCacheObject
492 void ComputeStringBoundsInternal(
const vtkUnicodeString&
string,
float bounds[4]);
497 std::list<vtkMarkerCacheObject> MarkerCache;
498 int MaximumMarkerCacheSize;
507 #endif // vtkOpenGLContextDevice2D_h
void ReadyLinesCBOProgram()
void BufferIdModeEnd() override
Finalize BufferId creation Mode.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
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 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 DrawPolyData(float p[2], float scale, vtkPolyData *polyData, vtkUnsignedCharArray *colors, int scalarMode) override
Draw the supplied PolyData at the given x, y (p[0], p[1]) (bottom corner), scaled by scale (1....
vtkMatrix4x4 * GetModelMatrix()
CellArrayHelper * PolyDataImpl
unsigned short LinePattern
void DrawImage(float p[2], float scale, vtkImageData *image) override
Draw the supplied image at the given x, y (p[0], p[1]) (bottom corner), scaled by scale (1....
~vtkOpenGLContextDevice2D() override
void SetMatrix(vtkMatrix3x3 *m) override
Set the model view matrix for the display.
void EnableClipping(bool enable) override
Disable clipping of the display.
vtkOpenGLHelper * LinesCBO
void SetColor4(unsigned char color[4]) override
Set the color for the device using unsigned char of length 4, RGBA.
void DrawString(float *point, const vtkUnicodeString &string) override
Draw some text to the screen.
void DrawLines(float *f, 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...
void DrawPlusMarkersGL2PS(bool highlight, float *points, int n, unsigned char *colors, int nc_comps)
concrete dataset representing a path defined by Bezier curves.
dynamic, self-adjusting array of unsigned char
void CoreDrawTriangles(std::vector< float > &tverts, unsigned char *colors=nullptr, int numComp=0)
bool HasGLSL()
Check whether the current context device has support for GLSL.
void DrawCircleMarkersGL2PS(bool highlight, float *points, int n, unsigned char *colors, int nc_comps)
base class for classes that render supplied text to an image.
void DrawImageGL2PS(float p[2], vtkImageData *image)
Embed an RGBA image in the GL2PS output at the supplied point.
void PushMatrix() override
Push the current matrix onto the stack.
void PopMatrix() override
Pop the current matrix off of the stack.
int GetNumberOfArcIterations(float rX, float rY, float startAngle, float stopAngle)
Factorized code called by DrawEllipseWedge() and DrawEllipticArc() to figure out the number of iterat...
represent and manipulate 3x3 transformation matrices
void ComputeJustifiedStringBounds(const char *string, float bounds[4]) override
Compute the bounds of the supplied string while taking into account the justification of the currentl...
void DrawEllipseWedge(float x, float y, float outRx, float outRy, float inRx, float inRy, float startAngle, float stopAngle) override
Draw an elliptic wedge with center at x, y, outer radii outRx, outRy, inner radii inRx,...
window superclass for vtkRenderWindow
void DrawMathTextString(float point[2], const vtkStdString &string) override
Draw text using MathText markup for mathematical equations.
void BuildVBO(vtkOpenGLHelper *cbo, float *v, int nv, unsigned char *coolors, int nc, float *tcoords)
void DrawMarkersGL2PS(int shape, bool highlight, float *points, int n, unsigned char *colors, int nc_comps)
Draw the markers as paths/polydata instead of sprites for detailed GL2PS capture.
2D array of ids, used for picking.
void BufferIdModeBegin(vtkAbstractContextBufferId *bufferId) override
Start BufferId creation Mode.
void DrawImageGL2PS(float p[2], float scale, vtkImageData *image)
void DrawCircleGL2PS(float x, float y, float rX, float rY)
Inject smooth primitives into the GL2PS stream.
void DrawImageGL2PS(const vtkRectf &rect, vtkImageData *image)
vtkOpenGLContextDevice2D()
void DrawCrossMarkersGL2PS(bool highlight, float *points, int n, unsigned char *colors, int nc_comps)
void ComputeStringBounds(const vtkUnicodeString &string, float bounds[4]) override
Compute the bounds of the supplied string.
void DrawMarkers(int shape, bool highlight, float *points, int n, unsigned char *colors=nullptr, int nc_comps=0) override
Draw a series of markers centered at the points supplied.
Class for drawing 2D primitives using OpenGL 1.1+.
The ShaderProgram uses one or more Shader objects.
void SetMatrices(vtkShaderProgram *prog)
void SetTexture(vtkImageData *image, int properties=0) override
Set the texture for the device, it is used to fill the polygons.
topologically and geometrically regular array of data
a simple class to control print indentation
represent and manipulate 4x4 transformation matrices
String class that stores Unicode text.
void SetLineWidth(float width) override
Set the line width for glyphs/sprites.
bool SetStringRendererToQt()
Force the use of the Qt based string render strategy.
void ComputeStringBounds(const vtkStdString &string, float bounds[4]) override
Compute the bounds of the supplied string.
void DrawDiamondMarkersGL2PS(bool highlight, float *points, int n, unsigned char *colors, int nc_comps)
virtual void SetColor(unsigned char color[3])
Set the color for the device using unsigned char of length 3, RGB.
void Begin(vtkViewport *viewport) override
Begin drawing, pass in the viewport to set up the view.
void DrawPoly(float *f, 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 DrawQuadStrip(float *points, int n) override
Draws a rectangle.
VTKCOMMONCORE_EXPORT bool operator==(const vtkUnicodeString &lhs, const vtkUnicodeString &rhs)
abstract specification for Viewports
void MultiplyMatrix(vtkMatrix3x3 *m) override
Multiply the current model view matrix by the supplied one.
void SetLineType(int type) override
Set the line type type (using anonymous enum in vtkPen).
void GetMatrix(vtkMatrix3x3 *m) override
Set the model view matrix for the display.
Abstract class for drawing 2D primitives.
void DrawColoredPolygon(float *points, int numPoints, unsigned char *colors=nullptr, int nc_comps=0) override
Draw a polygon using the specified number of points.
void DrawImage(const vtkRectf &pos, vtkImageData *image) override
Draw the supplied image at the given position.
vtkRenderer * Renderer
We need to store a pointer to the renderer for the text rendering.
void SetPointSize(float size) override
Set the point size for glyphs/sprites.
void DrawWedgeGL2PS(float x, float y, float outRx, float outRy, float inRx, float inRy)
virtual void ReleaseGraphicsResources(vtkWindow *window)
Release any graphics resources that are being consumed by this device.
void TransformSize(float &dx, float &dy) const
Transform the width and height from pixels to data units.
bool SetStringRendererToFreeType()
Force the use of the freetype based render strategy.
vtkOpenGLHelper * LinesBO
void SetClipping(int *x) override
Supply an int array of length 4 with x1, y1, width, height specifying clipping region for the device ...
abstract specification for renderers
concrete dataset represents vertices, lines, polygons, and triangle strips
static vtkOpenGLContextDevice2D * New()
Creates a 2D Painter object.
void DrawSquareMarkersGL2PS(bool highlight, float *points, int n, unsigned char *colors, int nc_comps)
void DrawString(float *point, const vtkStdString &string) override
Draw some text to the screen!
void DrawEllipticArc(float x, float y, float rX, float rY, float startAngle, float stopAngle) override
Draw an elliptic arc with center at x,y with radii rX and rY between angles startAngle and stopAngle ...
bool InRender
Is the device currently rendering? Prevent multiple End() calls.
void DrawPolygon(float *, int) override
Draw a polygon using the specified number of points.
Wrapper around std::string to keep symbols short.
void AddEllipseToPath(vtkPath *path, float x, float y, float rx, float ry, bool reverse)
Add an ellipse to a vtkPath.
vtkOpenGLRenderWindow * RenderWindow
The OpenGL render window being used by the device.
void TransformPoint(float &x, float &y) const
Transform the 2D point using the current modelview matrix.
vtkMatrix4x4 * GetProjectionMatrix()
Get the projection matrix this is needed.
void TransformPath(vtkPath *path) const
Transform the path using the current modelview matrix.
void End() override
End drawing, clean up the view.
void DrawQuad(float *points, int n) override
Draws a rectangle.
void ReadyLinesBOProgram()