VTK  9.0.2
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
a list of nodes that form an assembly path
a list of lists of props representing an assembly hierarchy
~vtkAssemblyPaths() override
void AddItem(vtkAssemblyPath *p)
Add a path to the list.
vtkAssemblyPath * GetNextPath(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
int IsItemPresent(vtkAssemblyPath *p)
Determine whether a particular path is present.
static vtkAssemblyPaths * New()
vtkAssemblyPath * GetNextItem()
Get the next path in the list.
vtkMTimeType GetMTime() override
Override the standard GetMTime() to check for the modified times of the paths.
void RemoveItem(vtkAssemblyPath *p)
Remove a path from the list.
create and manipulate ordered lists of objects
Definition: vtkCollection.h:53
void RemoveItem(int i)
Remove the i'th item in the list.
void AddItem(vtkObject *)
Add an object to the bottom of the list.
vtkObject * GetNextItemAsObject()
Get the next item in the collection.
int IsItemPresent(vtkObject *a)
Search for an object and return location in list.
abstract base class for most VTK objects
Definition: vtkObject.h:63
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:54
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:48
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:293