VTK  9.5.20250718
vtkContextDevice3D.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
3
16#ifndef vtkContextDevice3D_h
17#define vtkContextDevice3D_h
18
19#include "vtkObject.h"
20#include "vtkRect.h" // For the rectangles..
21#include "vtkRenderingContext2DModule.h" // For export macro
22#include "vtkVector.h" // For the vector coordinates.
23
24#include <cstdint> // For std::uintptr_t
25
26VTK_ABI_NAMESPACE_BEGIN
27class vtkMatrix4x4;
28class vtkViewport;
29class vtkPen;
30class vtkBrush;
31class vtkPoints;
33
34class VTKRENDERINGCONTEXT2D_EXPORT vtkContextDevice3D : public vtkObject
35{
36public:
38 void PrintSelf(ostream& os, vtkIndent indent) override;
39
41
46 virtual void DrawPoly(
47 const float* verts, int n, const unsigned char* colors = nullptr, int nc = 0) = 0;
48
53 virtual void DrawLines(
54 const float* verts, int n, const unsigned char* colors = nullptr, int nc = 0) = 0;
55
59 virtual void DrawPoints(
60 const float* verts, int n, const unsigned char* colors = nullptr, int nc = 0) = 0;
61 virtual void DrawPoints(vtkDataArray* positions, vtkUnsignedCharArray* colors,
62 std::uintptr_t vtkNotUsed(cacheIdentifier));
63
67 virtual void DrawTriangleMesh(const float* mesh, int n, const unsigned char* colors, int nc) = 0;
68 virtual void DrawTriangleMesh(vtkDataArray* positions, vtkUnsignedCharArray* colors,
69 std::uintptr_t vtkNotUsed(cacheIdentifier));
70
76 virtual void ApplyPen(vtkPen* pen) = 0;
77
83 virtual void ApplyBrush(vtkBrush* brush) = 0;
84
88 virtual void SetMatrix(vtkMatrix4x4* m) = 0;
89
93 virtual void GetMatrix(vtkMatrix4x4* m) = 0;
94
98 virtual void MultiplyMatrix(vtkMatrix4x4* m) = 0;
99
103 virtual void PushMatrix() = 0;
104
108 virtual void PopMatrix() = 0;
109
114 virtual void SetClipping(const vtkRecti& rect) = 0;
115
120 virtual void DisableClipping() { this->EnableClipping(false); }
121
125 virtual void EnableClipping(bool enable) = 0;
126
128
131 virtual void EnableClippingPlane(int i, double* planeEquation) = 0;
132 virtual void DisableClippingPlane(int i) = 0;
134
140 virtual void ReleaseCache(std::uintptr_t vtkNotUsed(cacheIdentifier)) {}
141
142protected:
145
146private:
147 vtkContextDevice3D(const vtkContextDevice3D&) = delete;
148 void operator=(const vtkContextDevice3D&) = delete;
149};
150
151VTK_ABI_NAMESPACE_END
152#endif
provides a brush that fills shapes drawn by vtkContext2D.
Definition vtkBrush.h:90
Abstract class for drawing 3D primitives.
static vtkContextDevice3D * New()
virtual void ReleaseCache(std::uintptr_t cacheIdentifier)
Concrete graphics implementations maintain a cache of heavy-weight buffer objects to achieve higher i...
virtual void GetMatrix(vtkMatrix4x4 *m)=0
Set the model view matrix for the display.
virtual void PushMatrix()=0
Push the current matrix onto the stack.
virtual void EnableClipping(bool enable)=0
Enable or disable the clipping of the scene.
virtual void SetMatrix(vtkMatrix4x4 *m)=0
Set the model view matrix for the display.
virtual void ApplyBrush(vtkBrush *brush)=0
Apply the supplied brush which controls the outlines of shapes, as well as lines, points and related ...
virtual void SetClipping(const vtkRecti &rect)=0
Supply a float array of length 4 with x1, y1, width, height specifying clipping region for the device...
virtual void DrawPoly(const float *verts, int n, const unsigned char *colors=nullptr, int nc=0)=0
Draw a polyline between the specified points.
virtual void PopMatrix()=0
Pop the current matrix off of the stack.
virtual void DisableClippingPlane(int i)=0
Enable/Disable the specified clipping plane.
virtual void MultiplyMatrix(vtkMatrix4x4 *m)=0
Multiply the current model view matrix by the supplied one.
virtual void DrawTriangleMesh(const float *mesh, int n, const unsigned char *colors, int nc)=0
Draw triangles to generate the specified mesh.
virtual void ApplyPen(vtkPen *pen)=0
Apply the supplied pen which controls the outlines of shapes, as well as lines, points and related pr...
virtual void DrawPoints(vtkDataArray *positions, vtkUnsignedCharArray *colors, std::uintptr_t cacheIdentifier)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void DisableClipping()
Disable clipping of the display.
virtual void EnableClippingPlane(int i, double *planeEquation)=0
Enable/Disable the specified clipping plane.
virtual void DrawTriangleMesh(vtkDataArray *positions, vtkUnsignedCharArray *colors, std::uintptr_t cacheIdentifier)
~vtkContextDevice3D() override
virtual void DrawLines(const float *verts, int n, const unsigned char *colors=nullptr, int nc=0)=0
Draw lines defined by specified pair of points.
virtual void DrawPoints(const float *verts, int n, const unsigned char *colors=nullptr, int nc=0)=0
Draw points at the vertex positions specified.
abstract superclass for arrays of numeric data
a simple class to control print indentation
Definition vtkIndent.h:108
represent and manipulate 4x4 transformation matrices
abstract base class for most VTK objects
Definition vtkObject.h:162
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition vtkPen.h:79
represent and manipulate 3D points
Definition vtkPoints.h:139
dynamic, self-adjusting array of unsigned char
abstract specification for Viewports
Definition vtkViewport.h:66