2016-02-09 13:59:26 +00:00
|
|
|
//============================================================================
|
|
|
|
// Copyright (c) Kitware, Inc.
|
|
|
|
// All rights reserved.
|
|
|
|
// See LICENSE.txt for details.
|
2019-04-15 23:24:21 +00:00
|
|
|
//
|
2016-02-09 13:59:26 +00:00
|
|
|
// This software is distributed WITHOUT ANY WARRANTY; without even
|
|
|
|
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
// PURPOSE. See the above copyright notice for more information.
|
|
|
|
//============================================================================
|
2016-06-02 21:43:30 +00:00
|
|
|
#ifndef vtk_m_rendering_Actor_h
|
|
|
|
#define vtk_m_rendering_Actor_h
|
2016-02-09 13:59:26 +00:00
|
|
|
|
2016-08-31 23:28:41 +00:00
|
|
|
#include <vtkm/rendering/vtkm_rendering_export.h>
|
|
|
|
|
2016-06-02 19:04:01 +00:00
|
|
|
#include <vtkm/rendering/Camera.h>
|
2016-08-31 23:28:41 +00:00
|
|
|
#include <vtkm/rendering/Canvas.h>
|
2016-06-02 19:41:14 +00:00
|
|
|
#include <vtkm/rendering/Mapper.h>
|
2016-08-31 23:28:41 +00:00
|
|
|
|
2016-09-12 17:08:06 +00:00
|
|
|
#include <memory>
|
2016-02-09 13:59:26 +00:00
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
namespace vtkm
|
|
|
|
{
|
|
|
|
namespace rendering
|
|
|
|
{
|
2016-02-09 13:59:26 +00:00
|
|
|
|
2023-07-27 20:07:19 +00:00
|
|
|
/// @brief An item to be rendered.
|
|
|
|
///
|
|
|
|
/// The `Actor` holds the geometry from a `vtkm::cont::DataSet` as well as other visual
|
|
|
|
/// properties that define how the geometry should look when it is rendered.
|
2016-10-19 18:09:15 +00:00
|
|
|
class VTKM_RENDERING_EXPORT Actor
|
2016-02-09 13:59:26 +00:00
|
|
|
{
|
|
|
|
public:
|
2023-07-27 20:07:19 +00:00
|
|
|
/// Create an `Actor` object that renders a set of cells positioned by a given coordiante
|
|
|
|
/// system. A field to apply psudocoloring is also provided. The default colormap is applied.
|
|
|
|
/// The cells, coordinates, and field are typically pulled from a `vtkm::cont::DataSet` object.
|
2022-01-04 22:38:18 +00:00
|
|
|
Actor(const vtkm::cont::UnknownCellSet& cells,
|
2018-01-18 18:55:15 +00:00
|
|
|
const vtkm::cont::CoordinateSystem& coordinates,
|
|
|
|
const vtkm::cont::Field& scalarField);
|
|
|
|
|
2023-07-27 20:07:19 +00:00
|
|
|
/// Create an `Actor` object that renders a set of cells positioned by a given coordiante
|
|
|
|
/// system. A field to apply psudocoloring is also provided. A color table providing the map
|
|
|
|
/// from scalar values to colors is also provided.
|
|
|
|
/// The cells, coordinates, and field are typically pulled from a `vtkm::cont::DataSet` object.
|
2022-01-04 22:38:18 +00:00
|
|
|
Actor(const vtkm::cont::UnknownCellSet& cells,
|
2017-05-26 17:53:28 +00:00
|
|
|
const vtkm::cont::CoordinateSystem& coordinates,
|
2017-05-18 14:29:41 +00:00
|
|
|
const vtkm::cont::Field& scalarField,
|
2018-01-18 18:55:15 +00:00
|
|
|
const vtkm::cont::ColorTable& colorTable);
|
2016-08-31 23:28:41 +00:00
|
|
|
|
2023-07-27 20:07:19 +00:00
|
|
|
/// Create an `Actor` object that renders a set of cells positioned by a given coordiante
|
|
|
|
/// system. A constant color to apply to the object is also provided.
|
|
|
|
/// The cells and coordinates are typically pulled from a `vtkm::cont::DataSet` object.
|
|
|
|
// Why do you have to provide a `Field` if a constant color is provided?
|
2022-01-04 22:38:18 +00:00
|
|
|
Actor(const vtkm::cont::UnknownCellSet& cells,
|
2017-07-28 17:31:19 +00:00
|
|
|
const vtkm::cont::CoordinateSystem& coordinates,
|
|
|
|
const vtkm::cont::Field& scalarField,
|
|
|
|
const vtkm::rendering::Color& color);
|
|
|
|
|
2023-06-02 16:32:44 +00:00
|
|
|
Actor(const Actor&);
|
|
|
|
Actor& operator=(const Actor&);
|
2023-06-01 17:28:49 +00:00
|
|
|
|
|
|
|
Actor(Actor&&) noexcept;
|
|
|
|
Actor& operator=(Actor&&) noexcept;
|
|
|
|
~Actor();
|
|
|
|
|
2017-05-26 17:53:28 +00:00
|
|
|
void Render(vtkm::rendering::Mapper& mapper,
|
|
|
|
vtkm::rendering::Canvas& canvas,
|
2017-05-18 14:29:41 +00:00
|
|
|
const vtkm::rendering::Camera& camera) const;
|
2016-08-31 23:28:41 +00:00
|
|
|
|
2022-01-04 22:38:18 +00:00
|
|
|
const vtkm::cont::UnknownCellSet& GetCells() const;
|
2016-08-31 23:28:41 +00:00
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
const vtkm::cont::CoordinateSystem& GetCoordinates() const;
|
2016-08-31 23:28:41 +00:00
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
const vtkm::cont::Field& GetScalarField() const;
|
2016-08-31 23:28:41 +00:00
|
|
|
|
2018-01-18 18:55:15 +00:00
|
|
|
const vtkm::cont::ColorTable& GetColorTable() const;
|
2016-08-31 23:28:41 +00:00
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
const vtkm::Range& GetScalarRange() const;
|
2016-08-31 23:28:41 +00:00
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
const vtkm::Bounds& GetSpatialBounds() const;
|
2016-08-31 23:28:41 +00:00
|
|
|
|
2023-07-27 20:07:19 +00:00
|
|
|
/// @brief Specifies the range for psudocoloring.
|
|
|
|
///
|
|
|
|
/// When coloring data by mapping a scalar field to colors, this is the range used for
|
|
|
|
/// the colors provided by the table. If a range is not provided, the range of data in the
|
|
|
|
/// field is used.
|
2017-05-18 14:29:41 +00:00
|
|
|
void SetScalarRange(const vtkm::Range& scalarRange);
|
2017-02-09 23:38:40 +00:00
|
|
|
|
2016-08-31 23:28:41 +00:00
|
|
|
private:
|
|
|
|
struct InternalsType;
|
2023-06-01 17:28:49 +00:00
|
|
|
std::unique_ptr<InternalsType> Internals;
|
2017-07-28 17:31:19 +00:00
|
|
|
|
|
|
|
void Init(const vtkm::cont::CoordinateSystem& coordinates, const vtkm::cont::Field& scalarField);
|
2016-02-09 13:59:26 +00:00
|
|
|
};
|
2017-05-18 14:29:41 +00:00
|
|
|
}
|
|
|
|
} //namespace vtkm::rendering
|
2016-02-09 13:59:26 +00:00
|
|
|
|
2016-06-02 21:43:30 +00:00
|
|
|
#endif //vtk_m_rendering_Actor_h
|