VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkPainterDeviceAdapter.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 /* 00016 * Copyright 2004 Sandia Corporation. 00017 * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive 00018 * license for use of this work by or on behalf of the 00019 * U.S. Government. Redistribution and use in source and binary forms, with 00020 * or without modification, are permitted provided that this Notice and any 00021 * statement of authorship are reproduced on all copies. 00022 */ 00023 00046 #ifndef vtkPainterDeviceAdapter_h 00047 #define vtkPainterDeviceAdapter_h 00048 00049 #include "vtkRenderingCoreModule.h" // For export macro 00050 #include "vtkObject.h" 00051 #include "vtkDataArray.h" // needed for inline functions. 00052 class vtkRenderer; 00053 00054 class VTKRENDERINGCORE_EXPORT vtkPainterDeviceAdapter : public vtkObject 00055 { 00056 public: 00057 static vtkPainterDeviceAdapter* New(); 00058 vtkTypeMacro(vtkPainterDeviceAdapter, vtkObject); 00059 virtual void PrintSelf(ostream &os, vtkIndent indent); 00060 00069 virtual void BeginPrimitive(int mode) = 0; 00070 00072 virtual void EndPrimitive() = 0; 00073 00076 virtual int IsAttributesSupported(int attribute)=0; 00077 00079 00080 virtual void SendMultiTextureCoords(int numcomp, int type, const void *attribute, 00081 int idx, vtkIdType offset) = 0; 00083 00085 00095 virtual void SendAttribute(int index, int components, int type, 00096 const void *attribute, vtkIdType offset=0) = 0; 00098 00104 void SetAttributePointer(int index, vtkDataArray *attributeArray); 00105 00107 00116 virtual void SetAttributePointer(int index, int numcomponents, int type, 00117 int stride, const void *pointer) = 0; 00119 00121 00122 virtual void EnableAttributeArray(int index) = 0; 00123 virtual void DisableAttributeArray(int index) = 0; 00125 00135 virtual void DrawArrays(int mode, vtkIdType first, vtkIdType count) = 0; 00136 00138 00150 virtual void DrawElements(int mode, vtkIdType count, int type, 00151 void *indices) = 0; 00153 00156 virtual int Compatible(vtkRenderer *renderer) = 0; 00157 00158 #ifndef VTK_LEGACY_REMOVE 00159 00161 virtual void MakeLighting(int mode) = 0; 00162 00165 virtual int QueryLighting() = 0; 00166 00169 virtual void MakeMultisampling(int mode) = 0; 00170 00173 virtual int QueryMultisampling() = 0; 00174 00177 virtual void MakeBlending(int mode) = 0; 00178 00180 00182 virtual int QueryBlending() = 0; 00183 #endif 00184 00185 00187 virtual void MakeVertexEmphasis(bool mode) = 0; 00188 00190 00191 virtual void Stencil(int on) = 0; 00192 virtual void WriteStencil(vtkIdType value) = 0; 00193 virtual void TestStencil(vtkIdType value) = 0; 00195 00196 protected: 00197 vtkPainterDeviceAdapter(); 00198 ~vtkPainterDeviceAdapter(); 00199 00200 private: 00201 vtkPainterDeviceAdapter(const vtkPainterDeviceAdapter &); // Not implemented. 00202 void operator=(const vtkPainterDeviceAdapter &); // Not implemented. 00203 }; 00204 00205 inline void vtkPainterDeviceAdapter::SetAttributePointer(int index, 00206 vtkDataArray *attributeArray) 00207 { 00208 this->SetAttributePointer(index, attributeArray->GetNumberOfComponents(), 00209 attributeArray->GetDataType(), 0, 00210 attributeArray->GetVoidPointer(0)); 00211 } 00212 00213 #endif //_vtkPainterDeviceAdapter_h