VTK
vtkAssemblyPaths.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkAssemblyPaths.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 vtkAssemblyPaths_h
28 #define vtkAssemblyPaths_h
29 
30 #include "vtkCollection.h"
31 #include "vtkRenderingCoreModule.h" // For export macro
32 
33 #include "vtkAssemblyPath.h" // Needed for inline methods
34 
35 class vtkProp;
36 
37 class VTKRENDERINGCORE_EXPORT vtkAssemblyPaths : public vtkCollection
38 {
39 public:
40  static vtkAssemblyPaths* New();
42 
46  void AddItem(vtkAssemblyPath* p);
47 
51  void RemoveItem(vtkAssemblyPath* p);
52 
58 
62  vtkAssemblyPath* GetNextItem();
63 
68  vtkMTimeType GetMTime() override;
69 
75  {
76  return static_cast<vtkAssemblyPath*>(this->GetNextItemAsObject(cookie));
77  }
78 
79 protected:
81  ~vtkAssemblyPaths() override {}
82 
83 private:
84  // hide the standard AddItem from the user and the compiler.
85  void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
86  void RemoveItem(vtkObject* o) { this->vtkCollection::RemoveItem(o); }
87  void RemoveItem(int i) { this->vtkCollection::RemoveItem(i); }
88  int IsItemPresent(vtkObject* o) { return this->vtkCollection::IsItemPresent(o); }
89 
90 private:
91  vtkAssemblyPaths(const vtkAssemblyPaths&) = delete;
92  void operator=(const vtkAssemblyPaths&) = delete;
93 };
94 
96 {
97  this->vtkCollection::AddItem(p);
98 }
99 
101 {
102  this->vtkCollection::RemoveItem(p);
103 }
104 
106 {
107  return this->vtkCollection::IsItemPresent(p);
108 }
109 
111 {
112  return static_cast<vtkAssemblyPath*>(this->GetNextItemAsObject());
113 }
114 
115 #endif
116 // VTK-HeaderTest-Exclude: vtkAssemblyPaths.h
vtkCollection::New
static vtkCollection * New()
Construct with empty list.
vtkCollectionSimpleIterator
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:48
vtkAssemblyPaths::IsItemPresent
int IsItemPresent(vtkAssemblyPath *p)
Determine whether a particular path is present.
Definition: vtkAssemblyPaths.h:105
vtkCollection.h
vtkAssemblyPaths::AddItem
void AddItem(vtkAssemblyPath *p)
Add a path to the list.
Definition: vtkAssemblyPaths.h:95
vtkCollection::IsItemPresent
int IsItemPresent(vtkObject *a)
Search for an object and return location in list.
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:53
vtkAssemblyPaths::RemoveItem
void RemoveItem(vtkAssemblyPath *p)
Remove a path from the list.
Definition: vtkAssemblyPaths.h:100
vtkAssemblyPath
a list of nodes that form an assembly path
Definition: vtkAssemblyPath.h:41
vtkAssemblyPaths::vtkAssemblyPaths
vtkAssemblyPaths()
Definition: vtkAssemblyPaths.h:80
vtkAssemblyPaths
a list of lists of props representing an assembly hierarchy
Definition: vtkAssemblyPaths.h:37
vtkCollection::GetNextItemAsObject
vtkObject * GetNextItemAsObject()
Get the next item in the collection.
Definition: vtkCollection.h:179
vtkAssemblyPaths::GetNextItem
vtkAssemblyPath * GetNextItem()
Get the next path in the list.
Definition: vtkAssemblyPaths.h:110
vtkCollection
create and manipulate ordered lists of objects
Definition: vtkCollection.h:52
vtkObject::GetMTime
virtual vtkMTimeType GetMTime()
Return this object's modified time.
vtkAssemblyPaths::GetNextPath
vtkAssemblyPath * GetNextPath(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
Definition: vtkAssemblyPaths.h:74
vtkAssemblyPaths::~vtkAssemblyPaths
~vtkAssemblyPaths() override
Definition: vtkAssemblyPaths.h:81
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:47
vtkCollection::RemoveItem
void RemoveItem(int i)
Remove the i'th item in the list.
vtkCollection::AddItem
void AddItem(vtkObject *)
Add an object to the bottom of the list.
vtkAssemblyPath.h
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:298