29 #include <Eigen/Geometry> 39 class AxisAlignedBoundingBox;
49 namespace visualization {
54 struct TriangleMeshModel;
62 static const uint32_t kUpdatePointsFlag = (1 << 0);
63 static const uint32_t kUpdateNormalsFlag = (1 << 1);
64 static const uint32_t kUpdateColorsFlag = (1 << 2);
65 static const uint32_t kUpdateUv0Flag = (1 << 3);
67 using Transform = Eigen::Transform<float, 3, Eigen::Affine>;
70 virtual ~
Scene() =
default;
79 virtual void SetViewActive(
const ViewHandle& view_id,
bool is_active) = 0;
80 virtual void SetRenderOnce(
const ViewHandle& view_id) = 0;
81 virtual void RemoveView(
const ViewHandle& view_id) = 0;
84 virtual void AddCamera(
const std::string& camera_name,
85 std::shared_ptr<Camera> cam) = 0;
86 virtual void RemoveCamera(
const std::string& camera_name) = 0;
90 virtual bool AddGeometry(
const std::string& object_name,
93 const std::string& downsampled_name =
"",
94 size_t downsample_threshold = SIZE_MAX) = 0;
95 virtual bool AddGeometry(
const std::string& object_name,
98 const std::string& downsampled_name =
"",
99 size_t downsample_threshold = SIZE_MAX) = 0;
100 virtual bool AddGeometry(
const std::string& object_name,
102 virtual bool HasGeometry(
const std::string& object_name)
const = 0;
103 virtual void UpdateGeometry(
const std::string& object_name,
106 virtual void RemoveGeometry(
const std::string& object_name) = 0;
107 virtual void ShowGeometry(
const std::string& object_name,
bool show) = 0;
108 virtual bool GeometryIsVisible(
const std::string& object_name) = 0;
109 virtual void OverrideMaterial(
const std::string& object_name,
111 virtual void GeometryShadows(
const std::string& object_name,
113 bool receive_shadows) = 0;
114 virtual void QueryGeometry(std::vector<std::string>& geometry) = 0;
115 virtual void SetGeometryTransform(
const std::string& object_name,
117 virtual Transform GetGeometryTransform(
const std::string& object_name) = 0;
119 const std::string& object_name) = 0;
120 virtual void OverrideMaterialAll(
const Material& material,
121 bool shader_only =
true) = 0;
124 virtual bool AddPointLight(
const std::string& light_name,
125 const Eigen::Vector3f&
color,
129 bool cast_shadows) = 0;
130 virtual bool AddSpotLight(
const std::string& light_name,
131 const Eigen::Vector3f& color,
132 const Eigen::Vector3f& position,
133 const Eigen::Vector3f& direction,
136 float inner_cone_angle,
137 float outer_cone_angle,
138 bool cast_shadows) = 0;
139 virtual Light& GetLight(
const std::string& light_name) = 0;
140 virtual void RemoveLight(
const std::string& light_name) = 0;
141 virtual void UpdateLight(
const std::string& light_name,
142 const Light& light) = 0;
143 virtual void UpdateLightColor(
const std::string& light_name,
144 const Eigen::Vector3f& color) = 0;
145 virtual void UpdateLightPosition(
const std::string& light_name,
146 const Eigen::Vector3f& position) = 0;
147 virtual void UpdateLightDirection(
const std::string& light_name,
148 const Eigen::Vector3f& direction) = 0;
149 virtual void UpdateLightIntensity(
const std::string& light_name,
150 float intensity) = 0;
151 virtual void UpdateLightFalloff(
const std::string& light_name,
153 virtual void UpdateLightConeAngles(
const std::string& light_name,
154 float inner_cone_angle,
155 float outer_cone_angle) = 0;
156 virtual void EnableLightShadow(
const std::string& light_name,
157 bool cast_shadows) = 0;
159 virtual void SetDirectionalLight(
const Eigen::Vector3f& direction,
160 const Eigen::Vector3f& color,
161 float intensity) = 0;
162 virtual void EnableDirectionalLight(
bool enable) = 0;
163 virtual void EnableDirectionalLightShadows(
bool enable) = 0;
164 virtual void SetDirectionalLightDirection(
165 const Eigen::Vector3f& direction) = 0;
166 virtual Eigen::Vector3f GetDirectionalLightDirection() = 0;
168 virtual bool SetIndirectLight(
const std::string& ibl_name) = 0;
169 virtual const std::string& GetIndirectLight() = 0;
170 virtual void EnableIndirectLight(
bool enable) = 0;
171 virtual void SetIndirectLightIntensity(
float intensity) = 0;
172 virtual float GetIndirectLightIntensity() = 0;
173 virtual void SetIndirectLightRotation(
const Transform& rotation) = 0;
174 virtual Transform GetIndirectLightRotation() = 0;
175 virtual void ShowSkybox(
bool show) = 0;
176 virtual void SetBackgroundColor(
const Eigen::Vector4f& color) = 0;
179 virtual void RenderToImage(
180 std::function<
void(std::shared_ptr<geometry::Image>)> callback) = 0;
const char const char value recording_handle imu_sample recording_handle uint8_t size_t data_size k4a_record_configuration_t config target_format k4a_capture_t capture_handle k4a_imu_sample_t imu_sample playback_handle k4a_logging_message_cb_t void min_level device_handle k4a_imu_sample_t timeout_in_ms capture_handle capture_handle capture_handle image_handle temperature_c k4a_image_t image_handle uint8_t image_handle image_handle image_handle image_handle uint32_t
Definition: K4aPlugin.cpp:554
Eigen::Transform< float, 3, Eigen::Affine > Transform
Definition: Scene.h:67
A bounding box that is aligned along the coordinate axes.
Definition: BoundingVolume.h:149
const char const char value recording_handle imu_sample recording_handle uint8_t size_t data_size k4a_record_configuration_t config target_format k4a_capture_t capture_handle k4a_imu_sample_t imu_sample playback_handle k4a_logging_message_cb_t void min_level device_handle k4a_imu_sample_t int32_t
Definition: K4aPlugin.cpp:395
Renderer & renderer_
Definition: Scene.h:183
math::float4 color
Definition: LineSetBuffers.cpp:63
Definition: Renderer.h:65
The base geometry class for 3D geometries.
Definition: Geometry3D.h:46
math::float3 position
Definition: LineSetBuffers.cpp:62
A pointcloud contains a set of 3D points.
Definition: PointCloud.h:93
Definition: Material.h:40
Definition: PinholeCameraIntrinsic.cpp:35
Scene(Renderer &renderer)
Definition: Scene.h:69
bool SetActiveCamera(const std::string &path, std::shared_ptr< ConnectionBase > connection)
Definition: RemoteFunctions.cpp:394