VTK  9.4.20250321
vtkAnariPolyDataMapperInheritInterface.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 vtkAnariPolyDataMapperInheritInterface_h
15#define vtkAnariPolyDataMapperInheritInterface_h
16
17#include <anari/anari_cpp.hpp>
18#include <anari/anari_cpp/ext/std.h>
19
20#include <vector>
21
22class vtkDataArray;
24class vtkPolyData;
25class vtkProperty;
26
27using uvec2 = anari::std_types::uvec2;
28using uvec3 = anari::std_types::uvec3;
29using vec2 = anari::std_types::vec2;
30using vec3 = anari::std_types::vec3;
31using vec4 = anari::std_types::vec4;
32using mat4 = anari::std_types::mat4;
33
35{
36public:
38
44 {
45 bool Positions = true;
46 bool Indices = true;
47 bool Normals = true;
48 bool Scales = true;
49 bool Texcoords = true;
50 bool Colors = true;
51 };
52
56 virtual void SetDevice(
57 anari::Device& device, anari::Extensions& extensions, const char* const* anariExtensionStrings);
58
63 virtual int GetSurfaceRepresentation(vtkProperty* property) const;
65
66 virtual anari::Geometry InitializeSpheres(vtkPolyData* polyData, vtkProperty* property,
67 std::vector<vec3>& vertices, std::vector<uint32_t>& indexArray, double pointSize,
68 vtkDataArray* scaleArray, vtkPiecewiseFunction* scaleFunction, std::vector<vec2>& textureCoords,
69 std::vector<float>& pointValueTextureCoords, std::vector<vec4>& pointColors, int cellFlag);
70 virtual anari::Geometry InitializeCurves(vtkPolyData* polyData, vtkProperty* property,
71 std::vector<vec3>& vertices, std::vector<uint32_t>& indexArray, double lineWidth,
72 vtkDataArray* scaleArray, vtkPiecewiseFunction* scaleFunction, std::vector<vec2>& textureCoords,
73 std::vector<float>& pointValueTextureCoords, std::vector<vec4>& pointColors, int cellFlag);
74 virtual anari::Geometry InitializeCylinders(vtkPolyData* polyData, vtkProperty* property,
75 std::vector<vec3>& vertices, std::vector<uint32_t>& indexArray, double lineWidth,
76 vtkDataArray* scaleArray, vtkPiecewiseFunction* scaleFunction, std::vector<vec2>& textureCoords,
77 std::vector<float>& pointValueTextureCoords, std::vector<vec4>& pointColors, int cellFlag);
78 virtual anari::Geometry InitializeTriangles(vtkPolyData* polyData, vtkProperty* property,
79 std::vector<vec3>& vertices, std::vector<uint32_t>& indexArray, std::vector<vec3>& normals,
80 std::vector<vec2>& textureCoords, std::vector<float>& pointValueTextureCoords,
81 std::vector<vec4>& pointColors, int cellFlag);
82
86 virtual const char* GetSpheresPostfix() const;
87 virtual const char* GetCurvesPostfix() const;
88 virtual const char* GetCylindersPostfix() const;
89 virtual const char* GetTrianglesPostfix() const;
90
91 anari::Device AnariDevice{ nullptr };
92 anari::Extensions AnariExtensions{};
93 const char* const* AnariExtensionStrings{ nullptr };
94};
95
96#endif
Interface for inheriting classes for overriding mapper functionality.
virtual anari::Geometry InitializeCylinders(vtkPolyData *polyData, vtkProperty *property, std::vector< vec3 > &vertices, std::vector< uint32_t > &indexArray, double lineWidth, vtkDataArray *scaleArray, vtkPiecewiseFunction *scaleFunction, std::vector< vec2 > &textureCoords, std::vector< float > &pointValueTextureCoords, std::vector< vec4 > &pointColors, int cellFlag)
virtual anari::Geometry InitializeTriangles(vtkPolyData *polyData, vtkProperty *property, std::vector< vec3 > &vertices, std::vector< uint32_t > &indexArray, std::vector< vec3 > &normals, std::vector< vec2 > &textureCoords, std::vector< float > &pointValueTextureCoords, std::vector< vec4 > &pointColors, int cellFlag)
virtual ParameterFlags GetBaseUpdateResponsibility() const
virtual void SetDevice(anari::Device &device, anari::Extensions &extensions, const char *const *anariExtensionStrings)
Set the ANARI device to write to.
virtual anari::Geometry InitializeSpheres(vtkPolyData *polyData, vtkProperty *property, std::vector< vec3 > &vertices, std::vector< uint32_t > &indexArray, double pointSize, vtkDataArray *scaleArray, vtkPiecewiseFunction *scaleFunction, std::vector< vec2 > &textureCoords, std::vector< float > &pointValueTextureCoords, std::vector< vec4 > &pointColors, int cellFlag)
virtual anari::Geometry InitializeCurves(vtkPolyData *polyData, vtkProperty *property, std::vector< vec3 > &vertices, std::vector< uint32_t > &indexArray, double lineWidth, vtkDataArray *scaleArray, vtkPiecewiseFunction *scaleFunction, std::vector< vec2 > &textureCoords, std::vector< float > &pointValueTextureCoords, std::vector< vec4 > &pointColors, int cellFlag)
virtual const char * GetCylindersPostfix() const
virtual const char * GetTrianglesPostfix() const
virtual const char * GetCurvesPostfix() const
virtual const char * GetSpheresPostfix() const
Inheriting classes can also influence the postfix of the created prim names.
virtual int GetSurfaceRepresentation(vtkProperty *property) const
Inheriting classes can own (override) representation choice, creation of anari geometries and paramet...
abstract superclass for arrays of numeric data
Defines a 1D piecewise function.
concrete dataset represents vertices, lines, polygons, and triangle strips
represent surface properties of a geometric object
Specifies parameter flags, which can be used by inheriting classes to specify which parameter it take...
anari::std_types::vec4 vec4
anari::std_types::vec3 vec3
anari::std_types::uvec3 uvec3
anari::std_types::vec2 vec2
anari::std_types::mat4 mat4
anari::std_types::uvec2 uvec2
std::pair< boost::graph_traits< vtkGraph * >::vertex_iterator, boost::graph_traits< vtkGraph * >::vertex_iterator > vertices(vtkGraph *g)