Rerun C++ SDK
Loading...
Searching...
No Matches
line_grid3d.hpp
1// DO NOT EDIT! This file was auto-generated by crates/build/re_types_builder/src/codegen/cpp/mod.rs
2// Based on "crates/store/re_types/definitions/rerun/blueprint/archetypes/line_grid3d.fbs".
3
4#pragma once
5
6#include "../../blueprint/components/grid_spacing.hpp"
7#include "../../blueprint/components/visible.hpp"
8#include "../../collection.hpp"
9#include "../../compiler_utils.hpp"
10#include "../../component_batch.hpp"
11#include "../../components/color.hpp"
12#include "../../components/plane3d.hpp"
13#include "../../components/stroke_width.hpp"
14#include "../../indicator_component.hpp"
15#include "../../result.hpp"
16
17#include <cstdint>
18#include <optional>
19#include <utility>
20#include <vector>
21
22namespace rerun::blueprint::archetypes {
23 /// **Archetype**: Configuration for the 3D line grid.
24 struct LineGrid3D {
25 /// Whether the grid is visible.
26 ///
27 /// Defaults to true.
28 std::optional<rerun::blueprint::components::Visible> visible;
29
30 /// Space between grid lines spacing of one line to the next in scene units.
31 ///
32 /// As you zoom out, successively only every tenth line is shown.
33 /// This controls the closest zoom level.
34 std::optional<rerun::blueprint::components::GridSpacing> spacing;
35
36 /// In what plane the grid is drawn.
37 ///
38 /// Defaults to whatever plane is determined as the plane at zero units up/down as defined by `components::ViewCoordinates` if present.
39 std::optional<rerun::components::Plane3D> plane;
40
41 /// How thick the lines should be in ui units.
42 ///
43 /// Default is 1.0 ui unit.
44 std::optional<rerun::components::StrokeWidth> stroke_width;
45
46 /// Color used for the grid.
47 ///
48 /// Transparency via alpha channel is supported.
49 /// Defaults to a slightly transparent light gray.
50 std::optional<rerun::components::Color> color;
51
52 public:
53 static constexpr const char IndicatorComponentName[] =
54 "rerun.blueprint.components.LineGrid3DIndicator";
55
56 /// Indicator component, used to identify the archetype when converting to a list of components.
58
59 public:
60 LineGrid3D() = default;
61 LineGrid3D(LineGrid3D&& other) = default;
62
63 /// Whether the grid is visible.
64 ///
65 /// Defaults to true.
67 visible = std::move(_visible);
68 // See: https://github.com/rerun-io/rerun/issues/4027
69 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
70 }
71
72 /// Space between grid lines spacing of one line to the next in scene units.
73 ///
74 /// As you zoom out, successively only every tenth line is shown.
75 /// This controls the closest zoom level.
77 spacing = std::move(_spacing);
78 // See: https://github.com/rerun-io/rerun/issues/4027
79 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
80 }
81
82 /// In what plane the grid is drawn.
83 ///
84 /// Defaults to whatever plane is determined as the plane at zero units up/down as defined by `components::ViewCoordinates` if present.
86 plane = std::move(_plane);
87 // See: https://github.com/rerun-io/rerun/issues/4027
88 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
89 }
90
91 /// How thick the lines should be in ui units.
92 ///
93 /// Default is 1.0 ui unit.
95 stroke_width = std::move(_stroke_width);
96 // See: https://github.com/rerun-io/rerun/issues/4027
97 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
98 }
99
100 /// Color used for the grid.
101 ///
102 /// Transparency via alpha channel is supported.
103 /// Defaults to a slightly transparent light gray.
105 color = std::move(_color);
106 // See: https://github.com/rerun-io/rerun/issues/4027
107 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
108 }
109 };
110
111} // namespace rerun::blueprint::archetypes
112
113namespace rerun {
114 /// \private
115 template <typename T>
116 struct AsComponents;
117
118 /// \private
119 template <>
120 struct AsComponents<blueprint::archetypes::LineGrid3D> {
121 /// Serialize all set component batches.
122 static Result<std::vector<ComponentBatch>> serialize(
123 const blueprint::archetypes::LineGrid3D& archetype
124 );
125 };
126} // namespace rerun
A class for representing either a usable value, or an error.
Definition result.hpp:14
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:23
Archetype: Configuration for the 3D line grid.
Definition line_grid3d.hpp:24
std::optional< rerun::components::Color > color
Color used for the grid.
Definition line_grid3d.hpp:50
std::optional< rerun::blueprint::components::GridSpacing > spacing
Space between grid lines spacing of one line to the next in scene units.
Definition line_grid3d.hpp:34
LineGrid3D with_visible(rerun::blueprint::components::Visible _visible) &&
Whether the grid is visible.
Definition line_grid3d.hpp:66
std::optional< rerun::components::Plane3D > plane
In what plane the grid is drawn.
Definition line_grid3d.hpp:39
std::optional< rerun::blueprint::components::Visible > visible
Whether the grid is visible.
Definition line_grid3d.hpp:28
LineGrid3D with_spacing(rerun::blueprint::components::GridSpacing _spacing) &&
Space between grid lines spacing of one line to the next in scene units.
Definition line_grid3d.hpp:76
LineGrid3D with_plane(rerun::components::Plane3D _plane) &&
In what plane the grid is drawn.
Definition line_grid3d.hpp:85
std::optional< rerun::components::StrokeWidth > stroke_width
How thick the lines should be in ui units.
Definition line_grid3d.hpp:44
LineGrid3D with_stroke_width(rerun::components::StrokeWidth _stroke_width) &&
How thick the lines should be in ui units.
Definition line_grid3d.hpp:94
LineGrid3D with_color(rerun::components::Color _color) &&
Color used for the grid.
Definition line_grid3d.hpp:104
Component: Space between grid lines of one line to the next in scene units.
Definition grid_spacing.hpp:15
Component: Whether the container, view, entity or instance is currently visible.
Definition visible.hpp:15
Component: An RGBA color with unmultiplied/separate alpha, in sRGB gamma space with linear alpha.
Definition color.hpp:18
Indicator component used by archetypes when converting them to component lists.
Definition indicator_component.hpp:32
Component: An infinite 3D plane represented by a unit normal vector and a distance.
Definition plane3d.hpp:23
Component: The width of a stroke specified in UI points.
Definition stroke_width.hpp:15