VTK
dox/Charts/vtkOpenGLContextDevice2D.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkOpenGLContextDevice2D.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 __vtkOpenGLContextDevice2D_h
00029 #define __vtkOpenGLContextDevice2D_h
00030 
00031 #include "vtkContextDevice2D.h"
00032 
00033 class vtkWindow;
00034 class vtkViewport;
00035 class vtkRenderer;
00036 class vtkLabelRenderStrategy;
00037 class vtkOpenGLRenderWindow;
00038 class vtkOpenGLExtensionManager;
00039 
00040 class VTK_CHARTS_EXPORT vtkOpenGLContextDevice2D : public vtkContextDevice2D
00041 {
00042 public:
00043   vtkTypeMacro(vtkOpenGLContextDevice2D, vtkContextDevice2D);
00044   virtual void PrintSelf(ostream &os, vtkIndent indent);
00045 
00047   static vtkOpenGLContextDevice2D *New();
00048 
00051   virtual void DrawPoly(float *points, int n);
00052 
00055   virtual void DrawPoints(float *points, int n);
00056 
00060   virtual void DrawPointSprites(vtkImageData *sprite, float *points, int n);
00061 
00063   virtual void DrawQuad(float *points, int n);
00064 
00066 
00072   virtual void DrawEllipseWedge(float x, float y, float outRx, float outRy,
00073                                 float inRx, float inRy, float startAngle,
00074                                 float stopAngle);
00076 
00078 
00081   virtual void DrawEllipticArc(float x, float y, float rX, float rY,
00082                                float startAngle, float stopAngle);
00084 
00085 
00086 //BTX
00088 
00089   virtual void DrawString(float *point, vtkTextProperty *tprop,
00090                           const vtkStdString &string);
00092 
00094 
00099   virtual void ComputeStringBounds(const vtkStdString &string,
00100                                    vtkTextProperty *tprop,
00101                                    float bounds[4]);
00103 //ETX
00104 
00107   virtual void DrawImage(float *p, int n, vtkImageData *image);
00108 
00110   virtual void SetColor4(unsigned char *color);
00111 
00113   virtual void SetColor(unsigned char *color);
00114 
00116   virtual void SetPointSize(float size);
00117 
00119   virtual void SetLineWidth(float width);
00120 
00122   virtual void SetLineType(int type);
00123 
00125   virtual void MultiplyMatrix(vtkMatrix3x3 *m);
00126 
00128   virtual void SetMatrix(vtkMatrix3x3 *m);
00129 
00131   virtual void PushMatrix();
00132 
00134   virtual void PopMatrix();
00135 
00138   virtual void SetClipping(int *x);
00139 
00141   virtual void DisableClipping();
00142 
00144   virtual void Begin(vtkViewport* viewport);
00145 
00147   virtual void End();
00148 
00152   virtual void BufferIdModeBegin(vtkAbstractContextBufferId *bufferId);
00153 
00158   virtual void BufferIdModeEnd();
00159 
00163   bool SetStringRendererToFreeType();
00164 
00167   bool SetStringRendererToQt();
00168 
00170   bool HasGLSL();
00171 
00173 
00175   vtkGetObjectMacro(RenderWindow, vtkOpenGLRenderWindow);
00177 
00181   virtual void ReleaseGraphicsResources(vtkWindow *window);
00182 
00183 //BTX
00184 protected:
00185   vtkOpenGLContextDevice2D();
00186   virtual ~vtkOpenGLContextDevice2D();
00187 
00189 
00193   int GetNumberOfArcIterations(float rX,
00194                                float rY,
00195                                float startAngle,
00196                                float stopAngle);
00198 
00200   int Geometry[2];
00201 
00203   vtkRenderer *Renderer;
00204 
00206   vtkLabelRenderStrategy *TextRenderer;
00207 
00210   bool IsTextDrawn;
00211 
00213   bool InRender;
00214 
00216 
00217   class Private;
00218   Private *Storage;
00220 
00222   bool LoadExtensions(vtkOpenGLExtensionManager *m);
00223 
00225   vtkOpenGLRenderWindow* RenderWindow;
00226 
00227 private:
00228   vtkOpenGLContextDevice2D(const vtkOpenGLContextDevice2D &); // Not implemented.
00229   void operator=(const vtkOpenGLContextDevice2D &);   // Not implemented.
00230 
00231 //ETX
00232 };
00233 
00234 #endif //__vtkOpenGLContextDevice2D_h