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 
36 class vtkCollection;
37 class vtkViewNodeFactory;
39 
40 class VTKRENDERINGSCENEGRAPH_EXPORT vtkViewNode :
41  public vtkObject
42 {
43 public:
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*);
79  virtual vtkViewNode * GetParent();
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 
132 protected:
135 
136  static const char* operation_type_strings[];
137 
138  void Apply(int operation, bool prepass);
139 
141 
148 
150 
154  void PrepareNodes();
157 
163 
168 
173 
174  friend class vtkViewNodeFactory;
175 
176 private:
177  vtkViewNode(const vtkViewNode&) VTK_DELETE_FUNCTION;
178  void operator=(const vtkViewNode&) VTK_DELETE_FUNCTION;
179 };
180 
181 #endif
vtkViewNodeCollection
collection of view nodes
Definition: vtkViewNodeCollection.h:35
vtkViewNode::Build
virtual void Build(bool)
Builds myself.
Definition: vtkViewNode.h:57
vtkX3D::type
@ type
Definition: vtkX3D.h:516
vtkViewNode::Synchronize
virtual void Synchronize(bool)
Ensures that my state agrees with my Renderable's.
Definition: vtkViewNode.h:62
vtkViewNode::GetViewNodeFor
vtkViewNode * GetViewNodeFor(vtkObject *)
Returns the view node that corresponding to the provided object Will return NULL if a match is not fo...
vtkViewNode::Apply
void Apply(int operation, bool prepass)
vtkViewNode::RemoveUnusedNodes
void RemoveUnusedNodes()
Called after PrepareNodes and AddMissingNodes removes any extra leftover nodes.
vtkViewNode::synchronize
@ synchronize
Definition: vtkViewNode.h:130
vtkViewNode::MyFactory
vtkViewNodeFactory * MyFactory
Definition: vtkViewNode.h:172
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:60
vtkViewNode::PreparedNodes
vtkCollection * PreparedNodes
Definition: vtkViewNode.h:155
vtkViewNode::SetChildren
virtual void SetChildren(vtkViewNodeCollection *)
Access nodes that this one owns.
vtkViewNode::AddMissingNodes
void AddMissingNodes(vtkCollection *col)
vtkMTimeType
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248
vtkViewNode::operation_type
operation_type
internal mechanics of graph traversal and actions
Definition: vtkViewNode.h:130
vtkViewNode::TraverseAllPasses
virtual void TraverseAllPasses()
vtkCollection
create and manipulate unsorted lists of objects
Definition: vtkCollection.h:52
vtkViewNode::SetRenderable
virtual void SetRenderable(vtkObject *)
Alow explicit setting of the renderable for a view node.
vtkViewNode::RenderTime
vtkMTimeType RenderTime
Allows smart caching.
Definition: vtkViewNode.h:125
vtkViewNodeFactory
factory that chooses vtkViewNodes to create
Definition: vtkViewNodeFactory.h:38
vtkViewNode::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkViewNode::PrepareNodes
void PrepareNodes()
Called first before adding missing nodes.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkViewNode::Render
virtual void Render(bool)
Makes calls to make self visible.
Definition: vtkViewNode.h:67
vtkWeakPointer.h
vtkViewNode
a node within a VTK scene graph
Definition: vtkViewNode.h:42
vtkViewNode::GetParent
virtual vtkViewNode * GetParent()
vtkViewNode::Children
vtkViewNodeCollection * Children
Definition: vtkViewNode.h:171
vtkObject.h
vtkViewNode::Parent
vtkWeakPointer< vtkViewNode > Parent
Definition: vtkViewNode.h:170
vtkViewNode::Renderable
vtkObject * Renderable
Definition: vtkViewNode.h:169
vtkViewNode::CreateViewNode
virtual vtkViewNode * CreateViewNode(vtkObject *obj)
Create the correct ViewNode subclass for the passed in object.
vtkViewNode::Invalidate
virtual void Invalidate(bool)
Clear any cached data.
Definition: vtkViewNode.h:72
vtkViewNode::SetParent
virtual void SetParent(vtkViewNode *)
Access the node that owns this one.
vtkViewNode::~vtkViewNode
~vtkViewNode()
vtkViewNode::vtkViewNode
vtkViewNode()
vtkViewNode::SetMyFactory
virtual void SetMyFactory(vtkViewNodeFactory *)
A factory that creates particular subclasses for different rendering back ends.
vtkViewNode::GetFirstAncestorOfType
vtkViewNode * GetFirstAncestorOfType(const char *type)
Find the first parent/grandparent of the desired type.
vtkWeakPointer< vtkViewNode >
vtkViewNode::AddMissingNode
void AddMissingNode(vtkObject *obj)
convienience method to add node or nodes if missing from our current list
vtkViewNode::Traverse
virtual void Traverse(int operation)