PixelLightAPI  .
SNText3D.h
Go to the documentation of this file.
00001 /*********************************************************\
00002  *  File: SNText3D.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_SCENENODE_TEXT3D_H__
00024 #define __PLSCENE_SCENENODE_TEXT3D_H__
00025 #pragma once
00026 
00027 
00028 //[-------------------------------------------------------]
00029 //[ Includes                                              ]
00030 //[-------------------------------------------------------]
00031 #include <PLRenderer/Material/MaterialHandler.h>
00032 #include "PLScene/Scene/SceneNodes/SNText.h"
00033 
00034 
00035 //[-------------------------------------------------------]
00036 //[ Namespace                                             ]
00037 //[-------------------------------------------------------]
00038 namespace PLScene {
00039 
00040 
00041 //[-------------------------------------------------------]
00042 //[ Classes                                               ]
00043 //[-------------------------------------------------------]
00044 /**
00045 *  @brief
00046 *    3D ("flat") text scene node
00047 *
00048 *  @note
00049 *    - The text is drawn on the x/y plane and 'looks' into the positive z axis
00050 *    - The 3D placed text has always a height of 1 to be independent of the actual 'font size'
00051 *    - The 'font size' can be seen as the 'font quality'
00052 */
00053 class SNText3D : public SNText {
00054 
00055 
00056     //[-------------------------------------------------------]
00057     //[ Public definitions                                    ]
00058     //[-------------------------------------------------------]
00059     public:
00060         /**
00061         *  @brief
00062         *    Scene node flags (SceneNode flags extension)
00063         */
00064         enum EFlags {
00065             NoBackfaceCulling = 1<<11   /**< No backface culling so 'both' sides of the text can be seen */
00066         };
00067         pl_enum(EFlags)
00068             pl_enum_base(SNText::EFlags)
00069             pl_enum_value(NoBackfaceCulling, "No backface culling so 'both' sides of the text can be seen")
00070         pl_enum_end
00071 
00072 
00073     //[-------------------------------------------------------]
00074     //[ RTTI interface                                        ]
00075     //[-------------------------------------------------------]
00076     pl_class(PLS_RTTI_EXPORT, SNText3D, "PLScene", PLScene::SNText, "3D (\"flat\") text scene node")
00077         // Attributes
00078         pl_attribute(BackgroundMaterial,    PLCore::String,         "", ReadWrite,  GetSet, "Background material to use",   "Type='Material Effect Image TextureAni'")
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 PLCore::String GetBackgroundMaterial() const;
00091         PLS_API void SetBackgroundMaterial(const PLCore::String &sValue);
00092         PLS_API virtual void SetText(const PLCore::String &sValue) override;
00093         PLS_API virtual void SetFont(const PLCore::String &sValue) override;
00094         PLS_API virtual void SetFontSize(PLCore::uint32 nValue) override;
00095         PLS_API virtual void SetFlags(PLCore::uint32 nValue) override;
00096 
00097 
00098     //[-------------------------------------------------------]
00099     //[ Public functions                                      ]
00100     //[-------------------------------------------------------]
00101     public:
00102         /**
00103         *  @brief
00104         *    Default constructor
00105         */
00106         PLS_API SNText3D();
00107 
00108         /**
00109         *  @brief
00110         *    Destructor
00111         */
00112         PLS_API virtual ~SNText3D();
00113 
00114         /**
00115         *  @brief
00116         *    Returns the handler of the background material
00117         *
00118         *  @return
00119         *    Handler of the background material
00120         */
00121         PLS_API const PLRenderer::MaterialHandler &GetBackgroundMaterialHandler();
00122 
00123 
00124     //[-------------------------------------------------------]
00125     //[ Private data                                          ]
00126     //[-------------------------------------------------------]
00127     private:
00128         PLCore::String              m_sBackgroundMaterial;  /**< Background material */
00129         bool                        m_bBackgroundMaterial;  /**< Background material loaded? */
00130         PLRenderer::MaterialHandler m_cBackgroundMaterial;  /**< Background material */
00131 
00132 
00133     //[-------------------------------------------------------]
00134     //[ Public virtual SceneNode functions                    ]
00135     //[-------------------------------------------------------]
00136     public:
00137         PLS_API virtual void DrawTransparent(PLRenderer::Renderer &cRenderer, const VisNode *pVisNode) override;
00138 
00139 
00140     //[-------------------------------------------------------]
00141     //[ Private virtual SceneNode functions                   ]
00142     //[-------------------------------------------------------]
00143     private:
00144         virtual void UpdateAABoundingBox() override;
00145 
00146 
00147 };
00148 
00149 
00150 //[-------------------------------------------------------]
00151 //[ Namespace                                             ]
00152 //[-------------------------------------------------------]
00153 } // PLScene
00154 
00155 
00156 #endif // __PLSCENE_SCENENODE_TEXT3D_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