PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: SQLine.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_SCENEQUERY_LINE_H__ 00024 #define __PLSCENE_SCENEQUERY_LINE_H__ 00025 #pragma once 00026 00027 00028 //[-------------------------------------------------------] 00029 //[ Includes ] 00030 //[-------------------------------------------------------] 00031 #include <PLMath/Line.h> 00032 #include <PLRenderer/Renderer/Types.h> 00033 #include "PLScene/Scene/SceneQuery.h" 00034 00035 00036 //[-------------------------------------------------------] 00037 //[ Namespace ] 00038 //[-------------------------------------------------------] 00039 namespace PLScene { 00040 00041 00042 //[-------------------------------------------------------] 00043 //[ Forward declarations ] 00044 //[-------------------------------------------------------] 00045 class SceneHierarchyNode; 00046 00047 00048 //[-------------------------------------------------------] 00049 //[ Classes ] 00050 //[-------------------------------------------------------] 00051 /** 00052 * @brief 00053 * Line intersection scene query class 00054 * 00055 * @remarks 00056 * This line test scene query will enumerate all scene nodes intersecting the 00057 * given line. 00058 */ 00059 class SQLine : public SceneQuery { 00060 00061 00062 //[-------------------------------------------------------] 00063 //[ RTTI interface ] 00064 //[-------------------------------------------------------] 00065 pl_class(PLS_RTTI_EXPORT, SQLine, "PLScene", PLScene::SceneQuery, "Line intersection scene query class") 00066 // Constructors 00067 pl_constructor_0(DefaultConstructor, "Default constructor", "") 00068 pl_class_end 00069 00070 00071 //[-------------------------------------------------------] 00072 //[ Public functions ] 00073 //[-------------------------------------------------------] 00074 public: 00075 /** 00076 * @brief 00077 * Default constructor 00078 */ 00079 PLS_API SQLine(); 00080 00081 /** 00082 * @brief 00083 * Destructor 00084 */ 00085 PLS_API virtual ~SQLine(); 00086 00087 /** 00088 * @brief 00089 * Returns the used line 00090 * 00091 * @return 00092 * The used line 00093 */ 00094 PLS_API PLMath::Line &GetLine(); 00095 00096 /** 00097 * @brief 00098 * Returns the used cull mode 00099 * 00100 * @return 00101 * The used cull mode (see "PLRenderer::Cull") 00102 * 00103 * @note 00104 * - May not always be used, e.g. usually this is useful for mesh intersection tests 00105 */ 00106 PLS_API PLRenderer::Cull::Enum GetCull() const; 00107 00108 /** 00109 * @brief 00110 * Sets the used cull mode 00111 * 00112 * @param[in] nCull 00113 * The used cull mode (see "PLRenderer::Cull") 00114 * 00115 * @see 00116 * - "GetCull()" 00117 */ 00118 PLS_API void SetCull(PLRenderer::Cull::Enum nCull = PLRenderer::Cull::CCW); 00119 00120 00121 //[-------------------------------------------------------] 00122 //[ Private functions ] 00123 //[-------------------------------------------------------] 00124 private: 00125 /** 00126 * @brief 00127 * Recursive part of PerformQuery() 00128 * 00129 * @param[in] cHierarchyNode 00130 * Current scene hierarchy node we work on 00131 * 00132 * @return 00133 * 'true' to continue the query, 'false' if stop it right now 00134 */ 00135 bool PerformQueryRec(SceneHierarchyNode &cHierarchyNode); 00136 00137 00138 //[-------------------------------------------------------] 00139 //[ Private data ] 00140 //[-------------------------------------------------------] 00141 private: 00142 PLMath::Line m_cLine; /**< Line used for the query */ 00143 PLRenderer::Cull::Enum m_nCull; /**< The cull mode used for the query (see "PLRenderer::Cull") */ 00144 00145 00146 //[-------------------------------------------------------] 00147 //[ Public virtual SceneQuery functions ] 00148 //[-------------------------------------------------------] 00149 public: 00150 PLS_API virtual bool PerformQuery() override; 00151 00152 00153 }; 00154 00155 00156 //[-------------------------------------------------------] 00157 //[ Namespace ] 00158 //[-------------------------------------------------------] 00159 } // PLScene 00160 00161 00162 #endif // __PLSCENE_SCENEQUERY_LINE_H__
|