1 /*
2  * Copyright (c) 2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef API_3D_ECS_SYSTEMS_IRENDER_PREPROCESSOR_SYSTEM_H
17 #define API_3D_ECS_SYSTEMS_IRENDER_PREPROCESSOR_SYSTEM_H
18 
19 #include <3d/namespace.h>
20 #include <base/containers/string.h>
21 #include <base/containers/string_view.h>
22 #include <core/ecs/intf_system.h>
23 #include <core/namespace.h>
24 #include <render/datastore/intf_render_data_store_manager.h>
25 
26 RENDER_BEGIN_NAMESPACE()
27 class IRenderDataStoreManager;
28 RENDER_END_NAMESPACE()
29 
CORE3D_BEGIN_NAMESPACE()30 CORE3D_BEGIN_NAMESPACE()
31 /** @ingroup group_ecs_systems_irender */
32 /** IRender pre-processor system */
33 class IRenderPreprocessorSystem : public CORE_NS::ISystem {
34 public:
35     static constexpr BASE_NS::Uid UID { "f0dac6cf-3828-44c2-8eec-60b04f06b7b2" };
36     /** Rendering related data stores to feed data to renderer.
37      */
38     struct Properties {
39         /** Data store for scene */
40         BASE_NS::string dataStoreScene;
41         /** Data store for camera */
42         BASE_NS::string dataStoreCamera;
43         /** Data store for light */
44         BASE_NS::string dataStoreLight;
45         /** Data store for material */
46         BASE_NS::string dataStoreMaterial;
47         /** Data store for morphing (passed to rendering) */
48         BASE_NS::string dataStoreMorph;
49 
50         /** Data store prefix for other data stores in e.g. different plugins */
51         BASE_NS::string dataStorePrefix;
52     };
53 
54 protected:
55     IRenderPreprocessorSystem() = default;
56     ~IRenderPreprocessorSystem() override = default;
57     IRenderPreprocessorSystem(const IRenderPreprocessorSystem&) = delete;
58     IRenderPreprocessorSystem(IRenderPreprocessorSystem&&) = delete;
59     IRenderPreprocessorSystem& operator=(const IRenderPreprocessorSystem&) = delete;
60     IRenderPreprocessorSystem& operator=(IRenderPreprocessorSystem&&) = delete;
61 };
62 
63 /** @ingroup group_ecs_systems_irender */
64 /** Return name of this system
65  */
GetName(const IRenderPreprocessorSystem *)66 inline constexpr BASE_NS::string_view GetName(const IRenderPreprocessorSystem*)
67 {
68     return "RenderPreprocessorSystem";
69 }
70 CORE3D_END_NAMESPACE()
71 
72 #endif // API_3D_ECS_SYSTEMS_IRENDER_PREPROCESSOR_SYSTEM_H
73