VTK  9.3.20240329
vtkAssemblyPaths.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
15 #ifndef vtkAssemblyPaths_h
16 #define vtkAssemblyPaths_h
17 
18 #include "vtkCollection.h"
19 #include "vtkRenderingCoreModule.h" // For export macro
20 
21 #include "vtkAssemblyPath.h" // Needed for inline methods
22 
23 VTK_ABI_NAMESPACE_BEGIN
24 class vtkProp;
25 
26 class VTKRENDERINGCORE_EXPORT vtkAssemblyPaths : public vtkCollection
27 {
28 public:
29  static vtkAssemblyPaths* New();
31  void PrintSelf(ostream& os, vtkIndent indent) override;
32 
36  void AddItem(vtkAssemblyPath* p);
37 
41  void RemoveItem(vtkAssemblyPath* p);
42 
49 
53  vtkAssemblyPath* GetNextItem();
54 
59  vtkMTimeType GetMTime() override;
60 
66  {
67  return static_cast<vtkAssemblyPath*>(this->GetNextItemAsObject(cookie));
68  }
69 
70 protected:
71  vtkAssemblyPaths() = default;
72  ~vtkAssemblyPaths() override = default;
73 
74 private:
75  // hide the standard AddItem from the user and the compiler.
76  void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
77  void RemoveItem(vtkObject* o) { this->vtkCollection::RemoveItem(o); }
78  void RemoveItem(int i) { this->vtkCollection::RemoveItem(i); }
79  int IsItemPresent(vtkObject* o) { return this->vtkCollection::IsItemPresent(o); }
80 
81  vtkAssemblyPaths(const vtkAssemblyPaths&) = delete;
82  void operator=(const vtkAssemblyPaths&) = delete;
83 };
84 
86 {
87  this->vtkCollection::AddItem(p);
88 }
89 
91 {
93 }
94 
96 {
97  return this->vtkCollection::IsItemPresent(p);
98 }
99 
101 {
102  return static_cast<vtkAssemblyPath*>(this->GetNextItemAsObject());
103 }
104 
105 VTK_ABI_NAMESPACE_END
106 #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:46
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:108
abstract base class for most VTK objects
Definition: vtkObject.h:162
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:66
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:41
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270