PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: SceneCreator.h * 00003 * 00004 * Copyright (C) 2002-2012 The PixelLight Team (http://www.pixellight.org/) 00005 * 00006 * This file is part of PixelLight. 00007 * 00008 * PixelLight is free software: you can redistribute it and/or modify 00009 * it under the terms of the GNU Lesser General Public License as published by 00010 * the Free Software Foundation, either version 3 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * PixelLight is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public License 00019 * along with PixelLight. If not, see <http://www.gnu.org/licenses/>. 00020 \*********************************************************/ 00021 00022 00023 #ifndef __PLENGINE_SCENECREATOR_H__ 00024 #define __PLENGINE_SCENECREATOR_H__ 00025 #pragma once 00026 00027 00028 //[-------------------------------------------------------] 00029 //[ Includes ] 00030 //[-------------------------------------------------------] 00031 #include <PLCore/Base/Object.h> 00032 #include "PLEngine/PLEngine.h" 00033 00034 00035 //[-------------------------------------------------------] 00036 //[ Forward declarations ] 00037 //[-------------------------------------------------------] 00038 namespace PLScene { 00039 class SNCamera; 00040 class SceneNode; 00041 class SceneContainer; 00042 } 00043 00044 00045 //[-------------------------------------------------------] 00046 //[ Namespace ] 00047 //[-------------------------------------------------------] 00048 namespace PLEngine { 00049 00050 00051 //[-------------------------------------------------------] 00052 //[ Classes ] 00053 //[-------------------------------------------------------] 00054 /** 00055 * @brief 00056 * Abstract scene creator base class 00057 */ 00058 class SceneCreator : public PLCore::Object { 00059 00060 00061 //[-------------------------------------------------------] 00062 //[ RTTI interface ] 00063 //[-------------------------------------------------------] 00064 pl_class(PL_RTTI_EXPORT, SceneCreator, "PLEngine", PLCore::Object, "Abstract scene creator base class") 00065 pl_class_end 00066 00067 00068 //[-------------------------------------------------------] 00069 //[ Public static functions ] 00070 //[-------------------------------------------------------] 00071 public: 00072 /** 00073 * @brief 00074 * Configures a generic scene 00075 * 00076 * @param[in] cSceneContainer 00077 * The scene container to add the new scene nodes to (not cleared before filled) 00078 * @param[in] pPrimarySceneNode 00079 * Primary scene node, for example representing the loaded mesh or a box with the loaded material etc., can be a null pointer 00080 * 00081 * @return 00082 * The preferred camera scene node, can be a null pointer 00083 * 00084 * @note 00085 * - Adds a directional light source scene node named "Light" 00086 * - Adds a free camera scene node named "Camera" 00087 * - If primary scene node given, adds an orbiter camera scene node named "OrbiterCamera" 00088 * - Makes the orbiting camera to the preferred camera scene node, if there's no orbiting camera then the free camera will be used instead 00089 */ 00090 static PL_API PLScene::SNCamera *ConfigureGenericScene(PLScene::SceneContainer &cSceneContainer, PLScene::SceneNode *pPrimarySceneNode); 00091 00092 /** 00093 * @brief 00094 * Configures a scene 00095 * 00096 * @param[in] cSceneContainer 00097 * The scene container to add the new scene nodes to (not cleared before filled) 00098 * @param[in] sClass 00099 * Name of the scene creator class to use for configuring the scene 00100 * @param[in] sParameters 00101 * Optional parameter string 00102 * 00103 * @return 00104 * The preferred camera scene node, can be a null pointer 00105 */ 00106 static PL_API PLScene::SNCamera *ConfigureScene(PLScene::SceneContainer &cSceneContainer, const PLCore::String &sClass, const PLCore::String &sParameters = ""); 00107 00108 00109 //[-------------------------------------------------------] 00110 //[ Protected functions ] 00111 //[-------------------------------------------------------] 00112 protected: 00113 /** 00114 * @brief 00115 * Default constructor 00116 */ 00117 PL_API SceneCreator(); 00118 00119 /** 00120 * @brief 00121 * Destructor 00122 */ 00123 PL_API virtual ~SceneCreator(); 00124 00125 00126 //[-------------------------------------------------------] 00127 //[ Public virtual SceneCreator functions ] 00128 //[-------------------------------------------------------] 00129 public: 00130 /** 00131 * @brief 00132 * Creates the content of a scene container 00133 * 00134 * @param[in] cSceneContainer 00135 * Scene container to manipulate (not cleared before filled) 00136 * 00137 * @return 00138 * The preferred camera scene node, can be a null pointer 00139 */ 00140 PL_API virtual PLScene::SNCamera *Create(PLScene::SceneContainer &cSceneContainer) const = 0; 00141 00142 00143 }; 00144 00145 00146 //[-------------------------------------------------------] 00147 //[ Namespace ] 00148 //[-------------------------------------------------------] 00149 } // PLEngine 00150 00151 00152 #endif // __PLENGINE_SCENECREATOR_H__
|