VTK
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 
26 #ifndef vtkContext3D_h
27 #define vtkContext3D_h
28 
29 #include "vtkRenderingContext2DModule.h" // For export macro
30 #include "vtkObject.h"
31 #include "vtkVector.h" // For the vector coordinates.
32 #include "vtkSmartPointer.h" // For SP ivars.
33 
34 class vtkContextDevice3D;
35 class vtkPen;
36 class vtkBrush;
37 class vtkTransform;
38 
40 {
41 public:
42  vtkTypeMacro(vtkContext3D, vtkObject);
43  virtual void PrintSelf(ostream &os, vtkIndent indent);
44 
46  static vtkContext3D *New();
47 
51  bool Begin(vtkContextDevice3D *device);
52 
54  vtkContextDevice3D * GetDevice();
55 
59  bool End();
60 
62  void DrawLine(const vtkVector3f &start, const vtkVector3f &end);
63 
65  void DrawPoly(const float *points, int n);
66 
68  void DrawPoint(const vtkVector3f &point);
69 
71  void DrawPoints(const float *points, int n);
72 
74 
77  void DrawPoints(const float *points, int n,
78  unsigned char *colors, int nc_comps);
80 
82 
83  void DrawTriangleMesh(const float *mesh, int n,
84  const unsigned char *colors, int nc);
86 
91  void ApplyPen(vtkPen *pen);
92 
97  void ApplyBrush(vtkBrush *brush);
98 
102  void SetTransform(vtkTransform *transform);
103 
105  vtkTransform* GetTransform();
106 
111  void AppendTransform(vtkTransform *transform);
112 
114 
116  void PushMatrix();
117  void PopMatrix();
119 
121 
126  void EnableClippingPlane(int i, double *planeEquation);
127  void DisableClippingPlane(int i);
129 
130 protected:
131  vtkContext3D();
132  ~vtkContext3D();
133 
134  vtkSmartPointer<vtkContextDevice3D> Device; // The underlying device
136 
137 private:
138  vtkContext3D(const vtkContext3D &); // Not implemented.
139  void operator=(const vtkContext3D &); // Not implemented.
140 };
141 
142 #endif // VTKCONTEXT3D_H
abstract base class for most VTK objects
Definition: vtkObject.h:61
Abstract class for drawing 3D primitives.
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:59
vtkSmartPointer< vtkTransform > Transform
Definition: vtkContext3D.h:135
provides a brush that fills shapes drawn by vtkContext2D.
Definition: vtkBrush.h:36
virtual void PrintSelf(ostream &os, vtkIndent indent)
#define VTKRENDERINGCONTEXT2D_EXPORT
a simple class to control print indentation
Definition: vtkIndent.h:38
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition: vtkPen.h:38
static vtkObject * New()
vtkSmartPointer< vtkContextDevice3D > Device
Definition: vtkContext3D.h:134
Class for drawing 3D primitives to a graphical context.
Definition: vtkContext3D.h:39