VR-Forces 4.0.4 Class Documentation
include/vrvOsg/DtOsgWidgetLabel.h
Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Copyright (c) 2011 MAK Technologies, Inc.
00003  * All rights reserved.
00004  *****************************************************************************/
00005 
00009 
00010 #pragma once
00011 
00012 #include <vrvOsg/vrvOsg.h>
00013 
00014 #include <vrvCore/DtWidgetLabel.h>
00015 
00016 #include <vrvGraphics/DtBoundingBox.h>
00017 
00018 #include <GL/glew.h>
00019 
00020 #include <osg/ref_ptr>
00021 #include <osg/Texture>
00022 
00023 namespace osg
00024 {
00025    class Texture;
00026 }
00027 
00028 namespace makVrv
00029 {
00030 
00031    class DtSprite;
00032    class DtTextProxy;
00033 
00036    class DT_DLL_VRVOSG DtOsgWidgetLabel : public DtWidgetLabel
00037    {
00038    public:
00039 
00041       DtOsgWidgetLabel( DtDe& de, DtUniqueID id );
00042 
00044       virtual ~DtOsgWidgetLabel();
00045 
00047       virtual void setOverlay( unsigned int layer );
00048 
00050       virtual unsigned int overlay() const;
00051 
00053       virtual void setOrderGroup( unsigned int group );
00054 
00056       virtual unsigned int orderGroup() const;
00057 
00059       virtual void setPosition( float x, float y, float z, float w = 0 );
00060 
00063       virtual void setText( const DtUnicode& string );
00064 
00066       virtual void setFont( const std::string& font, float size );
00067 
00069       virtual void setFontScale( float scale );
00070 
00072       int fontScale() const;
00073 
00075       virtual void setBackgroundImage( const std::string& filename );
00076       virtual void setBackgroundImage( const std::string& filename,
00077          float left, float right, float bottom, float top );
00078 
00080       virtual void setTextColor( float r,float g,float b, float a );
00081 
00083       virtual void setColor( float r, float g, float b, float a );
00084 
00087       virtual void setOrigin( float originX, float originY);
00088 
00090       virtual void setSize( float w, float h);
00091 
00093       virtual void setPadding( float paddingX, float paddingY );
00094 
00096       virtual void setModelDefinition( const std::string& str );
00097 
00099       virtual void setTextAlignment( DtWidgetLabel::HorizontalAlignment ha );
00100 
00102       virtual void setGlyphCenterPolicy( DtWidgetLabel::GlyphCenterPolicy gcp );
00103 
00105       virtual void setEventsEnabled( bool enabled );
00106 
00108       virtual void setVisible( bool visible );
00109 
00112       virtual void setBoundsLength( int len );
00113 
00115       virtual void setRotation( float angle );
00116 
00117    protected:
00118 
00119       void updateBounds( bool calculateText );
00120       void updateTextBounds( DtBoundingBox box, bool calculateText );
00121       void updateFont( const std::string& font );
00122 
00123    protected:
00124 
00125       osg::ref_ptr<osg::Texture> myTexture;
00126       DtSprite* mySprite;
00127       DtTextProxy* myText;
00128       DtBoundingBox myTextBounds;
00129       unsigned int myOverlay;
00130       float myWidth;
00131       float myHeight;
00132       float myOriginX;
00133       float myOriginY;
00134       float myPaddingX;
00135       float myPaddingY;
00136       float myRotation;
00137       unsigned int myGroup;
00138       float myFontScale;
00139       int myFontSize;
00140       int myBoundsLength;
00141       GlyphCenterPolicy myCenterPolicy;
00142 
00143    };
00144 
00145 }

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)