PageRenderTime 3ms CodeModel.GetById 0ms RepoModel.GetById 0ms 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
Possible License(s): LGPL-2.1
  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. #ifndef LL_LLAPPEARANCE_H
  27. #define LL_LLAPPEARANCE_H
  28. #include "lluuid.h"
  29. class LLAppearance
  30. {
  31. public:
  32. LLAppearance() {}
  33. ~LLAppearance() { mParamMap.clear(); }
  34. void addParam( S32 id, F32 value ) { mParamMap[id] = value; }
  35. F32 getParam( S32 id, F32 defval ) { return get_if_there(mParamMap, id, defval ); }
  36. void addTexture( S32 te, const LLUUID& uuid ) { if( te < LLVOAvatarDefines::TEX_NUM_INDICES ) mTextures[te] = uuid; }
  37. const LLUUID& getTexture( S32 te ) { return ( te < LLVOAvatarDefines::TEX_NUM_INDICES ) ? mTextures[te] : LLUUID::null; }
  38. void clear() { mParamMap.clear(); for( S32 i=0; i<LLVOAvatarDefines::TEX_NUM_INDICES; i++ ) mTextures[i].setNull(); }
  39. typedef std::map<S32, F32> param_map_t;
  40. param_map_t mParamMap;
  41. LLUUID mTextures[LLVOAvatarDefines::TEX_NUM_INDICES];
  42. };
  43. #endif // LL_LLAPPEARANCE_H