16 #ifndef vtkCompositeDataSetRange_h
17 #define vtkCompositeDataSetRange_h
48 struct CompositeDataSetRange;
49 struct CompositeDataSetIterator;
70 : Iterator(o.Iterator ?
SmartIterator::Take(o.Iterator->NewInstance()) : nullptr)
72 this->CopyState(o.Iterator);
80 this->CopyState(o.Iterator);
127 return !(lhs == rhs);
133 swap(lhs.Iterator, rhs.Iterator);
142 : Iterator(std::move(iter))
154 void CopyState(InternalIterator*
source)
158 assert(this->Iterator !=
nullptr);
166 this->AdvanceTo(
source->GetCurrentFlatIndex());
170 void AdvanceTo(
const unsigned int flatIdx)
172 assert(this->Iterator !=
nullptr);
182 assert(this->Iterator !=
nullptr);
189 assert(this->Iterator !=
nullptr);
194 mutable SmartIterator Iterator;
217 : CompositeDataSet(cds)
220 assert(this->CompositeDataSet);
231 auto iter = this->NewIterator();
232 iter->InitTraversal();
233 while (!iter->IsDoneWithTraversal())
236 iter->GoToNextItem();
252 SmartIterator NewIterator()
const
257 result->SetSkipEmptyNodes((this->Options & Opts::SkipEmptyNodes) != Opts::None);
258 result->InitTraversal();
superclass for composite data iterators
virtual void SetDataSet(vtkCompositeDataSet *ds)
Set the composite dataset this iterator is iterating over.
virtual int IsDoneWithTraversal()=0
Test whether the iterator is finished with the traversal.
virtual void InitTraversal()
Begin iterating over the composite dataset structure.
virtual void SetSkipEmptyNodes(vtkTypeBool)
If SkipEmptyNodes is true, then nullptr datasets will be skipped.
virtual void GoToNextItem()=0
Move the iterator to the next item in the collection.
virtual unsigned int GetCurrentFlatIndex()=0
Flat index is an index to identify the data in a composite data structure.
abstract superclass for composite (multi-block or AMR) datasets
virtual vtkCompositeDataIterator * NewIterator()=0
Return a new iterator (the iterator has to be deleted by user).
general representation of visualization data
static vtkSmartPointer< InternalIterator > Take(InternalIterator *t)
Transfer ownership of one reference to the given VTK object to a new smart pointer.
A reference proxy into a vtkCompositeDataSet, obtained by dereferencing an iterator from the vtk::Ran...
vtkSmartPointer< vtkDataArray > GetData(const Ioss::GroupingEntity *entity, const std::string &fieldname, Ioss::Transform *transform=nullptr, Cache *cache=nullptr, const std::string &cachekey=std::string())
Returns a VTK array for a given field (fieldname) on the chosen block (or set) entity.
vtk::CompositeDataSetNodeReference< vtkCompositeDataIterator, CompositeDataSetIterator > CompositeDataSetIteratorReference
Specialization of tuple ranges and iterators for vtkAOSDataArrayTemplate.
CompositeDataSetIterator operator++(int)
CompositeDataSetIterator(CompositeDataSetIterator &&) noexcept=default
pointer operator->() const
friend bool operator!=(const CompositeDataSetIterator &lhs, const CompositeDataSetIterator &rhs)
friend void swap(CompositeDataSetIterator &lhs, CompositeDataSetIterator &rhs) noexcept
reference operator*() const
CompositeDataSetIterator(SmartIterator &&iter) noexcept
CompositeDataSetIterator & operator++()
std::forward_iterator_tag iterator_category
CompositeDataSetIterator(const CompositeDataSetIterator &o)
friend bool operator==(const CompositeDataSetIterator &lhs, const CompositeDataSetIterator &rhs)
CompositeDataSetIterator() noexcept
vtkCompositeDataSet * GetCompositeDataSet() const noexcept
const_iterator cend() const
CompositeDataSetOptions GetOptions() const noexcept
const_iterator cbegin() const
CompositeDataSetRange(vtkCompositeDataSet *cds, CompositeDataSetOptions opts=CompositeDataSetOptions::None)
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)