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 
47 #ifndef vtkPainterDeviceAdapter_h
48 #define vtkPainterDeviceAdapter_h
49 
50 #include "vtkRenderingCoreModule.h" // For export macro
51 #include "vtkObject.h"
52 #include "vtkDataArray.h" // needed for inline functions.
53 class vtkRenderer;
54 
55 class VTKRENDERINGCORE_EXPORT vtkPainterDeviceAdapter : public vtkObject
56 {
57 public:
60  virtual void PrintSelf(ostream &os, vtkIndent indent);
61 
72  virtual void BeginPrimitive(int mode) = 0;
73 
77  virtual void EndPrimitive() = 0;
78 
83  virtual int IsAttributesSupported(int attribute)=0;
84 
88  virtual void SendMultiTextureCoords(int numcomp, int type, const void *attribute,
89  int idx, vtkIdType offset) = 0;
90 
104  virtual void SendAttribute(int index, int components, int type,
105  const void *attribute, vtkIdType offset=0) = 0;
106 
114  void SetAttributePointer(int index, vtkDataArray *attributeArray);
115 
130  virtual void SetAttributePointer(int index, int numcomponents, int type,
131  int stride, const void *pointer) = 0;
132 
134 
137  virtual void EnableAttributeArray(int index) = 0;
138  virtual void DisableAttributeArray(int index) = 0;
140 
152  virtual void DrawArrays(int mode, vtkIdType first, vtkIdType count) = 0;
153 
168  virtual void DrawElements(int mode, vtkIdType count, int type,
169  void *indices) = 0;
170 
175  virtual int Compatible(vtkRenderer *renderer) = 0;
176 
180  virtual void MakeVertexEmphasis(bool mode) = 0;
181 
183 
186  virtual void Stencil(int on) = 0;
187  virtual void WriteStencil(vtkIdType value) = 0;
188  virtual void TestStencil(vtkIdType value) = 0;
190 
191 protected:
194 
195 private:
196  vtkPainterDeviceAdapter(const vtkPainterDeviceAdapter &) VTK_DELETE_FUNCTION;
197  void operator=(const vtkPainterDeviceAdapter &) VTK_DELETE_FUNCTION;
198 };
199 
201  vtkDataArray *attributeArray)
202 {
203  this->SetAttributePointer(index, attributeArray->GetNumberOfComponents(),
204  attributeArray->GetDataType(), 0,
205  attributeArray->GetVoidPointer(0));
206 }
207 
208 #endif //_vtkPainterDeviceAdapter_h
virtual int GetDataType()=0
Return the underlying data type.
virtual void * GetVoidPointer(vtkIdType valueIdx)=0
Return a void pointer.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
a simple class to control print indentation
Definition: vtkIndent.h:40
abstract base class for most VTK objects
Definition: vtkObject.h:60
An adapter between a vtkPainter and a rendering device.
virtual void DrawElements(int mode, vtkIdType count, int type, void *indices)=0
Send items in the attribute pointers to the graphics card to define a primitive.
virtual void EnableAttributeArray(int index)=0
Enable/disable the attribute array set with SetAttributePointer.
virtual int IsAttributesSupported(int attribute)=0
Returns if the given attribute type is supported by the device.
virtual void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual int Compatible(vtkRenderer *renderer)=0
Returns true if this device adapter is compatible with the given vtkRenderer.
virtual void BeginPrimitive(int mode)=0
Signals the start of sending a primitive to the graphics card.
static vtkPainterDeviceAdapter * New()
virtual void EndPrimitive()=0
Signals the end of sending a primitive to the graphics card.
virtual void SetAttributePointer(int index, int numcomponents, int type, int stride, const void *pointer)=0
Sets an array of attributes.
void SetAttributePointer(int index, vtkDataArray *attributeArray)
Sets an array of attributes.
virtual void TestStencil(vtkIdType value)=0
virtual void MakeVertexEmphasis(bool mode)=0
Turns emphasis of vertices on or off for vertex selection.
virtual void SendAttribute(int index, int components, int type, const void *attribute, vtkIdType offset=0)=0
Sends a single attribute to the graphics card.
virtual void Stencil(int on)=0
Control use of the stencil buffer (for vertex selection).
virtual void WriteStencil(vtkIdType value)=0
virtual void DrawArrays(int mode, vtkIdType first, vtkIdType count)=0
Send a section of the enabled attribute pointers to the graphics card to define a primitive.
virtual void SendMultiTextureCoords(int numcomp, int type, const void *attribute, int idx, vtkIdType offset)=0
Calls glMultiTex.
virtual void DisableAttributeArray(int index)=0
abstract specification for renderers
Definition: vtkRenderer.h:64
@ on
Definition: vtkX3D.h:439
@ mode
Definition: vtkX3D.h:247
@ value
Definition: vtkX3D.h:220
@ type
Definition: vtkX3D.h:516
@ index
Definition: vtkX3D.h:246
@ offset
Definition: vtkX3D.h:438
int vtkIdType
Definition: vtkType.h:287