llfloateranimpreview.h
上传用户:king477883
上传日期:2021-03-01
资源大小:9553k
文件大小:4k
源码类别:

游戏引擎

开发平台:

C++ Builder

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