PageRenderTime 24ms CodeModel.GetById 14ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llhudobject.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 123 lines | 75 code | 19 blank | 29 comment | 0 complexity | b3985383b9f4d731f4a3a6ee7df303b4 MD5 | raw file
  1/** 
  2 * @file llhudobject.h
  3 * @brief LLHUDObject class definition
  4 *
  5 * $LicenseInfo:firstyear=2002&license=viewerlgpl$
  6 * Second Life Viewer Source Code
  7 * Copyright (C) 2010, Linden Research, Inc.
  8 * 
  9 * This library is free software; you can redistribute it and/or
 10 * modify it under the terms of the GNU Lesser General Public
 11 * License as published by the Free Software Foundation;
 12 * version 2.1 of the License only.
 13 * 
 14 * This library is distributed in the hope that it will be useful,
 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 17 * Lesser General Public License for more details.
 18 * 
 19 * You should have received a copy of the GNU Lesser General Public
 20 * License along with this library; if not, write to the Free Software
 21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 22 * 
 23 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
 24 * $/LicenseInfo$
 25 */
 26
 27#ifndef LL_LLHUDOBJECT_H
 28#define LL_LLHUDOBJECT_H
 29
 30/**
 31 * Base class and manager for in-world 2.5D non-interactive objects
 32 */
 33
 34#include "llpointer.h"
 35
 36#include "v4color.h"
 37#include "v3math.h"
 38#include "v3dmath.h"
 39#include "lldrawpool.h"		// TODO: eliminate, unused below
 40#include <list>
 41
 42class LLViewerCamera;
 43class LLFontGL;
 44class LLFace;
 45class LLViewerObject;
 46class LLHUDEffect;
 47
 48class LLHUDObject : public LLRefCount
 49{
 50public:
 51	virtual void markDead();
 52	virtual F32 getDistance() const;
 53	virtual void setSourceObject(LLViewerObject* objectp);
 54	virtual void setTargetObject(LLViewerObject* objectp);
 55	virtual LLViewerObject* getSourceObject() { return mSourceObject; }
 56	virtual LLViewerObject* getTargetObject() { return mTargetObject; }
 57
 58	void setPositionGlobal(const LLVector3d &position_global);
 59	void setPositionAgent(const LLVector3 &position_agent);
 60
 61	BOOL isVisible() const { return mVisible; }
 62
 63	U8 getType() const { return mType; }
 64
 65	LLVector3d getPositionGlobal() const { return mPositionGlobal; }
 66
 67	static LLHUDObject *addHUDObject(const U8 type);
 68	static LLHUDEffect *addHUDEffect(const U8 type);
 69	static void updateAll();
 70	static void renderAll();
 71	static void renderAllForSelect();
 72	static void renderAllForTimer();
 73
 74	// Some objects may need to update when window shape changes
 75	static void reshapeAll();
 76
 77	static void cleanupHUDObjects();
 78
 79	enum
 80	{
 81		LL_HUD_TEXT,
 82		LL_HUD_ICON,
 83		LL_HUD_CONNECTOR,
 84		LL_HUD_FLEXIBLE_OBJECT,			// Ventrella
 85		LL_HUD_ANIMAL_CONTROLS,			// Ventrella
 86		LL_HUD_LOCAL_ANIMATION_OBJECT,	// Ventrella
 87		LL_HUD_CLOTH,					// Ventrella
 88		LL_HUD_EFFECT_BEAM,
 89		LL_HUD_EFFECT_GLOW,
 90		LL_HUD_EFFECT_POINT,
 91		LL_HUD_EFFECT_TRAIL,
 92		LL_HUD_EFFECT_SPHERE,
 93		LL_HUD_EFFECT_SPIRAL,
 94		LL_HUD_EFFECT_EDIT,
 95		LL_HUD_EFFECT_LOOKAT,
 96		LL_HUD_EFFECT_POINTAT,
 97		LL_HUD_EFFECT_VOICE_VISUALIZER,	// Ventrella
 98		LL_HUD_NAME_TAG,
 99		LL_HUD_EFFECT_BLOB
100	};
101protected:
102	static void sortObjects();
103
104	LLHUDObject(const U8 type);
105	~LLHUDObject();
106
107	virtual void render() = 0;
108	virtual void renderForTimer() {};
109	
110protected:
111	U8				mType;
112	BOOL			mDead;
113	BOOL			mVisible;
114	LLVector3d		mPositionGlobal;
115	LLPointer<LLViewerObject> mSourceObject;
116	LLPointer<LLViewerObject> mTargetObject;
117
118private:
119	typedef std::list<LLPointer<LLHUDObject> > hud_object_list_t;
120	static hud_object_list_t sHUDObjects;
121};
122
123#endif // LL_LLHUDOBJECT_H