llviewervisualparam.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /**
  2. * @file llviewervisualparam.h
  3. * @brief viewer side visual params (with data file parsing)
  4. *
  5. * $LicenseInfo:firstyear=2001&license=viewergpl$
  6. *
  7. * Copyright (c) 2001-2009, Linden Research, Inc.
  8. *
  9. * Second Life Viewer Source Code
  10. * The source code in this file ("Source Code") is provided by Linden Lab
  11. * to you under the terms of the GNU General Public License, version 2.0
  12. * ("GPL"), unless you have obtained a separate licensing agreement
  13. * ("Other License"), formally executed by you and Linden Lab. Terms of
  14. * the GPL can be found in doc/GPL-license.txt in this distribution, or
  15. * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
  16. *
  17. * There are special exceptions to the terms and conditions of the GPL as
  18. * it is applied to this Source Code. View the full text of the exception
  19. * in the file doc/FLOSS-exception.txt in this software distribution, or
  20. * online at
  21. * http://secondlifegrid.net/programs/open_source/licensing/flossexception
  22. *
  23. * By copying, modifying or distributing this software, you acknowledge
  24. * that you have read and understood your obligations described above,
  25. * and agree to abide by those obligations.
  26. *
  27. * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
  28. * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
  29. * COMPLETENESS OR PERFORMANCE.
  30. * $/LicenseInfo$
  31. */
  32. #ifndef LL_LLVIEWERVISUALPARAM_H
  33. #define LL_LLVIEWERVISUALPARAM_H
  34. #include "llvisualparam.h"
  35. class LLWearable;
  36. //-----------------------------------------------------------------------------
  37. // LLViewerVisualParamInfo
  38. //-----------------------------------------------------------------------------
  39. class LLViewerVisualParamInfo : public LLVisualParamInfo
  40. {
  41. friend class LLViewerVisualParam;
  42. public:
  43. LLViewerVisualParamInfo();
  44. bool parseXml(LLXmlTreeNode* node) override;
  45. protected:
  46. std::string mEditGroup;
  47. S32 mWearableType;
  48. F32 mCamDist;
  49. F32 mCamAngle; // degrees
  50. F32 mCamElevation;
  51. F32 mEditGroupDisplayOrder;
  52. // When in simple UI, apply this minimum, range 0.f to 100.f
  53. F32 mSimpleMin;
  54. // When in simple UI, apply this maximum, range 0.f to 100.f
  55. F32 mSimpleMax;
  56. bool mCrossWearable;
  57. };
  58. //-----------------------------------------------------------------------------
  59. // LLViewerVisualParam - Virtual class
  60. // A viewer side interface class for a generalized parametric modification of
  61. // the avatar mesh
  62. //-----------------------------------------------------------------------------
  63. class alignas(16) LLViewerVisualParam : public LLVisualParam
  64. {
  65. protected:
  66. LLViewerVisualParam(const LLViewerVisualParam& other);
  67. public:
  68. LLViewerVisualParam();
  69. LL_INLINE LLViewerVisualParam* asViewerVisualParam() override
  70. {
  71. return this;
  72. }
  73. // Special: These functions are overridden by child classes
  74. LL_INLINE LLViewerVisualParamInfo* getInfo() const
  75. {
  76. return (LLViewerVisualParamInfo*)mInfo;
  77. }
  78. // This sets mInfo and calls initialization functions
  79. bool setInfo(LLViewerVisualParamInfo* info);
  80. virtual LLViewerVisualParam* cloneParam(LLWearable* wearable) const = 0;
  81. #if 0 // Unused methods
  82. // New Virtual functions
  83. virtual F32 getTotalDistortion() = 0;
  84. virtual const LLVector4a& getAvgDistortion() = 0;
  85. virtual F32 getMaxDistortion() = 0;
  86. virtual LLVector4a getVertexDistortion(S32 index, LLPolyMesh* mesh) = 0;
  87. virtual const LLVector4a* getFirstDistortion(U32* idx, LLPolyMesh** m) = 0;
  88. virtual const LLVector4a* getNextDistortion(U32* idx, LLPolyMesh** m) = 0;
  89. #endif
  90. // Interface methods
  91. LL_INLINE F32 getDisplayOrder() const { return getInfo()->mEditGroupDisplayOrder; }
  92. LL_INLINE S32 getWearableType() const { return getInfo()->mWearableType; }
  93. LL_INLINE const std::string& getEditGroup() const
  94. {
  95. return getInfo()->mEditGroup;
  96. }
  97. LL_INLINE F32 getCameraDistance() const { return getInfo()->mCamDist; }
  98. LL_INLINE F32 getCameraAngle() const { return getInfo()->mCamAngle; }
  99. LL_INLINE F32 getCameraElevation() const { return getInfo()->mCamElevation; }
  100. LL_INLINE F32 getSimpleMin() const { return getInfo()->mSimpleMin; }
  101. LL_INLINE F32 getSimpleMax() const { return getInfo()->mSimpleMax; }
  102. LL_INLINE bool getCrossWearable() const { return getInfo()->mCrossWearable; }
  103. };
  104. #endif // LL_LLVIEWERVISUALPARAM_H