PageRenderTime 32ms CodeModel.GetById 22ms app.highlight 6ms RepoModel.GetById 2ms app.codeStats 0ms

/indra/newview/lltexglobalcolor.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 83 lines | 44 code | 12 blank | 27 comment | 0 complexity | 7568707f8d39ba6150ef5592c6d0522c MD5 | raw file
 1/** 
 2 * @file lltexglobalcolor.h
 3 * @brief This is global texture color info used by llvoavatar.
 4 *
 5 * $LicenseInfo:firstyear=2008&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_LLTEXGLOBALCOLOR_H
28#define LL_LLTEXGLOBALCOLOR_H
29
30#include "lltexlayer.h"
31#include "lltexlayerparams.h"
32
33class LLVOAvatar;
34class LLWearable;
35class LLTexGlobalColorInfo;
36
37class LLTexGlobalColor
38{
39public:
40	LLTexGlobalColor( LLVOAvatar* avatar );
41	~LLTexGlobalColor();
42
43	LLTexGlobalColorInfo*	getInfo() const { return mInfo; }
44	//   This sets mInfo and calls initialization functions
45	BOOL					setInfo(LLTexGlobalColorInfo *info);
46	
47	LLVOAvatar*				getAvatar()	const			   	{ return mAvatar; }
48	LLColor4				getColor() const;
49	const std::string&		getName() const;
50
51private:
52	param_color_list_t		mParamGlobalColorList;
53	LLVOAvatar*				mAvatar;  // just backlink, don't LLPointer 
54	LLTexGlobalColorInfo	*mInfo;
55};
56
57// Used by llvoavatar to determine skin/eye/hair color.
58class LLTexGlobalColorInfo
59{
60	friend class LLTexGlobalColor;
61public:
62	LLTexGlobalColorInfo();
63	~LLTexGlobalColorInfo();
64
65	BOOL parseXml(LLXmlTreeNode* node);
66
67private:
68	param_color_info_list_t		mParamColorInfoList;
69	std::string				mName;
70};
71
72class LLTexParamGlobalColor : public LLTexLayerParamColor
73{
74public:
75	LLTexParamGlobalColor(LLTexGlobalColor *tex_color);
76	/*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const;
77protected:
78	/*virtual*/ void onGlobalColorChanged(bool upload_bake);
79private:
80	LLTexGlobalColor*		mTexGlobalColor;
81};
82
83#endif