VTK: Rendering/Core/vtkAssemblyPaths.h Source File

| VTK 9.3.1

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();
30 vtkTypeMacro(vtkAssemblyPaths, vtkCollection);
31 void PrintSelf(ostream& os, vtkIndent indent) override;
32
36 void AddItem(vtkAssemblyPath* p);
37
41 void RemoveItem(vtkAssemblyPath* p);
42
48 int IsItemPresent(vtkAssemblyPath* p);
49
53 vtkAssemblyPath* GetNextItem();
54
59 vtkMTimeType GetMTime() override;
60
65 vtkAssemblyPath* GetNextPath(vtkCollectionSimpleIterator& cookie)
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
85 inline void vtkAssemblyPaths::AddItem(vtkAssemblyPath* p)
86 {
87 this->vtkCollection::AddItem(p);
88 }
89
90 inline void vtkAssemblyPaths::RemoveItem(vtkAssemblyPath* p)
91 {
92 this->vtkCollection::RemoveItem(p);
93 }
94
95 inline int vtkAssemblyPaths::IsItemPresent(vtkAssemblyPath* p)
96 {
97 return this->vtkCollection::IsItemPresent(p);
98 }
99
100 inline vtkAssemblyPath* vtkAssemblyPaths::GetNextItem()
101 {
102 return static_cast<vtkAssemblyPath*>(this->GetNextItemAsObject());
103 }
104
105 VTK_ABI_NAMESPACE_END
106 #endif
vtkAssemblyPath
a list of nodes that form an assembly path
Definition: vtkAssemblyPath.h:43
vtkAssemblyPaths
a list of lists of props representing an assembly hierarchy
Definition: vtkAssemblyPaths.h:27
vtkAssemblyPaths::AddItem
void AddItem(vtkAssemblyPath *p)
Add a path to the list.
Definition: vtkAssemblyPaths.h:85
vtkAssemblyPaths::GetNextPath
vtkAssemblyPath * GetNextPath(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
Definition: vtkAssemblyPaths.h:65
vtkAssemblyPaths::IsItemPresent
int IsItemPresent(vtkAssemblyPath *p)
Determine whether a particular path is present.
Definition: vtkAssemblyPaths.h:95
vtkAssemblyPaths::New
static vtkAssemblyPaths * New()
vtkAssemblyPaths::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkAssemblyPaths::GetNextItem
vtkAssemblyPath * GetNextItem()
Get the next path in the list.
Definition: vtkAssemblyPaths.h:100
vtkAssemblyPaths::vtkAssemblyPaths
vtkAssemblyPaths()=default
vtkAssemblyPaths::GetMTime
vtkMTimeType GetMTime() override
Override the standard GetMTime() to check for the modified times of the paths.
vtkAssemblyPaths::~vtkAssemblyPaths
~vtkAssemblyPaths() override=default
vtkAssemblyPaths::RemoveItem
void RemoveItem(vtkAssemblyPath *p)
Remove a path from the list.
Definition: vtkAssemblyPaths.h:90
vtkCollection
create and manipulate ordered lists of objects
Definition: vtkCollection.h:45
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.
vtkCollection::GetNextItemAsObject
vtkObject * GetNextItemAsObject()
Get the next item in the collection.
Definition: vtkCollection.h:177
vtkCollection::IsItemPresent
int IsItemPresent(vtkObject *a)
Search for an object and return location in list.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:55
vtkAssemblyPath.h
vtkCollection.h
vtkCollectionSimpleIterator
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:40
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270