PageRenderTime 27ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/newview/lllocaltextureobject.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 87 lines | 41 code | 15 blank | 31 comment | 0 complexity | bb002047c68371cca65bf6de45a24a8a MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file lllocaltextureobject.h
  3. * @brief LLLocalTextureObject class header file
  4. *
  5. * $LicenseInfo:firstyear=2009&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_LOCALTEXTUREOBJECT_H
  27. #define LL_LOCALTEXTUREOBJECT_H
  28. #include <boost/shared_ptr.hpp>
  29. #include "llviewertexture.h"
  30. class LLUUID;
  31. class LLTexLayer;
  32. class LLTextureEntry;
  33. class LLTexLayerTemplate;
  34. class LLWearable;
  35. // Stores all relevant information for a single texture
  36. // assumed to have ownership of all objects referred to -
  37. // will delete objects when being replaced or if object is destroyed.
  38. class LLLocalTextureObject
  39. {
  40. public:
  41. LLLocalTextureObject();
  42. LLLocalTextureObject(LLViewerFetchedTexture* image, const LLUUID& id);
  43. LLLocalTextureObject(const LLLocalTextureObject& lto);
  44. ~LLLocalTextureObject();
  45. LLViewerFetchedTexture* getImage() const;
  46. LLTexLayer* getTexLayer(U32 index) const;
  47. LLTexLayer* getTexLayer(const std::string &name);
  48. U32 getNumTexLayers() const;
  49. LLUUID getID() const;
  50. S32 getDiscard() const;
  51. BOOL getBakedReady() const;
  52. void setImage(LLViewerFetchedTexture* new_image);
  53. BOOL setTexLayer(LLTexLayer *new_tex_layer, U32 index);
  54. BOOL addTexLayer(LLTexLayer *new_tex_layer, LLWearable *wearable);
  55. BOOL addTexLayer(LLTexLayerTemplate *new_tex_layer, LLWearable *wearable);
  56. BOOL removeTexLayer(U32 index);
  57. void setID(LLUUID new_id);
  58. void setDiscard(S32 new_discard);
  59. void setBakedReady(BOOL ready);
  60. protected:
  61. private:
  62. LLPointer<LLViewerFetchedTexture> mImage;
  63. // NOTE: LLLocalTextureObject should be the exclusive owner of mTexEntry and mTexLayer
  64. // using shared pointers here only for smart assignment & cleanup
  65. // do NOT create new shared pointers to these objects, or keep pointers to them around
  66. typedef std::vector<LLTexLayer*> tex_layer_vec_t;
  67. tex_layer_vec_t mTexLayers;
  68. LLUUID mID;
  69. BOOL mIsBakedReady;
  70. S32 mDiscard;
  71. };
  72. #endif // LL_LOCALTEXTUREOBJECT_H