VTK
vtkPistonMapper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPistonMapper.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 =========================================================================*/
27 #ifndef vtkPistonMapper_h
28 #define vtkPistonMapper_h
29 
30 #include "vtkAcceleratorsPistonModule.h" // For export macro
31 #include "vtkMapper.h"
32 
33 class vtkActor;
34 class vtkRenderer;
37 class vtkRenderWindow;
38 class vtkWindow;
39 
40 class VTKACCELERATORSPISTON_EXPORT vtkPistonMapper : public vtkMapper
41 {
42 public:
43  static vtkPistonMapper *New();
44  vtkTypeMacro(vtkPistonMapper,vtkMapper);
45  void PrintSelf(ostream& os, vtkIndent indent);
46 
51  static void InitCudaGL(vtkRenderWindow *rw);
52 
56  inline static bool IsEnabledCudaGL()
57  {
58  return CudaGLInitted;
59  }
60 
66 
71 
76  virtual void Render(vtkRenderer *ren, vtkActor *a);
77 
84 
86 
90  virtual double *GetBounds();
91  virtual void GetBounds(double bounds[6])
92  {this->vtkAbstractMapper3D::GetBounds(bounds);};
94 
101  virtual bool GetSupportsSelection()
102  { return false; }
103 
105 
109  virtual void Update();
110  // Use the other overloads of Update.
111  using vtkAlgorithm::Update;
113 
115 
118  vtkSetMacro(Piece, int);
119  vtkGetMacro(Piece, int);
120  vtkSetMacro(NumberOfPieces, int);
121  vtkGetMacro(NumberOfPieces, int);
123 
125 
128  vtkSetMacro(GhostLevel, int);
129  vtkGetMacro(GhostLevel, int);
131 
132 protected:
135 
140 
142 
145  void RenderOnCPU();
146  void RenderOnGPU();
149 
150  int Piece;
153 
154 private:
155  vtkPistonMapper(const vtkPistonMapper&) VTK_DELETE_FUNCTION;
156  void operator=(const vtkPistonMapper&) VTK_DELETE_FUNCTION;
157 
161  void PrepareDirectRenderBuffers(int nPoints);
162 
163  static bool CudaGLInitted;
164 
165  class InternalInfo;
166  InternalInfo *Internal;
167 };
168 
169 #endif
vtkAbstractMapper3D::GetBounds
virtual double * GetBounds()=0
Return bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax,...
vtkPistonDataObject
A GPU resident data set.
Definition: vtkPistonDataObject.h:43
vtkPistonMapper::~vtkPistonMapper
~vtkPistonMapper()
vtkPistonMapper::FillInputPortInformation
virtual int FillInputPortInformation(int port, vtkInformation *info)
Overridden to say that we take in vtkPistonDataObjects.
vtkPistonMapper::Update
virtual void Update()
Bring this algorithm's outputs up-to-date.
vtkPistonScalarsColors
Color Mapping for piston results.
Definition: vtkPistonScalarsColors.h:35
vtkPistonMapper::Render
virtual void Render(vtkRenderer *ren, vtkActor *a)
Method initiates the mapping process.
vtkPistonMapper::GetPistonDataObjectInput
vtkPistonDataObject * GetPistonDataObjectInput(int port)
A convenience method to reduce code duplication that gets the input as the expected type or NULL.
vtkPistonMapper::RenderImageDataOutline
void RenderImageDataOutline()
vtkPistonMapper::Piece
int Piece
Definition: vtkPistonMapper.h:150
vtkPistonMapper::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
vtkPistonMapper::vtkPistonMapper
vtkPistonMapper()
vtkMapper.h
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkMapper
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:92
vtkAlgorithm::Update
virtual void Update()
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:52
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkPistonMapper::ShallowCopy
void ShallowCopy(vtkAbstractMapper *m)
Make a shallow copy of this mapper.
vtkPistonMapper::GhostLevel
int GhostLevel
Definition: vtkPistonMapper.h:152
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:87
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkPistonMapper::GetBounds
virtual double * GetBounds()
Return bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax,...
vtkPistonMapper::RenderOnGPU
void RenderOnGPU()
vtkPistonMapper::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this mapper.
Definition: vtkPistonMapper.h:83
vtkPistonMapper::NumberOfPieces
int NumberOfPieces
Definition: vtkPistonMapper.h:151
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:64
vtkRenderWindow
create a window for renderers to draw into
Definition: vtkRenderWindow.h:87
vtkPistonMapper::IsEnabledCudaGL
static bool IsEnabledCudaGL()
Return true if using cuda interop feature otherwise false.
Definition: vtkPistonMapper.h:56
vtkPistonMapper::New
static vtkPistonMapper * New()
vtkPistonMapper::GetSupportsSelection
virtual bool GetSupportsSelection()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition: vtkPistonMapper.h:101
vtkPistonMapper::InitCudaGL
static void InitCudaGL(vtkRenderWindow *rw)
Manually call this before any cuda filters are created to use direct GPU rendering.
vtkPistonMapper::RenderOnCPU
void RenderOnCPU()
Internal render methods.
vtkPistonMapper::GetBounds
virtual void GetBounds(double bounds[6])
Get the bounds for this mapper as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
Definition: vtkPistonMapper.h:91
vtkAbstractMapper
abstract class specifies interface to map data
Definition: vtkAbstractMapper.h:56
vtkPistonMapper
draws vtkPistonDataObjects to the screen
Definition: vtkPistonMapper.h:41