VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkGL2PSContextDevice2D.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 00028 #ifndef __vtkGL2PSContextDevice2D_h 00029 #define __vtkGL2PSContextDevice2D_h 00030 00031 #include "vtkRenderingGL2PSModule.h" // For export macro 00032 #include "vtkOpenGLContextDevice2D.h" 00033 00034 class vtkPath; 00035 00036 class VTKRENDERINGGL2PS_EXPORT vtkGL2PSContextDevice2D 00037 : public vtkOpenGLContextDevice2D 00038 { 00039 public: 00040 vtkTypeMacro(vtkGL2PSContextDevice2D, vtkOpenGLContextDevice2D); 00041 virtual void PrintSelf(ostream &os, vtkIndent indent); 00042 00043 static vtkGL2PSContextDevice2D *New(); 00044 00046 00050 virtual void DrawPoly(float *f, int n, unsigned char *colors = 0, 00051 int nc_comps = 0); 00053 00055 00057 virtual void DrawPoints(float *points, int n, unsigned char* colors = 0, 00058 int nc_comps = 0); 00060 00062 00067 virtual void DrawPointSprites(vtkImageData *sprite, float *points, int n, 00068 unsigned char *colors = 0, int nc_comps = 0); 00070 00072 virtual void DrawQuadStrip(float *, int); 00073 00075 virtual void DrawPolygon(float *, int); 00076 00078 00084 virtual void DrawEllipseWedge(float x, float y, float outRx, float outRy, 00085 float inRx, float inRy, float startAngle, 00086 float stopAngle); 00088 00090 00093 virtual void DrawEllipticArc(float x, float y, float rX, float rY, 00094 float startAngle, float stopAngle); 00096 00098 00104 virtual void DrawMarkers(int shape, bool highlight, float *points, int n, 00105 unsigned char *colors = 0, int nc_comps = 0); 00107 00109 virtual void DrawQuad(float *points, int n); 00110 00112 virtual void DrawString(float *point, const vtkStdString &string); 00113 00115 virtual void DrawString(float *point, const vtkUnicodeString &string); 00116 00120 virtual void DrawMathTextString(float point[2], const vtkStdString &string); 00121 00126 void ApplyPen(vtkPen *pen); 00127 00129 virtual void SetPointSize(float size); 00130 00132 virtual void SetLineWidth(float width); 00133 00135 virtual void SetLineType(int type); 00136 00137 protected: 00138 vtkGL2PSContextDevice2D(); 00139 virtual ~vtkGL2PSContextDevice2D(); 00140 00141 private: 00142 vtkGL2PSContextDevice2D(const vtkGL2PSContextDevice2D &); // Not implemented. 00143 void operator=(const vtkGL2PSContextDevice2D &); // Not implemented. 00144 00145 void DrawCrossMarkers(bool highlight, float *points, int n, 00146 unsigned char *colors, int nc_comps); 00147 void DrawPlusMarkers(bool highlight, float *points, int n, 00148 unsigned char *colors, int nc_comps); 00149 void DrawSquareMarkers(bool highlight, float *points, int n, 00150 unsigned char *colors, int nc_comps); 00151 void DrawCircleMarkers(bool highlight, float *points, int n, 00152 unsigned char *colors, int nc_comps); 00153 void DrawDiamondMarkers(bool highlight, float *points, int n, 00154 unsigned char *colors, int nc_comps); 00155 void AddEllipseToPath(vtkPath *path, float x, float y, float rx, float ry, 00156 bool reverse); 00157 00158 // Transform the path using the current modelview matrix. 00159 void TransformPath(vtkPath *path) const; 00160 00161 // Transform the 2D point using the current modelview matrix. 00162 void TransformPoint(float &x, float &y) const; 00163 00164 // Transform the width and height from pixels to data units. 00165 void TransformSize(float &dx, float &dy) const; 00166 }; 00167 00168 #endif //__vtkGL2PSContextDevice2D_h