LLHUDText Class Reference

#include <llhudtext.h>

Inheritance diagram for LLHUDText:

Inheritance graph
[legend]
Collaboration diagram for LLHUDText:

Collaboration graph
[legend]
List of all members.

Public Types

typedef enum LLHUDText::e_text_alignment ETextAlignment
typedef enum LLHUDText::e_vert_alignment EVertAlignment
 ALIGN_TEXT_LEFT
 ALIGN_TEXT_CENTER
 ALIGN_VERT_TOP
 ALIGN_VERT_CENTER
enum  e_text_alignment { ALIGN_TEXT_LEFT, ALIGN_TEXT_CENTER }
enum  e_vert_alignment { ALIGN_VERT_TOP, ALIGN_VERT_CENTER }

Public Member Functions

void setStringUTF8 (const std::string &utf8string)
void setString (const LLWString &wstring)
void clearString ()
void addLine (const std::string &text, const LLColor4 &color, const LLFontGL::StyleFlags style=LLFontGL::NORMAL)
void addLine (const LLWString &wtext, const LLColor4 &color, const LLFontGL::StyleFlags style=LLFontGL::NORMAL)
void setLabel (const std::string &label)
void setLabel (const LLWString &label)
void setDropShadow (const BOOL do_shadow)
void setFont (const LLFontGL *font)
void setColor (const LLColor4 &color)
void setBackgroundColor (const LLColor4 &color)
void setUsePixelSize (const BOOL use_pixel_size)
void setZCompare (const BOOL zcompare)
void setDoFade (const BOOL do_fade)
void setVisibleOffScreen (BOOL visible)
void setMaxLines (S32 max_lines)
void setFadeDistance (F32 fade_distance, F32 fade_range)
void updateVisibility ()
LLVector2 updateScreenPos (LLVector2 &offset_target)
void updateSize ()
void setMass (F32 mass)
void setTextAlignment (ETextAlignment alignment)
void setVertAlignment (EVertAlignment alignment)
void markDead ()
F32 getDistance () const
void setUseBubble (BOOL use_bubble)
S32 getLOD ()
BOOL getVisible ()
BOOL getHidden () const
void setHidden (BOOL hide)
void setOnHUDAttachment (BOOL on_hud)

Static Public Member Functions

static void renderAllHUD ()
static void addPickable (std::set< LLViewerObject * > &pick_list)
static void reshape ()

Protected Member Functions

 LLHUDText (const U8 type)
void render ()
void renderForSelect ()
void renderText (BOOL for_select)
void setLOD (S32 lod)
S32 getMaxLines ()

Static Protected Member Functions

static void updateAll ()

Private Types

typedef std::set< LLPointer<
LLHUDText > >::iterator 
TextObjectIterator
typedef std::vector< LLPointer<
LLHUDText > >::iterator 
VisibleTextObjectIterator

Private Member Functions

 ~LLHUDText ()

Private Attributes

BOOL mOnHUD
BOOL mUseBubble
BOOL mDropShadow
BOOL mDoFade
F32 mFadeRange
F32 mFadeDistance
F32 mLastDistance
BOOL mUsePixelSize
BOOL mZCompare
BOOL mVisibleOffScreen
BOOL mOffscreen
LLColor4 mColor
LLColor4 mBackgroundColor
LLVector3 mScale
F32 mWidth
F32 mHeight
LLColor4U mPickColor
const LLFontGLmFontp
const LLFontGLmBoldFontp
LLRectf mSoftScreenRect
LLVector3 mPositionAgent
LLVector2 mPositionOffset
LLVector2 mTargetPositionOffset
F32 mMass
S32 mMaxLines
S32 mOffsetY
F32 mRadius
std::vector< LLHUDTextSegmentmTextSegments
std::vector< LLHUDTextSegmentmLabelSegments
LLFrameTimer mResizeTimer
ETextAlignment mTextAlignment
EVertAlignment mVertAlignment
S32 mLOD
BOOL mHidden

Static Private Attributes

static std::set< LLPointer<
LLHUDText > > 
sTextObjects
static std::vector< LLPointer<
LLHUDText > > 
sVisibleTextObjects
static std::vector< LLPointer<
LLHUDText > > 
sVisibleHUDTextObjects

Friends

class LLHUDObject

Classes

class  LLHUDTextSegment

Detailed Description

Definition at line 58 of file llhudtext.h.


Member Typedef Documentation

typedef enum LLHUDText::e_text_alignment LLHUDText::ETextAlignment

typedef enum LLHUDText::e_vert_alignment LLHUDText::EVertAlignment

typedef std::set<LLPointer<LLHUDText> >::iterator LLHUDText::TextObjectIterator [private]

Definition at line 178 of file llhudtext.h.

typedef std::vector<LLPointer<LLHUDText> >::iterator LLHUDText::VisibleTextObjectIterator [private]

Definition at line 179 of file llhudtext.h.


Member Enumeration Documentation

enum LLHUDText::e_text_alignment

Enumerator:
ALIGN_TEXT_LEFT 
ALIGN_TEXT_CENTER 

Definition at line 78 of file llhudtext.h.

enum LLHUDText::e_vert_alignment

Enumerator:
ALIGN_VERT_TOP 
ALIGN_VERT_CENTER 

Definition at line 84 of file llhudtext.h.


Constructor & Destructor Documentation

LLHUDText::LLHUDText ( const U8  type  )  [protected]

Definition at line 85 of file llhudtext.cpp.

References f, FALSE, LLControlGroup::getColor4(), gSavedSettings, mBackgroundColor, mColor, mDoFade, mDropShadow, mFadeDistance, mFadeRange, mOffscreen, mRadius, mZCompare, sTextObjects, and TRUE.

LLHUDText::~LLHUDText (  )  [private]

Definition at line 116 of file llhudtext.cpp.


Member Function Documentation

void LLHUDText::addLine ( const LLWString wtext,
const LLColor4 color,
const LLFontGL::StyleFlags  style = LLFontGL::NORMAL 
)

Definition at line 470 of file llhudtext.cpp.

References gNoRender, HUD_TEXT_MAX_WIDTH, HUD_TEXT_MAX_WIDTH_NO_BUBBLE, LLFontGL::maxDrawableChars(), mFontp, mTextSegments, mUseBubble, S32, TRUE, and utf8str_to_wstring().

void LLHUDText::addLine ( const std::string &  text,
const LLColor4 color,
const LLFontGL::StyleFlags  style = LLFontGL::NORMAL 
)

Definition at line 464 of file llhudtext.cpp.

References utf8str_to_wstring().

Referenced by setString().

void LLHUDText::addPickable ( std::set< LLViewerObject * > &  pick_list  )  [static]

Definition at line 968 of file llhudtext.cpp.

References sVisibleTextObjects.

Referenced by LLViewerObjectList::renderObjectsForSelect().

void LLHUDText::clearString (  ) 

Definition at line 458 of file llhudtext.cpp.

References mTextSegments.

F32 LLHUDText::getDistance (  )  const [inline, virtual]

Reimplemented from LLHUDObject.

Definition at line 118 of file llhudtext.h.

References mLastDistance.

BOOL LLHUDText::getHidden (  )  const [inline]

Definition at line 122 of file llhudtext.h.

References mHidden.

S32 LLHUDText::getLOD (  )  [inline]

Definition at line 120 of file llhudtext.h.

References mLOD.

S32 LLHUDText::getMaxLines (  )  [protected]

Definition at line 932 of file llhudtext.cpp.

References mLOD, and mMaxLines.

Referenced by renderText(), and updateSize().

BOOL LLHUDText::getVisible (  )  [inline]

Definition at line 121 of file llhudtext.h.

References LLHUDObject::mVisible.

void LLHUDText::markDead (  )  [virtual]

Reimplemented from LLHUDObject.

Definition at line 948 of file llhudtext.cpp.

References LLHUDObject::markDead(), and sTextObjects.

void LLHUDText::render (  )  [protected, virtual]

Implements LLHUDObject.

Definition at line 121 of file llhudtext.cpp.

References FALSE, LLHUDObject::mOnHUDAttachment, and renderText().

void LLHUDText::renderAllHUD (  )  [static]

Definition at line 954 of file llhudtext.cpp.

References depth, FALSE, and sVisibleHUDTextObjects.

Referenced by render_hud_elements().

void LLHUDText::renderForSelect (  )  [protected, virtual]

Reimplemented from LLHUDObject.

Definition at line 130 of file llhudtext.cpp.

References LLHUDObject::mOnHUDAttachment, renderText(), and TRUE.

void LLHUDText::renderText ( BOOL  for_select  )  [protected]

Definition at line 139 of file llhudtext.cpp.

References ALIGN_TEXT_CENTER, ALIGN_VERT_CENTER, ALIGN_VERT_TOP, LLViewerImage::bindTexture(), LLFontGL::BOLD, LLFontGL::DROP_SHADOW, f, FALSE, gCamera, LLControlGroup::getF32(), LLImageGL::getHeight(), LLViewerImageList::getImage(), LLFontGL::getLineHeight(), getMaxLines(), LLViewerCamera::getPixelVectors(), LLControlGroup::getString(), LLImageGL::getWidth(), LLViewerWindow::getWindowHeight(), LLViewerWindow::getWindowWidth(), gImageList, gl_segmented_rect_3d_tex(), gl_segmented_rect_3d_tex_top(), glBegin, glColor4f, glColor4fv, glColor4ubv, glEnd, gSavedSettings, gViewerArt, gViewerWindow, HORIZONTAL_PADDING, hud_render_text(), LLPointer< Type >::isNull(), llabs(), llfloor(), llmax(), llmin(), lltrunc(), mBackgroundColor, mBoldFontp, mColor, mDoFade, mDropShadow, mFadeDistance, mFadeRange, mFontp, mHeight, mHidden, MIPMAP_FALSE, mLabelSegments, mLastDistance, mOffscreen, mOffsetY, LLHUDObject::mOnHUDAttachment, mPositionAgent, mPositionOffset, mRadius, LLHUDObject::mSourceObject, mTextAlignment, mTextSegments, mUseBubble, LLColor4U::mV, LLVector3::mV, LLVector2::mV, LLColor4::mV, mVertAlignment, LLHUDObject::mVisible, mWidth, mZCompare, LLUI::popMatrix(), LLViewerCamera::projectPosAgentToScreen(), LLUI::pushMatrix(), S32, LLUUID::set(), LLColor4::setAlpha(), LLUI::setLineWidth(), LLUI::translate(), TRUE, updateScreenPos(), VALPHA, VERTICAL_PADDING, VX, VY, VZ, LLVector3::y_axis, LLVector3::z_axis, and LLVector3::zero.

Referenced by render(), and renderForSelect().

void LLHUDText::reshape (  )  [static]

Definition at line 985 of file llhudtext.cpp.

References sTextObjects.

Referenced by LLViewerWindow::rawSnapshot(), and LLViewerWindow::reshape().

void LLHUDText::setBackgroundColor ( const LLColor4 color  ) 

Definition at line 563 of file llhudtext.cpp.

References mBackgroundColor.

void LLHUDText::setColor ( const LLColor4 color  ) 

Definition at line 553 of file llhudtext.cpp.

References mColor, and mTextSegments.

Referenced by LLTracker::renderBeacon(), and LLViewerObjectList::renderObjectBeacons().

void LLHUDText::setDoFade ( const BOOL  do_fade  ) 

Definition at line 573 of file llhudtext.cpp.

References mDoFade.

void LLHUDText::setDropShadow ( const BOOL  do_shadow  ) 

Definition at line 537 of file llhudtext.cpp.

References mDropShadow.

void LLHUDText::setFadeDistance ( F32  fade_distance,
F32  fade_range 
) [inline]

Definition at line 109 of file llhudtext.h.

References mFadeDistance, and mFadeRange.

void LLHUDText::setFont ( const LLFontGL font  ) 

Definition at line 547 of file llhudtext.cpp.

References mFontp.

Referenced by LLTracker::renderBeacon().

void LLHUDText::setHidden ( BOOL  hide  )  [inline]

Definition at line 123 of file llhudtext.h.

References mHidden.

Referenced by LLViewerObject::hideExtraDisplayItems().

void LLHUDText::setLabel ( const LLWString label  ) 

Definition at line 506 of file llhudtext.cpp.

References HUD_TEXT_MAX_WIDTH, HUD_TEXT_MAX_WIDTH_NO_BUBBLE, LLFontGL::maxDrawableChars(), mColor, mFontp, mLabelSegments, mUseBubble, LLFontGL::NORMAL, S32, TRUE, and utf8str_to_wstring().

void LLHUDText::setLabel ( const std::string &  label  ) 

Definition at line 501 of file llhudtext.cpp.

References utf8str_to_wstring().

void LLHUDText::setLOD ( S32  lod  )  [protected]

Definition at line 923 of file llhudtext.cpp.

References mLOD.

void LLHUDText::setMass ( F32  mass  )  [inline]

Definition at line 113 of file llhudtext.h.

References f, llmax(), and mMass.

void LLHUDText::setMaxLines ( S32  max_lines  )  [inline]

Definition at line 108 of file llhudtext.h.

References mMaxLines.

void LLHUDText::setOnHUDAttachment ( BOOL  on_hud  )  [inline]

Definition at line 124 of file llhudtext.h.

References LLHUDObject::mOnHUDAttachment.

void LLHUDText::setString ( const LLWString wstring  ) 

Definition at line 452 of file llhudtext.cpp.

References addLine(), mColor, and mTextSegments.

Referenced by LLTracker::renderBeacon(), LLViewerObjectList::renderObjectBeacons(), and setStringUTF8().

void LLHUDText::setStringUTF8 ( const std::string &  utf8string  ) 

Definition at line 447 of file llhudtext.cpp.

References setString(), and utf8str_to_wstring().

void LLHUDText::setTextAlignment ( ETextAlignment  alignment  )  [inline]

Definition at line 114 of file llhudtext.h.

References mTextAlignment.

void LLHUDText::setUseBubble ( BOOL  use_bubble  )  [inline]

Definition at line 119 of file llhudtext.h.

References mUseBubble.

void LLHUDText::setUsePixelSize ( const BOOL  use_pixel_size  ) 

Definition at line 568 of file llhudtext.cpp.

References mUsePixelSize.

void LLHUDText::setVertAlignment ( EVertAlignment  alignment  )  [inline]

Definition at line 115 of file llhudtext.h.

References mVertAlignment.

Referenced by LLTracker::renderBeacon().

void LLHUDText::setVisibleOffScreen ( BOOL  visible  )  [inline]

Definition at line 105 of file llhudtext.h.

References mVisibleOffScreen.

void LLHUDText::setZCompare ( const BOOL  zcompare  ) 

Definition at line 542 of file llhudtext.cpp.

References mZCompare.

Referenced by LLTracker::renderBeacon(), and LLViewerObjectList::renderObjectBeacons().

void LLHUDText::updateAll (  )  [static, protected]

Reimplemented from LLHUDObject.

Definition at line 786 of file llhudtext.cpp.

References BUFFER_SIZE, f, gCamera, LLStat::getCurrent(), LLCriticalDamp::getInterpolant(), LLViewerCamera::getVelocityStat(), LLViewerWindow::getWindowHeight(), LLViewerWindow::getWindowWidth(), gViewerWindow, i, lerp(), llmin(), LOD_0_SCREEN_COVERAGE, LOD_1_SCREEN_COVERAGE, LOD_2_SCREEN_COVERAGE, MAX_STABLE_CAMERA_VELOCITY, LLVector2::mV, LLVector2::normVec(), NUM_OVERLAP_ITERATIONS, POSITION_DAMPING_TC, S32, LLVector2::setVec(), SPRING_STRENGTH, sTextObjects, sVisibleHUDTextObjects, sVisibleTextObjects, VX, VY, and LLVector2::zero.

Referenced by LLHUDObject::updateAll().

LLVector2 LLHUDText::updateScreenPos ( LLVector2 offset_target  ) 

Definition at line 672 of file llhudtext.cpp.

References ALIGN_VERT_TOP, bottom, BUFFER_SIZE, CHAT_BAR_HEIGHT, f, FALSE, gCamera, gChatBar, LLCamera::getAspect(), LLViewerCamera::getPixelVectors(), LLView::getVisible(), LLViewerWindow::getWindowDisplayHeight(), LLViewerWindow::getWindowDisplayWidth(), gViewerWindow, llabs(), llclamp(), llmax(), MENU_BAR_HEIGHT, mHeight, mPositionAgent, mSoftScreenRect, LLVector2::mV, mVertAlignment, mVisibleOffScreen, mWidth, LLCoord::mX, LLCoord::mY, LLVector2::normVec(), LLViewerCamera::projectPosAgentToScreen(), S32, LLRectBase< Type >::setCenterAndSize(), LLRectBase< Type >::setLeftTopAndSize(), LLVector2::setVec(), STATUS_BAR_HEIGHT, VX, and VY.

Referenced by renderText().

void LLHUDText::updateSize (  ) 

Definition at line 735 of file llhudtext.cpp.

References f, LLFontGL::getLineHeight(), getMaxLines(), LLFrameTimer::getStarted(), height, HORIZONTAL_PADDING, HUD_TEXT_MAX_WIDTH, lerp(), llmax(), llmin(), mFontp, mHeight, mLabelSegments, mResizeTimer, mTextSegments, mWidth, S32, LLFrameTimer::start(), LLFrameTimer::stop(), u, VERTICAL_PADDING, and width.

void LLHUDText::updateVisibility (  ) 

Definition at line 578 of file llhudtext.cpp.

References f, FALSE, gAgent, gCamera, LLCoordFrame::getAtAxis(), LLCamera::getNear(), LLCoordFrame::getOrigin(), LLViewerCamera::getPixelVectors(), LLAgent::getPosAgentFromGlobal(), mDoFade, mFadeDistance, mFadeRange, mLastDistance, mLOD, mOffscreen, LLHUDObject::mOnHUDAttachment, mPositionAgent, LLHUDObject::mPositionGlobal, mPositionOffset, mRadius, LLHUDObject::mSourceObject, mTextSegments, LLVector2::mV, LLVector3::mV, LLHUDObject::mVisible, mVisibleOffScreen, LLVector3::normVec(), projected_vec(), LLCamera::sphereInFrustum(), sVisibleHUDTextObjects, sVisibleTextObjects, TRUE, VX, and VY.


Friends And Related Function Documentation

friend class LLHUDObject [friend]

Definition at line 117 of file llhudtext.h.


Member Data Documentation

LLColor4 LLHUDText::mBackgroundColor [private]

Definition at line 152 of file llhudtext.h.

Referenced by LLHUDText(), renderText(), and setBackgroundColor().

const LLFontGL* LLHUDText::mBoldFontp [private]

Definition at line 158 of file llhudtext.h.

Referenced by renderText().

LLColor4 LLHUDText::mColor [private]

Definition at line 151 of file llhudtext.h.

Referenced by LLHUDText(), renderText(), setColor(), setLabel(), and setString().

BOOL LLHUDText::mDoFade [private]

Definition at line 143 of file llhudtext.h.

Referenced by LLHUDText(), renderText(), setDoFade(), and updateVisibility().

BOOL LLHUDText::mDropShadow [private]

Definition at line 142 of file llhudtext.h.

Referenced by LLHUDText(), renderText(), and setDropShadow().

F32 LLHUDText::mFadeDistance [private]

Definition at line 145 of file llhudtext.h.

Referenced by LLHUDText(), renderText(), setFadeDistance(), and updateVisibility().

F32 LLHUDText::mFadeRange [private]

Definition at line 144 of file llhudtext.h.

Referenced by LLHUDText(), renderText(), setFadeDistance(), and updateVisibility().

const LLFontGL* LLHUDText::mFontp [private]

Definition at line 157 of file llhudtext.h.

Referenced by addLine(), renderText(), setFont(), setLabel(), and updateSize().

F32 LLHUDText::mHeight [private]

Definition at line 155 of file llhudtext.h.

Referenced by renderText(), updateScreenPos(), and updateSize().

BOOL LLHUDText::mHidden [private]

Definition at line 173 of file llhudtext.h.

Referenced by getHidden(), renderText(), and setHidden().

std::vector<LLHUDTextSegment> LLHUDText::mLabelSegments [private]

Definition at line 168 of file llhudtext.h.

Referenced by renderText(), setLabel(), and updateSize().

F32 LLHUDText::mLastDistance [private]

Definition at line 146 of file llhudtext.h.

Referenced by getDistance(), renderText(), and updateVisibility().

S32 LLHUDText::mLOD [private]

Definition at line 172 of file llhudtext.h.

Referenced by getLOD(), getMaxLines(), setLOD(), and updateVisibility().

F32 LLHUDText::mMass [private]

Definition at line 163 of file llhudtext.h.

Referenced by setMass().

S32 LLHUDText::mMaxLines [private]

Definition at line 164 of file llhudtext.h.

Referenced by getMaxLines(), and setMaxLines().

BOOL LLHUDText::mOffscreen [private]

Definition at line 150 of file llhudtext.h.

Referenced by LLHUDText(), renderText(), and updateVisibility().

S32 LLHUDText::mOffsetY [private]

Definition at line 165 of file llhudtext.h.

Referenced by renderText().

BOOL LLHUDText::mOnHUD [private]

Definition at line 140 of file llhudtext.h.

LLColor4U LLHUDText::mPickColor [private]

Definition at line 156 of file llhudtext.h.

LLVector3 LLHUDText::mPositionAgent [private]

Definition at line 160 of file llhudtext.h.

Referenced by renderText(), updateScreenPos(), and updateVisibility().

LLVector2 LLHUDText::mPositionOffset [private]

Definition at line 161 of file llhudtext.h.

Referenced by renderText(), and updateVisibility().

F32 LLHUDText::mRadius [private]

Definition at line 166 of file llhudtext.h.

Referenced by LLHUDText(), renderText(), and updateVisibility().

LLFrameTimer LLHUDText::mResizeTimer [private]

Definition at line 169 of file llhudtext.h.

Referenced by updateSize().

LLVector3 LLHUDText::mScale [private]

Definition at line 153 of file llhudtext.h.

LLRectf LLHUDText::mSoftScreenRect [private]

Definition at line 159 of file llhudtext.h.

Referenced by updateScreenPos().

LLVector2 LLHUDText::mTargetPositionOffset [private]

Definition at line 162 of file llhudtext.h.

ETextAlignment LLHUDText::mTextAlignment [private]

Definition at line 170 of file llhudtext.h.

Referenced by renderText(), and setTextAlignment().

std::vector<LLHUDTextSegment> LLHUDText::mTextSegments [private]

Definition at line 167 of file llhudtext.h.

Referenced by addLine(), clearString(), renderText(), setColor(), setString(), updateSize(), and updateVisibility().

BOOL LLHUDText::mUseBubble [private]

Definition at line 141 of file llhudtext.h.

Referenced by addLine(), renderText(), setLabel(), and setUseBubble().

BOOL LLHUDText::mUsePixelSize [private]

Definition at line 147 of file llhudtext.h.

Referenced by setUsePixelSize().

EVertAlignment LLHUDText::mVertAlignment [private]

Definition at line 171 of file llhudtext.h.

Referenced by renderText(), setVertAlignment(), and updateScreenPos().

BOOL LLHUDText::mVisibleOffScreen [private]

Definition at line 149 of file llhudtext.h.

Referenced by setVisibleOffScreen(), updateScreenPos(), and updateVisibility().

F32 LLHUDText::mWidth [private]

Definition at line 154 of file llhudtext.h.

Referenced by renderText(), updateScreenPos(), and updateSize().

BOOL LLHUDText::mZCompare [private]

Definition at line 148 of file llhudtext.h.

Referenced by LLHUDText(), renderText(), and setZCompare().

std::set< LLPointer< LLHUDText > > LLHUDText::sTextObjects [static, private]

Definition at line 175 of file llhudtext.h.

Referenced by LLHUDText(), markDead(), reshape(), and updateAll().

std::vector< LLPointer< LLHUDText > > LLHUDText::sVisibleHUDTextObjects [static, private]

Definition at line 177 of file llhudtext.h.

Referenced by renderAllHUD(), updateAll(), and updateVisibility().

std::vector< LLPointer< LLHUDText > > LLHUDText::sVisibleTextObjects [static, private]

Definition at line 176 of file llhudtext.h.

Referenced by addPickable(), updateAll(), and updateVisibility().


The documentation for this class was generated from the following files:
Generated on Thu Jul 1 06:11:24 2010 for Second Life Viewer by  doxygen 1.4.7