diff options
author | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
commit | 38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4 (patch) | |
tree | adca584755d22ca041a2dbfc35d4eca01f70b32c /linden/indra/newview/llviewervisualparam.cpp | |
parent | README.txt (diff) | |
download | meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.zip meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.gz meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.bz2 meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.xz |
Second Life viewer sources 1.13.2.12
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llviewervisualparam.cpp | 151 |
1 files changed, 151 insertions, 0 deletions
diff --git a/linden/indra/newview/llviewervisualparam.cpp b/linden/indra/newview/llviewervisualparam.cpp new file mode 100644 index 0000000..b255235 --- /dev/null +++ b/linden/indra/newview/llviewervisualparam.cpp | |||
@@ -0,0 +1,151 @@ | |||
1 | /** | ||
2 | * @file llviewervisualparam.cpp | ||
3 | * @brief Implementation of LLViewerVisualParam class | ||
4 | * | ||
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | ||
6 | * | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
8 | * to you under the terms of the GNU General Public License, version 2.0 | ||
9 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
10 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
11 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
12 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
13 | * | ||
14 | * There are special exceptions to the terms and conditions of the GPL as | ||
15 | * it is applied to this Source Code. View the full text of the exception | ||
16 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
17 | * online at http://secondlife.com/developers/opensource/flossexception | ||
18 | * | ||
19 | * By copying, modifying or distributing this software, you acknowledge | ||
20 | * that you have read and understood your obligations described above, | ||
21 | * and agree to abide by those obligations. | ||
22 | * | ||
23 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
24 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
25 | * COMPLETENESS OR PERFORMANCE. | ||
26 | */ | ||
27 | |||
28 | //----------------------------------------------------------------------------- | ||
29 | // Header Files | ||
30 | //----------------------------------------------------------------------------- | ||
31 | #include "llviewerprecompiledheaders.h" | ||
32 | |||
33 | #include "llviewervisualparam.h" | ||
34 | #include "llxmltree.h" | ||
35 | #include "llui.h" | ||
36 | #include "llwearable.h" | ||
37 | |||
38 | //----------------------------------------------------------------------------- | ||
39 | // LLViewerVisualParamInfo() | ||
40 | //----------------------------------------------------------------------------- | ||
41 | LLViewerVisualParamInfo::LLViewerVisualParamInfo() | ||
42 | : | ||
43 | mWearableType( WT_INVALID ), | ||
44 | mCamDist( 0.5f ), | ||
45 | mCamAngle( 0.f ), | ||
46 | mCamElevation( 0.f ), | ||
47 | mEditGroupDisplayOrder( 0 ), | ||
48 | mShowSimple(FALSE), | ||
49 | mSimpleMin(0.f), | ||
50 | mSimpleMax(100.f) | ||
51 | { | ||
52 | } | ||
53 | |||
54 | LLViewerVisualParamInfo::~LLViewerVisualParamInfo() | ||
55 | { | ||
56 | } | ||
57 | |||
58 | //----------------------------------------------------------------------------- | ||
59 | // parseXml() | ||
60 | //----------------------------------------------------------------------------- | ||
61 | BOOL LLViewerVisualParamInfo::parseXml(LLXmlTreeNode *node) | ||
62 | { | ||
63 | llassert( node->hasName( "param" ) ); | ||
64 | |||
65 | if (!LLVisualParamInfo::parseXml(node)) | ||
66 | return FALSE; | ||
67 | |||
68 | // VIEWER SPECIFIC PARAMS | ||
69 | |||
70 | LLString wearable; | ||
71 | static LLStdStringHandle wearable_string = LLXmlTree::addAttributeString("wearable"); | ||
72 | if( node->getFastAttributeString( wearable_string, wearable) ) | ||
73 | { | ||
74 | mWearableType = LLWearable::typeNameToType( wearable ); | ||
75 | } | ||
76 | |||
77 | static LLStdStringHandle edit_group_string = LLXmlTree::addAttributeString("edit_group"); | ||
78 | if (!node->getFastAttributeString( edit_group_string, mEditGroup)) | ||
79 | { | ||
80 | mEditGroup = ""; | ||
81 | } | ||
82 | |||
83 | // Optional camera offsets from the current joint center. Used for generating "hints" (thumbnails). | ||
84 | static LLStdStringHandle camera_distance_string = LLXmlTree::addAttributeString("camera_distance"); | ||
85 | node->getFastAttributeF32( camera_distance_string, mCamDist ); | ||
86 | static LLStdStringHandle camera_angle_string = LLXmlTree::addAttributeString("camera_angle"); | ||
87 | node->getFastAttributeF32( camera_angle_string, mCamAngle ); // in degrees | ||
88 | static LLStdStringHandle camera_elevation_string = LLXmlTree::addAttributeString("camera_elevation"); | ||
89 | node->getFastAttributeF32( camera_elevation_string, mCamElevation ); | ||
90 | static LLStdStringHandle camera_target_string = LLXmlTree::addAttributeString("camera_target"); | ||
91 | node->getFastAttributeString( camera_target_string, mCamTargetName ); | ||
92 | |||
93 | mCamAngle += 180; | ||
94 | |||
95 | static S32 params_loaded = 0; | ||
96 | |||
97 | // By default, parameters are displayed in the order in which they appear in the xml file. | ||
98 | // "edit_group_order" overriddes. | ||
99 | static LLStdStringHandle edit_group_order_string = LLXmlTree::addAttributeString("edit_group_order"); | ||
100 | if( !node->getFastAttributeF32( edit_group_order_string, mEditGroupDisplayOrder ) ) | ||
101 | { | ||
102 | mEditGroupDisplayOrder = (F32)params_loaded; | ||
103 | } | ||
104 | |||
105 | params_loaded++; | ||
106 | |||
107 | return TRUE; | ||
108 | } | ||
109 | |||
110 | //----------------------------------------------------------------------------- | ||
111 | // LLViewerVisualParam() | ||
112 | //----------------------------------------------------------------------------- | ||
113 | LLViewerVisualParam::LLViewerVisualParam() | ||
114 | { | ||
115 | } | ||
116 | |||
117 | /* | ||
118 | //============================================================================= | ||
119 | // These virtual functions should always be overridden, | ||
120 | // but are included here for use as templates | ||
121 | //============================================================================= | ||
122 | |||
123 | //----------------------------------------------------------------------------- | ||
124 | // setInfo() | ||
125 | //----------------------------------------------------------------------------- | ||
126 | |||
127 | BOOL LLViewerVisualParam::setInfo(LLViewerVisualParamInfo *info) | ||
128 | { | ||
129 | llassert(mInfo == NULL); | ||
130 | if (info->mID < 0) | ||
131 | return FALSE; | ||
132 | mInfo = info; | ||
133 | mID = info->mID; | ||
134 | setWeight(getDefaultWeight(), FALSE ); | ||
135 | return TRUE; | ||
136 | } | ||
137 | |||
138 | //----------------------------------------------------------------------------- | ||
139 | // parseData() | ||
140 | //----------------------------------------------------------------------------- | ||
141 | BOOL LLViewerVisualParam::parseData(LLXmlTreeNode *node) | ||
142 | { | ||
143 | LLViewerVisualParamInfo* info = new LLViewerVisualParamInfo; | ||
144 | |||
145 | info->parseXml(node); | ||
146 | if (!setInfo(info)) | ||
147 | return FALSE; | ||
148 | |||
149 | return TRUE; | ||
150 | } | ||
151 | */ | ||