1 /*=========================================================================
2 
3   Program:   Visualization Toolkit
4   Module:    vtkViewNodeCollection.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 =========================================================================*/
15 /**
16  * @class   vtkViewNodeCollection
17  * @brief   collection of view nodes
18  *
19  * vtk centric collection of vtkViewNodes
20 */
21 
22 #ifndef vtkViewNodeCollection_h
23 #define vtkViewNodeCollection_h
24 
25 #include "vtkRenderingSceneGraphModule.h" // For export macro
26 #include "vtkCollection.h"
27 
28 class vtkViewNode;
29 
30 class VTKRENDERINGSCENEGRAPH_EXPORT vtkViewNodeCollection :
31   public vtkCollection
32 {
33 public:
34   static vtkViewNodeCollection* New();
35   vtkTypeMacro(vtkViewNodeCollection, vtkCollection);
36   void PrintSelf(ostream& os, vtkIndent indent) override;
37 
38   /**
39    * Add a ViewNode to the list.
40    */
41   void AddItem(vtkViewNode *a);
42 
43   /**
44    * Get the next ViewNode in the list. NULL is returned when the collection is
45    * exhausted.
46    */
47   vtkViewNode *GetNextItem();
48 
49   /**
50    * Reentrant safe way to get an object in a collection. Just pass the
51    * same cookie back and forth.
52    */
53   vtkViewNode *GetNextViewNode(vtkCollectionSimpleIterator &cookie);
54 
55   /**
56    * Return true only if we have viewnode for obj.
57    */
58   bool IsRenderablePresent(vtkObject *obj);
59 
60 protected:
vtkViewNodeCollection()61   vtkViewNodeCollection() {};
~vtkViewNodeCollection()62   ~vtkViewNodeCollection() {};
63 
64 private:
65   // hide the standard AddItem from the user and the compiler.
AddItem(vtkObject * o)66   void AddItem(vtkObject *o)
67     { this->vtkCollection::AddItem(o); }
68 
69   vtkViewNodeCollection(const vtkViewNodeCollection&) = delete;
70   void operator=(const vtkViewNodeCollection&) = delete;
71 };
72 
73 #endif
74