VTK
dox/Rendering/Context2D/vtkContext3D.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkContext3D.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00015 
00026 #ifndef __vtkContext3D_h
00027 #define __vtkContext3D_h
00028 
00029 #include "vtkRenderingContext2DModule.h" // For export macro
00030 #include "vtkObject.h"
00031 #include "vtkVector.h" // For the vector coordinates.
00032 #include "vtkSmartPointer.h" // For SP ivars.
00033 
00034 class vtkContextDevice3D;
00035 class vtkPen;
00036 class vtkBrush;
00037 class vtkTransform;
00038 
00039 class VTKRENDERINGCONTEXT2D_EXPORT vtkContext3D : public vtkObject
00040 {
00041 public:
00042   vtkTypeMacro(vtkContext3D, vtkObject);
00043   virtual void PrintSelf(ostream &os, vtkIndent indent);
00044 
00046   static vtkContext3D *New();
00047 
00051   bool Begin(vtkContextDevice3D *device);
00052 
00054   vtkContextDevice3D * GetDevice();
00055 
00059   bool End();
00060 
00062   void DrawLine(const vtkVector3f &start, const vtkVector3f &end);
00063 
00065   void DrawPoly(const float *points, int n);
00066 
00068   void DrawPoint(const vtkVector3f &point);
00069 
00071   void DrawPoints(const float *points, int n);
00072 
00074 
00077   void DrawPoints(const float *points, int n,
00078                   unsigned char *colors, int nc_comps);
00080 
00082 
00083   void DrawTriangleMesh(const float *mesh, int n,
00084                         const unsigned char *colors, int nc);
00086 
00091   void ApplyPen(vtkPen *pen);
00092 
00097   void ApplyBrush(vtkBrush *brush);
00098 
00102   void SetTransform(vtkTransform *transform);
00103 
00105   vtkTransform* GetTransform();
00106 
00111   void AppendTransform(vtkTransform *transform);
00112 
00114 
00116   void PushMatrix();
00117   void PopMatrix();
00119 
00121 
00126   void EnableClippingPlane(int i, double *planeEquation);
00127   void DisableClippingPlane(int i);
00129 
00130 protected:
00131   vtkContext3D();
00132   ~vtkContext3D();
00133 
00134   vtkSmartPointer<vtkContextDevice3D> Device; // The underlying device
00135   vtkSmartPointer<vtkTransform> Transform;    // Current transform
00136 
00137 private:
00138   vtkContext3D(const vtkContext3D &);   // Not implemented.
00139   void operator=(const vtkContext3D &); // Not implemented.
00140 };
00141 
00142 #endif // VTKCONTEXT3D_H