PixelLightAPI  .
SceneRendererLoaderPL.h
Go to the documentation of this file.
00001 /*********************************************************\
00002  *  File: SceneRendererLoaderPL.h                        *
00003  *
00004  *  Copyright (C) 2002-2011 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 __PLSCENE_COMPOSITING_SCENERENDERERLOADER_PL_H__
00024 #define __PLSCENE_COMPOSITING_SCENERENDERERLOADER_PL_H__
00025 #pragma once
00026 
00027 
00028 //[-------------------------------------------------------]
00029 //[ Includes                                              ]
00030 //[-------------------------------------------------------]
00031 #include "PLScene/Compositing/SceneRendererLoader.h"
00032 
00033 
00034 //[-------------------------------------------------------]
00035 //[ Namespace                                             ]
00036 //[-------------------------------------------------------]
00037 namespace PLScene {
00038 
00039 
00040 //[-------------------------------------------------------]
00041 //[ Classes                                               ]
00042 //[-------------------------------------------------------]
00043 /**
00044 *  @brief
00045 *    Scene renderer loader implementation for the PixelLight scene renderer XML file format
00046 *
00047 *  @note
00048 *    - If the save function receives a boolean 'NoDefault'-parameter with 'true', (default setting)
00049 *      variables with default values are not saved
00050 */
00051 class SceneRendererLoaderPL : public SceneRendererLoader {
00052 
00053 
00054     //[-------------------------------------------------------]
00055     //[ RTTI interface                                        ]
00056     //[-------------------------------------------------------]
00057     pl_class(PLS_RTTI_EXPORT, SceneRendererLoaderPL, "PLScene", PLScene::SceneRendererLoader, "Scene renderer loader implementation for the PixelLight scene renderer XML file format")
00058         // Properties
00059         pl_properties
00060             pl_property("Formats",  "sr,SR")
00061             pl_property("Load",     "1")
00062             pl_property("Save",     "1")
00063         pl_properties_end
00064         // Constructors
00065         pl_constructor_0(DefaultConstructor,    "Default constructor",  "")
00066         // Methods
00067         pl_method_2(Load,       pl_ret_type(bool),  SceneRenderer&, PLCore::File&,          "Load method",                                              "")
00068         pl_method_2(Save,       pl_ret_type(bool),  SceneRenderer&, PLCore::File&,          "Save method. Default values are not written.",             "")
00069         pl_method_3(SaveParams, pl_ret_type(bool),  SceneRenderer&, PLCore::File&,  bool,   "Save method. Parameters: No default values as 'bool'.",    "")
00070     pl_class_end
00071 
00072 
00073     //[-------------------------------------------------------]
00074     //[ Public RTTI methods                                   ]
00075     //[-------------------------------------------------------]
00076     public:
00077         PLS_API bool Load(SceneRenderer &cSceneRenderer, PLCore::File &cFile);
00078         PLS_API bool Save(SceneRenderer &cSceneRenderer, PLCore::File &cFile);
00079         PLS_API bool SaveParams(SceneRenderer &cSceneRenderer, PLCore::File &cFile, bool bNoDefault);
00080 
00081 
00082     //[-------------------------------------------------------]
00083     //[ Public functions                                      ]
00084     //[-------------------------------------------------------]
00085     public:
00086         /**
00087         *  @brief
00088         *    Default constructor
00089         */
00090         PLS_API SceneRendererLoaderPL();
00091 
00092         /**
00093         *  @brief
00094         *    Destructor
00095         */
00096         PLS_API virtual ~SceneRendererLoaderPL();
00097 
00098 
00099     //[-------------------------------------------------------]
00100     //[ Private functions                                     ]
00101     //[-------------------------------------------------------]
00102     private:
00103         /**
00104         *  @brief
00105         *    Loader implementation for format version 1
00106         *
00107         *  @param[in] cSceneRenderer
00108         *    Scene renderer to load into
00109         *  @param[in] cSceneRendererElement
00110         *    Scene renderer XML element to read the data from
00111         *
00112         *  @return
00113         *    'true' if all went fine, else 'false'
00114         */
00115         bool LoadV1(SceneRenderer &cSceneRenderer, const PLCore::XmlElement &cSceneRendererElement) const;
00116 
00117 
00118 };
00119 
00120 
00121 //[-------------------------------------------------------]
00122 //[ Namespace                                             ]
00123 //[-------------------------------------------------------]
00124 } // PLScene
00125 
00126 
00127 #endif // __PLSCENE_COMPOSITING_SCENERENDERERLOADER_PL_H__


PixelLight PixelLight 0.9.10-R1
Copyright (C) 2002-2011 by The PixelLight Team
Last modified Fri Dec 23 2011 15:51:01
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported