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 SetGeometryCulling(
const std::string& object_name,
116 virtual void SetGeometryPriority(
const std::string& object_name,
117 uint8_t priority) = 0;
118 virtual void QueryGeometry(std::vector<std::string>& geometry) = 0;
119 virtual void SetGeometryTransform(
const std::string& object_name,
121 virtual Transform GetGeometryTransform(
const std::string& object_name) = 0;
123 const std::string& object_name) = 0;
124 virtual void OverrideMaterialAll(
const Material& material,
125 bool shader_only =
true) = 0;
128 virtual bool AddPointLight(
const std::string& light_name,
129 const Eigen::Vector3f&
color,
133 bool cast_shadows) = 0;
134 virtual bool AddSpotLight(
const std::string& light_name,
135 const Eigen::Vector3f& color,
136 const Eigen::Vector3f& position,
137 const Eigen::Vector3f& direction,
140 float inner_cone_angle,
141 float outer_cone_angle,
142 bool cast_shadows) = 0;
143 virtual bool AddDirectionalLight(
const std::string& light_name,
144 const Eigen::Vector3f& color,
145 const Eigen::Vector3f& direction,
147 bool cast_shadows) = 0;
148 virtual Light& GetLight(
const std::string& light_name) = 0;
149 virtual void RemoveLight(
const std::string& light_name) = 0;
150 virtual void UpdateLight(
const std::string& light_name,
151 const Light& light) = 0;
152 virtual void UpdateLightColor(
const std::string& light_name,
153 const Eigen::Vector3f& color) = 0;
154 virtual void UpdateLightPosition(
const std::string& light_name,
155 const Eigen::Vector3f& position) = 0;
156 virtual void UpdateLightDirection(
const std::string& light_name,
157 const Eigen::Vector3f& direction) = 0;
158 virtual void UpdateLightIntensity(
const std::string& light_name,
159 float intensity) = 0;
160 virtual void UpdateLightFalloff(
const std::string& light_name,
162 virtual void UpdateLightConeAngles(
const std::string& light_name,
163 float inner_cone_angle,
164 float outer_cone_angle) = 0;
165 virtual void EnableLightShadow(
const std::string& light_name,
166 bool cast_shadows) = 0;
168 virtual void SetSunLight(
const Eigen::Vector3f& direction,
169 const Eigen::Vector3f& color,
170 float intensity) = 0;
171 virtual void EnableSunLight(
bool enable) = 0;
172 virtual void EnableSunLightShadows(
bool enable) = 0;
173 virtual float GetSunLightIntensity() = 0;
174 virtual void SetSunLightDirection(
const Eigen::Vector3f& direction) = 0;
175 virtual Eigen::Vector3f GetSunLightDirection() = 0;
176 virtual void SetSunAngularRadius(
float radius) = 0;
177 virtual void SetSunHaloSize(
float size) = 0;
178 virtual void SetSunHaloFalloff(
float falloff) = 0;
180 virtual bool SetIndirectLight(
const std::string& ibl_name) = 0;
181 virtual const std::string& GetIndirectLight() = 0;
182 virtual void EnableIndirectLight(
bool enable) = 0;
183 virtual void SetIndirectLightIntensity(
float intensity) = 0;
184 virtual float GetIndirectLightIntensity() = 0;
185 virtual void SetIndirectLightRotation(
const Transform& rotation) = 0;
186 virtual Transform GetIndirectLightRotation() = 0;
187 virtual void ShowSkybox(
bool show) = 0;
188 virtual void SetBackground(
189 const Eigen::Vector4f& color,
190 const std::shared_ptr<geometry::Image> image =
nullptr) = 0;
193 virtual void RenderToImage(
194 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:557
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:398
int size
Definition: FilePCD.cpp:59
Renderer & renderer_
Definition: Scene.h:197
math::float4 color
Definition: LineSetBuffers.cpp:64
Definition: Renderer.h:64
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:94
Definition: Material.h:41
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