SPH
Factory.cpp
Go to the documentation of this file.
1 #include "gui/Factory.h"
2 #include "gui/Project.h"
3 #include "gui/objects/Camera.h"
5 #include "gui/renderers/Brdf.h"
12 
14 
16  const int trackedIndex = settings.get<int>(GuiSettingsId::CAMERA_TRACK_PARTICLE);
17  if (trackedIndex >= 0) {
18  return makeAuto<ParticleTracker>(trackedIndex);
19  }
20  const bool useMedian = settings.get<bool>(GuiSettingsId::CAMERA_TRACK_MEDIAN);
21  if (useMedian) {
22  const Vector offset = settings.get<Vector>(GuiSettingsId::CAMERA_TRACKING_OFFSET);
23  return makeAuto<MedianTracker>(offset);
24  }
25  return nullptr;
26 }
27 
28 AutoPtr<ICamera> Factory::getCamera(const GuiSettings& settings, const Pixel size) {
30  CameraParams data;
31  data.imageSize = size;
32  data.position = settings.get<Vector>(GuiSettingsId::CAMERA_POSITION);
33  data.target = settings.get<Vector>(GuiSettingsId::CAMERA_TARGET);
34  data.up = settings.get<Vector>(GuiSettingsId::CAMERA_UP);
35  data.clipping = Interval(settings.get<Float>(GuiSettingsId::CAMERA_CLIP_NEAR),
37  data.perspective.fov = settings.get<Float>(GuiSettingsId::CAMERA_PERSPECTIVE_FOV);
38  data.ortho.fov = float(settings.get<Float>(GuiSettingsId::CAMERA_ORTHO_FOV));
39  data.ortho.cutoff = float(settings.get<Float>(GuiSettingsId::CAMERA_ORTHO_CUTOFF));
40  if (data.ortho.cutoff.value() == 0._f) {
41  data.ortho.cutoff = NOTHING;
42  }
43 
44  switch (cameraId) {
45  case CameraEnum::ORTHO:
46  return makeAuto<OrthoCamera>(data);
48  return makeAuto<PerspectiveCamera>(data);
50  return makeAuto<FisheyeCamera>(data);
52  return makeAuto<SphericalCamera>(data);
53  default:
55  }
56 }
57 
60  return getRenderer(scheduler, settings);
61 }
62 
65  AutoPtr<IRenderer> renderer;
66  switch (id) {
67  case RendererEnum::NONE:
68  class NullRenderer : public IRenderer {
69  virtual void initialize(const Storage&, const IColorizer&, const ICamera&) override {}
70  virtual bool isInitialized() const override {
71  return true;
72  }
73  virtual void render(const RenderParams&, Statistics&, IRenderOutput&) const override {}
74  virtual void cancelRender() override {}
75  };
76  renderer = makeAuto<NullRenderer>();
77  break;
79  renderer = makeAuto<ParticleRenderer>(settings);
80  break;
81  case RendererEnum::MESH:
82  renderer = makeAuto<MeshRenderer>(scheduler, settings);
83  break;
85  renderer = makeAuto<RayMarcher>(scheduler, settings);
86  break;
88  renderer = makeAuto<VolumeRenderer>(scheduler, settings);
89  break;
91  renderer = makeAuto<ContourRenderer>(scheduler, settings);
92  break;
93  default:
95  }
96 
97  return renderer;
98 }
99 
101  const BrdfEnum id = settings.get<BrdfEnum>(GuiSettingsId::RAYTRACE_BRDF);
102  switch (id) {
103  case BrdfEnum::LAMBERT:
104  return makeAuto<LambertBrdf>(1._f);
105  case BrdfEnum::PHONG:
106  return makeAuto<PhongBrdf>(1._f);
107  default:
109  }
110 }
111 
114  switch (id) {
116  return nullptr;
118  const float factor = settings.get<Float>(GuiSettingsId::COLORMAP_LOGARITHMIC_FACTOR);
119  return makeAuto<LogarithmicColorMap>(factor);
120  }
122  return makeAuto<FilmicColorMap>();
123  default:
125  }
126 }
127 
128 static AutoPtr<IColorizer> getColorizer(const GuiSettings& settings, const ExtColorizerId id) {
129  using Factory::getPalette;
130 
131  switch (id) {
133  return makeAuto<VelocityColorizer>(getPalette(id));
135  return makeAuto<AccelerationColorizer>(getPalette(id));
137  return makeAuto<DirectionColorizer>(Vector(0._f, 0._f, 1._f), getPalette(id));
139  return makeAuto<CorotatingVelocityColorizer>(getPalette(ColorizerId::VELOCITY));
141  return makeAuto<DensityPerturbationColorizer>(getPalette(id));
143  return makeAuto<SummedDensityColorizer>(RunSettings::getDefaults(), getPalette(QuantityId::DENSITY));
145  return makeAuto<EnergyColorizer>(getPalette(id));
147  return makeAuto<TemperatureColorizer>();
149  return makeAuto<StressColorizer>(getPalette(id));
151  return makeAuto<YieldReductionColorizer>(getPalette(id));
153  return makeAuto<DamageActivationColorizer>(getPalette(id));
154  case ColorizerId::RADIUS:
155  return makeAuto<RadiusColorizer>(getPalette(id));
157  return makeAuto<BoundaryColorizer>(BoundaryColorizer::Detection::NEIGBOUR_THRESHOLD, 40);
158  case ColorizerId::UVW:
159  return makeAuto<UvwColorizer>();
161  return makeAuto<ParticleIdColorizer>(settings);
163  return makeAuto<ComponentIdColorizer>(
166  return makeAuto<ComponentIdColorizer>(
169  return makeAuto<AggregateIdColorizer>(settings);
170  case ColorizerId::FLAG:
171  return makeAuto<IndexColorizer>(QuantityId::FLAG, settings);
173  return makeAuto<MaterialColorizer>(settings);
174  case ColorizerId::BEAUTY:
175  return makeAuto<BeautyColorizer>();
176  default:
177  QuantityId quantity = QuantityId(id);
178  SPH_ASSERT(int(quantity) >= 0);
179 
180  Palette palette = getPalette(id);
181  switch (getMetadata(quantity).expectedType) {
182  case ValueEnum::INDEX:
183  return makeAuto<TypedColorizer<Size>>(quantity, std::move(palette));
184  case ValueEnum::SCALAR:
185  return makeAuto<TypedColorizer<Float>>(quantity, std::move(palette));
186  case ValueEnum::VECTOR:
187  return makeAuto<TypedColorizer<Vector>>(quantity, std::move(palette));
189  return makeAuto<TypedColorizer<TracelessTensor>>(quantity, std::move(palette));
191  return makeAuto<TypedColorizer<SymmetricTensor>>(quantity, std::move(palette));
192  default:
194  }
195  }
196 }
197 
199  AutoPtr<IColorizer> colorizer = Sph::getColorizer(project.getGuiSettings(), id);
200  Optional<Palette> palette = colorizer->getPalette();
201  if (palette && project.getPalette(colorizer->name(), palette.value())) {
202  colorizer->setPalette(palette.value());
203  }
204  return colorizer;
205 }
206 
207 struct PaletteDesc {
210 };
211 
212 static FlatMap<ExtColorizerId, PaletteDesc> paletteDescs = {
213  { QuantityId::DENSITY, { Interval(2650._f, 2750._f), PaletteScale::LINEAR } },
214  { QuantityId::MASS, { Interval(1.e5_f, 1.e10_f), PaletteScale::LOGARITHMIC } },
215  { QuantityId::PRESSURE, { Interval(-1.e5_f, 1.e10_f), PaletteScale::HYBRID } },
216  { QuantityId::ENERGY, { Interval(1._f, 1.e6_f), PaletteScale::LOGARITHMIC } },
218  { QuantityId::DAMAGE, { Interval(0._f, 1._f), PaletteScale::LINEAR } },
224  { QuantityId::SOUND_SPEED, { Interval(0._f, 5.e3_f), PaletteScale::LINEAR } },
226  { QuantityId::BULK_DENSITY, { Interval(2650._f, 2750._f), PaletteScale::LINEAR } },
227  { QuantityId::AV_ALPHA, { Interval(0.1_f, 1.5_f), PaletteScale::LINEAR } },
229  { QuantityId::AV_STRESS, { Interval(0._f, 1.e8_f), PaletteScale::LINEAR } },
234  { QuantityId::EPS_MIN, { Interval(0._f, 1._f), PaletteScale::LINEAR } },
235  { QuantityId::FRICTION, { Interval(0._f, 1._f), PaletteScale::LINEAR } },
241  { ColorizerId::RADIUS, { Interval(0._f, 1.e3_f), PaletteScale::LINEAR } },
248 };
249 
250 static Palette getDefaultPalette(const Interval range) {
251  const float x0 = float(range.lower());
252  const float dx = float(range.size());
253  return Palette({ { x0, Rgba(0.f, 0.f, 0.6f) },
254  { x0 + 0.2f * dx, Rgba(0.1f, 0.1f, 0.1f) },
255  { x0 + 0.6f * dx, Rgba(0.9f, 0.9f, 0.9f) },
256  { x0 + 0.8f * dx, Rgba(1.f, 1.f, 0.f) },
257  { x0 + dx, Rgba(0.6f, 0.f, 0.f) } },
259 }
260 
262  const PaletteDesc desc = paletteDescs[id];
263  const Interval range = desc.range;
264  const PaletteScale scale = desc.scale;
265  const float x0 = float(range.lower());
266  const float dx = float(range.size());
267  switch (id) {
269  return Palette({ { x0, Rgba(0.5f, 0.5f, 0.5f) },
270  { x0 + 0.001f * dx, Rgba(0.0f, 0.0f, 0.2f) },
271  { x0 + 0.01f * dx, Rgba(0.0f, 0.0f, 1.0f) },
272  { x0 + 0.1f * dx, Rgba(1.0f, 0.0f, 0.2f) },
273  { x0 + dx, Rgba(1.0f, 1.0f, 0.2f) } },
274  scale);
276  return Palette({ { x0, Rgba(0.5f, 0.5f, 0.5f) },
277  { x0 + 0.001f * dx, Rgba(0.0f, 0.0f, 0.2f) },
278  { x0 + 0.01f * dx, Rgba(0.0f, 0.0f, 1.0f) },
279  { x0 + 0.1f * dx, Rgba(1.0f, 0.0f, 0.2f) },
280  { x0 + dx, Rgba(1.0f, 1.0f, 0.2f) } },
281  scale);
283  SPH_ASSERT(range == Interval(0.f, 2._f * PI)); // in radians
284  const float pi = float(PI);
285  return Palette({ { 0.f, Rgba(0.1f, 0.1f, 1.f) },
286  { pi / 3.f, Rgba(1.f, 0.1f, 1.f) },
287  { 2.f * pi / 3.f, Rgba(1.f, 0.1f, 0.1f) },
288  { 3.f * pi / 3.f, Rgba(1.f, 1.f, 0.1f) },
289  { 4.f * pi / 3.f, Rgba(0.1f, 1.f, 0.1f) },
290  { 5.f * pi / 3.f, Rgba(0.1f, 1.f, 1.f) },
291  { 2.f * pi, Rgba(0.1f, 0.1f, 1.f) } },
292  scale);
293  }
295  return Palette({ { x0, Rgba(0.1f, 0.1f, 1.f) },
296  { x0 + 0.5f * dx, Rgba(0.7f, 0.7f, 0.7f) },
297  { x0 + dx, Rgba(1.f, 0.1f, 0.1f) } },
298  scale);
300  return Palette({ { x0, Rgba(0.f, 0.f, 0.6f) },
301  { x0 + 0.01f * dx, Rgba(0.1f, 0.1f, 0.1f) },
302  { x0 + 0.05f * dx, Rgba(0.9f, 0.9f, 0.9f) },
303  { x0 + 0.2f * dx, Rgba(1.f, 1.f, 0.f) },
304  { x0 + dx, Rgba(0.6f, 0.f, 0.f) } },
305  scale);
307  return Palette({ { x0, Rgba(0.1f, 0.1f, 0.1f) },
308  { x0 + 0.001f * dx, Rgba(0.1f, 0.1f, 1.f) },
309  { x0 + 0.01f * dx, Rgba(1.f, 0.f, 0.f) },
310  { x0 + 0.1f * dx, Rgba(1.0f, 0.6f, 0.4f) },
311  { x0 + dx, Rgba(1.f, 1.f, 0.f) } },
312  scale);
314  return Palette({ { 0._f, Rgba(0.1f, 0.1f, 0.1f) }, { 1._f, Rgba(0.9f, 0.9f, 0.9f) } }, scale);
316  return Palette({ { x0, Rgba(0.1f, 0.1f, 1.f) },
317  { x0 + 0.5f * dx, Rgba(0.7f, 0.7f, 0.7f) },
318  { x0 + dx, Rgba(1.f, 0.1f, 0.1f) } },
319  scale);
320  case ColorizerId::RADIUS:
321  return Palette({ { x0, Rgba(0.1f, 0.1f, 1.f) },
322  { x0 + 0.5f * dx, Rgba(0.7f, 0.7f, 0.7f) },
323  { x0 + dx, Rgba(1.f, 0.1f, 0.1f) } },
324  scale);
325  default:
326  // check extended values
327  switch (QuantityId(id)) {
329  SPH_ASSERT(x0 < -1.f);
330  return Palette({ { x0, Rgba(0.3f, 0.3f, 0.8f) },
331  { -1.e4f, Rgba(0.f, 0.f, 0.2f) },
332  { 0.f, Rgba(0.2f, 0.2f, 0.2f) },
333  { 1.e4f, Rgba(0.8f, 0.8f, 0.8f) },
334  { 2.e4f, Rgba(1.f, 1.f, 0.2f) },
335  { x0 + dx, Rgba(0.5f, 0.f, 0.f) } },
336  scale);
337  case QuantityId::ENERGY:
338  return Palette({ { x0, Rgba(0.1f, 0.1f, 0.1f) },
339  { x0 + 0.001f * dx, Rgba(0.1f, 0.1f, 1.f) },
340  { x0 + 0.01f * dx, Rgba(1.f, 0.f, 0.f) },
341  { x0 + 0.1f * dx, Rgba(1.0f, 0.6f, 0.4f) },
342  { x0 + dx, Rgba(1.f, 1.f, 0.f) } },
343  scale);
345  return Palette({ { x0, Rgba(0.f, 0.f, 0.2f) },
346  { x0 + 0.1f * dx, Rgba(0.9f, 0.9f, 0.9f) },
347  { x0 + 0.25f * dx, Rgba(1.f, 1.f, 0.2f) },
348  { x0 + 0.5f * dx, Rgba(1.f, 0.5f, 0.f) },
349  { x0 + dx, Rgba(0.5f, 0.f, 0.f) } },
350  scale);
351  case QuantityId::DENSITY:
356  return Palette({ { x0, Rgba(0.4f, 0.f, 0.4f) },
357  { x0 + 0.3f * dx, Rgba(0.3f, 0.3f, 1.f) },
358  { x0 + 0.5f * dx, Rgba(0.9f, 0.9f, 0.9f) },
359  { x0 + 0.7f * dx, Rgba(1.f, 0.f, 0.f) },
360  { x0 + dx, Rgba(1.f, 1.f, 0.f) } },
361  scale);
362  case QuantityId::DAMAGE:
363  return Palette({ { x0, Rgba(0.1f, 0.1f, 0.1f) }, { x0 + dx, Rgba(0.9f, 0.9f, 0.9f) } }, scale);
364  case QuantityId::MASS:
365  return Palette({ { x0, Rgba(0.1f, 0.1f, 0.1f) }, { x0 + dx, Rgba(0.9f, 0.9f, 0.9f) } }, scale);
367  SPH_ASSERT(x0 < 0._f);
368  return Palette({ { x0, Rgba(0.3f, 0.3f, 0.8f) },
369  { 0.1f * x0, Rgba(0.f, 0.f, 0.2f) },
370  { 0.f, Rgba(0.2f, 0.2f, 0.2f) },
371  { 0.1f * (x0 + dx), Rgba(0.8f, 0.8f, 0.8f) },
372  { x0 + dx, Rgba(1.0f, 0.6f, 0.f) } },
373  scale);
375  SPH_ASSERT(x0 == 0._f);
376  return Palette({ { 0._f, Rgba(0.3f, 0.3f, 0.8f) },
377  { 0.01f * dx, Rgba(0.f, 0.f, 0.2f) },
378  { 0.05f * dx, Rgba(0.2f, 0.2f, 0.2f) },
379  { 0.2f * dx, Rgba(0.8f, 0.8f, 0.8f) },
380  { dx, Rgba(1.0f, 0.6f, 0.f) } },
381  scale);
383  SPH_ASSERT(x0 == 0._f);
384  return Palette({ { 0._f, Rgba(0.3f, 0.3f, 0.8f) },
385  { 0.25f * dx, Rgba(0.f, 0.f, 0.2f) },
386  { 0.5f * dx, Rgba(0.2f, 0.2f, 0.2f) },
387  { 0.75f * dx, Rgba(0.8f, 0.8f, 0.8f) },
388  { dx, Rgba(1.0f, 0.6f, 0.f) } },
389  scale);
391  // sqrt(3) is an important value, as it corresponds to identity tensor
392  const float actDx = max(dx, sqrt(3.f) + 0.2f);
393  const float eps = 0.05f;
394  return Palette({ { 0._f, Rgba(0.f, 0.0f, 0.5f) },
395  { sqrt(3.f) - eps, Rgba(0.9f, 0.9f, 0.9f) },
396  { sqrt(3.f), Rgba(1.f, 1.f, 0.f) },
397  { sqrt(3.f) + eps, Rgba(0.9f, 0.9f, 0.9f) },
398  { actDx, Rgba(0.5f, 0.0f, 0.0f) } },
399  scale);
400  }
402  return Palette({ { x0, Rgba(0.1f, 0.1f, 0.1f) }, { x0 + dx, Rgba(0.9f, 0.9f, 0.9f) } }, scale);
403  case QuantityId::EPS_MIN:
404  return Palette({ { x0, Rgba(0.1f, 0.1f, 1.f) },
405  { x0 + 0.5f * dx, Rgba(0.7f, 0.7f, 0.7f) },
406  { x0 + dx, Rgba(1.f, 0.1f, 0.1f) } },
407  scale);
409  return Palette({ { x0, Rgba(0.1f, 0.1f, 1.f) },
410  { x0 + 0.5f * dx, Rgba(0.7f, 0.7f, 0.7f) },
411  { x0 + dx, Rgba(1.f, 0.1f, 0.1f) } },
412  scale);
413  default:
414  return getDefaultPalette(Interval(x0, x0 + dx));
415  }
416  }
417 }
418 
#define SPH_ASSERT(x,...)
Definition: Assert.h:94
#define NOT_IMPLEMENTED
Helper macro marking missing implementation.
Definition: Assert.h:100
NAMESPACE_SPH_BEGIN
Definition: BarnesHut.cpp:13
Defines projection transforming 3D particles onto 2D screen.
Object converting quantity values of particles into colors.
@ TOTAL_STRESS
Total stress (sigma = S - pI)
@ FLAG
Particles of different bodies are colored differently.
@ COROTATING_VELOCITY
Velocities with a respect to the rotating body.
@ MOVEMENT_DIRECTION
Projected direction of motion.
@ RADIUS
Radii/smoothing lenghts of particles.
@ SUMMED_DENSITY
Density computed from particle masses by direct summation of neighbours.
@ DENSITY_PERTURBATION
Relative difference of density and initial density (rho/rho0 - 1)
@ COMPONENT_ID
Color assigned to each component (group of connected particles)
@ VELOCITY
Particle velocities.
@ YIELD_REDUCTION
Reduction of stress tensor due to yielding (1 - f_vonMises)
@ PARTICLE_ID
Each particle drawn with different color.
@ TOTAL_ENERGY
Sum of kinetic and internal energy for given particle.
@ BOUND_COMPONENT_ID
Color assigned to each group of gravitationally bound particles.
@ DAMAGE_ACTIVATION
Ratio of the stress and the activation strain.
@ BOUNDARY
Shows boundary particles.
@ AGGREGATE_ID
Color assigned to each aggregate.
@ TEMPERATURE
Temperature, computed from internal energy.
@ ACCELERATION
Acceleration of particles.
@ BEAUTY
Attempts to show the real-world look.
@ MATERIAL_ID
Particles with different materials are colored differently.
@ UVW
Shows UV mapping, u-coordinate in red and v-coordinate in blur.
Renderer drawing iso-contours of specified quantity.
double Float
Precision used withing the code. Use Float instead of float or double where precision is important.
Definition: Globals.h:13
constexpr INLINE T max(const T &f1, const T &f2)
Definition: MathBasic.h:20
INLINE T sqrt(const T f)
Return a squared root of a value.
Definition: MathUtils.h:78
constexpr Float PI
Mathematical constants.
Definition: MathUtils.h:361
Renderer visualizing the surface as triangle mesh.
#define NAMESPACE_SPH_END
Definition: Object.h:12
const NothingType NOTHING
Definition: Optional.h:16
PaletteScale
Definition: Palette.h:13
@ HYBRID
Logarithic scale for values > 1 and < -1, linear scale on interval <-1, 1>
@ LINEAR
Control points are interpolated on linear scale.
@ LOGARITHMIC
Control points are interpolated on logarithmic scale. All points must be positive!
Renderer drawing individual particles as dots.
@ SYMMETRIC_TENSOR
@ TRACELESS_TENSOR
QuantityMetadata getMetadata(const QuantityId key)
Returns the quantity information using quantity ID.
Definition: QuantityIds.cpp:27
QuantityId
Unique IDs of basic quantities of SPH particles.
Definition: QuantityIds.h:19
@ BULK_DENSITY
Bulk density, may be lower than the material density.
@ AV_ALPHA
Coefficient alpha of the artificial viscosity. Coefficient beta is always 2*alpha.
@ FLAG
ID of original body, used to implement discontinuities between bodies in SPH.
@ VELOCITY_DIVERGENCE
Velocity divergence.
@ STRAIN_RATE_CORRECTION_TENSOR
Correction tensor used to improve conservation of total angular momentum.
@ DEVIATORIC_STRESS
Deviatoric stress tensor, always a traceless tensor.
@ PRESSURE
Pressure, affected by yielding and fragmentation model, always a scalar quantity.
@ AV_BALSARA
Balsara factor.
@ MOMENT_OF_INERTIA
Moment of inertia of particles, analogy of particle masses for rotation.
@ VELOCITY_GRADIENT
Velocity gradient.
@ DAMAGE
Damage.
@ ENERGY
Specific internal energy, always a scalar quantity.
@ VELOCITY_LAPLACIAN
@ VELOCITY_ROTATION
Velocity rotation.
@ DENSITY
Density, always a scalar quantity.
@ DELTASPH_DENSITY_GRADIENT
@ MASS
Paricles masses, always a scalar quantity.
@ NEIGHBOUR_CNT
Number of neighbouring particles (in radius h * kernel.radius)
@ SOUND_SPEED
Sound speed, always a scalar quantity.
@ AV_STRESS
Artificial stress by Monaghan .
@ VIBRATIONAL_VELOCITY
Vibrational particle velocity, used by the block model of acoustic fluidization.
@ EPS_MIN
Activation strait rate.
@ VELOCITY_GRADIENT_OF_DIVERGENCE
BasicVector< Float > Vector
Definition: Vector.h:539
Helper type allowing to "derive" from enum class.
Definition: ExtendedEnum.h:24
Container of key-value pairs.
Definition: FlatMap.h:19
INLINE TValue get(const GuiSettingsId id) const
Definition: Settings.h:245
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
virtual Optional< Palette > getPalette() const =0
Returns recommended palette for drawing this colorizer.
virtual std::string name() const =0
Returns the name of the colorizer.
virtual void setPalette(const Palette &newPalette)=0
Modifies the palette used by ths colorizer.
Interface used to implement renderers.
Definition: IRenderer.h:166
virtual void initialize(const Storage &storage, const IColorizer &colorizer, const ICamera &camera)=0
Prepares the objects for rendering and updates its data.
virtual void render(const RenderParams &params, Statistics &stats, IRenderOutput &output) const =0
Draws particles into the bitmap, given the data provided in initialize.
virtual void cancelRender()=0
Stops the rendering if it is currently in progress.
virtual bool isInitialized() const =0
Checks if the renderer has been initialized.
Object representing a 1D interval of real numbers.
Definition: Interval.h:17
INLINE Float lower() const
Returns lower bound of the interval.
Definition: Interval.h:74
INLINE Float size() const
Returns the size of the interval.
Definition: Interval.h:89
INLINE Type & value()
Returns the reference to the stored value.
Definition: Optional.h:172
Represents a color palette, used for mapping arbitrary number to a color.
Definition: Palette.h:25
bool getPalette(const std::string &name, Palette &palette) const
Definition: Project.h:41
GuiSettings & getGuiSettings()
Definition: Project.h:51
Definition: Color.h:8
static const Settings & getDefaults()
\brief Returns a reference to object containing default values of all settings.
Object holding various statistics about current run.
Definition: Statistics.h:22
Container storing all quantities used within the simulations.
Definition: Storage.h:230
@ COLORMAP_LOGARITHMIC_FACTOR
@ CAMERA_ORTHO_CUTOFF
Max z-coordinate of particle to be displayed by ortho renderer.
@ RENDERER
Selected renderer.
@ CAMERA_ORTHO_FOV
View field of view (zoom). Special value 0 means the field of view is computed from the bounding box.
ColorMapEnum
Definition: Settings.h:85
BrdfEnum
Definition: Settings.h:80
CameraEnum
Definition: Settings.h:35
RendererEnum
Definition: Settings.h:14
@ PARTICLE
2D section showing particles as points
@ MESH
Surfaces of bodies are meshed using Marching cubes and drawed as triangles.
@ RAYMARCHER
Raymarcher that computes intersections with implicit surface.
@ VOLUME
Volumetric renderer.
@ CONTOUR
Draws contours (iso-lines) of quantities.
@ NONE
No particle visualization.
AutoPtr< IColorMap > getColorMap(const GuiSettings &settings)
Definition: Factory.cpp:112
AutoPtr< IColorizer > getColorizer(const Project &project, const ExtColorizerId id)
Definition: Factory.cpp:198
AutoPtr< ITracker > getTracker(const GuiSettings &settings)
Definition: Factory.cpp:15
AutoPtr< IBrdf > getBrdf(const GuiSettings &settings)
Definition: Factory.cpp:100
Palette getPalette(const ExtColorizerId id)
Definition: Factory.cpp:261
AutoPtr< IRenderer > getRenderer(const GuiSettings &settings)
Definition: Factory.cpp:58
AutoPtr< ICamera > getCamera(const GuiSettings &settings, const Pixel size)
Definition: Factory.cpp:28
SharedPtr< IScheduler > getScheduler(const RunSettings &settings=RunSettings::getDefaults())
Definition: Factory.cpp:178
@ OVERLAP
Specifies that overlapping particles belong into the same component.
Pixel imageSize
Size of the image.
Definition: Camera.h:136
PaletteScale scale
Definition: Factory.cpp:209
Interval range
Definition: Factory.cpp:208
Definition: Point.h:101
Parameters of the rendered image.
Definition: IRenderer.h:60