PageRenderTime 45ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/newview/llviewervisualparam.h

https://bitbucket.org/lindenlab/viewer-beta/
C Header | 109 lines | 52 code | 18 blank | 39 comment | 0 complexity | 70977c13e0f41855e9d93b893c35b5be MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llviewervisualparam.h
  3. * @brief viewer side visual params (with data file parsing)
  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_LLViewerVisualParam_H
  27. #define LL_LLViewerVisualParam_H
  28. #include "v3math.h"
  29. #include "llstring.h"
  30. #include "llvisualparam.h"
  31. class LLWearable;
  32. //-----------------------------------------------------------------------------
  33. // LLViewerVisualParamInfo
  34. //-----------------------------------------------------------------------------
  35. class LLViewerVisualParamInfo : public LLVisualParamInfo
  36. {
  37. friend class LLViewerVisualParam;
  38. public:
  39. LLViewerVisualParamInfo();
  40. /*virtual*/ ~LLViewerVisualParamInfo();
  41. /*virtual*/ BOOL parseXml(LLXmlTreeNode* node);
  42. /*virtual*/ void toStream(std::ostream &out);
  43. protected:
  44. S32 mWearableType;
  45. BOOL mCrossWearable;
  46. std::string mEditGroup;
  47. F32 mCamDist;
  48. F32 mCamAngle; // degrees
  49. F32 mCamElevation;
  50. F32 mEditGroupDisplayOrder;
  51. BOOL mShowSimple; // show edit controls when in "simple ui" mode?
  52. F32 mSimpleMin; // when in simple UI, apply this minimum, range 0.f to 100.f
  53. F32 mSimpleMax; // when in simple UI, apply this maximum, range 0.f to 100.f
  54. };
  55. //-----------------------------------------------------------------------------
  56. // LLViewerVisualParam
  57. // VIRTUAL CLASS
  58. // a viewer side interface class for a generalized parametric modification of the avatar mesh
  59. //-----------------------------------------------------------------------------
  60. class LLViewerVisualParam : public LLVisualParam
  61. {
  62. public:
  63. LLViewerVisualParam();
  64. /*virtual*/ ~LLViewerVisualParam(){};
  65. // Special: These functions are overridden by child classes
  66. LLViewerVisualParamInfo *getInfo() const { return (LLViewerVisualParamInfo*)mInfo; };
  67. // This sets mInfo and calls initialization functions
  68. BOOL setInfo(LLViewerVisualParamInfo *info);
  69. virtual LLViewerVisualParam* cloneParam(LLWearable* wearable) const = 0;
  70. // LLVisualParam Virtual functions
  71. ///*virtual*/ BOOL parseData(LLXmlTreeNode* node);
  72. // New Virtual functions
  73. virtual F32 getTotalDistortion() = 0;
  74. virtual const LLVector3& getAvgDistortion() = 0;
  75. virtual F32 getMaxDistortion() = 0;
  76. virtual LLVector3 getVertexDistortion(S32 index, LLPolyMesh *mesh) = 0;
  77. virtual const LLVector3* getFirstDistortion(U32 *index, LLPolyMesh **mesh) = 0;
  78. virtual const LLVector3* getNextDistortion(U32 *index, LLPolyMesh **mesh) = 0;
  79. // interface methods
  80. F32 getDisplayOrder() const { return getInfo()->mEditGroupDisplayOrder; }
  81. S32 getWearableType() const { return getInfo()->mWearableType; }
  82. const std::string& getEditGroup() const { return getInfo()->mEditGroup; }
  83. F32 getCameraDistance() const { return getInfo()->mCamDist; }
  84. F32 getCameraAngle() const { return getInfo()->mCamAngle; } // degrees
  85. F32 getCameraElevation() const { return getInfo()->mCamElevation; }
  86. BOOL getShowSimple() const { return getInfo()->mShowSimple; }
  87. F32 getSimpleMin() const { return getInfo()->mSimpleMin; }
  88. F32 getSimpleMax() const { return getInfo()->mSimpleMax; }
  89. BOOL getCrossWearable() const { return getInfo()->mCrossWearable; }
  90. };
  91. #endif // LL_LLViewerVisualParam_H