16#ifndef vtkCompositeDataSetRange_h
17#define vtkCompositeDataSetRange_h
50struct CompositeDataSetRange;
51struct CompositeDataSetIterator;
59 :
public std::iterator<std::forward_iterator_tag, vtkDataObject*, int,
60 CompositeDataSetIteratorReference, CompositeDataSetIteratorReference>
63 using Superclass = std::iterator<std::forward_iterator_tag,
vtkDataObject*, int,
72 using pointer =
typename Superclass::pointer;
76 : Iterator(o.Iterator ?
SmartIterator::Take(o.Iterator->NewInstance()) : nullptr)
78 this->CopyState(o.Iterator);
86 this->CopyState(o.Iterator);
133 return !(lhs == rhs);
139 swap(lhs.Iterator, rhs.Iterator);
148 : Iterator(std::move(iter))
160 void CopyState(InternalIterator*
source)
164 assert(this->Iterator !=
nullptr);
168 assert(!
source->IsDoneWithTraversal());
169 this->AdvanceTo(
source->GetCurrentFlatIndex());
173 void AdvanceTo(
const unsigned int flatIdx)
175 assert(this->Iterator !=
nullptr);
185 assert(this->Iterator !=
nullptr);
192 assert(this->Iterator !=
nullptr);
197 mutable SmartIterator Iterator;
220 : CompositeDataSet(cds)
223 assert(this->CompositeDataSet);
234 auto iter = this->NewIterator();
235 iter->InitTraversal();
236 while (!iter->IsDoneWithTraversal())
239 iter->GoToNextItem();
255 SmartIterator NewIterator()
const
260 result->SetSkipEmptyNodes((this->Options & Opts::SkipEmptyNodes) != Opts::None);
261 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++()
CompositeDataSetIterator operator++(int)
typename Superclass::pointer pointer
CompositeDataSetIterator(CompositeDataSetIterator &&) noexcept=default
pointer operator->() const
typename Superclass::difference_type difference_type
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(const CompositeDataSetIterator &o)
friend bool operator==(const CompositeDataSetIterator &lhs, const CompositeDataSetIterator &rhs)
CompositeDataSetIterator() noexcept
typename Superclass::iterator_category iterator_category
typename Superclass::reference reference
typename Superclass::value_type value_type
const_iterator cend() const
CompositeDataSetOptions GetOptions() const noexcept
vtkCompositeDataSet * GetCompositeDataSet() 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 *)