VTK  9.2.6
vtkImageSliceCollection.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageSliceCollection.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
26 #ifndef vtkImageSliceCollection_h
27 #define vtkImageSliceCollection_h
28 
29 #include "vtkImageSlice.h" // to allow inline static-cast
30 #include "vtkPropCollection.h"
31 #include "vtkRenderingImageModule.h" // For export macro
32 
33 class VTKRENDERINGIMAGE_EXPORT vtkImageSliceCollection : public vtkPropCollection
34 {
35 public:
36  static vtkImageSliceCollection* New();
38  void PrintSelf(ostream& os, vtkIndent indent) override;
39 
46  void Sort();
47 
52  void AddItem(vtkImageSlice* a);
53 
59  vtkImageSlice* GetNextImage();
60 
64  vtkImageSlice* GetNextImage(vtkCollectionSimpleIterator& cookie);
65 
71  vtkImageSlice* GetNextItem() { return this->GetNextImage(); }
72 
73 protected:
74  vtkImageSliceCollection() = default;
75  ~vtkImageSliceCollection() override;
76 
77  void DeleteElement(vtkCollectionElement*) override;
78 
79 private:
80  // hide the standard AddItem from the user and the compiler.
81  void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); }
82  void AddItem(vtkProp* o) { this->vtkPropCollection::AddItem(o); }
83 
84 private:
86  void operator=(const vtkImageSliceCollection&) = delete;
87 };
88 
90 {
91  return static_cast<vtkImageSlice*>(this->GetNextItemAsObject());
92 }
93 
95 {
96  return static_cast<vtkImageSlice*>(this->GetNextItemAsObject(cookie));
97 }
98 
99 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:56
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:51
abstract base class for most VTK objects
Definition: vtkObject.h:62
virtual void DeleteElement(vtkCollectionElement *)
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.
void Sort(RandomIt bitr, RandomIt eitr, BackToFront< T > &me)
an ordered list of Props
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkImageSlice * GetNextImage()
Standard Collection methods.
void AddItem(vtkObject *)
Add an object to the bottom of the list.
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:49
vtkObject * GetNextItemAsObject()
Get the next item in the collection.
static vtkPropCollection * New()