vtkDataAssembly

Struct vtkDataAssembly 

Source
pub struct vtkDataAssembly(/* private fields */);
Expand description

hierarchical representation to use with

vtkPartitionedDataSetCollection

vtkDataAssembly is a mechanism to represent hierarchical organization of items (or vtkPartitionedDataSet instances) in a vtkPartitionedDataSetCollection. vtkPartitionedDataSetCollection is similar to a vtkMultiBlockDataSet since it provides a means for putting together multiple non-composite datasets. However, vtkPartitionedDataSetCollection itself doesn’t provide any mechanism to define relationships between items in the collections. That is done using vtkDataAssembly.

@section Overview Overview

At its core, vtkDataAssembly is simply a tree of nodes starting with the root node. Each node has a unique id and a string name (names need not be unique). On initialization with vtkDataAssembly::Initialize, an empty tree with a root node is created. The root node’s id and name can be obtained using vtkDataAssembly::GetRootNode and vtkDataAssembly::GetRootNodeName. The root node’s id is fixed (vtkDataAssembly::GetRootNode), however the name can be changed using vtkDataAssembly::SetRootNodeName.

Child nodes can be added using vtkDataAssembly::AddNode or vtkDataAssembly::AddNodes, each of which returns the ids for every child node added. A non-root node can be removed using vtkDataAssembly::RemoveNode.

Each node in the tree (including the root node) can have associated dataset indices. For a vtkDataAssembly associated with a vtkPartitionedDataSetCollection, these indices refer to the item index, or partitioned-dataset-index for items in the collection. Dataset indices can be specified using vtkDataAssembly::AddDataSetIndex, vtkDataAssembly::AddDataSetIndices and removed using vtkDataAssembly::RemoveDataSetIndex, vtkDataAssembly::RemoveAllDataSetIndices. vtkDataAssembly::GetDataSetIndices provides a mechanism to get the database indices associated with a node, and optionally, the entire subtree rooted at the chosen node.

@section Searching Searching

Each node in the vtkDataAssembly is assigned a unique id. vtkDataAssembly::FindFirstNodeWithName and vtkDataAssembly::FindNodesWithName can be used to get the id(s) for node(s) with given name.

vtkDataAssembly::SelectNodes provides a more flexible mechanism to find nodes using name-based queries. Section @ref DataAssemblyPathQueries covers supported queries.

@section Traversal Traversal

vtkDataAssemblyVisitor defines a visitor API. An instance of a concretized vtkDataAssemblyVisitor subclass can be passed to vtkDataAssembly::Visit to traverse the data-assembly hierarchy either in depth-first or breadth-first order.

@section DataAssemblyPathQueries Supported Path Queries

vtkDataAssembly::SelectNodes can be used find nodes that match the specified query (or queries) using XPath 1.0 syntax.

For example:

  • ‘/’ is used as the path separator. If a node name has a / it must be escaped using \\ in the query. Note, escaping is not necessary when using SetNodeName/GetNodeName.

  • ‘/’ selects the root node.

  • ‘/nodename’ selects all child nodes of the root with the name ‘nodename’.

  • ‘//nodename’ selects all nodes with ‘nodename’ that are descendants of the root; thus, this this will traverse the entire tree.

  • ‘/nodename/’ selects all child nodes of all nodes named ‘nodename’ under the root; thus, ending a query with ‘/’ selects the children of the found nodes rather than the nodes themselves.

  • ‘/nodename1/nodename2’ selects all nodes named ‘nodename2’ which are children of nodes with name ‘nodename1’ that are themselves children of the root node.

  • ‘//nodename1/nodename2’ finds all nodes in the tree named ‘nodename1’ and then selects all children of these found nodes that are named ‘nodename2’.

@section Applications Applications

The separation of dataset storage (vtkPartitionedDataSetCollection) and organization (vtkDataAssembly) enables development of algorithms that can expose APIs that are not tightly coupled to dataset storage. Together, vtkPartitionedDataSetCollection and vtkDataAssembly can be thought of as a different way of organizing data that was previously organized as a vtkMultiBlockDataSet. The advantage of the this newer approach is that filters can support specifying parameters using paths or path queries rather than composite indices. The composite indices suffered from the fact that they made no sense except for the specific vtkMultiBlockDataSet they were applied too. Thus, if the filters input was changed, the composite ids rarely made any sense and needed to be updated. Paths and path queries, however, do not suffer from this issue.

Implementations§

Source§

impl vtkDataAssembly

Source

pub fn new() -> Self

Creates a new vtkDataAssembly wrapped inside vtkNew

Trait Implementations§

Source§

impl Default for vtkDataAssembly

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Drop for vtkDataAssembly

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.