VTK
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 "vtkRenderingImageModule.h" // For export macro
30 #include "vtkPropCollection.h"
31 #include "vtkImageSlice.h" // to allow inline static-cast
32 
33 class VTKRENDERINGIMAGE_EXPORT vtkImageSliceCollection : public vtkPropCollection
34 {
35  public:
36  static vtkImageSliceCollection *New();
38 
45  void Sort();
46 
51  void AddItem(vtkImageSlice *a);
52 
58  vtkImageSlice *GetNextImage();
59 
63  vtkImageSlice *GetNextImage(vtkCollectionSimpleIterator &cookie);
64 
70  vtkImageSlice *GetNextItem() { return this->GetNextImage(); }
71 
72 protected:
74  ~vtkImageSliceCollection() override;
75 
76  void DeleteElement(vtkCollectionElement *) override;
77 
78 private:
79  // hide the standard AddItem from the user and the compiler.
80  void AddItem(vtkObject *o) { this->vtkCollection::AddItem(o); };
81  void AddItem(vtkProp *o) { this->vtkPropCollection::AddItem(o); };
82 
83 private:
85  void operator=(const vtkImageSliceCollection&) = delete;
86 };
87 
89 {
90  return static_cast<vtkImageSlice *>(this->GetNextItemAsObject());
91 }
92 
95 {
96  return static_cast<vtkImageSlice *>(this->GetNextItemAsObject(cookie));
97 }
98 
99 
100 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:52
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:47
abstract base class for most VTK objects
Definition: vtkObject.h:59
virtual void DeleteElement(vtkCollectionElement *)
a sorted list of image slice objects
an ordered list of Props
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:52
vtkObject * GetNextItemAsObject()
Get the next item in the collection.
static vtkPropCollection * New()