aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/CMakeLists.txt2
-rw-r--r--linden/indra/newview/llpanelmorph.cpp351
-rw-r--r--linden/indra/newview/llpanelmorph.h66
3 files changed, 0 insertions, 419 deletions
diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt
index 313f0c4..1a81412 100644
--- a/linden/indra/newview/CMakeLists.txt
+++ b/linden/indra/newview/CMakeLists.txt
@@ -302,7 +302,6 @@ set(viewer_SOURCE_FILES
302 llpanellandobjects.cpp 302 llpanellandobjects.cpp
303 llpanellandoptions.cpp 303 llpanellandoptions.cpp
304 llpanellogin.cpp 304 llpanellogin.cpp
305 llpanelmorph.cpp
306 llpanelmsgs.cpp 305 llpanelmsgs.cpp
307 llpanelnetwork.cpp 306 llpanelnetwork.cpp
308 llpanelobject.cpp 307 llpanelobject.cpp
@@ -737,7 +736,6 @@ set(viewer_HEADER_FILES
737 llpanellandoptions.h 736 llpanellandoptions.h
738 llpanelLCD.h 737 llpanelLCD.h
739 llpanellogin.h 738 llpanellogin.h
740 llpanelmorph.h
741 llpanelmsgs.h 739 llpanelmsgs.h
742 llpanelnetwork.h 740 llpanelnetwork.h
743 llpanelobject.h 741 llpanelobject.h
diff --git a/linden/indra/newview/llpanelmorph.cpp b/linden/indra/newview/llpanelmorph.cpp
deleted file mode 100644
index 9776c8a..0000000
--- a/linden/indra/newview/llpanelmorph.cpp
+++ /dev/null
@@ -1,351 +0,0 @@
1/**
2 * @file llpanelmorph.cpp
3 * @brief LLPanelMorph class implementation
4 *
5 * $LicenseInfo:firstyear=2001&license=viewergpl$
6 *
7 * Copyright (c) 2001-2009, 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
33// file include
34#include "llviewerprecompiledheaders.h"
35
36/*
37#include "llpanelmorph.h"
38
39// library includes
40#include "llerror.h"
41#include "llrect.h"
42#include "llstring.h"
43#include "llfontgl.h"
44
45// project includes
46#include "llui.h"
47#include "llspinctrl.h"
48#include "llcheckboxctrl.h"
49#include "lltextbox.h"
50#include "llbutton.h"
51//#include "lldraghandle.h"
52
53#include "llviewerwindow.h"
54#include "llviewerobject.h"
55#include "llresmgr.h"
56
57#include "llcontrol.h"
58
59#include "llagent.h"
60#include "llvoavatar.h"
61#include "lltoolmgr.h"
62#include "lltoolmorph.h"
63#include "llquantize.h"
64
65//
66// Constants
67//
68const S32 VPAD = 2;
69const S32 HPAD = 4;
70
71const S32 TITLE_WIDTH = 100;
72const S32 TITLE_HEIGHT = 16;
73
74const S32 CLOSE_BOX_SIZE = 16;
75
76const S32 LABEL_HOFF = 8;
77const S32 LABEL_WIDTH = 140;
78const S32 SPIN_WIDTH = 250;
79
80// minimum and maximum morph weight values (a UI/network constraint, not inherent to morphs)
81const F32 MORPH_WEIGHT_MIN = (-1.f);
82const F32 MORPH_WEIGHT_MAX = (1.f);
83// this is the magic number that morph values are quantized to for network transmission purposes
84// the 200 value is a result of encoding the weights as a string (and avoiding NULL terminators
85// and avoiding \n (the between-NV-pair delimiter). Map -1 to 1 to 50-250. HACK. JC
86const S32 MORPH_WEIGHT_OFFSET = (50);
87const S32 MORPH_WEIGHT_QUANTUM = ((MORPH_WEIGHT_MAX - MORPH_WEIGHT_MIN) / MAXSTRINGVAL);
88
89//#define MORPH_PANEL_SHOW_SPINNERS
90
91//
92// Globals
93//
94LLPanelMorph *gPanelMorph = NULL;
95
96//
97// Methods
98//
99
100//static
101//-----------------------------------------------------------------------------
102// LLPanelMorph()
103//-----------------------------------------------------------------------------
104LLPanelMorph::LLPanelMorph(const std::string& name, const LLRect& rect)
105: LLPanel( name, rect )
106{
107 mParamSpinners = NULL;
108 mSexRadioGroup = NULL;
109 mRect = rect;
110 mMesh = NULL;
111 setBackgroundVisible( TRUE );
112}
113
114//-----------------------------------------------------------------------------
115// ~LLPanelMorph()
116//-----------------------------------------------------------------------------
117LLPanelMorph::~LLPanelMorph()
118{
119#ifdef MORPH_PANEL_SHOW_SPINNERS
120 for (S32 i = 0; i < mNumParamSpinners; i++)
121 {
122 removeChild(mParamSpinners[i]);
123 delete mParamSpinners[i];
124 }
125 delete [] mParamSpinners;
126#endif
127}
128
129// static
130//-----------------------------------------------------------------------------
131// onCommitSexChange()
132//-----------------------------------------------------------------------------
133void LLPanelMorph::onCommitSexChange( void *data)
134{
135// LLRadioGroup *group = (LLRadioGroup *)data;
136
137// LLVOAvatar *avatarp = gAgent.getAvatarObject();
138//
139// LLNameValue* avatarSexNV = avatarp->getNVPair("AvatarSex");
140// if (!avatarSexNV)
141// {
142// avatarp->addNVPair( "AvatarSex U32 READ_WRITE SIM_SPACE_VIEWER 0");
143// avatarSexNV = avatarp->getNVPair("AvatarSex");
144// }
145//
146// avatarSexNV->setU32(gSavedSettings.getU32("AvatarSex"));
147//
148// avatarp->sendNVPairToSimulator("AvatarSex");
149//
150// // preemptively update sex based on local value
151// avatarp->updateSex();
152//
153// LLVisualParamHint::requestHintUpdates();
154
155}
156
157
158// static
159//-----------------------------------------------------------------------------
160// onCommitMorphChange()
161//-----------------------------------------------------------------------------
162void LLPanelMorph::onCommitMorphChange( LLUICtrl* ctrl, void* userdata )
163{
164//#ifdef MORPH_PANEL_SHOW_SPINNERS
165// LLVOAvatar *avatarp = gAgent.getAvatarObject();
166//
167// LLPanelMorph* self = (LLPanelMorph*) userdata;
168//
169// S32 i = 0;
170// for(LLPolyMorphTarget* morphTargetp = self->mMesh->getFirstVisualParam();
171// morphTargetp;
172// morphTargetp = self->mMesh->getNextVisualParam())
173// {
174// for(S32 j = 0; j < self->mNumParamSpinners; j++)
175// {
176// if (!strcmp(self->mParamSpinners[j]->getName(), morphTargetp->getName()))
177// {
178// avatarp->mHeadMesh0.getMesh()->setDistortionWeight(morphTargetp, self->mParamSpinners[j]->get());
179// }
180// }
181// i++;
182// }
183// avatarp->updateDistortions();
184// avatarp->sendVisualParams();
185//#endif
186}
187
188//-----------------------------------------------------------------------------
189// updateSpinners()
190//-----------------------------------------------------------------------------
191void LLPanelMorph::updateSpinners(LLPolyMesh *mesh)
192{
193 if (mesh != mMesh) return;
194#ifdef MORPH_PANEL_SHOW_SPINNERS
195
196 for(LLViewerVisualParam *param = (LLViewerVisualParam*)gAgent.getAvatarObject()->getFirstVisualParam();
197 param;
198 param = gAgent.getAvatarObject()->getNextVisualParam())
199 {
200 if (param->getID() == -1 ||
201 param->getGroup() != LLVisualParam::VISUAL_PARAM_GROUP_TWEAKABLE) continue;
202
203 F32 paramWeight = gAgent.getAvatarObject()->getVisualParamWeight(morphTargetp);
204
205 for (S32 i = 0; i < mNumParamSpinners; i++)
206 {
207 if (!strcmp(mParamSpinners[i]->getName() , morphTargetp->getName()))
208 {
209 mParamSpinners[i]->set(paramWeight);
210 }
211 }
212 }
213#endif
214}
215
216//-----------------------------------------------------------------------------
217// createSpinners()
218//-----------------------------------------------------------------------------
219void LLPanelMorph::createSpinners(LLPolyMesh *mesh)
220{
221 const LLFontGL* font = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF_SMALL );
222 S32 cur_y;
223 S32 new_height;
224 S32 control_focus = -1;
225
226 if (mSexRadioGroup)
227 {
228 removeChild(mSexRadioGroup);
229 delete mSexRadioGroup;
230 }
231
232 if (mParamSpinners)
233 {
234 for (S32 i = 0; i < mNumParamSpinners; i++)
235 {
236 if (mParamSpinners[i]->hasFocus())
237 {
238 control_focus = i;
239 mParamSpinners[i]->setFocus(FALSE);
240 }
241 }
242 for (i = 0; i < mNumParamSpinners; i++)
243 {
244 removeChild(mParamSpinners[i]);
245 delete mParamSpinners[i];
246 }
247 delete [] mParamSpinners;
248 mParamSpinners = NULL;
249 }
250
251#ifdef MORPH_PANEL_SHOW_SPINNERS
252 S32 numSpinners = 0;
253
254 for(LLViewerVisualParam *param = (LLViewerVisualParam*)gAgent.getAvatarObject()->getFirstVisualParam();
255 param;
256 param = gAgent.getAvatarObject()->getNextVisualParam())
257 {
258 if(param->getID() != -1 &&
259 param->getGroup() == LLVisualParam::VISUAL_PARAM_GROUP_TWEAKABLE)
260 {
261 numSpinners++;
262 }
263 }
264
265 if (numSpinners != 0)
266 {
267 mParamSpinners = new LLSpinCtrl*[numSpinners];
268 }
269
270 // set focus back to control #n
271 if (control_focus >= 0 && control_focus < numSpinners)
272 {
273 mParamSpinners[control_focus]->setFocus(TRUE);
274 }
275 new_height = numSpinners * (SPINCTRL_HEIGHT + VPAD) + (VPAD * 3) + CHECKBOXCTRL_HEIGHT + VPAD + VPAD;
276
277#else
278 new_height = (VPAD * 3) + CHECKBOXCTRL_HEIGHT + VPAD + VPAD;
279#endif
280
281 LLRect panelRect = getRect();
282 reshape(panelRect.getWidth(), new_height, TRUE);
283
284 cur_y = new_height - VPAD - VPAD;
285
286 LLRect radio_rect;
287 radio_rect.setLeftTopAndSize(HPAD + LABEL_HOFF,
288 cur_y,
289 getRect().getWidth() - HPAD - HPAD - LABEL_HOFF,
290 CHECKBOXCTRL_HEIGHT + VPAD);
291 mSexRadioGroup = new LLRadioGroup("sex radio",
292 radio_rect,
293 "AvatarSex",
294 &LLPanelMorph::onCommitSexChange,
295 (void *)this);
296 addChild(mSexRadioGroup);
297
298 radio_rect.setLeftTopAndSize(HPAD + LABEL_HOFF,
299 0,
300 (getRect().getWidth() - HPAD - HPAD - LABEL_HOFF) / 2.f,
301 0);
302 mSexRadioGroup->addRadioButton("Female", "Female", radio_rect, font);
303
304 radio_rect.setLeftTopAndSize(((getRect().getWidth() - HPAD - HPAD - LABEL_HOFF) / 2.f) + HPAD + LABEL_HOFF,
305 0,
306 (getRect().getWidth() - HPAD - HPAD - LABEL_HOFF) / 2.f,
307 0);
308 mSexRadioGroup->addRadioButton("Male", "Male", radio_rect, font);
309
310 cur_y -= CHECKBOXCTRL_HEIGHT + VPAD + VPAD;
311
312#ifdef MORPH_PANEL_SHOW_SPINNERS
313 S32 i = 0;
314
315 for(LLViewerVisualParam *param = (LLViewerVisualParam*)gAgent.getAvatarObject()->getFirstVisualParam();
316 param;
317 param = gAgent.getAvatarObject()->getNextVisualParam())
318 {
319 if (param->getID() == -1 ||
320 param->getGroup() != LLVisualParam::VISUAL_PARAM_GROUP_TWEAKABLE) continue;
321 LLRect spinnerRect;
322 spinnerRect.setLeftTopAndSize(HPAD + LABEL_HOFF,
323 cur_y,
324 getRect().getWidth() - HPAD - HPAD - LABEL_HOFF,
325 cur_y - SPINCTRL_HEIGHT);
326 mParamSpinners[i] = new LLSpinCtrl(param->getName(),
327 spinnerRect,
328 font,
329 param->getName(),
330 &LLPanelMorph::onCommitMorphChange,
331 this,
332 param->getWeight(),
333 param->getMinWeight(),
334 param->getMaxWeight(),
335 MORPH_WEIGHT_QUANTUM * 2,
336 NULL,
337 LABEL_WIDTH );
338
339 mParamSpinners[i]->setPrecision(2);
340 mParamSpinners[i]->setFollowsTop();
341 mParamSpinners[i]->setFollowsLeft();
342 addChild(mParamSpinners[i]);
343 cur_y -= VPAD + SPINCTRL_HEIGHT;
344 i++;
345 }
346
347 mNumParamSpinners = numSpinners;
348#endif
349 mMesh = mesh;
350}
351*/
diff --git a/linden/indra/newview/llpanelmorph.h b/linden/indra/newview/llpanelmorph.h
deleted file mode 100644
index 3fde123..0000000
--- a/linden/indra/newview/llpanelmorph.h
+++ /dev/null
@@ -1,66 +0,0 @@
1/**
2 * @file llpanelmorph.h
3 * @brief LLPanelMorph class definition
4 *
5 * $LicenseInfo:firstyear=2001&license=viewergpl$
6 *
7 * Copyright (c) 2001-2009, 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
33/*
34#ifndef LL_LLPANELMORPH_H
35#define LL_LLPANELMORPH_H
36
37
38#include "llfloater.h"
39#include "llpolymesh.h"
40#include "llradiogroup.h"
41#include "llquantize.h"
42
43class LLSpinCtrl;
44
45class LLPanelMorph : public LLPanel
46{
47public:
48 LLPanelMorph(const std::string& name, const LLRect& rect);
49 ~LLPanelMorph();
50 static void onCommitSexChange( void *data);
51 static void onCommitMorphChange(LLUICtrl* ctrl, void* userdata);
52 void updateSpinners(LLPolyMesh *mesh);
53 void createSpinners(LLPolyMesh *mesh);
54
55protected:
56 S32 mNumParamSpinners;
57 LLRadioGroup* mSexRadioGroup;
58 LLSpinCtrl** mParamSpinners;
59 LLRect mRect;
60 LLPolyMesh* mMesh;
61};
62
63extern LLPanelMorph *gPanelMorph;
64
65#endif
66*/