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 00159 virtual void MakeLighting(int mode) = 0; 00160 00162 virtual int QueryLighting() = 0; 00163 00165 virtual void MakeMultisampling(int mode) = 0; 00166 00168 virtual int QueryMultisampling() = 0; 00169 00171 virtual void MakeBlending(int mode) = 0; 00172 00174 virtual int QueryBlending() = 0; 00175 00177 virtual void MakeVertexEmphasis(bool mode) = 0; 00178 00180 00181 virtual void Stencil(int on) = 0; 00182 virtual void WriteStencil(vtkIdType value) = 0; 00183 virtual void TestStencil(vtkIdType value) = 0; 00185 00186 protected: 00187 vtkPainterDeviceAdapter(); 00188 ~vtkPainterDeviceAdapter(); 00189 00190 private: 00191 vtkPainterDeviceAdapter(const vtkPainterDeviceAdapter &); // Not implemented. 00192 void operator=(const vtkPainterDeviceAdapter &); // Not implemented. 00193 }; 00194 00195 inline void vtkPainterDeviceAdapter::SetAttributePointer(int index, 00196 vtkDataArray *attributeArray) 00197 { 00198 this->SetAttributePointer(index, attributeArray->GetNumberOfComponents(), 00199 attributeArray->GetDataType(), 0, 00200 attributeArray->GetVoidPointer(0)); 00201 } 00202 00203 #endif //_vtkPainterDeviceAdapter_h