Viskores  1.0
ANARIActor.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_ANARIActor_h
20 #define viskores_interop_anari_ANARIActor_h
21 
22 // viskores
24 #include <viskores/cont/DataSet.h>
25 #include <viskores/cont/Field.h>
28 // std
29 #include <array>
30 #include <memory>
31 
32 #include <viskores/interop/anari/viskores_anari_export.h>
33 
34 namespace viskores
35 {
36 namespace interop
37 {
38 namespace anari
39 {
40 
43 using FieldSet = std::array<viskores::cont::Field, 4>;
44 
48 
60 struct VISKORES_ANARI_EXPORT ANARIActor
61 {
62  ANARIActor() = default;
63 
67  const viskores::cont::CoordinateSystem& coordinates,
68  const viskores::cont::Field& field0 = {},
69  const viskores::cont::Field& field1 = {},
70  const viskores::cont::Field& field2 = {},
71  const viskores::cont::Field& field3 = {});
72 
76  const viskores::cont::CoordinateSystem& coordinates,
77  const FieldSet& fieldset);
78 
81  ANARIActor(const viskores::cont::DataSet& dataset,
82  const std::string& field0 = "",
83  const std::string& field1 = "",
84  const std::string& field2 = "",
85  const std::string& field3 = "");
86 
87  const viskores::cont::UnknownCellSet& GetCellSet() const;
88  const viskores::cont::CoordinateSystem& GetCoordinateSystem() const;
89  const viskores::cont::Field& GetField(viskores::IdComponent idx = -1) const;
90 
91  FieldSet GetFieldSet() const;
92 
93  void SetPrimaryFieldIndex(viskores::IdComponent idx);
94  viskores::IdComponent GetPrimaryFieldIndex() const;
95 
98  viskores::cont::DataSet MakeDataSet(bool includeFields = false) const;
99 
100 private:
101  struct ActorData
102  {
106  viskores::IdComponent PrimaryField{ 0 };
107  };
108 
109  std::shared_ptr<ActorData> Data = std::make_shared<ActorData>();
110 };
111 
112 } // namespace anari
113 } // namespace interop
114 } // namespace viskores
115 
116 #endif
anari
Definition: ViskoresANARITypes.h:38
viskores::cont::DataSet
Contains and manages the geometric data structures that Viskores operates on.
Definition: DataSet.h:66
UnknownCellSet.h
viskores::interop::anari::ANARIActor::ActorData::Fields
FieldSet Fields
Definition: ANARIActor.h:105
viskores::cont::CoordinateSystem
Manages a coordinate system for a DataSet.
Definition: CoordinateSystem.h:38
viskores::IdComponent
viskores::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:202
viskores::interop::anari::ANARIActor
Collects cells, coords, and 0-4 fields for ANARI mappers to consume.
Definition: ANARIActor.h:60
CoordinateSystem.h
viskores::interop::anari::ANARIActor::ActorData::Cells
viskores::cont::UnknownCellSet Cells
Definition: ANARIActor.h:103
viskores::interop::anari::FieldSet
std::array< viskores::cont::Field, 4 > FieldSet
Convenience type used to represent all the fields in an ANARIActor.
Definition: ANARIActor.h:43
viskores::interop::anari::ANARIActor::ActorData::Coordinates
viskores::cont::CoordinateSystem Coordinates
Definition: ANARIActor.h:104
viskores
Groups connected points that have the same field value.
Definition: Atomic.h:27
ViskoresANARITypes.h
Field.h
viskores::interop::anari::ANARIActor::ActorData
Definition: ANARIActor.h:101
viskores::cont::UnknownCellSet
A CellSet of an unknown type.
Definition: UnknownCellSet.h:56
viskores::interop::anari::AnariMaterialInputString
const char * AnariMaterialInputString(viskores::IdComponent p)
Returns the appropriate ANARI attribute string based on field index.
viskores::cont::Field
A Field encapsulates an array on some piece of the mesh, such as the points, a cell set,...
Definition: Field.h:39
DataSet.h