PageRenderTime 130ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 1ms

/indra/newview/llfloateranimpreview.h

https://bitbucket.org/lindenlab/viewer-beta/
C Header | 131 lines | 88 code | 18 blank | 25 comment | 0 complexity | 77c2bdc3b5e10ea345e7ecc1a9312ead MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llfloateranimpreview.h
  3. * @brief LLFloaterAnimPreview class definition
  4. *
  5. * $LicenseInfo:firstyear=2004&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_LLFLOATERANIMPREVIEW_H
  27. #define LL_LLFLOATERANIMPREVIEW_H
  28. #include "llassettype.h"
  29. #include "llfloaternamedesc.h"
  30. #include "lldynamictexture.h"
  31. #include "llcharacter.h"
  32. #include "llquaternion.h"
  33. class LLVOAvatar;
  34. class LLViewerJointMesh;
  35. class LLPreviewAnimation : public LLViewerDynamicTexture
  36. {
  37. protected:
  38. virtual ~LLPreviewAnimation();
  39. public:
  40. LLPreviewAnimation(S32 width, S32 height);
  41. /*virtual*/ S8 getType() const ;
  42. BOOL render();
  43. void requestUpdate();
  44. void rotate(F32 yaw_radians, F32 pitch_radians);
  45. void zoom(F32 zoom_delta);
  46. void setZoom(F32 zoom_amt);
  47. void pan(F32 right, F32 up);
  48. virtual BOOL needsUpdate() { return mNeedsUpdate; }
  49. LLVOAvatar* getDummyAvatar() { return mDummyAvatar; }
  50. protected:
  51. BOOL mNeedsUpdate;
  52. F32 mCameraDistance;
  53. F32 mCameraYaw;
  54. F32 mCameraPitch;
  55. F32 mCameraZoom;
  56. LLVector3 mCameraOffset;
  57. LLVector3 mCameraRelPos;
  58. LLPointer<LLVOAvatar> mDummyAvatar;
  59. };
  60. class LLFloaterAnimPreview : public LLFloaterNameDesc
  61. {
  62. public:
  63. LLFloaterAnimPreview(const std::string& filename);
  64. virtual ~LLFloaterAnimPreview();
  65. BOOL postBuild();
  66. BOOL handleMouseDown(S32 x, S32 y, MASK mask);
  67. BOOL handleMouseUp(S32 x, S32 y, MASK mask);
  68. BOOL handleHover(S32 x, S32 y, MASK mask);
  69. BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
  70. void onMouseCaptureLost();
  71. void refresh();
  72. void onBtnPlay();
  73. void onBtnPause();
  74. void onBtnStop();
  75. void onSliderMove();
  76. void onCommitBaseAnim();
  77. void onCommitLoop();
  78. void onCommitLoopIn();
  79. void onCommitLoopOut();
  80. bool validateLoopIn(const LLSD& data);
  81. bool validateLoopOut(const LLSD& data);
  82. void onCommitName();
  83. void onCommitHandPose();
  84. void onCommitEmote();
  85. void onCommitPriority();
  86. void onCommitEaseIn();
  87. void onCommitEaseOut();
  88. bool validateEaseIn(const LLSD& data);
  89. bool validateEaseOut(const LLSD& data);
  90. static void onBtnOK(void*);
  91. static void onSaveComplete(const LLUUID& asset_uuid,
  92. LLAssetType::EType type,
  93. void* user_data,
  94. S32 status, LLExtStat ext_status);
  95. private:
  96. void setAnimCallbacks() ;
  97. protected:
  98. void draw();
  99. void resetMotion();
  100. LLPointer< LLPreviewAnimation > mAnimPreview;
  101. S32 mLastMouseX;
  102. S32 mLastMouseY;
  103. LLButton* mPlayButton;
  104. LLButton* mPauseButton;
  105. LLButton* mStopButton;
  106. LLRect mPreviewRect;
  107. LLRectf mPreviewImageRect;
  108. LLAssetID mMotionID;
  109. LLTransactionID mTransactionID;
  110. LLAnimPauseRequest mPauseRequest;
  111. std::map<std::string, LLUUID> mIDList;
  112. };
  113. #endif // LL_LLFLOATERANIMPREVIEW_H