Photon Editor Library 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
DesignerSceneWriter.h
Go to the documentation of this file.
1#pragma once
2
3#include <SDL/SdlCommandGenerator.h>
4#include <SDL/SdlDependencyResolver.h>
5
6namespace ph { class FormattedTextOutputStream; }
7namespace ph { class Path; }
8
9namespace ph::editor
10{
11
12class DesignerScene;
13
17class DesignerSceneWriter : public SdlCommandGenerator
18{
19public:
21 explicit DesignerSceneWriter(const Path& sceneWorkingDirectory);
23
26 void write(const DesignerScene& scene);
27
28protected:
29 bool beginCommand(
30 const SdlClass* targetClass,
31 SdlOutputContext* out_ctx) override;
32
33 void endCommand() override;
34
35 void saveResource(
36 const ISdlResource* resource,
37 const SdlOutputContext& ctx,
38 SdlOutputClauses& clauses) override;
39
41 std::string_view commandStr,
42 const SdlOutputContext& ctx) override;
43
44private:
45 void saveSceneToFile(const DesignerScene& scene, const Path& filePath);
46
47 SdlDependencyResolver m_resolver;
48 FormattedTextOutputStream* m_fileStream;
49};
50
51}// end namespace ph::editor
Definition DesignerScene.h:58
Saving utility for designer scene. Writes .pds (Photon Designer Scene) file.
Definition DesignerSceneWriter.h:18
void saveResource(const ISdlResource *resource, const SdlOutputContext &ctx, SdlOutputClauses &clauses) override
Definition DesignerSceneWriter.cpp:55
void commandGenerated(std::string_view commandStr, const SdlOutputContext &ctx) override
Definition DesignerSceneWriter.cpp:73
void write(const DesignerScene &scene)
Writes the scene to the writer-specified destination.
Definition DesignerSceneWriter.cpp:85
bool beginCommand(const SdlClass *targetClass, SdlOutputContext *out_ctx) override
Definition DesignerSceneWriter.cpp:43
void endCommand() override
Definition DesignerSceneWriter.cpp:52
DesignerSceneWriter()
Definition DesignerSceneWriter.cpp:27
Definition ph_editor.h:10
Definition ph_editor.h:5