Loading [MathJax]/extensions/tex2jax.js
VTK  9.4.20250219
vtkConduitArrayUtilities.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
17#ifndef vtkConduitArrayUtilities_h
18#define vtkConduitArrayUtilities_h
19
20#include "vtkDeprecation.h" // for VTK_DEPRECATED_IN_9_5_0
21#include "vtkIOCatalystConduitModule.h" // for exports
22#include "vtkObject.h"
23#include "vtkSmartPointer.h" // for vtkSmartPointer
24
25#include "conduit.h" // for conduit_node
26
27#include <string> // for std::string
28
29VTK_ABI_NAMESPACE_BEGIN
30class vtkCellArray;
31class vtkDataArray;
32
33class VTKIOCATALYSTCONDUIT_EXPORT vtkConduitArrayUtilities : public vtkObject
34{
35public:
38 void PrintSelf(ostream& os, vtkIndent indent) override;
39
40 static bool IsDevicePointer(const void* p, int8_t& id);
41
43
46 static vtkSmartPointer<vtkDataArray> MCArrayToVTKArray(const conduit_node* mcarray);
48 const conduit_node* mcarray, const std::string& arrayname);
50
52
60 VTK_DEPRECATED_IN_9_5_0("This function is deprecated, because in the future "
61 "state/metadata/vtk_fields will only be used.")
62 static vtkSmartPointer<vtkDataArray> MCGhostArrayToVTKGhostArray(
63 const conduit_node* mcarray, bool is_cell_data);
65
72 VTK_DEPRECATED_IN_9_4_0("Version with additional `numberOfPoints` parameter needed with "
73 "zero-copy arrays stored on acceleration devices such as CUDA")
74 static vtkSmartPointer<vtkCellArray> MCArrayToVTKCellArray(
75 int cellType, vtkIdType cellSize, const conduit_node* mcarray);
76 static vtkSmartPointer<vtkCellArray> MCArrayToVTKCellArray(
77 vtkIdType numberOfPoints, int cellType, vtkIdType cellSize, const conduit_node* mcarray);
78
83 static vtkSmartPointer<vtkDataArray> SetNumberOfComponents(
84 vtkDataArray* array, int num_components);
85
89 VTK_DEPRECATED_IN_9_4_0("Version with additional `numberOfPoints` parameter needed with "
90 "zero-copy arrays stored on acceleration devices such as CUDA. "
91 "`leafname` is always connectivity, so it is removed in the new version.")
92 static vtkSmartPointer<vtkCellArray> O2MRelationToVTKCellArray(
93 const conduit_node* o2mrelation, const std::string& leafname);
94 static vtkSmartPointer<vtkCellArray> O2MRelationToVTKCellArray(
95 vtkIdType numberOfPoints, const conduit_node* o2mrelation);
96
97protected:
100
101 static vtkSmartPointer<vtkDataArray> MCArrayToVTKArrayImpl(
102 const conduit_node* mcarray, bool force_signed);
103 static vtkSmartPointer<vtkDataArray> MCArrayToVTKAOSArray(
104 const conduit_node* mcarray, bool force_signed);
105 static vtkSmartPointer<vtkDataArray> MCArrayToVTKSOAArray(
106 const conduit_node* mcarray, bool force_signed);
107
108private:
110 void operator=(const vtkConduitArrayUtilities&) = delete;
111};
112VTK_ABI_NAMESPACE_END
113
114#endif
object to represent cell connectivity
helper to convert Conduit arrays to VTK arrays.
static vtkConduitArrayUtilities * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkSmartPointer< vtkDataArray > MCArrayToVTKArray(const conduit_node *mcarray, const std::string &arrayname)
Returns a vtkDataArray from a conduit node in the conduit mcarray protocol.
static vtkSmartPointer< vtkDataArray > MCArrayToVTKArray(const conduit_node *mcarray)
Returns a vtkDataArray from a conduit node in the conduit mcarray protocol.
static bool IsDevicePointer(const void *p, int8_t &id)
abstract superclass for arrays of numeric data
a simple class to control print indentation
Definition vtkIndent.h:108
abstract base class for most VTK objects
Definition vtkObject.h:162
Hold a reference to a vtkObjectBase instance.
#define VTK_DEPRECATED_IN_9_4_0(reason)
#define VTK_DEPRECATED_IN_9_5_0(reason)
int vtkIdType
Definition vtkType.h:315