VTK  9.2.6
vtkContext3D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkContext3D.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 
36 #ifndef vtkContext3D_h
37 #define vtkContext3D_h
38 
39 #include "vtkObject.h"
40 #include "vtkRenderingContext2DModule.h" // For export macro
41 #include "vtkSmartPointer.h" // For SP ivars.
42 #include "vtkVector.h" // For the vector coordinates.
43 
44 class vtkContextDevice3D;
45 class vtkPen;
46 class vtkBrush;
47 class vtkTransform;
48 
49 class VTKRENDERINGCONTEXT2D_EXPORT vtkContext3D : public vtkObject
50 {
51 public:
52  vtkTypeMacro(vtkContext3D, vtkObject);
53  void PrintSelf(ostream& os, vtkIndent indent) override;
54 
58  static vtkContext3D* New();
59 
65  bool Begin(vtkContextDevice3D* device);
66 
71 
77  bool End();
78 
82  void DrawLine(const vtkVector3f& start, const vtkVector3f& end);
83 
87  void DrawPoly(const float* points, int n);
88 
92  void DrawPoint(const vtkVector3f& point);
93 
97  void DrawPoints(const float* points, int n);
98 
104  void DrawPoints(const float* points, int n, unsigned char* colors, int nc_comps);
105 
109  void DrawTriangleMesh(const float* mesh, int n, const unsigned char* colors, int nc);
110 
116  void ApplyPen(vtkPen* pen);
117 
123  void ApplyBrush(vtkBrush* brush);
124 
130  void SetTransform(vtkTransform* transform);
131 
136 
143  void AppendTransform(vtkTransform* transform);
144 
146 
150  void PushMatrix();
151  void PopMatrix();
153 
155 
162  void EnableClippingPlane(int i, double* planeEquation);
163  void DisableClippingPlane(int i);
165 
166 protected:
168  ~vtkContext3D() override;
169 
170  vtkSmartPointer<vtkContextDevice3D> Device; // The underlying device
172 
173 private:
174  vtkContext3D(const vtkContext3D&) = delete;
175  void operator=(const vtkContext3D&) = delete;
176 };
177 
178 #endif // VTKCONTEXT3D_H
provides a brush that fills shapes drawn by vtkContext2D.
Definition: vtkBrush.h:50
Class for drawing 3D primitives to a graphical context.
Definition: vtkContext3D.h:50
~vtkContext3D() override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
bool Begin(vtkContextDevice3D *device)
Begin painting on a vtkContextDevice3D, no painting can occur before this call has been made.
void DrawLine(const vtkVector3f &start, const vtkVector3f &end)
Draw a line between the specified points.
void DrawPoly(const float *points, int n)
Draw a poly line between the specified points.
vtkContextDevice3D * GetDevice()
Get access to the underlying 3D context.
vtkTransform * GetTransform()
Compute the current transform applied to the context.
void EnableClippingPlane(int i, double *planeEquation)
Enable/Disable the specified clipping plane.
vtkSmartPointer< vtkTransform > Transform
Definition: vtkContext3D.h:171
void SetTransform(vtkTransform *transform)
Set the transform for the context, the underlying device will use the matrix of the transform.
void DisableClippingPlane(int i)
Enable/Disable the specified clipping plane.
void AppendTransform(vtkTransform *transform)
Append the transform for the context, the underlying device will use the matrix of the transform.
void DrawPoints(const float *points, int n)
Draw a sequence of points at the specified locations.
void PopMatrix()
Push/pop the transformation matrix for the painter (sets the underlying matrix for the device when av...
vtkSmartPointer< vtkContextDevice3D > Device
Definition: vtkContext3D.h:170
void PushMatrix()
Push/pop the transformation matrix for the painter (sets the underlying matrix for the device when av...
void DrawTriangleMesh(const float *mesh, int n, const unsigned char *colors, int nc)
Draw triangles to generate the specified mesh.
void DrawPoints(const float *points, int n, unsigned char *colors, int nc_comps)
Draw a sequence of points at the specified locations.
bool End()
Ends painting on the device, you would not usually need to call this as it should be called by the de...
void ApplyPen(vtkPen *pen)
Apply the supplied pen which controls the outlines of shapes, as well as lines, points and related pr...
static vtkContext3D * New()
Creates a 3D context object.
void ApplyBrush(vtkBrush *brush)
Apply the supplied brush which controls the outlines of shapes, as well as lines, points and related ...
void DrawPoint(const vtkVector3f &point)
Draw a point at the point in 3D space.
Abstract class for drawing 3D primitives.
a simple class to control print indentation
Definition: vtkIndent.h:49
abstract base class for most VTK objects
Definition: vtkObject.h:72
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition: vtkPen.h:49
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:70
@ point
Definition: vtkX3D.h:242
@ points
Definition: vtkX3D.h:452