PageRenderTime 50ms CodeModel.GetById 37ms app.highlight 9ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llappearance.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 51 lines | 18 code | 8 blank | 25 comment | 2 complexity | ae097a871250dda2d0df2979e83951fd MD5 | raw file
 1/** 
 2 * @file llappearance.h
 3 * @brief LLAppearance 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_LLAPPEARANCE_H
28#define LL_LLAPPEARANCE_H
29
30#include "lluuid.h"
31
32class LLAppearance
33{
34public:
35	LLAppearance()										{}
36	~LLAppearance()										{ mParamMap.clear(); } 
37
38	void	addParam( S32 id, F32 value )				{ mParamMap[id] = value; }
39	F32		getParam( S32 id, F32 defval )				{ return get_if_there(mParamMap, id, defval ); }
40
41	void	addTexture( S32 te, const LLUUID& uuid )	{ if( te < LLVOAvatarDefines::TEX_NUM_INDICES ) mTextures[te] = uuid; }
42	const LLUUID& getTexture( S32 te )					{ return ( te < LLVOAvatarDefines::TEX_NUM_INDICES ) ? mTextures[te] : LLUUID::null; }
43	
44	void	clear()										{ mParamMap.clear(); for( S32 i=0; i<LLVOAvatarDefines::TEX_NUM_INDICES; i++ ) mTextures[i].setNull(); }
45
46	typedef std::map<S32, F32> param_map_t;
47	param_map_t mParamMap;
48	LLUUID	mTextures[LLVOAvatarDefines::TEX_NUM_INDICES];
49};
50
51#endif  // LL_LLAPPEARANCE_H