VTK-m  2.2
Actor.h
Go to the documentation of this file.
1 //============================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //============================================================================
10 #ifndef vtk_m_rendering_Actor_h
11 #define vtk_m_rendering_Actor_h
12 
14 
15 #include <vtkm/rendering/Camera.h>
16 #include <vtkm/rendering/Canvas.h>
17 #include <vtkm/rendering/Mapper.h>
18 
19 #include <memory>
20 
21 namespace vtkm
22 {
23 namespace rendering
24 {
25 
31 {
32 public:
33  Actor(const vtkm::cont::DataSet dataSet,
34  const std::string coordinateName,
35  const std::string fieldName);
36 
37  Actor(const vtkm::cont::DataSet dataSet,
38  const std::string coordinateName,
39  const std::string fieldName,
40  const vtkm::cont::ColorTable& colorTable);
41 
42  Actor(const vtkm::cont::DataSet dataSet,
43  const std::string coordinateName,
44  const std::string fieldName,
45  const vtkm::rendering::Color& color);
46 
48  const std::string coordinateName,
49  const std::string fieldName);
50 
52  const std::string coordinateName,
53  const std::string fieldName,
54  const vtkm::cont::ColorTable& colorTable);
55 
57  const std::string coordinateName,
58  const std::string fieldName,
59  const vtkm::rendering::Color& color);
60 
64  Actor(const vtkm::cont::UnknownCellSet& cells,
65  const vtkm::cont::CoordinateSystem& coordinates,
66  const vtkm::cont::Field& scalarField);
67 
72  Actor(const vtkm::cont::UnknownCellSet& cells,
73  const vtkm::cont::CoordinateSystem& coordinates,
74  const vtkm::cont::Field& scalarField,
75  const vtkm::cont::ColorTable& colorTable);
76 
80  // Why do you have to provide a `Field` if a constant color is provided?
81  Actor(const vtkm::cont::UnknownCellSet& cells,
82  const vtkm::cont::CoordinateSystem& coordinates,
83  const vtkm::cont::Field& scalarField,
84  const vtkm::rendering::Color& color);
85 
86  Actor(const Actor&);
87  Actor& operator=(const Actor&);
88 
89  Actor(Actor&&) noexcept;
90  Actor& operator=(Actor&&) noexcept;
91  ~Actor();
92 
93  void Render(vtkm::rendering::Mapper& mapper,
95  const vtkm::rendering::Camera& camera) const;
96 
97  const vtkm::cont::UnknownCellSet& GetCells() const;
98 
99  vtkm::cont::CoordinateSystem GetCoordinates() const;
100 
101  const vtkm::cont::Field& GetScalarField() const;
102 
103  const vtkm::cont::ColorTable& GetColorTable() const;
104 
105  const vtkm::Range& GetScalarRange() const;
106 
107  const vtkm::Bounds& GetSpatialBounds() const;
108 
114  void SetScalarRange(const vtkm::Range& scalarRange);
115 
116 private:
117  struct InternalsType;
118  std::unique_ptr<InternalsType> Internals;
119 
120  void Init(const vtkm::cont::CoordinateSystem& coordinates, const vtkm::cont::Field& scalarField);
121 
122  void Init();
123 };
124 }
125 } //namespace vtkm::rendering
126 
127 #endif //vtk_m_rendering_Actor_h
vtkm::rendering::Color
Representation of a color.
Definition: Color.h:29
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::cont::ColorTable
Color Table for coloring arbitrary fields.
Definition: cont/ColorTable.h:89
VTKM_RENDERING_EXPORT
#define VTKM_RENDERING_EXPORT
Definition: vtkm_rendering_export.h:44
vtkm::rendering::Actor
An item to be rendered.
Definition: Actor.h:30
vtkm::cont::DataSet
Contains and manages the geometric data structures that VTK-m operates on.
Definition: DataSet.h:57
vtkm::rendering::Actor::Internals
std::unique_ptr< InternalsType > Internals
Definition: Actor.h:117
vtkm::cont::UnknownCellSet
A CellSet of an unknown type.
Definition: UnknownCellSet.h:48
vtkm::cont::CoordinateSystem
Manages a coordinate system for a DataSet.
Definition: CoordinateSystem.h:30
vtkm_rendering_export.h
vtkm::rendering::Mapper
Converts data into commands to a rendering system.
Definition: Mapper.h:29
vtkm::rendering::Canvas
Represents the image space that is the target of rendering.
Definition: Canvas.h:35
vtkm::cont::Field
A Field encapsulates an array on some piece of the mesh, such as the points, a cell set,...
Definition: Field.h:31
vtkm::Bounds
Represent an axis-aligned 3D bounds in space.
Definition: Bounds.h:29
Camera.h
vtkm::rendering::Camera
Specifies the viewport for a rendering.
Definition: Camera.h:37
Canvas.h
Mapper.h
vtkm::cont::PartitionedDataSet
Comprises a set of vtkm::cont::DataSet objects.
Definition: PartitionedDataSet.h:26
vtkm::Range
Represent a continuous scalar range of values.
Definition: Range.h:31