1 /*========================================================================= 2 3 Program: Visualization Toolkit 4 Module: vtkImplicitFunctionCollection.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 vtkImplicitFunctionCollection 17 * @brief maintain a list of implicit functions 18 * 19 * vtkImplicitFunctionCollection is an object that creates and manipulates 20 * lists of objects of type vtkImplicitFunction. 21 * @sa 22 * vtkCollection vtkPlaneCollection 23 */ 24 25 #ifndef vtkImplicitFunctionCollection_h 26 #define vtkImplicitFunctionCollection_h 27 28 #include "vtkCollection.h" 29 #include "vtkCommonDataModelModule.h" // For export macro 30 31 #include "vtkImplicitFunction.h" // Needed for inline methods 32 33 class VTKCOMMONDATAMODEL_EXPORT vtkImplicitFunctionCollection : public vtkCollection 34 { 35 public: 36 vtkTypeMacro(vtkImplicitFunctionCollection, vtkCollection); 37 static vtkImplicitFunctionCollection* New(); 38 void PrintSelf(ostream& os, vtkIndent indent) override; 39 40 /** 41 * Add an implicit function to the list. 42 */ 43 void AddItem(vtkImplicitFunction*); 44 45 /** 46 * Get the next implicit function in the list. 47 */ 48 vtkImplicitFunction* GetNextItem(); 49 50 ///@{ 51 /** 52 * Reentrant safe way to get an object in a collection. Just pass the 53 * same cookie back and forth. 54 */ GetNextImplicitFunction(vtkCollectionSimpleIterator & cookie)55 vtkImplicitFunction* GetNextImplicitFunction(vtkCollectionSimpleIterator& cookie) 56 { 57 return static_cast<vtkImplicitFunction*>(this->GetNextItemAsObject(cookie)); 58 } 59 ///@} 60 61 protected: 62 vtkImplicitFunctionCollection() = default; 63 ~vtkImplicitFunctionCollection() override = default; 64 65 private: 66 // hide the standard AddItem from the user and the compiler. AddItem(vtkObject * o)67 void AddItem(vtkObject* o) { this->vtkCollection::AddItem(o); } 68 69 private: 70 vtkImplicitFunctionCollection(const vtkImplicitFunctionCollection&) = delete; 71 void operator=(const vtkImplicitFunctionCollection&) = delete; 72 }; 73 AddItem(vtkImplicitFunction * f)74inline void vtkImplicitFunctionCollection::AddItem(vtkImplicitFunction* f) 75 { 76 this->vtkCollection::AddItem(f); 77 } 78 GetNextItem()79inline vtkImplicitFunction* vtkImplicitFunctionCollection::GetNextItem() 80 { 81 return static_cast<vtkImplicitFunction*>(this->GetNextItemAsObject()); 82 } 83 84 #endif 85