Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
SdlSceneFileReader.h
Go to the documentation of this file.
1#pragma once
2
6
7#include <string>
8
9namespace ph
10{
11
12class SceneDescription;
13
18{
19public:
21
24 SdlSceneFileReader(const Path& sceneFile, const Path& sceneWorkingDirectory);
25
29 TSpanView<const SdlClass*> targetClasses,
30 const Path& sceneFile,
31 const Path& sceneWorkingDirectory);
32
34
39 void read(SceneDescription* scene = nullptr);
40
41 void setSceneFile(Path sceneFile);
42
48 void setScene(SceneDescription* scene);
49
50protected:
51 bool beginCommand(
52 ESdlCommandType commandType,
53 const SdlClass* targetClass,
54 SdlInputContext* out_ctx) override;
55
56 void endCommand() override;
57
59 std::string_view resourceName,
60 const SdlInputContext& ctx,
61 ESdlCommandType commandType) override;
62
63 void initResource(
64 std::string_view resourceName,
65 ISdlResource* resource,
66 const SdlInputContext& ctx,
67 SdlInputClauses& clauses,
68 ESdlCommandType commandType) override;
69
71 std::string_view resourceName,
72 const SdlInputContext& ctx) override;
73
74 void runExecutor(
75 std::string_view executorName,
76 const SdlInputContext& ctx,
77 ISdlResource* targetResource,
78 SdlInputClauses& clauses,
79 ESdlCommandType commandType) override;
80
82 const SemanticVersion& version,
83 const SdlInputContext& ctx) override;
84
86 std::string_view packetName,
87 const SdlInputClauses& packet,
88 const SdlInputContext& ctx) override;
89
90private:
91 Path m_sceneFile;
92 SdlDataPacketCollection m_namedDataPackets;
93 SceneDescription* m_scene;
94};
95
96}// end namespace ph
Interface for all SDL resource.
Definition ISdlResource.h:22
General path representation. Does not check whether the target actually exists (e....
Definition Path.h:21
Data that describe a scene. Represents the result of running SDL commands.
Definition SceneDescription.h:14
Definition SdlClass.h:25
Definition SdlCommandParser.h:32
Definition SdlDataPacketCollection.h:14
Container for input clauses.
Definition SdlInputClauses.h:18
Data that SDL input process can rely on.
Definition SdlInputContext.h:19
Loading utility for renderer scene. Loads .p2 (Photon-v2) file.
Definition SdlSceneFileReader.h:18
bool beginCommand(ESdlCommandType commandType, const SdlClass *targetClass, SdlInputContext *out_ctx) override
Called when the parser starts processing a command.
Definition SdlSceneFileReader.cpp:47
void commandVersionSet(const SemanticVersion &version, const SdlInputContext &ctx) override
Definition SdlSceneFileReader.cpp:161
void storeNamedDataPacket(std::string_view packetName, const SdlInputClauses &packet, const SdlInputContext &ctx) override
Definition SdlSceneFileReader.cpp:166
ISdlResource * createResource(std::string_view resourceName, const SdlInputContext &ctx, ESdlCommandType commandType) override
Definition SdlSceneFileReader.cpp:61
ISdlResource * getResource(std::string_view resourceName, const SdlInputContext &ctx) override
Definition SdlSceneFileReader.cpp:126
void setScene(SceneDescription *scene)
Definition SdlSceneFileReader.cpp:237
void initResource(std::string_view resourceName, ISdlResource *resource, const SdlInputContext &ctx, SdlInputClauses &clauses, ESdlCommandType commandType) override
Definition SdlSceneFileReader.cpp:105
void endCommand() override
Called when the parser finishes processing a command.
Definition SdlSceneFileReader.cpp:58
void setSceneFile(Path sceneFile)
Definition SdlSceneFileReader.cpp:232
void read(SceneDescription *scene=nullptr)
Definition SdlSceneFileReader.cpp:174
SdlSceneFileReader()
Definition SdlSceneFileReader.cpp:22
~SdlSceneFileReader() override
void runExecutor(std::string_view executorName, const SdlInputContext &ctx, ISdlResource *targetResource, SdlInputClauses &clauses, ESdlCommandType commandType) override
Called when an executor command has been processed and is ready to run.
Definition SdlSceneFileReader.cpp:140
Convenient software version handling routines. See https://semver.org/ for a detailed explaination of...
Definition SemanticVersion.h:16
The root for all renderer implementations.
Definition EEngineProject.h:6
std::span< const T, EXTENT > TSpanView
Same as TSpan, except that the objects are const-qualified. Note that for pointer types,...
Definition TSpan.h:19
ESdlCommandType
Definition SdlCommandParser.h:20