VTK  9.7.1
vtkImageSliceCollection.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
14 #ifndef vtkImageSliceCollection_h
15 #define vtkImageSliceCollection_h
16 
17 #include "vtkImageSlice.h" // to allow inline static-cast
18 #include "vtkPropCollection.h"
19 #include "vtkRenderingImageModule.h" // For export macro
20 #include "vtkWrappingHints.h"
21 
22 VTK_ABI_NAMESPACE_BEGIN
23 class VTKRENDERINGIMAGE_EXPORT VTK_MARSHALAUTO vtkImageSliceCollection : public vtkPropCollection
24 {
25 public:
26  static vtkImageSliceCollection* New();
28  void PrintSelf(ostream& os, vtkIndent indent) override;
29 
36  void Sort();
37 
42  void AddItem(vtkImageSlice* a);
43 
49  vtkImageSlice* GetNextImage();
50 
54  vtkImageSlice* GetNextImage(vtkCollectionSimpleIterator& cookie);
55 
61  vtkImageSlice* GetNextItem() { return this->GetNextImage(); }
62 
63 protected:
64  vtkImageSliceCollection() = default;
65  ~vtkImageSliceCollection() override;
66 
67 private:
68  // hide the standard AddItem from the user and the compiler.
69  void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
70  void AddItem(vtkProp* o) { this->vtkPropCollection::AddItem(o); }
71 
73  void operator=(const vtkImageSliceCollection&) = delete;
74 };
75 
77 {
78  return static_cast<vtkImageSlice*>(this->GetNextItemAsObject());
79 }
80 
82 {
83  return static_cast<vtkImageSlice*>(this->GetNextItemAsObject(cookie));
84 }
85 
86 VTK_ABI_NAMESPACE_END
87 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:49
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:35
abstract base class for most VTK objects
Definition: vtkObject.h:52
a sorted list of image slice objects
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
an ordered list of Props
a simple class to control print indentation
Definition: vtkIndent.h:28
vtkImageSlice * GetNextImage()
Standard Collection methods.
void AddItem(vtkObject *)
Add given item to the bottom (end) of the collection.
void AddItem(vtkProp *a)
Add a Prop to the bottom of the list.
vtkImageSlice * GetNextItem()
Access routine provided for compatibility with previous versions of VTK.
represents an image in a 3D scene
Definition: vtkImageSlice.h:39
void Sort(std::function< bool(vtkObject *, vtkObject *)> f)
Sort the collection according to a given std::function that should return true if the first vtkObject...
#define VTK_MARSHALAUTO
vtkObject * GetNextItemAsObject()
Get the next item in the collection.
static vtkPropCollection * New()