template<typename IteratorType, typename
OwnerType>
class vtk::CompositeDataSetNodeReference< IteratorType, OwnerType >
A reference proxy into a vtkCompositeDataSet, obtained by dereferencing an iterator from the vtk::Range(vtkCompositeDataSet*) overloads.
This proxy may be used as a pointer, in which case it will forward the currently pointed-to vtkDataObject*. This means that the following code is legal:
{
if (node)
{
assert(node->IsA("vtkDataObject"));
node = nullptr;
}
}
{
}
general representation of visualization data
auto Range(IterablePtr iterable, Options &&... opts) -> typename detail::IterableTraits< typename detail::StripPointers< IterablePtr >::type >::RangeType
Generate an iterable STL proxy object for a VTK container.
This allows for simple access to the objects in the composite dataset. If more advanced operations are required, the CompositeDataSetNodeReference can:
- Access the current vtkDataObject*:
vtkDataObject* NodeReference::GetDataObject() const
NodeReference::operator vtkDataObject* () const
(implicit conversion)
vtkDataObject* NodeReference::operator->() const
(arrow operator)
- Replace the current vtkDataObject* in the composite dataset:
void NodeReference::SetDataObject(vtkDataObject*)
NodeReference& NodeReference::operator=(vtkDataObject*)
(assignment)
- SetGet the vtkDataObject at the same position in another composite dataset
void NodeReference::SetDataObject(vtkCompositeDataSet*, vtkDataObject*)
vtkDataObject* NodeReference::GetDataObject(vtkCompositeDataSet*) const
- Check and access node metadata (if any):
bool NodeReference::HasMetaData() const
vtkInformation* NodeReference::GetMetaData() const
- Get the current flat index within the parent range:
unsigned int NodeReference::GetFlatIndex() const
Assigning one reference to another assigns the vtkDataObject* pointer to the target reference. Assigning to non-leaf nodes invalidates all iterators / references.
Equality testing compares each reference's DataObject and FlatIndex.
- Warning
- The NodeReference shares state with the OwnerType iterator that generates it. Incrementing or destroying the parent iterator will invalidate the reference. In debugging builds, these misuses will be caught via runtime assertions.
Definition at line 148 of file vtkCompositeDataSetNodeReference.h.