VTK  9.1.0
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  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
47  void AddItem(vtkAssemblyPath* p);
48 
52  void RemoveItem(vtkAssemblyPath* p);
53 
59 
63  vtkAssemblyPath* GetNextItem();
64 
69  vtkMTimeType GetMTime() override;
70 
76  {
77  return static_cast<vtkAssemblyPath*>(this->GetNextItemAsObject(cookie));
78  }
79 
80 protected:
81  vtkAssemblyPaths() = default;
82  ~vtkAssemblyPaths() override = default;
83 
84 private:
85  // hide the standard AddItem from the user and the compiler.
86  void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
87  void RemoveItem(vtkObject* o) { this->vtkCollection::RemoveItem(o); }
88  void RemoveItem(int i) { this->vtkCollection::RemoveItem(i); }
89  int IsItemPresent(vtkObject* o) { return this->vtkCollection::IsItemPresent(o); }
90 
91 private:
92  vtkAssemblyPaths(const vtkAssemblyPaths&) = delete;
93  void operator=(const vtkAssemblyPaths&) = delete;
94 };
95 
97 {
98  this->vtkCollection::AddItem(p);
99 }
100 
102 {
103  this->vtkCollection::RemoveItem(p);
104 }
105 
107 {
108  return this->vtkCollection::IsItemPresent(p);
109 }
110 
112 {
113  return static_cast<vtkAssemblyPath*>(this->GetNextItemAsObject());
114 }
115 
116 #endif
a list of nodes that form an assembly path
a list of lists of props representing an assembly hierarchy
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()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkAssemblyPath * GetNextItem()
Get the next path in the list.
vtkAssemblyPaths()=default
vtkMTimeType GetMTime() override
Override the standard GetMTime() to check for the modified times of the paths.
~vtkAssemblyPaths() override=default
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.
a simple class to control print indentation
Definition: vtkIndent.h:34
abstract base class for most VTK objects
Definition: vtkObject.h:63
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:57
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:48
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287