VTK  9.3.1
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 
26 VTK_ABI_NAMESPACE_BEGIN
27 class vtkMatrix4x4;
28 class vtkViewport;
29 class vtkPen;
30 class vtkBrush;
31 class vtkPoints;
33 
34 class VTKRENDERINGCONTEXT2D_EXPORT vtkContextDevice3D : public vtkObject
35 {
36 public:
37  vtkTypeMacro(vtkContextDevice3D, vtkObject);
38  void PrintSelf(ostream& os, vtkIndent indent) override;
39 
40  static vtkContextDevice3D* New();
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 
142 protected:
144  ~vtkContextDevice3D() override;
145 
146 private:
147  vtkContextDevice3D(const vtkContextDevice3D&) = delete;
148  void operator=(const vtkContextDevice3D&) = delete;
149 };
150 
151 VTK_ABI_NAMESPACE_END
152 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:51
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:30
Abstract class for drawing 3D primitives.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
abstract specification for Viewports
Definition: vtkViewport.h:44
virtual void DisableClipping()
Disable clipping of the display.
provides a brush that fills shapes drawn by vtkContext2D.
Definition: vtkBrush.h:29
a simple class to control print indentation
Definition: vtkIndent.h:28
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:44
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition: vtkPen.h:28
virtual void ReleaseCache(std::uintptr_t vtkNotUsed(cacheIdentifier))
Concrete graphics implementations maintain a cache of heavy-weight buffer objects to achieve higher i...
dynamic, self-adjusting array of unsigned char
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
represent and manipulate 3D points
Definition: vtkPoints.h:28