Viskores  1.0
ANARIMapperGlyphs.h
Go to the documentation of this file.
1 //============================================================================
2 // The contents of this file are covered by the Viskores license. See
3 // LICENSE.txt for details.
4 //
5 // By contributing to this file, all contributors agree to the Developer
6 // Certificate of Origin Version 1.1 (DCO 1.1) as stated in DCO.txt.
7 //============================================================================
8 
9 //============================================================================
10 // Copyright (c) Kitware, Inc.
11 // All rights reserved.
12 // See LICENSE.txt for details.
13 //
14 // This software is distributed WITHOUT ANY WARRANTY; without even
15 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 // PURPOSE. See the above copyright notice for more information.
17 //============================================================================
18 
19 #ifndef viskores_interop_anari_ANARIMapperGlyphs_h
20 #define viskores_interop_anari_ANARIMapperGlyphs_h
21 
23 
24 namespace viskores
25 {
26 namespace interop
27 {
28 namespace anari
29 {
30 
34 {
35  struct VertexData
36  {
37  anari_cpp::Array1D Position{ nullptr };
38  anari_cpp::Array1D Radius{ nullptr };
39  } Vertex{};
40 
41  unsigned int NumPrimitives{ 0 };
42 };
43 
47 {
50  std::shared_ptr<viskores::cont::Token> Token{ new viskores::cont::Token };
51 };
52 
57 struct VISKORES_ANARI_EXPORT ANARIMapperGlyphs : public ANARIMapper
58 {
62  anari_cpp::Device device,
63  const ANARIActor& actor = {},
64  const char* name = "<glyphs>",
66 
69  ~ANARIMapperGlyphs() override;
70 
77  void SetActor(const ANARIActor& actor) override;
78 
84  void SetOffsetGlyphs(bool enabled);
85 
89  anari_cpp::Geometry GetANARIGeometry() override;
90 
94  anari_cpp::Surface GetANARISurface() override;
95 
96 private:
100  void ConstructArrays(bool regenerate = false);
102  void UpdateGeometry();
103 
106  {
107  anari_cpp::Device Device{ nullptr };
108  anari_cpp::Geometry Geometry{ nullptr };
109  anari_cpp::Material Material{ nullptr };
110  anari_cpp::Surface Surface{ nullptr };
112  ~ANARIHandles();
113  void ReleaseArrays();
114  };
115 
116  std::shared_ptr<ANARIHandles> Handles;
117 
118  bool Offset{ false };
120 };
121 
122 } // namespace anari
123 } // namespace interop
124 } // namespace viskores
125 
126 #endif
anari
Definition: ViskoresANARITypes.h:38
ANARIMapper.h
viskores::interop::anari::ANARIMapperGlyphs::ANARIHandles
Container of all relevant ANARI scene object handles.
Definition: ANARIMapperGlyphs.h:105
Offset
viskores::Float32 Offset
Definition: Wireframer.h:410
viskores::interop::anari::ANARIMapperGlyphs
Mapper which turns vector data into arrow glyphs.
Definition: ANARIMapperGlyphs.h:57
viskores::interop::anari::ANARIMapperGlyphs::ANARIHandles::Parameters
GlyphsParameters Parameters
Definition: ANARIMapperGlyphs.h:111
viskores::interop::anari::GlyphsParameters::Vertex
struct viskores::interop::anari::GlyphsParameters::VertexData Vertex
viskores::cont::ColorTable::Preset::Default
@ Default
viskores::cont::ArrayHandle
Manages an array-worth of data.
Definition: ArrayHandle.h:313
viskores::interop::anari::ANARIActor
Collects cells, coords, and 0-4 fields for ANARI mappers to consume.
Definition: ANARIActor.h:60
viskores::interop::anari::GlyphArrays::Token
std::shared_ptr< viskores::cont::Token > Token
Definition: ANARIMapperGlyphs.h:50
viskores
Groups connected points that have the same field value.
Definition: Atomic.h:27
viskores::cont::ColorTable
Color Table for coloring arbitrary fields.
Definition: cont/ColorTable.h:97
viskores::interop::anari::GlyphsParameters::VertexData::Position
anari_cpp::Array1D Position
Definition: ANARIMapperGlyphs.h:37
viskores::interop::anari::ANARIMapperGlyphs::Arrays
GlyphArrays Arrays
Definition: ANARIMapperGlyphs.h:119
viskores::interop::anari::ANARIMapperGlyphs::Handles
std::shared_ptr< ANARIHandles > Handles
Definition: ANARIMapperGlyphs.h:116
viskores::interop::anari::GlyphsParameters::VertexData::Radius
anari_cpp::Array1D Radius
Definition: ANARIMapperGlyphs.h:38
viskores::interop::anari::ANARIMapper
This is the base class used for all ANARI mappers.
Definition: ANARIMapper.h:45
viskores::interop::anari::GlyphArrays::Radii
viskores::cont::ArrayHandle< viskores::Float32 > Radii
Definition: ANARIMapperGlyphs.h:49
viskores::interop::anari::GlyphsParameters::NumPrimitives
unsigned int NumPrimitives
Definition: ANARIMapperGlyphs.h:41
viskores::interop::anari::GlyphsParameters
Raw ANARI arrays and parameter values set on the ANARIGeometry.
Definition: ANARIMapperGlyphs.h:33
viskores::interop::anari::GlyphArrays::Vertices
viskores::cont::ArrayHandle< viskores::Vec3f_32 > Vertices
Definition: ANARIMapperGlyphs.h:48
viskores::cont::Token
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:43
viskores::interop::anari::GlyphArrays
Viskores data arrays underlying the ANARIArray handles created by the mapper.
Definition: ANARIMapperGlyphs.h:46
viskores::interop::anari::GlyphsParameters::VertexData
Definition: ANARIMapperGlyphs.h:35