VTK
vtkPainterDeviceAdapter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPainterDeviceAdapter.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 /*
16  * Copyright 2004 Sandia Corporation.
17  * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
18  * license for use of this work by or on behalf of the
19  * U.S. Government. Redistribution and use in source and binary forms, with
20  * or without modification, are permitted provided that this Notice and any
21  * statement of authorship are reproduced on all copies.
22  */
23 
46 #ifndef vtkPainterDeviceAdapter_h
47 #define vtkPainterDeviceAdapter_h
48 
49 #include "vtkRenderingCoreModule.h" // For export macro
50 #include "vtkObject.h"
51 #include "vtkDataArray.h" // needed for inline functions.
52 class vtkRenderer;
53 
55 {
56 public:
57  static vtkPainterDeviceAdapter* New();
59  virtual void PrintSelf(ostream &os, vtkIndent indent);
60 
69  virtual void BeginPrimitive(int mode) = 0;
70 
72  virtual void EndPrimitive() = 0;
73 
76  virtual int IsAttributesSupported(int attribute)=0;
77 
79 
80  virtual void SendMultiTextureCoords(int numcomp, int type, const void *attribute,
81  int idx, vtkIdType offset) = 0;
83 
85 
95  virtual void SendAttribute(int index, int components, int type,
96  const void *attribute, vtkIdType offset=0) = 0;
98 
104  void SetAttributePointer(int index, vtkDataArray *attributeArray);
105 
107 
116  virtual void SetAttributePointer(int index, int numcomponents, int type,
117  int stride, const void *pointer) = 0;
119 
121 
122  virtual void EnableAttributeArray(int index) = 0;
123  virtual void DisableAttributeArray(int index) = 0;
125 
135  virtual void DrawArrays(int mode, vtkIdType first, vtkIdType count) = 0;
136 
138 
150  virtual void DrawElements(int mode, vtkIdType count, int type,
151  void *indices) = 0;
153 
156  virtual int Compatible(vtkRenderer *renderer) = 0;
157 
159  virtual void MakeVertexEmphasis(bool mode) = 0;
160 
162 
163  virtual void Stencil(int on) = 0;
164  virtual void WriteStencil(vtkIdType value) = 0;
165  virtual void TestStencil(vtkIdType value) = 0;
167 
168 protected:
171 
172 private:
173  vtkPainterDeviceAdapter(const vtkPainterDeviceAdapter &); // Not implemented.
174  void operator=(const vtkPainterDeviceAdapter &); // Not implemented.
175 };
176 
178  vtkDataArray *attributeArray)
179 {
180  this->SetAttributePointer(index, attributeArray->GetNumberOfComponents(),
181  attributeArray->GetDataType(), 0,
182  attributeArray->GetVoidPointer(0));
183 }
184 
185 #endif //_vtkPainterDeviceAdapter_h
abstract base class for most VTK objects
Definition: vtkObject.h:61
abstract specification for renderers
Definition: vtkRenderer.h:63
virtual int GetDataType()=0
int vtkIdType
Definition: vtkType.h:275
virtual void PrintSelf(ostream &os, vtkIndent indent)
An adapter between a vtkPainter and a rendering device.
a simple class to control print indentation
Definition: vtkIndent.h:38
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
void SetAttributePointer(int index, vtkDataArray *attributeArray)
virtual void * GetVoidPointer(vtkIdType id)=0
#define VTKRENDERINGCORE_EXPORT
static vtkObject * New()