/indra/newview/llvlcomposition.h

https://bitbucket.org/lindenlab/viewer-beta/ · C++ Header · 86 lines · 45 code · 13 blank · 28 comment · 0 complexity · dcfe93014daf5777de27f2aa8c4549f3 MD5 · raw file

  1. /**
  2. * @file llvlcomposition.h
  3. * @brief Viewer-side representation of a composition layer...
  4. *
  5. * $LicenseInfo:firstyear=2001&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_LLVLCOMPOSITION_H
  27. #define LL_LLVLCOMPOSITION_H
  28. #include "llviewerlayer.h"
  29. #include "llviewertexture.h"
  30. class LLSurface;
  31. class LLVLComposition : public LLViewerLayer
  32. {
  33. public:
  34. LLVLComposition(LLSurface *surfacep, const U32 width, const F32 scale);
  35. /*virtual*/ ~LLVLComposition();
  36. void setSurface(LLSurface *surfacep);
  37. // Viewer side hack to generate composition values
  38. BOOL generateHeights(const F32 x, const F32 y, const F32 width, const F32 height);
  39. BOOL generateComposition();
  40. // Generate texture from composition values.
  41. BOOL generateTexture(const F32 x, const F32 y, const F32 width, const F32 height);
  42. // Use these as indeces ito the get/setters below that use 'corner'
  43. enum ECorner
  44. {
  45. SOUTHWEST = 0,
  46. SOUTHEAST = 1,
  47. NORTHWEST = 2,
  48. NORTHEAST = 3,
  49. CORNER_COUNT = 4
  50. };
  51. LLUUID getDetailTextureID(S32 corner);
  52. LLViewerFetchedTexture* getDetailTexture(S32 corner);
  53. F32 getStartHeight(S32 corner);
  54. F32 getHeightRange(S32 corner);
  55. void setDetailTextureID(S32 corner, const LLUUID& id);
  56. void setStartHeight(S32 corner, F32 start_height);
  57. void setHeightRange(S32 corner, F32 range);
  58. friend class LLVOSurfacePatch;
  59. friend class LLDrawPoolTerrain;
  60. void setParamsReady() { mParamsReady = TRUE; }
  61. BOOL getParamsReady() const { return mParamsReady; }
  62. protected:
  63. BOOL mParamsReady;
  64. LLSurface *mSurfacep;
  65. BOOL mTexturesLoaded;
  66. LLPointer<LLViewerFetchedTexture> mDetailTextures[CORNER_COUNT];
  67. LLPointer<LLImageRaw> mRawImages[CORNER_COUNT];
  68. F32 mStartHeight[CORNER_COUNT];
  69. F32 mHeightRange[CORNER_COUNT];
  70. F32 mTexScaleX;
  71. F32 mTexScaleY;
  72. };
  73. #endif //LL_LLVLCOMPOSITION_H