PageRenderTime 19ms CodeModel.GetById 7ms app.highlight 10ms RepoModel.GetById 1ms app.codeStats 0ms

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