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 "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 
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 
94 {
95  return static_cast<vtkImageSlice*>(this->GetNextItemAsObject(cookie));
96 }
97 
98 #endif
vtkCollection::DeleteElement
virtual void DeleteElement(vtkCollectionElement *)
vtkCollectionSimpleIterator
void * vtkCollectionSimpleIterator
Definition: vtkCollection.h:48
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:53
vtkCollection::GetNextItemAsObject
vtkObject * GetNextItemAsObject()
Get the next item in the collection.
Definition: vtkCollection.h:179
vtkImageSlice
represents an image in a 3D scene
Definition: vtkImageSlice.h:46
vtkImageSliceCollection::GetNextImage
vtkImageSlice * GetNextImage()
Standard Collection methods.
Definition: vtkImageSliceCollection.h:88
vtkPropCollection::AddItem
void AddItem(vtkProp *a)
Add a Prop to the bottom of the list.
Definition: vtkPropCollection.h:86
vtkImageSliceCollection
a sorted list of image slice objects
Definition: vtkImageSliceCollection.h:33
vtkImageSliceCollection::vtkImageSliceCollection
vtkImageSliceCollection()
Definition: vtkImageSliceCollection.h:73
vtkImageSliceCollection::GetNextItem
vtkImageSlice * GetNextItem()
Access routine provided for compatibility with previous versions of VTK.
Definition: vtkImageSliceCollection.h:70
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:47
vtkImageSlice.h
vtkPropCollection::New
static vtkPropCollection * New()
vtkCollection::AddItem
void AddItem(vtkObject *)
Add an object to the bottom of the list.
vtkCollectionElement
Definition: vtkCollection.h:37
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:35
vtkPropCollection.h