VTK  9.3.1
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
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 
24 VTK_ABI_NAMESPACE_BEGIN
26 class vtkDataAssembly;
27 class vtkDataObject;
30 class vtkUniformGridAMR;
31 
32 class VTKCOMMONDATAMODEL_EXPORT vtkDataAssemblyUtilities : public vtkObject
33 {
34 public:
35  static vtkDataAssemblyUtilities* New();
37  void PrintSelf(ostream& os, vtkIndent indent) override;
38 
43  static const char* HierarchyName() { return "Hierarchy"; }
44 
50  static vtkSmartPointer<vtkDataAssembly> GetDataAssembly(
51  const char* name, vtkCompositeDataSet* cd);
52 
67  static bool GenerateHierarchy(vtkCompositeDataSet* input, vtkDataAssembly* hierarchy,
68  vtkPartitionedDataSetCollection* output = nullptr);
69 
81  static vtkSmartPointer<vtkCompositeDataSet> GenerateCompositeDataSetFromHierarchy(
83 
96  static std::vector<unsigned int> GetSelectedCompositeIds(
97  const std::vector<std::string>& selectors, vtkDataAssembly* hierarchyOrAssembly,
98  vtkPartitionedDataSetCollection* data = nullptr, bool leaf_nodes_only = false);
99 
101 
109  static std::string GetSelectorForCompositeId(unsigned int id, vtkDataAssembly* hierarchy);
110  static std::vector<std::string> GetSelectorsForCompositeIds(
111  const std::vector<unsigned int>& ids, vtkDataAssembly* hierarchy);
112  static std::vector<std::string> GetSelectorsForCompositeIds(
113  const std::vector<unsigned int>& ids, vtkDataAssembly* hierarchy, vtkDataAssembly* assembly);
114  static std::vector<unsigned int> GetSelectorsCompositeIdsForCompositeIds(
115  const std::vector<unsigned int>& ids, vtkDataAssembly* hierarchy);
117 
118 protected:
120  ~vtkDataAssemblyUtilities() override;
121 
122  static bool GenerateHierarchyInternal(
124  static bool GenerateHierarchyInternal(vtkMultiBlockDataSet* input, vtkDataAssembly* hierarchy,
126  static bool GenerateHierarchyInternal(vtkPartitionedDataSetCollection* input,
128 
129 private:
131  void operator=(const vtkDataAssemblyUtilities&) = delete;
132 };
133 
134 VTK_ABI_NAMESPACE_END
135 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:51
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static const char * HierarchyName()
Returns the named used by VTK to correspond to a vtkDataAssembly associated with the structure of a c...
Hold a reference to a vtkObjectBase instance.
Definition: vtkMeta.h:23
abstract superclass for composite (multi-block or AMR) datasets
a simple class to control print indentation
Definition: vtkIndent.h:28
Composite dataset that organizes datasets into blocks.
collections of utilities for vtkDataAssembly
hierarchical representation to use with vtkPartitionedDataSetCollection
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
general representation of visualization data
Definition: vtkDataObject.h:54
a concrete implementation of vtkCompositeDataSet
Composite dataset that groups datasets as a collection.