SPH
MeshRenderer.h
Go to the documentation of this file.
1 #pragma once
2 
7 
8 #include "gui/Settings.h"
9 #include "gui/objects/Bitmap.h"
10 #include "gui/objects/Palette.h"
12 #include "post/MarchingCubes.h"
14 
16 
17 class MeshRenderer : public IRenderer {
18 private:
20  Float surfaceResolution;
21  Float surfaceLevel;
22 
24  Vector sunPosition;
25  float sunIntensity;
26  float ambient;
27 
29  struct {
32 
35 
36  } cached;
37 
38  SharedPtr<IScheduler> scheduler;
39 
41  AutoPtr<IBasicFinder> finder;
42 
43  LutKernel<3> kernel;
44 
45 public:
46  MeshRenderer(SharedPtr<IScheduler> scheduler, const GuiSettings& settings);
47 
48  virtual void initialize(const Storage& storage,
49  const IColorizer& colorizer,
50  const ICamera& camera) override;
51 
52  virtual bool isInitialized() const override;
53 
55  virtual void render(const RenderParams& params, Statistics& stats, IRenderOutput& output) const override;
56 
57  virtual void cancelRender() override {}
58 };
59 
NAMESPACE_SPH_BEGIN
Definition: BarnesHut.cpp:13
Wrapper of wxBitmap, will be possibly replaced by custom implementation.
double Float
Precision used withing the code. Use Float instead of float or double where precision is important.
Definition: Globals.h:13
Interface for renderers.
Computes interpolated values of quantities between SPH particles.
#define NAMESPACE_SPH_END
Definition: Object.h:12
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
Interface used to implement renderers.
Definition: IRenderer.h:166
virtual bool isInitialized() const override
Checks if the renderer has been initialized.
virtual void cancelRender() override
Stops the rendering if it is currently in progress.
Definition: MeshRenderer.h:57
MeshRenderer(SharedPtr< IScheduler > scheduler, const GuiSettings &settings)
Array< Rgba > colors
Colors of surface vertices assigned by the colorizer.
Definition: MeshRenderer.h:34
Array< Triangle > triangles
Triangles of the surface.
Definition: MeshRenderer.h:31
virtual void initialize(const Storage &storage, const IColorizer &colorizer, const ICamera &camera) override
Prepares the objects for rendering and updates its data.
virtual void render(const RenderParams &params, Statistics &stats, IRenderOutput &output) const override
Can only be called from main thread.
Object holding various statistics about current run.
Definition: Statistics.h:22
Container storing all quantities used within the simulations.
Definition: Storage.h:230
Parameters of the rendered image.
Definition: IRenderer.h:60