00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __PLENGINE_TOOLS_SCENERENDERERTOOL_H__
00024 #define __PLENGINE_TOOLS_SCENERENDERERTOOL_H__
00025 #pragma once
00026
00027
00028
00029
00030
00031 #include <PLCore/Base/Object.h>
00032 #include "PLEngine/PLEngine.h"
00033
00034
00035
00036
00037
00038 namespace PLRenderer {
00039 class SurfacePainter;
00040 }
00041 namespace PLScene {
00042 class SceneRenderer;
00043 class SceneContainer;
00044 class SceneRendererPass;
00045 }
00046
00047
00048
00049
00050
00051 namespace PLEngine {
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066 class SceneRendererTool : public PLCore::Object {
00067
00068
00069
00070
00071
00072 pl_class(PL_RTTI_EXPORT, SceneRendererTool, "PLEngine", PLCore::Object, "Class offering scene renderer tool functionality")
00073 #ifdef PLENGINE_EXPORTS // The following is only required when compiling PLEngine
00074
00075 pl_method_3(SetSceneRenderer, pl_ret_type(bool), PLScene::SceneContainer*, const PLCore::String&, const PLCore::String&, "Sets the used scene renderer, scene container to render as first parameter, filename of the scene renderer to use as second parameter, optional filename of a fallback scene renderer to use in case the desired scene renderer can't be used as third parameter. Returns 'true' if all went fine, else 'false'.", "")
00076 pl_method_0(GetNumOfPasses, pl_ret_type(PLCore::uint32), "Returns the number of scene renderer passes", "")
00077 pl_method_1(GetPassByIndex, pl_ret_type(PLScene::SceneRendererPass*), PLCore::uint32, "Gets a scene renderer pass by index. Index of the scene renderer pass to return as first parameter. The requested scene renderer pass as result, a null pointer on error.", "")
00078 pl_method_1(GetPassByName, pl_ret_type(PLScene::SceneRendererPass*), const PLCore::String&, "Gets a scene renderer pass by name. Name of the scene renderer pass to return as first parameter. The requested scene renderer pass as result, a null pointer on error.", "")
00079 pl_method_3(SetPassAttribute, pl_ret_type(bool), const PLCore::String&, const PLCore::String&, const PLCore::String&, "Sets a scene renderer pass attribute value using a string, name of the scene renderer pass as first parameter, name of the scene renderer pass attribute as second parameter and value to set as third parameter", "")
00080 pl_method_2(SetAttribute, pl_ret_type(PLCore::uint32), const PLCore::String&, const PLCore::String&, "Sets scene renderer pass attribute values using a string. Name of the scene renderer pass attribute (e.g. \"AmbientColor\") as first parameter, value to set (e.g. \"0.2 0.2 0.2\") as second parameter. Unlike \"SetPassAttribute()\", \"SetAttribute()\" sets the <AttributeName>-attribute from all scene renderer passes to the given value.", "")
00081 pl_method_1(SetValues, pl_ret_type(void), const PLCore::String&, "Values to set (e.g.: \"ColorClear=\"0 0 0 0\" AmbientColor=\"0.2 0.2 0.2\"\") as first parameter. Unlike \"SetPassAttribute()\" and \"SetAttribute()\", \"SetValues()\" sets multiple attributes from all scene renderer passes to the given value at once.", "")
00082 pl_method_0(SetDefaultValues, pl_ret_type(void), "Sets all scene renderer pass attribute values to their default value", "")
00083 #endif
00084 pl_class_end
00085
00086
00087
00088
00089
00090 public:
00091
00092
00093
00094
00095
00096
00097
00098 PL_API SceneRendererTool(PLRenderer::SurfacePainter *pPainter = nullptr);
00099
00100
00101
00102
00103
00104 PL_API virtual ~SceneRendererTool();
00105
00106
00107
00108
00109
00110
00111
00112
00113 PL_API PLRenderer::SurfacePainter *GetPainter() const;
00114
00115
00116
00117
00118
00119
00120
00121
00122 PL_API void SetPainter(PLRenderer::SurfacePainter *pSurfacePainter);
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134 PL_API PLScene::SceneRenderer *GetSceneRenderer() const;
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150 PL_API bool SetSceneRenderer(PLScene::SceneContainer *pSceneContainer, const PLCore::String &sFilename, const PLCore::String &sFallbackFilename = "");
00151
00152
00153
00154
00155
00156
00157
00158
00159 PL_API PLCore::uint32 GetNumOfPasses() const;
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171 PL_API PLScene::SceneRendererPass *GetPassByIndex(PLCore::uint32 nIndex) const;
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183 PL_API PLScene::SceneRendererPass *GetPassByName(const PLCore::String &sName) const;
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197 PL_API PLCore::DynVar *GetPassAttribute(const PLCore::String &sSceneRendererPassName, const PLCore::String &sAttributeName) const;
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213 PL_API bool SetPassAttribute(const PLCore::String &sSceneRendererPassName, const PLCore::String &sAttributeName, const PLCore::String &sValue) const;
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231 PL_API PLCore::uint32 SetAttribute(const PLCore::String &sAttributeName, const PLCore::String &sValue) const;
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244 PL_API void SetValues(const PLCore::String &sValues) const;
00245
00246
00247
00248
00249
00250 PL_API void SetDefaultValues() const;
00251
00252
00253
00254
00255
00256 private:
00257 PLRenderer::SurfacePainter *m_pSurfacePainter;
00258
00259
00260 };
00261
00262
00263
00264
00265
00266 }
00267
00268
00269 #endif // __PLENGINE_TOOLS_SCENERENDERERTOOL_H__