PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: SQByName.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_BYNAME_H__ 00024 #define __PLSCENE_SCENEQUERY_BYNAME_H__ 00025 #pragma once 00026 00027 00028 //[-------------------------------------------------------] 00029 //[ Includes ] 00030 //[-------------------------------------------------------] 00031 #include <PLCore/String/RegEx.h> 00032 #include "PLScene/Scene/SceneQuery.h" 00033 00034 00035 //[-------------------------------------------------------] 00036 //[ Namespace ] 00037 //[-------------------------------------------------------] 00038 namespace PLScene { 00039 00040 00041 //[-------------------------------------------------------] 00042 //[ Classes ] 00043 //[-------------------------------------------------------] 00044 /** 00045 * @brief 00046 * Scene node enumeration by name scene query class 00047 * 00048 * @remarks 00049 * This scene query will enumerate scene nodes of the scene graph 00050 * if their name matches a given regular expression. 00051 * 00052 * @note 00053 * - Cell portal recursion is not performed 00054 */ 00055 class SQByName : public SceneQuery { 00056 00057 00058 //[-------------------------------------------------------] 00059 //[ RTTI interface ] 00060 //[-------------------------------------------------------] 00061 pl_class(PLS_RTTI_EXPORT, SQByName, "PLScene", PLScene::SceneQuery, "Scene node enumeration by name scene query class") 00062 // Constructors 00063 pl_constructor_0(DefaultConstructor, "Default constructor", "") 00064 pl_class_end 00065 00066 00067 //[-------------------------------------------------------] 00068 //[ Public functions ] 00069 //[-------------------------------------------------------] 00070 public: 00071 /** 00072 * @brief 00073 * Default constructor 00074 */ 00075 PLS_API SQByName(); 00076 00077 /** 00078 * @brief 00079 * Destructor 00080 */ 00081 PLS_API virtual ~SQByName(); 00082 00083 /** 00084 * @brief 00085 * Returns the used regular expression 00086 * 00087 * @return 00088 * The used regular expression 00089 */ 00090 PLS_API const PLCore::RegEx &GetRegEx() const; 00091 00092 /** 00093 * @brief 00094 * Sets the used regular expression 00095 * 00096 * @param[in] cRegEx 00097 * The regular expression to use 00098 */ 00099 PLS_API void SetRegEx(const PLCore::RegEx &cRegEx); 00100 00101 00102 //[-------------------------------------------------------] 00103 //[ Private functions ] 00104 //[-------------------------------------------------------] 00105 private: 00106 /** 00107 * @brief 00108 * Recursive part of PerformQuery() 00109 * 00110 * @param[in] cContainer 00111 * Current scene container we work on 00112 * 00113 * @return 00114 * 'true' to continue the query, 'false' if stop it right now 00115 */ 00116 bool PerformQueryRec(const SceneContainer &cContainer); 00117 00118 00119 //[-------------------------------------------------------] 00120 //[ Private data ] 00121 //[-------------------------------------------------------] 00122 private: 00123 PLCore::RegEx m_cRegEx; /**< Regular expression used for the query */ 00124 00125 00126 //[-------------------------------------------------------] 00127 //[ Public virtual SceneQuery functions ] 00128 //[-------------------------------------------------------] 00129 public: 00130 PLS_API virtual bool PerformQuery() override; 00131 00132 00133 }; 00134 00135 00136 //[-------------------------------------------------------] 00137 //[ Namespace ] 00138 //[-------------------------------------------------------] 00139 } // PLScene 00140 00141 00142 #endif // __PLSCENE_SCENEQUERY_BYNAME_H__
|