OpenWalnut 1.2.5
WGELabel.h
00001 //---------------------------------------------------------------------------
00002 //
00003 // Project: OpenWalnut ( http://www.openwalnut.org )
00004 //
00005 // Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
00006 // For more information see http://www.openwalnut.org/copying
00007 //
00008 // This file is part of OpenWalnut.
00009 //
00010 // OpenWalnut is free software: you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as published by
00012 // the Free Software Foundation, either version 3 of the License, or
00013 // (at your option) any later version.
00014 //
00015 // OpenWalnut is distributed in the hope that it will be useful,
00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018 // GNU Lesser General Public License for more details.
00019 //
00020 // You should have received a copy of the GNU Lesser General Public License
00021 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
00022 //
00023 //---------------------------------------------------------------------------
00024 
00025 #ifndef WGELABEL_H
00026 #define WGELABEL_H
00027 
00028 #include <osgText/Text>
00029 #include <osgText/FadeText>
00030 
00031 #include "WGELayoutableItem.h"
00032 #include "../../WExportWGE.h"
00033 
00034 /**
00035  * Label layout-item. An layoutable item which displays text. This is nice for labeling elements on the screen. It can be used stand-alone (as it
00036  * simply is an osgText::Text instance or in conjunction with an WGEItemLayouter.
00037  */
00038 class WGE_EXPORT WGELabel: public osgText::Text,
00039                                 WGELayoutableItem
00040 {
00041 public:
00042 
00043     /**
00044      * Convenience typedef for a osg::ref_ptr< WGELabel >.
00045      */
00046     typedef osg::ref_ptr< WGELabel > SPtr;
00047 
00048     /**
00049      * Convenience typedef for a osg::ref_ptr< const WGELabel >.
00050      */
00051     typedef osg::ref_ptr< const WGELabel > ConstSPtr;
00052 
00053     /**
00054      * Default constructor.
00055      */
00056     WGELabel();
00057 
00058     /**
00059      * Destructor.
00060      */
00061     virtual ~WGELabel();
00062 
00063     /**
00064      * Gets the current anchor point of the label.
00065      *
00066      * \return the anchor.
00067      */
00068     virtual osg::Vec3 getAnchor() const;
00069 
00070     /**
00071      * Sets the anchor point in world coordinates of this labels.
00072      *
00073      * \param anchor the anchor point
00074      */
00075     virtual void setAnchor( const osg::Vec3& anchor );
00076 
00077 protected:
00078 
00079     /**
00080      * The anchor of the label in world space.
00081      */
00082     osg::Vec3 m_anchor;
00083 
00084 private:
00085 };
00086 
00087 #endif  // WGELABEL_H
00088 
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends