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:
28  static vtkTransformCollection* New();
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:
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 
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
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:40
abstract base class for most VTK objects
Definition: vtkObject.h:51
vtkTransform * GetNextTransform(vtkCollectionSimpleIterator &cookie)
Reentrant safe way to get an object in a collection.
void AddItem(vtkTransform *)
Add a Transform to the list.
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:49
vtkTransform * GetNextItem()
Get the next Transform in the list.
a simple class to control print indentation
Definition: vtkIndent.h:28
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkCollection * New()
Construct with empty list.
maintain a list of transforms
void AddItem(vtkObject *)
Add an object to the bottom of the list.
create and manipulate ordered lists of objects
Definition: vtkCollection.h:44
vtkObject * GetNextItemAsObject()
Get the next item in the collection.