PageRenderTime 21ms CodeModel.GetById 11ms app.highlight 7ms RepoModel.GetById 1ms 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
  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
 27#ifndef LL_LLTOOLMORPH_H
 28#define LL_LLTOOLMORPH_H
 29
 30#include "lltool.h"
 31#include "m4math.h"
 32#include "v2math.h"
 33#include "lldynamictexture.h"
 34#include "llundo.h"
 35#include "lltextbox.h"
 36#include "llstrider.h"
 37#include "llviewervisualparam.h"
 38#include "llframetimer.h"
 39#include "llviewertexture.h"
 40
 41class LLViewerJointMesh;
 42class LLPolyMesh;
 43class LLViewerObject;
 44class LLJoint;
 45
 46//-----------------------------------------------------------------------------
 47// LLVisualParamHint
 48//-----------------------------------------------------------------------------
 49class LLVisualParamHint : public LLViewerDynamicTexture
 50{
 51protected:
 52	virtual ~LLVisualParamHint();
 53
 54public:
 55	LLVisualParamHint(
 56		S32 pos_x, S32 pos_y,
 57		S32 width, S32 height, 
 58		LLViewerJointMesh *mesh, 
 59		LLViewerVisualParam *param,
 60		LLWearable *wearable,
 61		F32 param_weight, 
 62		LLJoint* jointp);	
 63
 64	/*virtual*/ S8 getType() const ;
 65
 66	BOOL					needsRender();
 67	void					preRender(BOOL clear_depth);
 68	BOOL					render();
 69	void					requestUpdate( S32 delay_frames ) {mNeedsUpdate = TRUE; mDelayFrames = delay_frames; }
 70	void					setUpdateDelayFrames( S32 delay_frames ) { mDelayFrames = delay_frames; }
 71	void					draw(F32 alpha);
 72	
 73	LLViewerVisualParam*	getVisualParam() { return mVisualParam; }
 74	F32						getVisualParamWeight() { return mVisualParamWeight; }
 75	BOOL					getVisible() { return mIsVisible; }
 76
 77	void					setAllowsUpdates( BOOL b ) { mAllowsUpdates = b; }
 78
 79	const LLRect&			getRect()	{ return mRect; }
 80
 81	// Requests updates for all instances (excluding two possible exceptions)  Grungy but efficient.
 82	static void				requestHintUpdates( LLVisualParamHint* exception1 = NULL, LLVisualParamHint* exception2 = NULL );
 83
 84protected:
 85	BOOL					mNeedsUpdate;		// does this texture need to be re-rendered?
 86	BOOL					mIsVisible;			// is this distortion hint visible?
 87	LLViewerJointMesh*		mJointMesh;			// mesh that this distortion applies to
 88	LLViewerVisualParam*	mVisualParam;		// visual param applied by this hint
 89	LLWearable*				mWearablePtr;		// wearable we're editing
 90	F32						mVisualParamWeight;		// weight for this visual parameter
 91	BOOL					mAllowsUpdates;		// updates are blocked unless this is true
 92	S32						mDelayFrames;		// updates are blocked for this many frames
 93	LLRect					mRect;
 94	F32						mLastParamWeight;
 95	LLJoint*				mCamTargetJoint;	// joint to target with preview camera
 96
 97	LLUIImagePtr mBackgroundp;
 98
 99	typedef std::set< LLVisualParamHint* > instance_list_t;
100	static instance_list_t sInstances;
101};
102
103// this class resets avatar data at the end of an update cycle
104class LLVisualParamReset : public LLViewerDynamicTexture
105{
106protected:
107	/*virtual */ ~LLVisualParamReset(){}
108public:
109	LLVisualParamReset();
110	/*virtual */ BOOL render();
111	/*virtual*/ S8 getType() const ;
112
113	static BOOL sDirty;
114};
115
116#endif
117