SPH
ParticleRenderer.cpp
Go to the documentation of this file.
2 #include "gui/Utils.h"
3 #include "gui/objects/Camera.h"
4 #include "gui/objects/Color.h"
9 #include "post/Plot.h"
10 #include "post/Point.h"
11 #include "sph/boundary/Boundary.h"
12 #include "system/Profiler.h"
13 #include "system/Statistics.h"
14 #include "thread/CheckFunction.h"
15 
17 
18 static void drawVector(IRenderContext& context,
19  const ICamera& camera,
20  const Vector& r,
21  const Vector& v,
22  const Float length) {
23  if (getSqrLength(v) == 0._f) {
24  return;
25  }
26  const Optional<ProjectedPoint> p1 = camera.project(r);
27  const Optional<ProjectedPoint> p2 = camera.project(r + v);
28  if (!p1 || !p2) {
29  return;
30  }
31 
32  Coords dir = p2->coords - p1->coords;
33  const Float l = getLength(dir);
34  if (l == 0._f) {
35  return;
36  }
37  dir *= float(length / l);
38  const Coords c1 = p1->coords;
39  const Coords c2 = p1->coords + dir;
40 
41  context.setColor(Rgba(1.f, 0.65f, 0.f), ColorFlag::LINE);
42  context.setThickness(2.f);
43  context.drawLine(c1, c2);
44 
45  // make an arrow
47  PlotPoint dp(dir.x, dir.y);
48  PlotPoint a1 = rot.transformPoint(dp) * 0.1f;
49  PlotPoint a2 = rot.transpose().transformPoint(dp) * 0.1f;
50 
51  context.drawLine(c2, c2 + Coords(float(a1.x), float(a1.y)));
52  context.drawLine(c2, c2 + Coords(float(a2.x), float(a2.y)));
53 }
54 
56  const Pixel origin,
57  const Pixel size,
58  const Rgba& lineColor,
59  const Palette& palette) {
60 
61  // draw palette
62  for (int i = 0; i < size.y; ++i) {
63  const float value = palette.relativeToPalette(float(i) / (size.y - 1));
64  context.setColor(palette(value), ColorFlag::LINE);
65  context.drawLine(Coords(origin.x, origin.y - i), Coords(origin.x + size.x, origin.y - i));
66  }
67 
68  // draw tics
69  const Interval interval = palette.getInterval();
70  const PaletteScale scale = palette.getScale();
71 
72  Array<Float> tics;
73  switch (scale) {
75  tics = getLinearTics(interval, 4);
76  break;
78  tics = getLogTics(interval, 4);
79  break;
80  case PaletteScale::HYBRID: {
81  const Size ticsCnt = 5;
82  // tics currently not implemented, so just split the range to equidistant steps
83  for (Size i = 0; i < ticsCnt; ++i) {
84  tics.push(palette.relativeToPalette(float(i) / (ticsCnt - 1)));
85  }
86  break;
87  }
88  default:
90  }
91  context.setColor(lineColor, ColorFlag::LINE | ColorFlag::TEXT);
92  for (Float tic : tics) {
93  const float value = palette.paletteToRelative(float(tic));
94  const int i = int(value * size.y);
95  context.drawLine(Coords(origin.x, origin.y - i), Coords(origin.x + 6, origin.y - i));
96  context.drawLine(
97  Coords(origin.x + size.x - 6, origin.y - i), Coords(origin.x + size.x, origin.y - i));
98 
99  std::wstring text = toPrintableString(tic, 1, 1000);
100  context.drawText(
101  Coords(origin.x - 15, origin.y - i), TextAlign::LEFT | TextAlign::VERTICAL_CENTER, text);
102  }
103 }
104 
105 static void drawGrid(IRenderContext& context, const ICamera& camera, const float grid) {
106  // find (any) direction in the camera plane
107  const Optional<CameraRay> originRay = camera.unproject(Coords(0, 0));
108  const Vector dir = getNormalized(originRay->target - originRay->origin);
109  Vector perpDir;
110  if (dir == Vector(0._f, 0._f, 1._f)) {
111  perpDir = Vector(1._f, 0._f, 0._f);
112  } else {
113  perpDir = getNormalized(cross(dir, Vector(0._f, 0._f, 1._f)));
114  }
115 
116  // find how much is projected grid distance
117  const Coords shifted = camera.project(originRay->origin + grid * perpDir)->coords;
118  const float dx = getLength(shifted);
119  const float dy = dx;
120  const Coords origin = camera.project(Vector(0._f))->coords;
121 
122  context.setColor(Rgba(0.16f), ColorFlag::LINE);
123  const Pixel size = context.size();
124  for (float x = origin.x; x < size.x; x += dx) {
125  context.drawLine(Coords(x, 0), Coords(x, size.y));
126  }
127  for (float x = origin.x - dx; x >= 0; x -= dx) {
128  context.drawLine(Coords(x, 0), Coords(x, size.y));
129  }
130  for (float y = origin.y; y < size.y; y += dy) {
131  context.drawLine(Coords(0, y), Coords(size.x, y));
132  }
133  for (float y = origin.y - dy; y >= 0; y -= dy) {
134  context.drawLine(Coords(0, y), Coords(size.x, y));
135  }
136 }
137 
138 static void drawKey(IRenderContext& context,
139  const Statistics& stats,
140  const float wtp,
141  const float UNUSED(fps),
142  const Rgba& background) {
143  const Coords keyStart(5, 2);
145 
146  context.setColor(background.inverse(), ColorFlag::TEXT | ColorFlag::LINE);
147  if (stats.has(StatisticsId::RUN_TIME)) {
148  const float time = float(stats.get<Float>(StatisticsId::RUN_TIME));
149  context.drawText(keyStart, flags, "t = " + getFormattedTime(int64_t(1.e3f * time)));
150  }
151  // context.drawText(keyStart + Coords(0, 50), flags, "fps = " + std::to_string(int(fps)));
152 
153  const float dFov_dPx = 1.f / wtp;
154  const float minimalScaleFov = dFov_dPx * 16;
155  float actScaleFov = pow(10.f, ceil(log10(minimalScaleFov)));
156  const float scaleSize = actScaleFov / dFov_dPx;
157  const Coords lineStart = keyStart + Coords(75, 30);
158  context.drawLine(lineStart + Coords(-scaleSize / 2, 0), lineStart + Coords(scaleSize / 2, 0));
159  context.drawLine(lineStart + Coords(-scaleSize / 2, -4), lineStart + Coords(-scaleSize / 2, 4));
160  context.drawLine(lineStart + Coords(scaleSize / 2 + 1, -4), lineStart + Coords(scaleSize / 2 + 1, 4));
161 
164  std::wstring units = L" m";
165  if (actScaleFov > Constants::au) {
166  actScaleFov /= float(Constants::au);
167  units = L" au";
168  } else if (actScaleFov > 1.e3f) {
169  actScaleFov /= 1.e3f;
170  units = L" km";
171  }
172  std::wstring scaleText = toPrintableString(actScaleFov, 0, 10);
173  if (scaleText.find(L'\u00D7') != std::wstring::npos) {
174  // convert 1x10^n -> 10^n
175  scaleText = scaleText.substr(3);
176  }
177  context.drawText(lineStart + Coords(0, 6), flags, scaleText + units);
178 }
179 
180 void drawAxis(IRenderContext& context, const Rgba& color, const Vector& axis, const std::string& label) {
181  const float length = 40;
182  const Coords origin(50, context.size().y - 50);
183  const Coords dir = Coords(-axis[0], axis[1]) * length;
184  context.setColor(color.brighten(0.25), ColorFlag::LINE);
185  context.drawLine(origin, origin + dir);
187  context.drawText(origin + dir, TextAlign::TOP | TextAlign::HORIZONTAL_CENTER, label);
188 }
189 
191  grid = float(settings.get<Float>(GuiSettingsId::VIEW_GRID_SIZE));
192  shouldContinue = true;
193 }
194 
195 static bool isCutOff(const Vector& r, const Optional<float> cutoff, const Vector direction) {
196  return cutoff && abs(dot(direction, r)) > cutoff.value();
197 }
198 
200  const IColorizer& colorizer,
201  const ICamera& camera) {
202  MEASURE_SCOPE("ParticleRenderer::initialize");
203  cached.idxs.clear();
204  cached.positions.clear();
205  cached.colors.clear();
206  cached.vectors.clear();
207 
208  const Optional<float> cutoff = camera.getCutoff();
209  const Vector direction = camera.getFrame().row(2);
210  bool hasVectorData = bool(colorizer.evalVector(0));
212  for (Size i = 0; i < r.size(); ++i) {
213  const Optional<ProjectedPoint> p = camera.project(r[i]);
214  if (p && !isCutOff(r[i], cutoff, direction)) {
215  cached.idxs.push(i);
216  cached.positions.push(r[i]);
217 
218  const Rgba color = colorizer.evalColor(i);
219  cached.colors.push(color);
220 
221  if (hasVectorData) {
222  Optional<Vector> v = colorizer.evalVector(i);
223  SPH_ASSERT(v);
224  cached.vectors.push(v.value());
225  }
226  }
227  }
228 
229  SharedPtr<IStorageUserData> data = storage.getUserData();
230  if (RawPtr<GhostParticlesData> ghosts = dynamicCast<GhostParticlesData>(data.get())) {
231  for (Size i = 0; i < ghosts->size(); ++i) {
232  const Vector pos = ghosts->getGhost(i).position;
233  const Optional<ProjectedPoint> p = camera.project(pos);
234  if (p && !isCutOff(pos, cutoff, direction)) {
235  cached.idxs.push(Size(-1));
236  cached.positions.push(pos);
237  cached.colors.push(Rgba::transparent());
238 
239  if (hasVectorData) {
240  cached.vectors.push(Vector(0._f));
241  }
242  }
243  }
244  }
245 
246  // sort in z-order
247  Order order(cached.positions.size());
248  order.shuffle([this, &direction](Size i, Size j) {
249  const Vector r1 = cached.positions[i];
250  const Vector r2 = cached.positions[j];
251  return dot(direction, r1) > dot(direction, r2);
252  });
254  cached.positions = order.apply(cached.positions);
255  cached.idxs = order.apply(cached.idxs);
256  cached.colors = order.apply(cached.colors);
257 
258  cached.cameraDir = direction;
259 
260  if (hasVectorData) {
261  cached.vectors = order.apply(cached.vectors);
262  } else {
263  cached.vectors.clear();
264  }
265 
266  cached.palette = colorizer.getPalette();
267 }
268 
270  return !cached.positions.empty();
271 }
272 
273 static AutoPtr<IRenderContext> getContext(const RenderParams& params, Bitmap<Rgba>& bitmap) {
274  if (params.particles.doAntialiasing) {
275  if (params.particles.smoothed) {
276  CubicSpline<2> kernel;
277  return makeAuto<SmoothedRenderContext>(bitmap, kernel);
278  } else {
279  return makeAuto<AntiAliasedRenderContext>(bitmap);
280  }
281  } else {
282  if (params.background.a() == 1.f) {
283  return makeAuto<PreviewRenderContext<OverridePixelOp>>(bitmap);
284  } else {
285  return makeAuto<PreviewRenderContext<OverPixelOp>>(bitmap);
286  }
287  }
288 }
289 
290 void ParticleRenderer::render(const RenderParams& params, Statistics& stats, IRenderOutput& output) const {
291  MEASURE_SCOPE("ParticleRenderer::render");
292 
293  Bitmap<Rgba> bitmap(params.camera->getSize());
294  AutoPtr<IRenderContext> context = getContext(params, bitmap);
295 
296  // fill with the background color
297  context->fill(params.background);
298 
299  if (grid > 0.f) {
300  drawGrid(*context, *params.camera, grid);
301  }
302 
303  struct {
304  Vector r;
305  Vector v;
306  bool used = false;
307  } dir;
308 
309  context->setColor(Rgba::black(), ColorFlag::LINE);
310 
311  shouldContinue = true;
312  // draw particles
313  const bool reverseOrder = dot(cached.cameraDir, params.camera->getFrame().row(2)) < 0._f;
314  for (Size k = 0; k < cached.positions.size(); ++k) {
315  const Size i = reverseOrder ? cached.positions.size() - k - 1 : k;
316  if (!params.particles.renderGhosts && cached.idxs[i] == Size(-1)) {
317  continue;
318  }
319  if (params.particles.selected && cached.idxs[i] == params.particles.selected.value()) {
320  // highlight the selected particle
321  context->setColor(Rgba::red(), ColorFlag::FILL);
322  context->setColor(Rgba::white(), ColorFlag::LINE);
323 
324  if (!cached.vectors.empty()) {
325  dir.used = true;
326  dir.v = cached.vectors[i];
327  dir.r = cached.positions[i];
328  }
329  } else {
330  Rgba color = cached.colors[i];
331  if (params.particles.grayScale) {
332  color = Rgba(color.intensity());
333  }
334  context->setColor(color, ColorFlag::FILL | ColorFlag::LINE);
335  if (cached.idxs[i] == Size(-1)) {
336  // ghost
337  context->setColor(Rgba::gray(0.7f), ColorFlag::LINE);
338  }
339  }
340 
341  const Optional<ProjectedPoint> p = params.camera->project(cached.positions[i]);
342  SPH_ASSERT(p); // cached values must be visible by the camera
343  const float size = min<float>(p->radius * params.particles.scale, context->size().x);
344  context->drawCircle(p->coords, size);
345  }
346  // after all particles are drawn, draw the velocity vector over
347  if (dir.used) {
348  drawVector(*context, *params.camera, dir.r, dir.v, params.vectors.length);
349  }
350 
351  if (params.showKey) {
352  if (cached.palette) {
353  const Pixel origin(context->size().x - 50, 231);
355  if (params.particles.grayScale) {
356  palette =
357  cached.palette->transform([](const Rgba& color) { return Rgba(color.intensity()); });
358  } else {
359  palette = cached.palette.value();
360  }
361  drawPalette(*context, origin, Pixel(30, 201), params.background.inverse(), palette);
362  }
363 
364  if (Optional<float> wtp = params.camera->getWorldToPixel()) {
365  const float fps = 1000.f / lastRenderTimer.elapsed(TimerUnit::MILLISECOND);
366  lastRenderTimer.restart();
367  drawKey(*context, stats, wtp.value(), fps, params.background);
368  }
369 
370  const AffineMatrix frame = params.camera->getFrame().inverse();
371  drawAxis(*context, Rgba::red(), frame.row(0), "x");
372  drawAxis(*context, Rgba::green(), -frame.row(1), "y");
373  drawAxis(*context, Rgba::blue(), frame.row(2), "z");
374  }
375 
376  // lastly black frame to draw on top of other stuff
377  const Pixel upper = bitmap.size() - Pixel(1, 1);
378  context->setColor(Rgba::black(), ColorFlag::LINE);
379  context->drawLine(Coords(0, 0), Coords(upper.x, 0));
380  context->drawLine(Coords(upper.x, 0), Coords(upper));
381  context->drawLine(Coords(upper), Coords(0, upper.y));
382  context->drawLine(Coords(0, upper.y), Coords(0, 0));
383 
384  output.update(bitmap, context->getLabels(), true);
385 }
386 
388  shouldContinue = false;
389 }
390 
#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
Boundary conditions.
Defines projection transforming 3D particles onto 2D screen.
Helper functions to check the internal consistency of the code.
Object converting quantity values of particles into colors.
Wraps a functor and executes it once the wrapper goes out of scope.
uint32_t Size
Integral type used to index arrays (by default).
Definition: Globals.h:16
double Float
Precision used withing the code. Use Float instead of float or double where precision is important.
Definition: Globals.h:13
@ HORIZONTAL_CENTER
constexpr INLINE Float pow(const Float v)
Power for floats.
constexpr Float DEG_TO_RAD
Definition: MathUtils.h:369
INLINE T log10(const T f)
Definition: MathUtils.h:331
INLINE auto ceil(const T &f)
Definition: MathUtils.h:351
INLINE auto abs(const T &f)
Definition: MathUtils.h:276
#define UNUSED(x)
Definition: Object.h:37
#define NAMESPACE_SPH_END
Definition: Object.h:12
Helper object defining permutation.
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!
void drawAxis(IRenderContext &context, const Rgba &color, const Vector &axis, const std::string &label)
void drawPalette(IRenderContext &context, const Pixel origin, const Pixel size, const Rgba &lineColor, const Palette &palette)
Renderer drawing individual particles as dots.
Array< Float > getLinearTics(const Interval &interval, const Size minCount)
Returns the tics to be drawn on a linear axis of a plot.
Definition: Plot.cpp:423
Array< Float > getLogTics(const Interval &interval, const Size minCount)
Returns the tics to be drawn on a logarithmic axis of a plot.
Definition: Plot.cpp:458
Drawing quantity values as functions of time or spatial coordinates.
Tool to measure time spent in functions and profile the code.
#define MEASURE_SCOPE(name)
Definition: Profiler.h:70
@ POSITION
Positions (velocities, accelerations) of particles, always a vector quantity,.
Statistics gathered and periodically displayed during the run.
@ RUN_TIME
Current time of the simulation in code units. Does not necessarily have to be 0 when run starts.
String getFormattedTime(const String &format)
Utility functions.
Definition: String.cpp:128
std::wstring toPrintableString(const Float value, const Size precision, const Float decimalThreshold)
Converts the value to a printable string.
Definition: Utils.cpp:121
Random utility functions for drawing stuff to DC.
INLINE Float getLength(const Vector &v)
Returns the length of the vector. Enabled only for vectors of floating-point precision.
Definition: Vector.h:579
INLINE Float getSqrLength(const Vector &v)
Definition: Vector.h:574
INLINE BasicVector< float > cross(const BasicVector< float > &v1, const BasicVector< float > &v2)
Cross product between two vectors.
Definition: Vector.h:559
BasicVector< Float > Vector
Definition: Vector.h:539
INLINE float dot(const BasicVector< float > &v1, const BasicVector< float > &v2)
Make sure the vector is trivially constructible and destructible, needed for fast initialization of a...
Definition: Vector.h:548
INLINE Vector getNormalized(const Vector &v)
Definition: Vector.h:590
2D affine matrix
Definition: Point.h:50
PlotPoint transformPoint(const PlotPoint &p) const
Applies the affine transform on given point.
Definition: Point.h:92
static AffineMatrix2 rotate(const Float phi)
Create a rotation matrix.
Definition: Point.h:137
AffineMatrix2 transpose() const
Returns the transposed matrix.
Definition: Point.h:131
INLINE Vector row(const Size idx) const
Definition: AffineMatrix.h:44
AffineMatrix inverse() const
Definition: AffineMatrix.h:86
Object providing safe access to continuous memory of data.
Definition: ArrayView.h:17
INLINE TCounter size() const
Definition: ArrayView.h:101
INLINE void push(U &&u)
Adds new element to the end of the array, resizing the array if necessary.
Definition: Array.h:306
Pixel size() const
Definition: Bitmap.h:72
Cubic spline (M4) kernel.
Definition: Kernel.h:150
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
virtual Optional< float > getCutoff() const =0
Returns the clipping distance from plane passing through origin, perpendicular to camera direction.
virtual Pixel getSize() const =0
Returns the current resolution of the camera.
virtual AffineMatrix getFrame() const =0
Returns the transformation matrix converting camera space to world space.
virtual Optional< float > getWorldToPixel() const =0
Returns the world-to-pixel ratio.
virtual Optional< ProjectedPoint > project(const Vector &r) const =0
Returns projected position of particle on the image.
virtual Optional< CameraRay > unproject(const Coords &coords) const =0
Returns a ray in particle coordinates corresponding to given coordinates in the image plane.
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 Optional< Vector > evalVector(const Size UNUSED(idx)) const
Returns the vector representation of the colorized quantity for idx-th particle.
Definition: Colorizer.h:65
virtual Rgba evalColor(const Size idx) const =0
Returns the color of idx-th particle.
Abstraction of a device used for rendering.
Definition: RenderContext.h:22
virtual void drawCircle(const Coords center, const float radius)=0
Draws a circle, given its center and a radius.
virtual void drawLine(const Coords p1, const Coords p2)=0
Draws a line connecting two points.
virtual void drawText(const Coords p, const Flags< TextAlign > align, const std::string &s)=0
virtual void setColor(const Rgba &color, const Flags< ColorFlag > flags)=0
Selects the color for one or more drawing modes.
virtual Array< IRenderOutput::Label > getLabels() const
Definition: RenderContext.h:56
virtual void setThickness(const float thickness)=0
Modifies the thickness of the lines.
virtual void fill(const Rgba &color)=0
Fills the whole canvas with given color.
virtual Pixel size() const =0
Returns the size of the canvas associated with the context.
virtual void update(const Bitmap< Rgba > &bitmap, Array< Label > &&labels, const bool isFinal)=0
May be called once after render finishes or multiple times for progressive renderers.
Object representing a 1D interval of real numbers.
Definition: Interval.h:17
Wrapper of type value of which may or may not be present.
Definition: Optional.h:23
INLINE Type & value()
Returns the reference to the stored value.
Definition: Optional.h:172
Permutation, i.e. (discrete) invertible function int->int.
Definition: Order.h:18
Array< T > apply(const Array< T > &input)
Shuffles given array using this order.
Definition: Order.h:76
void shuffle(TBinaryPredicate &&predicate)
Shuffles the order using a binary predicate.
Definition: Order.h:47
Represents a color palette, used for mapping arbitrary number to a color.
Definition: Palette.h:25
float relativeToPalette(const float value) const
Converts a relative position to an absolute position on a palette.
Definition: Palette.cpp:141
PaletteScale getScale() const
Returns the scale of the palette.
Definition: Palette.cpp:107
float paletteToRelative(const float value) const
Inverse transform to relativeToPalette.
Definition: Palette.cpp:162
Interval getInterval() const
Returns the interval for which the palette is defined.
Definition: Palette.cpp:90
ParticleRenderer(const GuiSettings &settings)
Optional< Palette > palette
Color palette or NOTHING if no palette is drawn.
virtual bool isInitialized() const override
Checks if the renderer has been initialized.
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
Draws particles into the bitmap, given the data provided in initialize.
virtual void cancelRender() override
Stops the rendering if it is currently in progress.
Non-owning wrapper of pointer.
Definition: RawPtr.h:19
Definition: Color.h:8
Rgba brighten(const float amount) const
Returns a color brighter by given factor.
Definition: Color.h:145
static Rgba gray(const float value=0.5f)
Definition: Color.h:198
Rgba inverse() const
Returns an inverse color.
Definition: Color.h:151
static Rgba green()
Definition: Color.h:182
float intensity() const
Returns the average intensity of the color.
Definition: Color.h:115
static Rgba black()
Definition: Color.h:190
float & a()
Definition: Color.h:63
static Rgba transparent()
Definition: Color.h:202
static Rgba white()
Definition: Color.h:194
static Rgba blue()
Definition: Color.h:186
static Rgba red()
Definition: Color.h:178
INLINE RawPtr< T > get() const
Definition: SharedPtr.h:223
Object holding various statistics about current run.
Definition: Statistics.h:22
TValue get(const StatisticsId idx) const
Returns value of a statistic.
Definition: Statistics.h:88
bool has(const StatisticsId idx) const
Checks if the object contains a statistic with given ID.
Definition: Statistics.h:44
Container storing all quantities used within the simulations.
Definition: Storage.h:230
SharedPtr< IStorageUserData > getUserData() const
Returns the stored user data.
Definition: Storage.cpp:828
Array< TValue > & getValue(const QuantityId key)
Retrieves a quantity values from the storage, given its key and value type.
Definition: Storage.cpp:191
int64_t elapsed(const TimerUnit unit) const
Returns elapsed time in timer units. Does not reset the timer.
Definition: Timer.cpp:55
void restart()
Reset elapsed duration to zero.
Definition: Timer.cpp:51
2D point and other primitives for 2D geometry
@ VIEW_GRID_SIZE
Size of the grid cell in simulation units (not window units); if zero, no grid is drawn.
constexpr Float au
Astronomical unit (exactly)
Definition: Constants.h:38
Definition: Point.h:115
Definition: Point.h:101
Point in 2D plot.
Definition: Point.h:16
Float y
Definition: Point.h:17
Float x
Definition: Point.h:17
Parameters of the rendered image.
Definition: IRenderer.h:60
Optional< Size > selected
Highlighted particle (only for interactive view).
Definition: IRenderer.h:86
Rgba background
Background color of the rendered image.
Definition: IRenderer.h:71
struct RenderParams::@33 particles
Parameters of the particle renderer.
float length
Length of the drawn vectors in pixels;.
Definition: IRenderer.h:110
AutoPtr< ICamera > camera
Camera used for rendering.
Definition: IRenderer.h:63
bool showKey
If true, a color palette and a distance scale is included in the image.
Definition: IRenderer.h:74
bool doAntialiasing
If true, the particles will be drawn with antialiasing.
Definition: IRenderer.h:94
bool renderGhosts
If true, ghost particles (if present) will be rendered as empty circles.
Definition: IRenderer.h:102
struct RenderParams::@34 vectors
Parameters of rendered vectors.
bool grayScale
If true, the palette is converted to grayscale.
Definition: IRenderer.h:89
bool smoothed
If true, particles will be smoothed using cubic spline.
Definition: IRenderer.h:99
float scale
Scaling factor of drawn particles relative to 1.
Definition: IRenderer.h:81