VTK
vtkOpenGLContextDevice3D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkOpenGLContextDevice3D.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 
25 #ifndef vtkOpenGLContextDevice3D_h
26 #define vtkOpenGLContextDevice3D_h
27 
28 #include "vtkRenderingContextOpenGLModule.h" // For export macro
29 #include "vtkContextDevice3D.h"
30 #include "vtkNew.h" // For ivars.
31 
32 class vtkBrush;
33 class vtkPen;
34 
35 class VTKRENDERINGCONTEXTOPENGL_EXPORT vtkOpenGLContextDevice3D : public vtkContextDevice3D
36 {
37 public:
39  void PrintSelf(ostream &os, vtkIndent indent);
40 
42 
47  void DrawPoly(const float *verts, int n, const unsigned char *colors, int nc);
48 
53  void DrawLines(const float *verts, int n, const unsigned char *colors, int nc);
54 
58  void DrawPoints(const float *verts, int n,
59  const unsigned char *colors, int nc);
60 
64  void DrawTriangleMesh(const float *mesh, int n,
65  const unsigned char *colors, int nc);
66 
72  void ApplyPen(vtkPen *pen);
73 
79  void ApplyBrush(vtkBrush *brush);
80 
85 
90 
95 
99  void PushMatrix();
100 
104  void PopMatrix();
105 
110  void SetClipping(const vtkRecti &rect);
111 
115  void EnableClipping(bool enable);
116 
118 
125  void EnableClippingPlane(int i, double *planeEquation);
126  void DisableClippingPlane(int i);
128 
129 protected:
132 
136  virtual void EnableDepthBuffer();
137 
141  virtual void DisableDepthBuffer();
142 
143 private:
144  vtkOpenGLContextDevice3D(const vtkOpenGLContextDevice3D &) VTK_DELETE_FUNCTION;
145  void operator=(const vtkOpenGLContextDevice3D &) VTK_DELETE_FUNCTION;
146 
148 
151  class Private;
152  Private *Storage;
154 
155  vtkNew<vtkBrush> Brush;
156  vtkNew<vtkPen> Pen;
157 };
158 
159 #endif
vtkBrush
provides a brush that fills shapes drawn by vtkContext2D.
Definition: vtkBrush.h:38
vtkOpenGLContextDevice3D
OpenGL class drawing 3D primitives.
Definition: vtkOpenGLContextDevice3D.h:36
vtkOpenGLContextDevice3D::EnableClippingPlane
void EnableClippingPlane(int i, double *planeEquation)
Enable/Disable the specified clipping plane.
vtkOpenGLContextDevice3D::PopMatrix
void PopMatrix()
Pop the current matrix off of the stack.
vtkOpenGLContextDevice3D::DrawLines
void DrawLines(const float *verts, int n, const unsigned char *colors, int nc)
Draw lines defined by specified pair of points.
vtkOpenGLContextDevice3D::ApplyBrush
void ApplyBrush(vtkBrush *brush)
Apply the supplied brush which controls the outlines of shapes, as well as lines, points and related ...
vtkContextDevice3D
Abstract class for drawing 3D primitives.
Definition: vtkContextDevice3D.h:42
vtkOpenGLContextDevice3D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkOpenGLContextDevice3D::SetMatrix
void SetMatrix(vtkMatrix4x4 *m)
Set the model view matrix for the display.
vtkOpenGLContextDevice3D::DrawPoly
void DrawPoly(const float *verts, int n, const unsigned char *colors, int nc)
Draw a polyline between the specified points.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkMatrix4x4
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:42
vtkOpenGLContextDevice3D::DrawPoints
void DrawPoints(const float *verts, int n, const unsigned char *colors, int nc)
Draw points at the vertex positions specified.
vtkOpenGLContextDevice3D::~vtkOpenGLContextDevice3D
~vtkOpenGLContextDevice3D()
vtkContextDevice3D.h
vtkOpenGLContextDevice3D::EnableClipping
void EnableClipping(bool enable)
Enable or disable the clipping of the scene.
vtkOpenGLContextDevice3D::DrawTriangleMesh
void DrawTriangleMesh(const float *mesh, int n, const unsigned char *colors, int nc)
Draw triangles to generate the specified mesh.
vtkNew< vtkBrush >
vtkOpenGLContextDevice3D::ApplyPen
void ApplyPen(vtkPen *pen)
Apply the supplied pen which controls the outlines of shapes, as well as lines, points and related pr...
vtkOpenGLContextDevice3D::GetMatrix
void GetMatrix(vtkMatrix4x4 *m)
Set the model view matrix for the display.
vtkOpenGLContextDevice3D::DisableDepthBuffer
virtual void DisableDepthBuffer()
End drawing, turn off the depth buffer.
vtkNew.h
vtkOpenGLContextDevice3D::New
static vtkOpenGLContextDevice3D * New()
vtkOpenGLContextDevice3D::DisableClippingPlane
void DisableClippingPlane(int i)
vtkOpenGLContextDevice3D::EnableDepthBuffer
virtual void EnableDepthBuffer()
Begin drawing, turn on the depth buffer.
vtkRecti
Definition: vtkRect.h:288
vtkOpenGLContextDevice3D::PushMatrix
void PushMatrix()
Push the current matrix onto the stack.
vtkPen
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition: vtkPen.h:40
vtkOpenGLContextDevice3D::vtkOpenGLContextDevice3D
vtkOpenGLContextDevice3D()
vtkOpenGLContextDevice3D::MultiplyMatrix
void MultiplyMatrix(vtkMatrix4x4 *m)
Multiply the current model view matrix by the supplied one.
vtkOpenGLContextDevice3D::SetClipping
void SetClipping(const vtkRecti &rect)
Supply a float array of length 4 with x1, y1, width, height specifying clipping region for the device...