VTK
vtkViewNode.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkViewNode.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=========================================================================*/
29#ifndef vtkViewNode_h
30#define vtkViewNode_h
31
32#include "vtkRenderingSceneGraphModule.h" // For export macro
33#include "vtkWeakPointer.h" //avoid ref loop to parent
34#include "vtkObject.h"
35
36class vtkCollection;
39
40class VTKRENDERINGSCENEGRAPH_EXPORT vtkViewNode :
41 public vtkObject
42{
43public:
44 vtkTypeMacro(vtkViewNode, vtkObject);
45 void PrintSelf(ostream& os, vtkIndent indent);
46
48
51 vtkGetObjectMacro(Renderable, vtkObject);
53
57 virtual void Build(bool /* prepass */) {};
58
62 virtual void Synchronize(bool /* prepass */) {};
63
67 virtual void Render(bool /*prepass*/) {};
68
72 virtual void Invalidate(bool /*prepass*/) {};
73
75
78 virtual void SetParent(vtkViewNode*);
81
83
87 vtkGetObjectMacro(Children, vtkViewNodeCollection);
89
91
96 vtkGetObjectMacro(MyFactory, vtkViewNodeFactory);
98
104
109
114 virtual void SetRenderable(vtkObject *);
115
116 // if you want to traverse your children in a specific order
117 // or way override this method
118 virtual void Traverse(int operation);
119
120 virtual void TraverseAllPasses();
121
126
130 enum operation_type{noop, build, synchronize, render, invalidate};
131
132protected:
135
136 static const char* operation_type_strings[];
137
138 void Apply(int operation, bool prepass);
139
141
148
150
157
163
168
173
174 friend class vtkViewNodeFactory;
175
176private:
177 vtkViewNode(const vtkViewNode&) VTK_DELETE_FUNCTION;
178 void operator=(const vtkViewNode&) VTK_DELETE_FUNCTION;
179};
180
181#endif
create and manipulate unsorted lists of objects
Definition: vtkCollection.h:52
a simple class to control print indentation
Definition: vtkIndent.h:40
abstract base class for most VTK objects
Definition: vtkObject.h:60
collection of view nodes
factory that chooses vtkViewNodes to create
a node within a VTK scene graph
Definition: vtkViewNode.h:42
virtual void SetRenderable(vtkObject *)
Alow explicit setting of the renderable for a view node.
virtual void TraverseAllPasses()
vtkWeakPointer< vtkViewNode > Parent
Definition: vtkViewNode.h:170
void AddMissingNodes(vtkCollection *col)
virtual vtkViewNode * GetParent()
vtkViewNode * GetViewNodeFor(vtkObject *)
Returns the view node that corresponding to the provided object Will return NULL if a match is not fo...
virtual void Render(bool)
Makes calls to make self visible.
Definition: vtkViewNode.h:67
void RemoveUnusedNodes()
Called after PrepareNodes and AddMissingNodes removes any extra leftover nodes.
vtkObject * Renderable
Definition: vtkViewNode.h:169
vtkMTimeType RenderTime
Allows smart caching.
Definition: vtkViewNode.h:125
vtkViewNodeFactory * MyFactory
Definition: vtkViewNode.h:172
operation_type
internal mechanics of graph traversal and actions
Definition: vtkViewNode.h:130
virtual void SetChildren(vtkViewNodeCollection *)
Access nodes that this one owns.
void Apply(int operation, bool prepass)
void AddMissingNode(vtkObject *obj)
convienience method to add node or nodes if missing from our current list
void PrepareNodes()
Called first before adding missing nodes.
virtual void Traverse(int operation)
virtual void Build(bool)
Builds myself.
Definition: vtkViewNode.h:57
virtual void Invalidate(bool)
Clear any cached data.
Definition: vtkViewNode.h:72
vtkViewNode * GetFirstAncestorOfType(const char *type)
Find the first parent/grandparent of the desired type.
virtual void SetMyFactory(vtkViewNodeFactory *)
A factory that creates particular subclasses for different rendering back ends.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkCollection * PreparedNodes
Definition: vtkViewNode.h:155
vtkViewNodeCollection * Children
Definition: vtkViewNode.h:171
virtual vtkViewNode * CreateViewNode(vtkObject *obj)
Create the correct ViewNode subclass for the passed in object.
virtual void Synchronize(bool)
Ensures that my state agrees with my Renderable's.
Definition: vtkViewNode.h:62
virtual void SetParent(vtkViewNode *)
Access the node that owns this one.
@ type
Definition: vtkX3D.h:516
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248