VTK: Rendering/Image/vtkImageSliceCollection.h Source File

| VTK 9.3.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
21 VTK_ABI_NAMESPACE_BEGIN
22 class VTKRENDERINGIMAGE_EXPORT vtkImageSliceCollection : public vtkPropCollection
23 {
24 public:
25 static vtkImageSliceCollection* New();
26 vtkTypeMacro(vtkImageSliceCollection, vtkPropCollection);
27 void PrintSelf(ostream& os, vtkIndent indent) override;
28
35 void Sort();
36
41 void AddItem(vtkImageSlice* a);
42
48 vtkImageSlice* GetNextImage();
49
53 vtkImageSlice* GetNextImage(vtkCollectionSimpleIterator& cookie);
54
60 vtkImageSlice* GetNextItem() { return this->GetNextImage(); }
61
62 protected:
63 vtkImageSliceCollection() = default;
64 ~vtkImageSliceCollection() override;
65
66 void DeleteElement(vtkCollectionElement*) override;
67
68 private:
69 // hide the standard AddItem from the user and the compiler.
70 void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
71 void AddItem(vtkProp* o) { this->vtkPropCollection::AddItem(o); }
72
73 vtkImageSliceCollection(const vtkImageSliceCollection&) = delete;
74 void operator=(const vtkImageSliceCollection&) = delete;
75 };
76
77 inline vtkImageSlice* vtkImageSliceCollection::GetNextImage()
78 {
79 return static_cast<vtkImageSlice*>(this->GetNextItemAsObject());
80 }
81
82 inline vtkImageSlice* vtkImageSliceCollection::GetNextImage(vtkCollectionSimpleIterator& cookie)
83 {
84 return static_cast<vtkImageSlice*>(this->GetNextItemAsObject(cookie));
85 }
86
87 VTK_ABI_NAMESPACE_END
88 #endif
vtkCollectionElement
Definition: vtkCollection.h:30
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
vtkImageSliceCollection
a sorted list of image slice objects
Definition: vtkImageSliceCollection.h:23
vtkImageSliceCollection::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkImageSliceCollection::GetNextItem
vtkImageSlice * GetNextItem()
Access routine provided for compatibility with previous versions of VTK.
Definition: vtkImageSliceCollection.h:60
vtkImageSliceCollection::Sort
void Sort()
Sorts the vtkImageSliceCollection by layer number.
vtkImageSliceCollection::DeleteElement
void DeleteElement(vtkCollectionElement *) override
vtkImageSliceCollection::AddItem
void AddItem(vtkImageSlice *a)
Add an image to the list.
vtkImageSliceCollection::New
static vtkImageSliceCollection * New()
vtkImageSliceCollection::GetNextImage
vtkImageSlice * GetNextImage()
Standard Collection methods.
Definition: vtkImageSliceCollection.h:77
vtkImageSliceCollection::vtkImageSliceCollection
vtkImageSliceCollection()=default
vtkImageSliceCollection::~vtkImageSliceCollection
~vtkImageSliceCollection() override
vtkImageSlice
represents an image in a 3D scene
Definition: vtkImageSlice.h:48
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:37
vtkPropCollection::AddItem
void AddItem(vtkProp *a)
Add a Prop to the bottom of the list.
Definition: vtkPropCollection.h:87
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:55
vtkCollectionSimpleIterator
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:40
vtkImageSlice.h
vtkPropCollection.h