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 "vtkObject.h" 00050 #include "vtkDataArray.h" // needed for inline functions. 00051 class vtkRenderer; 00052 00053 class VTK_RENDERING_EXPORT vtkPainterDeviceAdapter : public vtkObject 00054 { 00055 public: 00056 static vtkPainterDeviceAdapter* New(); 00057 vtkTypeMacro(vtkPainterDeviceAdapter, vtkObject); 00058 virtual void PrintSelf(ostream &os, vtkIndent indent); 00059 00068 virtual void BeginPrimitive(int mode) = 0; 00069 00071 virtual void EndPrimitive() = 0; 00072 00075 virtual int IsAttributesSupported(int attribute)=0; 00076 00078 00079 virtual void SendMultiTextureCoords(int numcomp, int type, const void *attribute, 00080 int idx, vtkIdType offset) = 0; 00082 00084 00094 virtual void SendAttribute(int index, int components, int type, 00095 const void *attribute, vtkIdType offset=0) = 0; 00097 00103 void SetAttributePointer(int index, vtkDataArray *attributeArray); 00104 00106 00115 virtual void SetAttributePointer(int index, int numcomponents, int type, 00116 int stride, const void *pointer) = 0; 00118 00120 00121 virtual void EnableAttributeArray(int index) = 0; 00122 virtual void DisableAttributeArray(int index) = 0; 00124 00134 virtual void DrawArrays(int mode, vtkIdType first, vtkIdType count) = 0; 00135 00137 00149 virtual void DrawElements(int mode, vtkIdType count, int type, 00150 void *indices) = 0; 00152 00155 virtual int Compatible(vtkRenderer *renderer) = 0; 00156 00158 virtual void MakeLighting(int mode) = 0; 00159 00161 virtual int QueryLighting() = 0; 00162 00164 virtual void MakeMultisampling(int mode) = 0; 00165 00167 virtual int QueryMultisampling() = 0; 00168 00170 virtual void MakeBlending(int mode) = 0; 00171 00173 virtual int QueryBlending() = 0; 00174 00176 virtual void MakeVertexEmphasis(bool mode) = 0; 00177 00179 VTK_LEGACY(virtual void MakeVertexEmphasisWithStencilCheck(int vtkNotUsed(mode))); 00180 00182 00183 virtual void Stencil(int on) = 0; 00184 virtual void WriteStencil(vtkIdType value) = 0; 00185 virtual void TestStencil(vtkIdType value) = 0; 00187 00188 protected: 00189 vtkPainterDeviceAdapter(); 00190 ~vtkPainterDeviceAdapter(); 00191 00192 private: 00193 vtkPainterDeviceAdapter(const vtkPainterDeviceAdapter &); // Not implemented. 00194 void operator=(const vtkPainterDeviceAdapter &); // Not implemented. 00195 }; 00196 00197 inline void vtkPainterDeviceAdapter::SetAttributePointer(int index, 00198 vtkDataArray *attributeArray) 00199 { 00200 this->SetAttributePointer(index, attributeArray->GetNumberOfComponents(), 00201 attributeArray->GetDataType(), 0, 00202 attributeArray->GetVoidPointer(0)); 00203 } 00204 00205 #endif //_vtkPainterDeviceAdapter_h