Class WebScene#
Defined in File WebScene.h
Inheritance Relationships#
Base Type#
public Karana::Scene::GraphicalScene(Class GraphicalScene)
Class Documentation#
-
class WebScene : public Karana::Scene::GraphicalScene#
GraphicalScene implementation for web-based graphics.
See Scene layer for more discussion on the scene layer.
Public Functions
-
WebScene(std::string_view name, const Karana::Core::ks_ptr<Karana::WebUI::Server> &server)#
WebScene constructor.
- Parameters:
name – - Name for the WebScene
server – - Server to communicate with frontends
-
~WebScene()#
-
virtual void renderToFile(const std::filesystem::path &filepath) override#
Render the scene to a file.
- Parameters:
filepath – - filename to render to
-
virtual Karana::Core::id_t addOverlayText(std::string_view message, float x, float y, const TextParameters ¶meters = TextParameters{}) override#
Add text in screen space.
- Parameters:
message – - The content of the overlay text
x – - The horizontal position of the text between 0 and 1
y – - The vertical position of the text between 0 and 1
parameters – - Addition text parameters
- Returns:
Unique id to later update the text instance
-
virtual void setOverlayText(const Karana::Core::id_t &id, std::string_view message) override#
Update the content of an existing overlay text.
- Parameters:
id – - Id for the text returned by a prior addOverlayText call
message – - The new content of the overlay text
-
virtual void removeOverlayText(const Karana::Core::id_t &id) override#
Delete an overlay text instance.
- Parameters:
id – - Id for the text returned by a prior addOverlayText call
-
virtual Karana::Core::ks_ptr<GraphicalSceneCamera> defaultCamera() const override#
Get the default camera.
- Returns:
The camera
-
void _forceRender() const#
Force a render on the frontend.
-
void _setShadows(const Karana::Math::Vec3 &direction)#
Configure shadows.
Note: this is an experimental API subject to removal
- Parameters:
direction – - The non-normalized direction to cast shadows or the zero vector to disable shadows.
-
void _setBackgroundColor(const Color &color)#
Set the color of the background.
Note: this is an experimental API subject to removal
- Parameters:
color – - The new background color.
-
Karana::Core::id_t _addLineBetween(const Karana::Core::ks_ptr<WebSceneNode> &node1, const Karana::Core::ks_ptr<WebSceneNode> &node2, const Color &color1, const Color &color2, bool dashed = false)#
Create a line segment connecting a pair of nodes.
Note: this is an experimental API subject to removal
- Parameters:
node1 – - The first node.
node2 – - The second node.
color1 – - The line’s color at the first node.
color2 – - The line’s color at the second node.
dashed – - Whether the line should be dashed.
- Returns:
A unique id for the created line
Public Static Functions
-
WebScene(std::string_view name, const Karana::Core::ks_ptr<Karana::WebUI::Server> &server)#