VTK
vtkPainter.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkPainter.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/*
17 * Copyright 2004 Sandia Corporation.
18 * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
19 * license for use of this work by or on behalf of the
20 * U.S. Government. Redistribution and use in source and binary forms, with
21 * or without modification, are permitted provided that this Notice and any
22 * statement of authorship are reproduced on all copies.
23 */
24
43#ifndef vtkPainter_h
44#define vtkPainter_h
45
46#include "vtkRenderingOpenGLModule.h" // For export macro
47#include "vtkObject.h"
48#include "vtkWeakPointer.h" // needed for vtkWeakPointer.
49
51class vtkActor;
52class vtkDataObject;
53class vtkDataSet;
54class vtkInformation;
56class vtkPainterObserver;
57class vtkRenderer;
58class vtkTimerLog;
59class vtkWindow;
60
61class VTKRENDERINGOPENGL_EXPORT vtkPainter : public vtkObject
62{
63public:
64 vtkTypeMacro(vtkPainter, vtkObject);
65 virtual void PrintSelf(ostream &os, vtkIndent indent);
66
74
82
89
91
94 vtkGetObjectMacro(Information, vtkInformation);
97
99
102 vtkGetObjectMacro(DelegatePainter, vtkPainter);
105
107
110 void Register(vtkObjectBase *o) VTK_OVERRIDE;
111 void UnRegister(vtkObjectBase *o) VTK_OVERRIDE;
113
114 enum {
115 VERTS = 0x1,
116 LINES = 0x2,
117 POLYS = 0x4,
118 STRIPS = 0x8
119 };
120
128 virtual void Render(vtkRenderer* renderer, vtkActor* actor,
129 unsigned long typeflags, bool forceCompileOnly);
130
138
140
143 vtkSetClampMacro(Progress,double,0.0,1.0);
144 vtkGetMacro(Progress,double);
146
152 virtual double GetTimeToDraw();
153
159 virtual void UpdateBounds(double bounds[6]);
160
162
167 vtkGetObjectMacro(Input, vtkDataObject);
169
175 { return this->Input; }
176
177protected:
180
184 void ReportReferences(vtkGarbageCollector *collector) VTK_OVERRIDE;
185
195
201 virtual void PassInformation(vtkPainter* toPainter);
202
211
219 virtual void RenderInternal(vtkRenderer* renderer, vtkActor* actor,
220 unsigned long typeflags, bool forceCompileOnly);
221
227 virtual void UpdateDelegateProgress(vtkPainter* delegate, double amount);
228
234
239 virtual void ObserverPainterProgress(vtkPainter* toObserve);
240
246 void UpdateProgress(double amount);
247
249
253 int fieldAttributeType,
254 vtkDataSet* ds,
255 bool *use_cell_data=0);
257 const char* name, vtkDataSet* dsl,
258 bool *use_cell_data=0);
260
261 // Time of most recent call to ProcessInformation().
263 friend class vtkPainterObserver;
264 vtkPainterObserver* Observer;
265
268
269 double Progress;
272
275
276
277 vtkWeakPointer<vtkWindow> LastWindow; // Window used for previous render.
278 // This is not reference counted.
279private:
280 vtkPainter(const vtkPainter &) VTK_DELETE_FUNCTION;
281 void operator=(const vtkPainter &) VTK_DELETE_FUNCTION;
282
283 vtkDataObject* Input;
284
285};
286
287#endif //vtkPainter_h
Abstract superclass for all arrays.
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:52
general representation of visualization data
Definition: vtkDataObject.h:65
abstract class to specify dataset behavior
Definition: vtkDataSet.h:63
Detect and break reference loops.
a simple class to control print indentation
Definition: vtkIndent.h:40
Key for integer values in vtkInformation.
Store vtkAlgorithm input/output information.
abstract base class for most VTK objects
Definition: vtkObjectBase.h:66
abstract base class for most VTK objects
Definition: vtkObject.h:60
Abstract class for drawing poly data.
Definition: vtkPainter.h:62
vtkAbstractArray * GetInputArrayToProcess(int fieldAssociation, const char *name, vtkDataSet *dsl, bool *use_cell_data=0)
vtkTimeStamp InformationProcessTime
Definition: vtkPainter.h:262
vtkTimerLog * Timer
Definition: vtkPainter.h:274
virtual void SetDelegatePainter(vtkPainter *)
virtual void RenderInternal(vtkRenderer *renderer, vtkActor *actor, unsigned long typeflags, bool forceCompileOnly)
Performs the actual rendering.
virtual void PassInformation(vtkPainter *toPainter)
Pass on the information and data (output) from the this to the argument painter.
void UpdateDelegatePainter()
Updates the delegate painter.
static vtkInformationIntegerKey * CONSERVE_MEMORY()
Keys used to specify control the behaviour of the painter.
virtual double GetTimeToDraw()
Get the time required to draw the geometry last time it was rendered.
vtkPainter * DelegatePainter
Definition: vtkPainter.h:267
static vtkInformationIntegerKey * STATIC_DATA()
Keys used to specify control the behaviour of the painter.
virtual void SetInformation(vtkInformation *)
double Progress
Definition: vtkPainter.h:269
void UpdateProgress(double amount)
Update the progress of the process object.
vtkWeakPointer< vtkWindow > LastWindow
Definition: vtkPainter.h:277
virtual void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this painter.
void UnRegister(vtkObjectBase *o) override
Decrease the reference count (release by another object).
virtual void Render(vtkRenderer *renderer, vtkActor *actor, unsigned long typeflags, bool forceCompileOnly)
Generates rendering primitives of appropriate type(s).
vtkInformation * Information
Definition: vtkPainter.h:266
virtual void ProcessInformation(vtkInformation *)
Called before RenderInternal() if the Information has been changed since the last time this method wa...
Definition: vtkPainter.h:233
virtual void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
static vtkInformationIntegerKey * HIGH_QUALITY()
Keys used to specify control the behaviour of the painter.
virtual vtkDataObject * GetOutput()
Get the output data object from this painter.
Definition: vtkPainter.h:174
void SetInput(vtkDataObject *)
Set the data object to paint.
double TimeToDraw
Definition: vtkPainter.h:273
virtual void ObserverPainterProgress(vtkPainter *toObserve)
Adds a progress event observer to toObserve.
virtual void PrepareForRendering(vtkRenderer *, vtkActor *)
Some subclasses may need to do some preprocessing before the actual rendering can be done eg.
Definition: vtkPainter.h:210
double ProgressScaleFactor
Definition: vtkPainter.h:271
virtual void UpdateBounds(double bounds[6])
Expand or shrink the estimated bounds of the object based on the geometric transformations performed ...
double ProgressOffset
Definition: vtkPainter.h:270
vtkAbstractArray * GetInputArrayToProcess(int fieldAssociation, int fieldAttributeType, vtkDataSet *ds, bool *use_cell_data=0)
Helper method to get input array to process.
void ReportReferences(vtkGarbageCollector *collector) override
Take part in garbage collection.
virtual void UpdateDelegateProgress(vtkPainter *delegate, double amount)
Called when the delegate painter reports its progress.
void Register(vtkObjectBase *o) override
Take part in garbage collection.
vtkPainterObserver * Observer
Definition: vtkPainter.h:264
abstract specification for renderers
Definition: vtkRenderer.h:64
record modification and/or execution time
Definition: vtkTimeStamp.h:36
Timer support and logging.
Definition: vtkTimerLog.h:81
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
@ name
Definition: vtkX3D.h:219