VTK  9.3.0
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:
29  void PrintSelf(ostream& os, vtkIndent indent) override;
30 
34  void AddItem(vtkTransform*);
35 
40  vtkTransform* GetNextItem();
41 
47  {
48  return static_cast<vtkTransform*>(this->GetNextItemAsObject(cookie));
49  }
50 
51 protected:
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 
60  void operator=(const vtkTransformCollection&) = delete;
61 };
62 
63 //----------------------------------------------------------------------------
65 {
66  this->vtkCollection::AddItem(t);
67 }
68 
69 //----------------------------------------------------------------------------
71 {
72  return static_cast<vtkTransform*>(this->GetNextItemAsObject());
73 }
74 
75 VTK_ABI_NAMESPACE_END
76 #endif
create and manipulate ordered lists of objects
Definition: vtkCollection.h:45
void AddItem(vtkObject *)
Add an object to the bottom of the list.
vtkObject * GetNextItemAsObject()
Get the next item in the collection.
a simple class to control print indentation
Definition: vtkIndent.h:29
abstract base class for most VTK objects
Definition: vtkObject.h:52
maintain a list of transforms
~vtkTransformCollection() override=default
static vtkTransformCollection * New()
void AddItem(vtkTransform *)
Add a Transform to the list.
vtkTransformCollection()=default
vtkTransform * GetNextItem()
Get the next Transform in the list.
vtkTransform * GetNextTransform(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:50
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:40