PageRenderTime 61ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/newview/lltoolmorph.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 117 lines | 69 code | 18 blank | 30 comment | 0 complexity | b9f128efa9349453172c2a7b36056fa5 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file lltoolmorph.h
  3. * @brief A tool to select object faces.
  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_LLTOOLMORPH_H
  27. #define LL_LLTOOLMORPH_H
  28. #include "lltool.h"
  29. #include "m4math.h"
  30. #include "v2math.h"
  31. #include "lldynamictexture.h"
  32. #include "llundo.h"
  33. #include "lltextbox.h"
  34. #include "llstrider.h"
  35. #include "llviewervisualparam.h"
  36. #include "llframetimer.h"
  37. #include "llviewertexture.h"
  38. class LLViewerJointMesh;
  39. class LLPolyMesh;
  40. class LLViewerObject;
  41. class LLJoint;
  42. //-----------------------------------------------------------------------------
  43. // LLVisualParamHint
  44. //-----------------------------------------------------------------------------
  45. class LLVisualParamHint : public LLViewerDynamicTexture
  46. {
  47. protected:
  48. virtual ~LLVisualParamHint();
  49. public:
  50. LLVisualParamHint(
  51. S32 pos_x, S32 pos_y,
  52. S32 width, S32 height,
  53. LLViewerJointMesh *mesh,
  54. LLViewerVisualParam *param,
  55. LLWearable *wearable,
  56. F32 param_weight,
  57. LLJoint* jointp);
  58. /*virtual*/ S8 getType() const ;
  59. BOOL needsRender();
  60. void preRender(BOOL clear_depth);
  61. BOOL render();
  62. void requestUpdate( S32 delay_frames ) {mNeedsUpdate = TRUE; mDelayFrames = delay_frames; }
  63. void setUpdateDelayFrames( S32 delay_frames ) { mDelayFrames = delay_frames; }
  64. void draw(F32 alpha);
  65. LLViewerVisualParam* getVisualParam() { return mVisualParam; }
  66. F32 getVisualParamWeight() { return mVisualParamWeight; }
  67. BOOL getVisible() { return mIsVisible; }
  68. void setAllowsUpdates( BOOL b ) { mAllowsUpdates = b; }
  69. const LLRect& getRect() { return mRect; }
  70. // Requests updates for all instances (excluding two possible exceptions) Grungy but efficient.
  71. static void requestHintUpdates( LLVisualParamHint* exception1 = NULL, LLVisualParamHint* exception2 = NULL );
  72. protected:
  73. BOOL mNeedsUpdate; // does this texture need to be re-rendered?
  74. BOOL mIsVisible; // is this distortion hint visible?
  75. LLViewerJointMesh* mJointMesh; // mesh that this distortion applies to
  76. LLViewerVisualParam* mVisualParam; // visual param applied by this hint
  77. LLWearable* mWearablePtr; // wearable we're editing
  78. F32 mVisualParamWeight; // weight for this visual parameter
  79. BOOL mAllowsUpdates; // updates are blocked unless this is true
  80. S32 mDelayFrames; // updates are blocked for this many frames
  81. LLRect mRect;
  82. F32 mLastParamWeight;
  83. LLJoint* mCamTargetJoint; // joint to target with preview camera
  84. LLUIImagePtr mBackgroundp;
  85. typedef std::set< LLVisualParamHint* > instance_list_t;
  86. static instance_list_t sInstances;
  87. };
  88. // this class resets avatar data at the end of an update cycle
  89. class LLVisualParamReset : public LLViewerDynamicTexture
  90. {
  91. protected:
  92. /*virtual */ ~LLVisualParamReset(){}
  93. public:
  94. LLVisualParamReset();
  95. /*virtual */ BOOL render();
  96. /*virtual*/ S8 getType() const ;
  97. static BOOL sDirty;
  98. };
  99. #endif