VTK  9.2.6
vtk::CompositeDataSetNodeReference< IteratorType, OwnerType > Class Template Reference

A reference proxy into a vtkCompositeDataSet, obtained by dereferencing an iterator from the vtk::Range(vtkCompositeDataSet*) overloads. More...

#include <vtkCompositeDataSetNodeReference.h>

Inheritance diagram for vtk::CompositeDataSetNodeReference< IteratorType, OwnerType >:
[legend]
Collaboration diagram for vtk::CompositeDataSetNodeReference< IteratorType, OwnerType >:
[legend]

Public Member Functions

 CompositeDataSetNodeReference ()=delete
 
 CompositeDataSetNodeReference (const CompositeDataSetNodeReference &src)=default
 
 CompositeDataSetNodeReference (CompositeDataSetNodeReference &&) noexcept=default
 
 ~CompositeDataSetNodeReference ()=default
 
CompositeDataSetNodeReferenceoperator= (const CompositeDataSetNodeReference &src)
 
vtkDataObjectGetDataObject () const
 
vtkDataObjectGetDataObject (vtkCompositeDataSet *other)
 
 operator bool () const
 
 operator vtkDataObject * () const
 
vtkDataObjectoperator-> () const
 
void SetDataObject (vtkDataObject *obj)
 
void SetDataObject (vtkCompositeDataSet *other, vtkDataObject *dObj)
 
CompositeDataSetNodeReferenceoperator= (vtkDataObject *obj)
 
unsigned int GetFlatIndex () const
 
bool HasMetaData () const
 
vtkInformationGetMetaData () const
 

Public Attributes

friend OwnerType
 

Protected Member Functions

 CompositeDataSetNodeReference (IteratorType *iterator)
 

Friends

bool operator== (const CompositeDataSetNodeReference &lhs, const CompositeDataSetNodeReference &rhs)
 
bool operator!= (const CompositeDataSetNodeReference &lhs, const CompositeDataSetNodeReference &rhs)
 

Detailed Description

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:

for (auto node : vtk::Range(cds))
{ // decltype(node) == CompositeDataSetNodeReference
if (node) // same as: if (node.GetDataObject() != nullptr)
{
assert(node->IsA("vtkDataObject")); // node.GetDataObject()->IsA(...)
node = nullptr; // node.SetDataObject(nullptr)
}
}
for (vtkDataObject *dObj : vtk::Range(cds))
{
// Work with dObj
}
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.
Definition vtkRange.h:85

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 146 of file vtkCompositeDataSetNodeReference.h.

Constructor & Destructor Documentation

◆ CompositeDataSetNodeReference() [1/4]

template<typename IteratorType , typename OwnerType >
vtk::CompositeDataSetNodeReference< IteratorType, OwnerType >::CompositeDataSetNodeReference ( IteratorType * iterator)
inlineexplicitprotected

Definition at line 170 of file vtkCompositeDataSetNodeReference.h.

◆ CompositeDataSetNodeReference() [2/4]

template<typename IteratorType , typename OwnerType >
vtk::CompositeDataSetNodeReference< IteratorType, OwnerType >::CompositeDataSetNodeReference ( )
delete

◆ CompositeDataSetNodeReference() [3/4]

template<typename IteratorType , typename OwnerType >
vtk::CompositeDataSetNodeReference< IteratorType, OwnerType >::CompositeDataSetNodeReference ( const CompositeDataSetNodeReference< IteratorType, OwnerType > & src)
default

◆ CompositeDataSetNodeReference() [4/4]

template<typename IteratorType , typename OwnerType >
vtk::CompositeDataSetNodeReference< IteratorType, OwnerType >::CompositeDataSetNodeReference ( CompositeDataSetNodeReference< IteratorType, OwnerType > && )
defaultnoexcept

◆ ~CompositeDataSetNodeReference()

template<typename IteratorType , typename OwnerType >
vtk::CompositeDataSetNodeReference< IteratorType, OwnerType >::~CompositeDataSetNodeReference ( )
default

Member Function Documentation

◆ operator=() [1/2]

template<typename IteratorType , typename OwnerType >
CompositeDataSetNodeReference & vtk::CompositeDataSetNodeReference< IteratorType, OwnerType >::operator= ( const CompositeDataSetNodeReference< IteratorType, OwnerType > & src)
inline

Definition at line 185 of file vtkCompositeDataSetNodeReference.h.

◆ GetDataObject() [1/2]

template<typename IteratorType , typename OwnerType >
vtkDataObject * vtk::CompositeDataSetNodeReference< IteratorType, OwnerType >::GetDataObject ( ) const
inline

Definition at line 205 of file vtkCompositeDataSetNodeReference.h.

◆ GetDataObject() [2/2]

template<typename IteratorType , typename OwnerType >
vtkDataObject * vtk::CompositeDataSetNodeReference< IteratorType, OwnerType >::GetDataObject ( vtkCompositeDataSet * other)
inline

Definition at line 218 of file vtkCompositeDataSetNodeReference.h.

◆ operator bool()

template<typename IteratorType , typename OwnerType >
vtk::CompositeDataSetNodeReference< IteratorType, OwnerType >::operator bool ( ) const
inline

Definition at line 224 of file vtkCompositeDataSetNodeReference.h.

◆ operator vtkDataObject *()

template<typename IteratorType , typename OwnerType >
vtk::CompositeDataSetNodeReference< IteratorType, OwnerType >::operator vtkDataObject * ( ) const
inline

Definition at line 226 of file vtkCompositeDataSetNodeReference.h.

◆ operator->()

template<typename IteratorType , typename OwnerType >
vtkDataObject * vtk::CompositeDataSetNodeReference< IteratorType, OwnerType >::operator-> ( ) const
inline

Definition at line 228 of file vtkCompositeDataSetNodeReference.h.

◆ SetDataObject() [1/2]

template<typename IteratorType , typename OwnerType >
void vtk::CompositeDataSetNodeReference< IteratorType, OwnerType >::SetDataObject ( vtkDataObject * obj)
inline

Definition at line 230 of file vtkCompositeDataSetNodeReference.h.

◆ SetDataObject() [2/2]

template<typename IteratorType , typename OwnerType >
void vtk::CompositeDataSetNodeReference< IteratorType, OwnerType >::SetDataObject ( vtkCompositeDataSet * other,
vtkDataObject * dObj )
inline

Definition at line 237 of file vtkCompositeDataSetNodeReference.h.

◆ operator=() [2/2]

template<typename IteratorType , typename OwnerType >
CompositeDataSetNodeReference & vtk::CompositeDataSetNodeReference< IteratorType, OwnerType >::operator= ( vtkDataObject * obj)
inline

Definition at line 243 of file vtkCompositeDataSetNodeReference.h.

◆ GetFlatIndex()

template<typename IteratorType , typename OwnerType >
unsigned int vtk::CompositeDataSetNodeReference< IteratorType, OwnerType >::GetFlatIndex ( ) const
inline

Definition at line 249 of file vtkCompositeDataSetNodeReference.h.

◆ HasMetaData()

template<typename IteratorType , typename OwnerType >
bool vtk::CompositeDataSetNodeReference< IteratorType, OwnerType >::HasMetaData ( ) const
inline

Definition at line 255 of file vtkCompositeDataSetNodeReference.h.

◆ GetMetaData()

template<typename IteratorType , typename OwnerType >
vtkInformation * vtk::CompositeDataSetNodeReference< IteratorType, OwnerType >::GetMetaData ( ) const
inline

Definition at line 261 of file vtkCompositeDataSetNodeReference.h.

Friends And Related Symbol Documentation

◆ operator==

template<typename IteratorType , typename OwnerType >
bool operator== ( const CompositeDataSetNodeReference< IteratorType, OwnerType > & lhs,
const CompositeDataSetNodeReference< IteratorType, OwnerType > & rhs )
friend

Definition at line 192 of file vtkCompositeDataSetNodeReference.h.

◆ operator!=

template<typename IteratorType , typename OwnerType >
bool operator!= ( const CompositeDataSetNodeReference< IteratorType, OwnerType > & lhs,
const CompositeDataSetNodeReference< IteratorType, OwnerType > & rhs )
friend

Definition at line 199 of file vtkCompositeDataSetNodeReference.h.

Member Data Documentation

◆ OwnerType

template<typename IteratorType , typename OwnerType >
friend vtk::CompositeDataSetNodeReference< IteratorType, OwnerType >::OwnerType

Definition at line 177 of file vtkCompositeDataSetNodeReference.h.


The documentation for this class was generated from the following file: