PageRenderTime 264ms CodeModel.GetById 151ms app.highlight 8ms RepoModel.GetById 103ms app.codeStats 0ms

/indra/newview/llviewervisualparam.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 109 lines | 52 code | 18 blank | 39 comment | 0 complexity | 70977c13e0f41855e9d93b893c35b5be MD5 | raw file
  1/** 
  2 * @file llviewervisualparam.h
  3 * @brief viewer side visual params (with data file parsing)
  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_LLViewerVisualParam_H
 28#define LL_LLViewerVisualParam_H
 29
 30#include "v3math.h"
 31#include "llstring.h"
 32#include "llvisualparam.h"
 33
 34class LLWearable;
 35
 36//-----------------------------------------------------------------------------
 37// LLViewerVisualParamInfo
 38//-----------------------------------------------------------------------------
 39class LLViewerVisualParamInfo : public LLVisualParamInfo
 40{
 41	friend class LLViewerVisualParam;
 42public:
 43	LLViewerVisualParamInfo();
 44	/*virtual*/ ~LLViewerVisualParamInfo();
 45	
 46	/*virtual*/ BOOL parseXml(LLXmlTreeNode* node);
 47
 48	/*virtual*/ void toStream(std::ostream &out);
 49
 50protected:
 51	S32			mWearableType;
 52	BOOL		mCrossWearable;
 53	std::string	mEditGroup;
 54	F32			mCamDist;
 55	F32			mCamAngle;		// degrees
 56	F32			mCamElevation;
 57	F32			mEditGroupDisplayOrder;
 58	BOOL		mShowSimple;	// show edit controls when in "simple ui" mode?
 59	F32			mSimpleMin;		// when in simple UI, apply this minimum, range 0.f to 100.f
 60	F32			mSimpleMax;		// when in simple UI, apply this maximum, range 0.f to 100.f
 61};
 62
 63//-----------------------------------------------------------------------------
 64// LLViewerVisualParam
 65// VIRTUAL CLASS
 66// a viewer side interface class for a generalized parametric modification of the avatar mesh
 67//-----------------------------------------------------------------------------
 68class LLViewerVisualParam : public LLVisualParam
 69{
 70public:
 71	LLViewerVisualParam();
 72	/*virtual*/ ~LLViewerVisualParam(){};
 73
 74	// Special: These functions are overridden by child classes
 75	LLViewerVisualParamInfo 	*getInfo() const { return (LLViewerVisualParamInfo*)mInfo; };
 76	//   This sets mInfo and calls initialization functions
 77	BOOL						setInfo(LLViewerVisualParamInfo *info);
 78
 79	virtual LLViewerVisualParam* cloneParam(LLWearable* wearable) const = 0;
 80	
 81	// LLVisualParam Virtual functions
 82	///*virtual*/ BOOL			parseData(LLXmlTreeNode* node);
 83
 84	// New Virtual functions
 85	virtual F32					getTotalDistortion() = 0;
 86	virtual const LLVector3&	getAvgDistortion() = 0;
 87	virtual F32					getMaxDistortion() = 0;
 88	virtual LLVector3			getVertexDistortion(S32 index, LLPolyMesh *mesh) = 0;
 89	virtual const LLVector3*	getFirstDistortion(U32 *index, LLPolyMesh **mesh) = 0;
 90	virtual const LLVector3*	getNextDistortion(U32 *index, LLPolyMesh **mesh) = 0;
 91	
 92	// interface methods
 93	F32					getDisplayOrder() const		{ return getInfo()->mEditGroupDisplayOrder; }
 94	S32					getWearableType() const		{ return getInfo()->mWearableType; }
 95	const std::string&	getEditGroup() const		{ return getInfo()->mEditGroup; }
 96
 97	F32					getCameraDistance()	const	{ return getInfo()->mCamDist; } 
 98	F32					getCameraAngle() const		{ return getInfo()->mCamAngle; }  // degrees
 99	F32					getCameraElevation() const	{ return getInfo()->mCamElevation; } 
100	
101	BOOL				getShowSimple() const		{ return getInfo()->mShowSimple; }
102	F32					getSimpleMin() const		{ return getInfo()->mSimpleMin; }
103	F32					getSimpleMax() const		{ return getInfo()->mSimpleMax; }
104
105	BOOL				getCrossWearable() const 	{ return getInfo()->mCrossWearable; }
106
107};
108
109#endif // LL_LLViewerVisualParam_H