PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: SNLineBox.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_SCENENODE_LINEBOX_H__ 00024 #define __PLSCENE_SCENENODE_LINEBOX_H__ 00025 #pragma once 00026 00027 00028 //[-------------------------------------------------------] 00029 //[ Includes ] 00030 //[-------------------------------------------------------] 00031 #include <PLGraphics/Color/Color4.h> 00032 #include "PLScene/Scene/SceneNode.h" 00033 00034 00035 //[-------------------------------------------------------] 00036 //[ Namespace ] 00037 //[-------------------------------------------------------] 00038 namespace PLScene { 00039 00040 00041 //[-------------------------------------------------------] 00042 //[ Classes ] 00043 //[-------------------------------------------------------] 00044 /** 00045 * @brief 00046 * Line box scene node 00047 */ 00048 class SNLineBox : public SceneNode { 00049 00050 00051 //[-------------------------------------------------------] 00052 //[ Public definitions ] 00053 //[-------------------------------------------------------] 00054 public: 00055 /** 00056 * @brief 00057 * Scene node flags (SceneNode flags extension) 00058 */ 00059 enum EFlags { 00060 No3DPosition = 1<<10, /**< The line box is not placed within 3D. If this flag is set, the node position is in 'screen space' between 0.0 and 1.0. */ 00061 NoDepthTest = 1<<11 /**< Do not perform a depth test */ 00062 }; 00063 pl_enum(EFlags) 00064 pl_enum_base(SceneNode::EFlags) 00065 pl_enum_value(No3DPosition, "The line box is not placed within 3D. If this flag is set, the node position is in 'screen space' between 0.0 and 1.0.") 00066 pl_enum_value(NoDepthTest, "Do not perform a depth test") 00067 pl_enum_end 00068 00069 00070 //[-------------------------------------------------------] 00071 //[ RTTI interface ] 00072 //[-------------------------------------------------------] 00073 pl_class(PLS_RTTI_EXPORT, SNLineBox, "PLScene", PLScene::SceneNode, "Line box scene node") 00074 // Attributes 00075 pl_attribute(StartPosition, PLMath::Vector3, PLMath::Vector3::Zero, ReadWrite, GetSet, "Line box start position (relative to this node)", "") 00076 pl_attribute(EndPosition, PLMath::Vector3, PLMath::Vector3::UnitZ, ReadWrite, GetSet, "Line box end position (relative to this node)", "") 00077 pl_attribute(Width, float, 1.0f, ReadWrite, DirectValue, "Line box width (if supported by the the used renderer API)", "Min='1.0'") 00078 pl_attribute(Color, PLGraphics::Color4, PLGraphics::Color4::White, ReadWrite, DirectValue, "Line box color (r/g/b/a)", "") 00079 // Overwritten SceneNode attributes 00080 pl_attribute(Flags, pl_flag_type(EFlags), 0, ReadWrite, GetSet, "Flags", "") 00081 // Constructors 00082 pl_constructor_0(DefaultConstructor, "Default constructor", "") 00083 pl_class_end 00084 00085 00086 //[-------------------------------------------------------] 00087 //[ Public RTTI get/set functions ] 00088 //[-------------------------------------------------------] 00089 public: 00090 PLS_API const PLMath::Vector3 &GetStartPosition() const; 00091 PLS_API void SetStartPosition(const PLMath::Vector3 &vValue); 00092 PLS_API const PLMath::Vector3 &GetEndPosition() const; 00093 PLS_API void SetEndPosition(const PLMath::Vector3 &vValue); 00094 00095 00096 //[-------------------------------------------------------] 00097 //[ Public functions ] 00098 //[-------------------------------------------------------] 00099 public: 00100 /** 00101 * @brief 00102 * Default constructor 00103 */ 00104 PLS_API SNLineBox(); 00105 00106 /** 00107 * @brief 00108 * Destructor 00109 */ 00110 PLS_API virtual ~SNLineBox(); 00111 00112 00113 //[-------------------------------------------------------] 00114 //[ Private data ] 00115 //[-------------------------------------------------------] 00116 private: 00117 PLMath::Vector3 m_vStartPosition; /**< Line box start position (relative to this node) */ 00118 PLMath::Vector3 m_vEndPosition; /**< Line box end position (relative to this node) */ 00119 00120 00121 //[-------------------------------------------------------] 00122 //[ Public virtual SceneNode functions ] 00123 //[-------------------------------------------------------] 00124 public: 00125 PLS_API virtual void DrawSolid(PLRenderer::Renderer &cRenderer, const VisNode *pVisNode = nullptr) override; 00126 PLS_API virtual void DrawTransparent(PLRenderer::Renderer &cRenderer, const VisNode *pVisNode = nullptr) override; 00127 00128 00129 //[-------------------------------------------------------] 00130 //[ Protected virtual SceneNode functions ] 00131 //[-------------------------------------------------------] 00132 protected: 00133 PLS_API virtual void UpdateAABoundingBox() override; 00134 00135 00136 }; 00137 00138 00139 //[-------------------------------------------------------] 00140 //[ Namespace ] 00141 //[-------------------------------------------------------] 00142 } // PLScene 00143 00144 00145 #endif // __PLSCENE_SCENENODE_LINEBOX_H__
|