Cumulia Illustrator Rendering Engine v2.1.0
A Rendering engine for industrial CAD/CAE model and optimized for greatest performance
 
Loading...
Searching...
No Matches
renderer.h
1//##################################################################################################
2//
3// Copyright (c) 2024 Beijing Qiongqi Tech Co.,Ltd. All rights reserved.
4
5// This source code is confidential and proprietary to Beijing Qiongqi Tech Co.,Ltd(The Holder).
6// Any unauthorized use, copying, modification, or distribution of the code is strictly prohibited.
7// Any user shall obtain authorizaition from the Holder before modifying the source code. And the user shall not
8// sublicense, sell, distribute, or transfer the source code, whether in original or modified form, to any third party
9// without the prior written consent of the Holder.
10
11// This copyright notice and permission grant shall be included in all copies or substantial portions of the source code.
12
13// Author Cumulia Illustrator
14// Date 2025-08-05
15// Version V2.1.0
16//##################################################################################################
17
18#pragma once
19
20#include <memory>
21
22#include "assetmanager.h"
23#include "scenemanager.h"
24#include "rendercontext.h"
25
26#include "../variant/types.h"
27#include "../primitive/types.h"
28#include "../scene/types.h"
29
30namespace cil
31{
34 {
35 friend class Stats;
36
37 protected:
38 std::shared_ptr<RenderContext> renderContext;
39
40 private:
41 std::shared_ptr<AssetManager> assetManager;
42 std::shared_ptr<SceneManager> sceneManager;
43
44 public:
46 virtual ~Renderer();
47
49
52 virtual void render(const ScenePtr& scene);
53
58
60 void add(const ScenePtr& scene);
61 void add(const PassPtr& pass);
62 void add(const NodePtr& node);
63 void add(const MeshPtr& mesh);
64 void add(const TargetPtr& target);
65 void add(const PrimitivePtr& primitive);
66 void add(const MaterialPtr& material);
67 void add(const GeometryPtr& geometry);
68 void add(const ProgramPtr& program);
69 void add(const TexturePtr& texture);
70 void add(const VerticesPtr& vertices);
71 void add(const ElementIndicesPtr& indices);
72 void add(const SourcePtr& source);
73 void add(const ImagePtr& image);
74 void add(const SamplerPtr& sampler);
75 void add(const ArrayBufferPtr& buffer);
76
78 void remove(const ScenePtr& scene);
79 void remove(const PassPtr& pass);
80 void remove(const NodePtr& node);
81 void remove(const MeshPtr& mesh);
82 void remove(const TargetPtr& target);
83 void remove(const PrimitivePtr& primitive);
84 void remove(const MaterialPtr& material);
85 void remove(const GeometryPtr& geometry);
86 void remove(const ProgramPtr& program);
87 void remove(const TexturePtr& texture);
88 void remove(const VerticesPtr& vertices);
89 void remove(const ElementIndicesPtr& indices);
90 void remove(const SourcePtr& source);
91 void remove(const ImagePtr& image);
92 void remove(const SamplerPtr& sampler);
93 void remove(const ArrayBufferPtr& buffer);
94
96 void update(const ScenePtr& scene);
97 void update(const PassPtr& pass);
98 void update(const NodePtr& node);
99 void update(const MeshPtr& mesh);
100 void update(const TargetPtr& target);
101 void update(const PrimitivePtr& primitive);
102 void update(const MaterialPtr& material);
103 void update(const GeometryPtr& geometry);
104 void update(const ProgramPtr& program);
105 void update(const TexturePtr& texture);
106 void update(const VerticesPtr& vertices);
107 void update(const ElementIndicesPtr& indices);
108 void update(const SourcePtr& source);
109 void update(const ImagePtr& image);
110 void update(const SamplerPtr& sampler);
111 void update(const ArrayBufferPtr& buffer);
112
114 void clear();
115
117 void free(bool unused = false);
118 };
119}
The Renderer class provides a comprehensive set of interfaces for managing and rendering scene.
Definition renderer.h:34
Image2DPtr read(const ImageBufferPtr &buffer)
Reads data from the given image buffer.
void update(const MeshPtr &mesh)
void remove(const PassPtr &pass)
void update(const PassPtr &pass)
void clear()
Clears.
friend class Stats
Definition renderer.h:35
void add(const VerticesPtr &vertices)
void add(const GeometryPtr &geometry)
void makeCurrent()
virtual void render(const ScenePtr &scene)
Renders the given scene.
void add(const MeshPtr &mesh)
void add(const ProgramPtr &program)
void add(const ArrayBufferPtr &buffer)
void remove(const MaterialPtr &material)
void add(const ScenePtr &scene)
Adds the given object.
void update(const TexturePtr &texture)
void remove(const PrimitivePtr &primitive)
virtual ~Renderer()
void update(const ImagePtr &image)
void update(const PrimitivePtr &primitive)
void update(const SamplerPtr &sampler)
void remove(const VerticesPtr &vertices)
void add(const TexturePtr &texture)
void update(const ProgramPtr &program)
void add(const SamplerPtr &sampler)
void remove(const GeometryPtr &geometry)
void add(const ElementIndicesPtr &indices)
void remove(const SourcePtr &source)
void add(const TargetPtr &target)
void add(const ImagePtr &image)
void add(const NodePtr &node)
void remove(const ImagePtr &image)
void free(bool unused=false)
Frees resources used by the renderer, ensuring that the renderer is properly terminated.
void update(const TargetPtr &target)
void update(const NodePtr &node)
void update(const GeometryPtr &geometry)
void remove(const MeshPtr &mesh)
void update(const ElementIndicesPtr &indices)
std::shared_ptr< RenderContext > renderContext
Definition renderer.h:38
void remove(const TargetPtr &target)
void remove(const ScenePtr &scene)
Removes the given object.
void add(const PassPtr &pass)
void remove(const NodePtr &node)
void add(const MaterialPtr &material)
void add(const PrimitivePtr &primitive)
void update(const ArrayBufferPtr &buffer)
void update(const VerticesPtr &vertices)
void update(const MaterialPtr &material)
void update(const SourcePtr &source)
void add(const SourcePtr &source)
void update(const ScenePtr &scene)
Updates the given object.
void remove(const TexturePtr &texture)
void remove(const ProgramPtr &program)
void remove(const SamplerPtr &sampler)
void remove(const ArrayBufferPtr &buffer)
void remove(const ElementIndicesPtr &indices)
Definition decal.h:23
std::shared_ptr< Mesh > MeshPtr
Definition types.h:32
std::shared_ptr< Geometry > GeometryPtr
Definition types.h:32
std::shared_ptr< Texture > TexturePtr
Definition types.h:86
std::shared_ptr< ElementIndices > ElementIndicesPtr
Definition types.h:40
std::shared_ptr< Scene > ScenePtr
Definition types.h:44
std::shared_ptr< Primitive > PrimitivePtr
Definition types.h:48
std::shared_ptr< Image > ImagePtr
Definition types.h:53
std::shared_ptr< Node > NodePtr
Definition types.h:36
std::shared_ptr< Pass > PassPtr
Definition types.h:40
std::shared_ptr< Material > MaterialPtr
Definition types.h:44
std::shared_ptr< ImageBuffer > ImageBufferPtr
Definition types.h:56
std::shared_ptr< Image2D > Image2DPtr
Definition types.h:54
std::shared_ptr< ArrayBuffer > ArrayBufferPtr
Definition types.h:102
std::shared_ptr< Source > SourcePtr
Definition types.h:95
std::shared_ptr< Vertices > VerticesPtr
Definition types.h:94
std::shared_ptr< Target > TargetPtr
Definition types.h:90
std::shared_ptr< Sampler > SamplerPtr
Definition types.h:60
std::shared_ptr< Program > ProgramPtr
Definition types.h:52