PixelLightAPI  .
SceneHierarchyNodeItem.h
Go to the documentation of this file.
00001 /*********************************************************\
00002  *  File: SceneHierarchyNodeItem.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_SCENEHIERARCHYITEM_H__
00024 #define __PLSCENE_SCENEHIERARCHYITEM_H__
00025 #pragma once
00026 
00027 
00028 //[-------------------------------------------------------]
00029 //[ Includes                                              ]
00030 //[-------------------------------------------------------]
00031 #include "PLScene/PLScene.h"
00032 
00033 
00034 //[-------------------------------------------------------]
00035 //[ Namespace                                             ]
00036 //[-------------------------------------------------------]
00037 namespace PLScene {
00038 
00039 
00040 //[-------------------------------------------------------]
00041 //[ Forward declarations                                  ]
00042 //[-------------------------------------------------------]
00043 class SceneNode;
00044 class SceneHierarchyNode;
00045 
00046 
00047 //[-------------------------------------------------------]
00048 //[ Classes                                               ]
00049 //[-------------------------------------------------------]
00050 /**
00051 *  @brief
00052 *    Scene hierarchy node item class
00053 *
00054 *  @remarks
00055 *    A scene hierarchy node item connects scene nodes and hierarchy nodes. One scene node can have
00056 *    multiple hierarchy node items linking them to different hierarchy nodes and one hierarchy node can have
00057 *    multiple hierarchy node items within it linking to different scene nodes.
00058 */
00059 class SceneHierarchyNodeItem {
00060 
00061 
00062     //[-------------------------------------------------------]
00063     //[ Friends                                               ]
00064     //[-------------------------------------------------------]
00065     friend class SceneHierarchy;
00066     friend class SceneHierarchyNode;
00067 
00068 
00069     //[-------------------------------------------------------]
00070     //[ Public functions                                      ]
00071     //[-------------------------------------------------------]
00072     public:
00073         /**
00074         *  @brief
00075         *    Returns the scene node this scene hierarchy node item is linked to
00076         *
00077         *  @return
00078         *    The scene node this scene hierarchy node item is linked to, a null pointer on error
00079         *    (currently not linked to a scene node?)
00080         */
00081         PLS_API SceneNode *GetSceneNode() const;
00082 
00083         /**
00084         *  @brief
00085         *    Returns the scene hierarchy node this scene hierarchy node item is attached to
00086         *
00087         *  @return
00088         *    The scene hierarchy node this scene hierarchy node item is attached to, a null pointer on error
00089         *    (currently not attached to a scene hierarchy node?)
00090         */
00091         PLS_API SceneHierarchyNode *GetHierarchyNode() const;
00092 
00093         /**
00094         *  @brief
00095         *    Returns the previous scene hierarchy node item
00096         *
00097         *  @return
00098         *    The previous scene hierarchy node item, a null pointer if there's no previous item
00099         */
00100         PLS_API SceneHierarchyNodeItem *GetPreviousItem() const;
00101 
00102         /**
00103         *  @brief
00104         *    Returns the next scene hierarchy node item
00105         *
00106         *  @return
00107         *    The next scene hierarchy node item, a null pointer if there's no next item
00108         */
00109         PLS_API SceneHierarchyNodeItem *GetNextItem() const;
00110 
00111 
00112     //[-------------------------------------------------------]
00113     //[ Private functions                                     ]
00114     //[-------------------------------------------------------]
00115     // [TODO] How to make this protected but available for classes like SHKdTreeNode??
00116     public:
00117 //  private:
00118         /**
00119         *  @brief
00120         *    Constructor
00121         */
00122         PLS_API SceneHierarchyNodeItem();
00123 
00124         /**
00125         *  @brief
00126         *    Destructor
00127         */
00128         PLS_API ~SceneHierarchyNodeItem();
00129 
00130         /**
00131         *  @brief
00132         *    Links this scene hierarchy node item with a scene node
00133         *
00134         *  @param[in] cSceneNode
00135         *    Scene node where link this scene hierarchy node item to
00136         *
00137         *  @return
00138         *    'true' if all went fine, else 'false' (currently already linked?)
00139         */
00140         PLS_API bool Link(SceneNode &cSceneNode);
00141 
00142         /**
00143         *  @brief
00144         *    Unlinks this scene hierarchy node item from the scene node
00145         *
00146         *  @return
00147         *    'true' if all went fine, else 'false' (currently not linked?)
00148         */
00149         PLS_API bool Unlink();
00150 
00151         /**
00152         *  @brief
00153         *    Attaches this scene hierarchy node item to a scene hierarchy node
00154         *
00155         *  @param[in] cSceneHierarchyNode
00156         *    Scene hierarchy node where to attach this scene hierarchy node item
00157         *
00158         *  @return
00159         *    'true' if all went fine, else 'false' (currently already attached?)
00160         */
00161         PLS_API bool Attach(SceneHierarchyNode &cSceneHierarchyNode);
00162 
00163         /**
00164         *  @brief
00165         *    Detaches this scene hierarchy node item from it's scene hierarchy node
00166         *
00167         *  @return
00168         *    'true' if all went fine, else 'false' (currently not attached?)
00169         */
00170         PLS_API bool Detach();
00171 
00172         /**
00173         *  @brief
00174         *    Returns a clone of this scene hierarchy node item
00175         *
00176         *  @return
00177         *    A clone of this scene hierarchy node item
00178         *
00179         *  @note
00180         *    - The clone is already linked to the same scene node, but not attached to
00181         *      any scene hierarchy node
00182         */
00183         PLS_API SceneHierarchyNodeItem &Clone() const;
00184 
00185 
00186     //[-------------------------------------------------------]
00187     //[ Private data                                          ]
00188     //[-------------------------------------------------------]
00189     private:
00190         // Scene node
00191         SceneNode              *m_pSceneNode;                       /**< Scene node this scene hierarchy node item is linked with, can be a null pointer */
00192         SceneHierarchyNodeItem *m_pPreviousSceneNodeItem;           /**< Next scene node item, can be a null pointer */
00193         SceneHierarchyNodeItem *m_pNextSceneNodeItem;               /**< Previous scene node item, can be a null pointer */
00194         // Scene hierarchy node
00195         SceneHierarchyNode     *m_pSceneHierarchyNode;              /**< Scene hierarchy node this scene hierarchy node item is attached to, can be a null pointer */
00196         SceneHierarchyNodeItem *m_pPreviousSceneHierarchyNodeItem;  /**< Next scene hierarchy node item, can be a null pointer */
00197         SceneHierarchyNodeItem *m_pNextSceneHierarchyNodeItem;      /**< Previous scene hierarchy node item, can be a null pointer */
00198 
00199 
00200 };
00201 
00202 
00203 //[-------------------------------------------------------]
00204 //[ Namespace                                             ]
00205 //[-------------------------------------------------------]
00206 } // PLScene
00207 
00208 
00209 #endif // __PLSCENE_SCENEHIERARCHYITEM_H__


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