VTK: Common/Transforms/vtkTransformCollection.h Source File

| VTK 9.3.1

vtkTransformCollection.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 vtkTransformCollection_h
16 #define vtkTransformCollection_h
17
18 #include "vtkCollection.h"
19 #include "vtkCommonTransformsModule.h" // For export macro
20
21 #include "vtkTransform.h" // Needed for inline methods
22
23 VTK_ABI_NAMESPACE_BEGIN
24 class VTKCOMMONTRANSFORMS_EXPORT vtkTransformCollection : public vtkCollection
25 {
26 public:
27 vtkTypeMacro(vtkTransformCollection, vtkCollection);
28 static vtkTransformCollection* New();
29 void PrintSelf(ostream& os, vtkIndent indent) override;
30
34 void AddItem(vtkTransform*);
35
40 vtkTransform* GetNextItem();
41
46 vtkTransform* GetNextTransform(vtkCollectionSimpleIterator& cookie)
47 {
48 return static_cast<vtkTransform*>(this->GetNextItemAsObject(cookie));
49 }
50
51 protected:
52 vtkTransformCollection() = default;
53 ~vtkTransformCollection() override = default;
54
55 private:
56 // hide the standard AddItem from the user and the compiler.
57 void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
58
59 vtkTransformCollection(const vtkTransformCollection&) = delete;
60 void operator=(const vtkTransformCollection&) = delete;
61 };
62
63 //----------------------------------------------------------------------------
64 inline void vtkTransformCollection::AddItem(vtkTransform* t)
65 {
66 this->vtkCollection::AddItem(t);
67 }
68
69 //----------------------------------------------------------------------------
70 inline vtkTransform* vtkTransformCollection::GetNextItem()
71 {
72 return static_cast<vtkTransform*>(this->GetNextItemAsObject());
73 }
74
75 VTK_ABI_NAMESPACE_END
76 #endif
vtkCollection
create and manipulate ordered lists of objects
Definition: vtkCollection.h:45
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
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkTransformCollection
maintain a list of transforms
Definition: vtkTransformCollection.h:25
vtkTransformCollection::~vtkTransformCollection
~vtkTransformCollection() override=default
vtkTransformCollection::New
static vtkTransformCollection * New()
vtkTransformCollection::AddItem
void AddItem(vtkTransform *)
Add a Transform to the list.
Definition: vtkTransformCollection.h:64
vtkTransformCollection::vtkTransformCollection
vtkTransformCollection()=default
vtkTransformCollection::GetNextItem
vtkTransform * GetNextItem()
Get the next Transform in the list.
Definition: vtkTransformCollection.h:70
vtkTransformCollection::GetNextTransform
vtkTransform * GetNextTransform(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
Definition: vtkTransformCollection.h:46
vtkTransformCollection::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTransform
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:59
vtkCollection.h
vtkCollectionSimpleIterator
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:40
vtkTransform.h