SPH
VolumeRenderer.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "gui/objects/Color.h"
5 #include "objects/finders/Bvh.h"
6 #include <atomic>
7 
9 
10 class VolumeRenderer : public IRaytracer {
11 private:
13  Bvh<BvhSphere> bvh;
14 
15  struct {
18 
21 
24 
25  } cached;
26 
27  struct RayData {
29  Array<IntersectionInfo> intersections;
30 
31  RayData() = default;
32  RayData(RayData&& other) = default;
33  RayData(const RayData& other)
34  : intersections(other.intersections.clone()) {
35  // needed to be used in Any, but never should be actually called
36  SPH_ASSERT(false);
37  }
38  };
39 
40 public:
42 
44 
45  virtual void initialize(const Storage& storage,
46  const IColorizer& colorizer,
47  const ICamera& camera) override;
48 
49  virtual bool isInitialized() const override;
50 
51 private:
52  virtual Rgba shade(const RenderParams& params,
53  const CameraRay& cameraRay,
54  ThreadData& data) const override;
55 };
56 
#define SPH_ASSERT(x,...)
Definition: Assert.h:94
NAMESPACE_SPH_BEGIN
Definition: BarnesHut.cpp:13
Interface for renderers.
#define NAMESPACE_SPH_END
Definition: Object.h:12
Generic dynamically allocated resizable storage.
Definition: Array.h:43
Interface defining a camera or view, used by a renderer.
Definition: Camera.h:62
Interface for objects assigning colors to particles.
Definition: Colorizer.h:34
Base class for renderers based on raytracing.
Definition: IRenderer.h:196
SharedPtr< IScheduler > scheduler
Definition: IRenderer.h:198
Definition: Color.h:8
Container storing all quantities used within the simulations.
Definition: Storage.h:230
virtual bool isInitialized() const override
Checks if the renderer has been initialized.
Array< Rgba > colors
Particle colors.
Array< Vector > r
Particle positions.
Array< float > distention
Distention factor of each particle.
virtual void initialize(const Storage &storage, const IColorizer &colorizer, const ICamera &camera) override
Prepares the objects for rendering and updates its data.
VolumeRenderer(SharedPtr< IScheduler > scheduler, const GuiSettings &settings)
Ray given by origin and target point.
Definition: Camera.h:56
Parameters of the rendered image.
Definition: IRenderer.h:60