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 usingSetNodeName/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
impl vtkDataAssembly
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new vtkDataAssembly wrapped inside vtkNew