PixelLightAPI  .
VisPortal.h
Go to the documentation of this file.
00001 /*********************************************************\
00002  *  File: VisPortal.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_VISIBILITY_VISPORTAL_H__
00024 #define __PLSCENE_VISIBILITY_VISPORTAL_H__
00025 #pragma once
00026 
00027 
00028 //[-------------------------------------------------------]
00029 //[ Includes                                              ]
00030 //[-------------------------------------------------------]
00031 #include <PLCore/Base/Event/EventHandler.h>
00032 #include "PLScene/Visibility/VisNode.h"
00033 
00034 
00035 //[-------------------------------------------------------]
00036 //[ Namespace                                             ]
00037 //[-------------------------------------------------------]
00038 namespace PLScene {
00039 
00040 
00041 //[-------------------------------------------------------]
00042 //[ Forward declarations                                  ]
00043 //[-------------------------------------------------------]
00044 class SCCell;
00045 class VisContainer;
00046 
00047 
00048 //[-------------------------------------------------------]
00049 //[ Classes                                               ]
00050 //[-------------------------------------------------------]
00051 /**
00052 *  @brief
00053 *    Portal of the visibility tree
00054 */
00055 class VisPortal : public VisNode {
00056 
00057 
00058     //[-------------------------------------------------------]
00059     //[ Friends                                               ]
00060     //[-------------------------------------------------------]
00061     friend class VisContainer;
00062 
00063 
00064     //[-------------------------------------------------------]
00065     //[ Public functions                                      ]
00066     //[-------------------------------------------------------]
00067     public:
00068         /**
00069         *  @brief
00070         *    Returns the target visibility cell the portal links to
00071         *
00072         *  @return
00073         *    The target visibility cell the portal links to, a null pointer if it's not possible to
00074         *    'see through' the portal (SNCellPortal::NoSeeThrough flag) or on error.
00075         */
00076         PLS_API VisContainer *GetTargetVisContainer() const;
00077 
00078 
00079     //[-------------------------------------------------------]
00080     //[ Private functions                                     ]
00081     //[-------------------------------------------------------]
00082     private:
00083         /**
00084         *  @brief
00085         *    Constructor
00086         *
00087         *  @param[in] cParent
00088         *    The parent visibility node
00089         */
00090         VisPortal(VisNode &cParent);
00091 
00092         /**
00093         *  @brief
00094         *    Destructor
00095         */
00096         virtual ~VisPortal();
00097 
00098         /**
00099         *  @brief
00100         *    Called when the scene node assigned with this visibility portal was destroyed
00101         */
00102         void OnDestroy();
00103 
00104 
00105     //[-------------------------------------------------------]
00106     //[ Private event handlers                                ]
00107     //[-------------------------------------------------------]
00108     private:
00109         PLCore::EventHandler<> EventHandlerDestroy;
00110 
00111 
00112     //[-------------------------------------------------------]
00113     //[ Private data                                          ]
00114     //[-------------------------------------------------------]
00115     private:
00116         VisContainer *m_pTargetCell;    /**< The target visibility cell the portal links to */
00117 
00118 
00119     //[-------------------------------------------------------]
00120     //[ Public virtual VisNode functions                      ]
00121     //[-------------------------------------------------------]
00122     public:
00123         PLS_API virtual bool IsPortal() const override;
00124 
00125 
00126 };
00127 
00128 
00129 //[-------------------------------------------------------]
00130 //[ Namespace                                             ]
00131 //[-------------------------------------------------------]
00132 } // PLScene
00133 
00134 
00135 #endif // __PLSCENE_VISIBILITY_VISPORTAL_H__


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