VTK  9.6.20260120
vtkDataAssemblyUtilities.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
13
14#ifndef vtkDataAssemblyUtilities_h
15#define vtkDataAssemblyUtilities_h
16
17#include "vtkCommonDataModelModule.h" // for export macros
18#include "vtkObject.h"
19#include "vtkSmartPointer.h" // for vtkSmartPointer
20
21#include <string> // for std::string
22#include <vector> // for std::vector
23
24VTK_ABI_NAMESPACE_BEGIN
26class vtkDataAssembly;
27class vtkDataObject;
31
32class VTKCOMMONDATAMODEL_EXPORT vtkDataAssemblyUtilities : public vtkObject
33{
34public:
37 void PrintSelf(ostream& os, vtkIndent indent) override;
38
43 static const char* HierarchyName() { return "Hierarchy"; }
44
49 static const char* CategoryHierarchyName() { return "vtk_category"; };
50
55 static const char* CategoryHierarchy() { return "hierarchy"; };
56
62 static const char* CategoryTransformedHierarchy() { return "xformed_hierarchy"; };
63
70 const char* name, vtkCompositeDataSet* cd);
71
87 vtkPartitionedDataSetCollection* output = nullptr);
88
102
115 static std::vector<unsigned int> GetSelectedCompositeIds(
116 const std::vector<std::string>& selectors, vtkDataAssembly* hierarchyOrAssembly,
117 vtkPartitionedDataSetCollection* data = nullptr, bool leaf_nodes_only = false);
118
120
128 static std::string GetSelectorForCompositeId(unsigned int id, vtkDataAssembly* hierarchy);
129 static std::vector<std::string> GetSelectorsForCompositeIds(
130 const std::vector<unsigned int>& ids, vtkDataAssembly* hierarchy);
131 static std::vector<std::string> GetSelectorsForCompositeIds(
132 const std::vector<unsigned int>& ids, vtkDataAssembly* hierarchy, vtkDataAssembly* assembly);
133 static std::vector<unsigned int> GetSelectorsCompositeIdsForCompositeIds(
134 const std::vector<unsigned int>& ids, vtkDataAssembly* hierarchy);
136
137protected:
140
147
148private:
150 void operator=(const vtkDataAssemblyUtilities&) = delete;
151};
152
153VTK_ABI_NAMESPACE_END
154#endif
abstract superclass for composite (multi-block or AMR) datasets
static const char * CategoryTransformedHierarchy()
Value used for CategoryHierarchyName() attribute on the generated data assembly when the data assembl...
static bool GenerateHierarchyInternal(vtkPartitionedDataSetCollection *input, vtkDataAssembly *hierarchy, vtkPartitionedDataSetCollection *output)
static bool GenerateHierarchyInternal(vtkUniformGridAMR *input, vtkDataAssembly *hierarchy, vtkPartitionedDataSetCollection *output)
static std::vector< std::string > GetSelectorsForCompositeIds(const std::vector< unsigned int > &ids, vtkDataAssembly *hierarchy, vtkDataAssembly *assembly)
For a vtkDataAssembly representing an hierarchy, returns the selector for the given composite id.
static const char * CategoryHierarchy()
Value used for CategoryHierarchyName() attribute on the generate data assembly when it represents the...
static vtkSmartPointer< vtkCompositeDataSet > GenerateCompositeDataSetFromHierarchy(vtkPartitionedDataSetCollection *input, vtkDataAssembly *hierarchy)
Inverse of GenerateHierarchy.
static bool GenerateHierarchy(vtkCompositeDataSet *input, vtkDataAssembly *hierarchy, vtkPartitionedDataSetCollection *output=nullptr)
Populates hierarchy with a representation of the hierarchy for the given composite dataset input.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkSmartPointer< vtkDataAssembly > GetDataAssembly(const char *name, vtkCompositeDataSet *cd)
Convenience method to get a named vtkDataAssembly from a vtkCompositeDataSet, if available.
static std::string GetSelectorForCompositeId(unsigned int id, vtkDataAssembly *hierarchy)
For a vtkDataAssembly representing an hierarchy, returns the selector for the given composite id.
static std::vector< unsigned int > GetSelectedCompositeIds(const std::vector< std::string > &selectors, vtkDataAssembly *hierarchyOrAssembly, vtkPartitionedDataSetCollection *data=nullptr, bool leaf_nodes_only=false)
Given a vtkDataAssembly and collection of selectors, returns a list of selected composite indices for...
static bool GenerateHierarchyInternal(vtkMultiBlockDataSet *input, vtkDataAssembly *hierarchy, vtkPartitionedDataSetCollection *output)
static const char * HierarchyName()
Returns the named used by VTK to correspond to a vtkDataAssembly associated with the structure of a c...
~vtkDataAssemblyUtilities() override
static std::vector< unsigned int > GetSelectorsCompositeIdsForCompositeIds(const std::vector< unsigned int > &ids, vtkDataAssembly *hierarchy)
For a vtkDataAssembly representing an hierarchy, returns the selector for the given composite id.
static const char * CategoryHierarchyName()
String used as the attribute name for data assembly nodes to identify data-assembly instances that re...
static vtkDataAssemblyUtilities * New()
static std::vector< std::string > GetSelectorsForCompositeIds(const std::vector< unsigned int > &ids, vtkDataAssembly *hierarchy)
For a vtkDataAssembly representing an hierarchy, returns the selector for the given composite id.
hierarchical representation to use with vtkPartitionedDataSetCollection
general representation of visualization data
a simple class to control print indentation
Definition vtkIndent.h:108
Composite dataset that organizes datasets into blocks.
Composite dataset that groups datasets as a collection.
Hold a reference to a vtkObjectBase instance.
Legacy, empty shell inheriting vtkAMRDataObject.