VTK  9.7.20261003
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
13
14#ifndef vtkAnariPolyDataMapperInheritInterface_h
15#define vtkAnariPolyDataMapperInheritInterface_h
16
17#include "vtkAnariDevice.h"
18#include "vtkSmartPointer.h"
19
20#include <anari/anari_cpp.hpp>
21#include <anari/anari_cpp/ext/std.h>
22
23#include <vector>
24
25class vtkDataArray;
27class vtkPolyData;
28class vtkProperty;
29
30using uvec2 = anari::std_types::uvec2;
31using uvec3 = anari::std_types::uvec3;
32using vec2 = anari::std_types::vec2;
33using vec3 = anari::std_types::vec3;
34using vec4 = anari::std_types::vec4;
35using mat4 = anari::std_types::mat4;
36
38{
39public:
41
47 {
48 bool Positions = true;
49 bool Indices = true;
50 bool Normals = true;
51 bool Scales = true;
52 bool Texcoords = true;
53 bool Colors = true;
54 };
55
60
65 virtual int GetSurfaceRepresentation(vtkProperty* property) const;
67
68 virtual anari::Geometry InitializeSpheres(vtkPolyData* polyData, vtkProperty* property,
69 std::vector<vec3>& vertices, std::vector<uint32_t>& indexArray, double pointSize,
70 vtkDataArray* scaleArray, vtkPiecewiseFunction* scaleFunction, std::vector<vec2>& textureCoords,
71 std::vector<vec2>& pointValueTextureCoords, std::vector<vec4>& pointColors, int cellFlag);
72 virtual anari::Geometry InitializeCurves(vtkPolyData* polyData, vtkProperty* property,
73 std::vector<vec3>& vertices, std::vector<uint32_t>& indexArray, double lineWidth,
74 vtkDataArray* scaleArray, vtkPiecewiseFunction* scaleFunction, std::vector<vec2>& textureCoords,
75 std::vector<vec2>& pointValueTextureCoords, std::vector<vec4>& pointColors, int cellFlag);
76 virtual anari::Geometry InitializeCylinders(vtkPolyData* polyData, vtkProperty* property,
77 std::vector<vec3>& vertices, std::vector<uint32_t>& indexArray, double lineWidth,
78 vtkDataArray* scaleArray, vtkPiecewiseFunction* scaleFunction, std::vector<vec2>& textureCoords,
79 std::vector<vec2>& pointValueTextureCoords, std::vector<vec4>& pointColors, int cellFlag);
80 virtual anari::Geometry InitializeTriangles(vtkPolyData* polyData, vtkProperty* property,
81 std::vector<vec3>& vertices, std::vector<uint32_t>& indexArray, std::vector<vec3>& normals,
82 std::vector<vec2>& textureCoords, std::vector<vec2>& pointValueTextureCoords,
83 std::vector<vec4>& pointColors, int cellFlag);
84
88 virtual const char* GetSpheresPostfix() const;
89 virtual const char* GetCurvesPostfix() const;
90 virtual const char* GetCylindersPostfix() const;
91 virtual const char* GetTrianglesPostfix() const;
92
93protected:
95};
96
97#endif
Interface for inheriting classes for overriding mapper functionality.
virtual ParameterFlags GetBaseUpdateResponsibility() const
virtual const char * GetCylindersPostfix() const
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< vec2 > &pointValueTextureCoords, std::vector< vec4 > &pointColors, int cellFlag)
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< vec2 > &pointValueTextureCoords, std::vector< vec4 > &pointColors, int cellFlag)
virtual const char * GetTrianglesPostfix() const
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< vec2 > &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< vec2 > &pointValueTextureCoords, std::vector< vec4 > &pointColors, int cellFlag)
virtual const char * GetCurvesPostfix() const
virtual void SetDevice(vtkSmartPointer< vtkAnariDevice > device)
Set the ANARI device to write to.
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...
Defines a 1D piecewise function.
concrete dataset represents vertices, lines, polygons, and triangle strips
represent surface properties of a geometric object
Hold a reference to a vtkObjectBase instance.
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)
#define vtkDataArray