PixelLightAPI  .
SHList.h
Go to the documentation of this file.
00001 /*********************************************************\
00002  *  File: SHList.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 __PLSCENE_SCENEHIERARCHY_LIST_H__
00024 #define __PLSCENE_SCENEHIERARCHY_LIST_H__
00025 #pragma once
00026 
00027 
00028 //[-------------------------------------------------------]
00029 //[ Includes                                              ]
00030 //[-------------------------------------------------------]
00031 #include "PLScene/Scene/SceneHierarchy.h"
00032 #include "PLScene/Scene/SceneHierarchyNode.h"
00033 
00034 
00035 //[-------------------------------------------------------]
00036 //[ Namespace                                             ]
00037 //[-------------------------------------------------------]
00038 namespace PLScene {
00039 
00040 
00041 //[-------------------------------------------------------]
00042 //[ Classes                                               ]
00043 //[-------------------------------------------------------]
00044 /**
00045 *  @brief
00046 *    Scene hierarchy which is in fact a simple list (a special case of a tree :)
00047 *
00048 *  @note
00049 *    - Try to avoid using this hierarchy type for larger scenes because it's quite inefficient!
00050 *    - Internally this 'hierarchy' will use the scene container nodes directly
00051 *      (therefore no extra reference to the scene nodes required :)
00052 */
00053 class SHList : public SceneHierarchy {
00054 
00055 
00056     //[-------------------------------------------------------]
00057     //[ RTTI interface                                        ]
00058     //[-------------------------------------------------------]
00059     pl_class(PLS_RTTI_EXPORT, SHList, "PLScene", PLScene::SceneHierarchy, "Scene hierarchy which is in fact a simple list (a special case of a tree :)")
00060         // Constructors
00061         pl_constructor_0(DefaultConstructor,    "Default constructor",  "")
00062     pl_class_end
00063 
00064 
00065     //[-------------------------------------------------------]
00066     //[ Public functions                                      ]
00067     //[-------------------------------------------------------]
00068     public:
00069         /**
00070         *  @brief
00071         *    Default constructor
00072         */
00073         PLS_API SHList();
00074 
00075 
00076     //[-------------------------------------------------------]
00077     //[ Private virtual SceneHierarchy functions              ]
00078     //[-------------------------------------------------------]
00079     private:
00080         virtual SceneHierarchyNode &CreateNode() override;
00081 
00082 
00083 };
00084 
00085 /**
00086 *  @brief
00087 *    List scene hierarchy node class
00088 */
00089 class SHListNode : public SceneHierarchyNode {
00090 
00091 
00092     //[-------------------------------------------------------]
00093     //[ Friends                                               ]
00094     //[-------------------------------------------------------]
00095     friend class SHList;
00096 
00097 
00098     //[-------------------------------------------------------]
00099     //[ Public virtual SceneHierarchyNode functions           ]
00100     //[-------------------------------------------------------]
00101     public:
00102         PLS_API virtual void Touch(bool bRecursive = false) override;
00103         PLS_API virtual PLCore::uint32 GetNumOfNodes() const override;
00104         PLS_API virtual SceneHierarchyNode *GetNode(PLCore::uint32 nIndex) const override;
00105 
00106 
00107     //[-------------------------------------------------------]
00108     //[ Private functions                                     ]
00109     //[-------------------------------------------------------]
00110     private:
00111         /**
00112         *  @brief
00113         *    Constructor
00114         *
00115         *  @param[in] cHierarchy
00116         *    The owner hierarchy
00117         */
00118         SHListNode(SceneHierarchy &cHierarchy);
00119 
00120         /**
00121         *  @brief
00122         *    Destructor
00123         */
00124         virtual ~SHListNode();
00125 
00126 
00127 };
00128 
00129 
00130 //[-------------------------------------------------------]
00131 //[ Namespace                                             ]
00132 //[-------------------------------------------------------]
00133 } // PLScene
00134 
00135 
00136 #endif // __PLSCENE_SCENEHIERARCHY_LIST_H__


PixelLight PixelLight 0.9.11-R1
Copyright (C) 2002-2012 by The PixelLight Team
Last modified Thu Feb 23 2012 14:08:59
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported