PixelLightAPI  .
SQAABoundingBox.h
Go to the documentation of this file.
00001 /*********************************************************\
00002  *  File: SQAABoundingBox.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_SCENEQUERY_AABOUNDINGBOX_H__
00024 #define __PLSCENE_SCENEQUERY_AABOUNDINGBOX_H__
00025 #pragma once
00026 
00027 
00028 //[-------------------------------------------------------]
00029 //[ Includes                                              ]
00030 //[-------------------------------------------------------]
00031 #include <PLMath/AABoundingBox.h>
00032 #include "PLScene/Scene/SceneQuery.h"
00033 
00034 
00035 //[-------------------------------------------------------]
00036 //[ Namespace                                             ]
00037 //[-------------------------------------------------------]
00038 namespace PLScene {
00039 
00040 
00041 //[-------------------------------------------------------]
00042 //[ Forward declarations                                  ]
00043 //[-------------------------------------------------------]
00044 class SceneHierarchyNode;
00045 
00046 
00047 //[-------------------------------------------------------]
00048 //[ Classes                                               ]
00049 //[-------------------------------------------------------]
00050 /**
00051 *  @brief
00052 *    Axis aligned bounding box intersection scene query class
00053 *
00054 *  @remarks
00055 *    This axis aligned bounding box test scene query will enumerate all scene nodes intersecting the
00056 *    given axis aligned bounding box. The intersection box will ALWAYS stay an axis aligned bounding box,
00057 *    even if it's transformed into a rotated child scene container! Therefore, if there are such rotated
00058 *    child scene containers, a new axis aligned bounding box in this container space is calculated
00059 *    automatically. As result, even scene nodes which are not inside the 'original' intersection volume
00060 *    may be within this transformed volume.
00061 */
00062 class SQAABoundingBox : public SceneQuery {
00063 
00064 
00065     //[-------------------------------------------------------]
00066     //[ RTTI interface                                        ]
00067     //[-------------------------------------------------------]
00068     pl_class(PLS_RTTI_EXPORT, SQAABoundingBox, "PLScene", PLScene::SceneQuery, "Axis aligned bounding box intersection scene query class")
00069         // Constructors
00070         pl_constructor_0(DefaultConstructor,    "Default constructor",  "")
00071     pl_class_end
00072 
00073 
00074     //[-------------------------------------------------------]
00075     //[ Public functions                                      ]
00076     //[-------------------------------------------------------]
00077     public:
00078         /**
00079         *  @brief
00080         *    Default constructor
00081         */
00082         PLS_API SQAABoundingBox();
00083 
00084         /**
00085         *  @brief
00086         *    Destructor
00087         */
00088         PLS_API virtual ~SQAABoundingBox();
00089 
00090         /**
00091         *  @brief
00092         *    Returns the used axis aligned bounding box
00093         *
00094         *  @return
00095         *    The used axis aligned bounding box
00096         */
00097         PLS_API PLMath::AABoundingBox &GetAABoundingBox();
00098 
00099 
00100     //[-------------------------------------------------------]
00101     //[ Private functions                                     ]
00102     //[-------------------------------------------------------]
00103     private:
00104         /**
00105         *  @brief
00106         *    Recursive part of PerformQuery()
00107         *
00108         *  @param[in] cHierarchyNode
00109         *    Current scene hierarchy node we work on
00110         *
00111         *  @return
00112         *    'true' to continue the query, 'false' if stop it right now
00113         */
00114         bool PerformQueryRec(SceneHierarchyNode &cHierarchyNode);
00115 
00116 
00117     //[-------------------------------------------------------]
00118     //[ Private data                                          ]
00119     //[-------------------------------------------------------]
00120     private:
00121         PLMath::AABoundingBox m_cAABoundingBox; /**< Axis aligned bounding box used for the query */
00122 
00123 
00124     //[-------------------------------------------------------]
00125     //[ Public virtual SceneQuery functions                   ]
00126     //[-------------------------------------------------------]
00127     public:
00128         PLS_API virtual bool PerformQuery() override;
00129 
00130 
00131 };
00132 
00133 
00134 //[-------------------------------------------------------]
00135 //[ Namespace                                             ]
00136 //[-------------------------------------------------------]
00137 } // PLScene
00138 
00139 
00140 #endif // __PLSCENE_SCENEQUERY_AABOUNDINGBOX_H__


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