1 | /* |
---|
2 | * ---------------------------------------------------------------------- |
---|
3 | * RpVariable.cc |
---|
4 | * |
---|
5 | * Rappture 2.0 Variable member functions |
---|
6 | * |
---|
7 | * ====================================================================== |
---|
8 | * AUTHOR: Derrick Kearney, Purdue University |
---|
9 | * Copyright (c) 2004-2005 Purdue Research Foundation |
---|
10 | * |
---|
11 | * See the file "license.terms" for information on usage and |
---|
12 | * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
---|
13 | * ====================================================================== |
---|
14 | */ |
---|
15 | |
---|
16 | #include "RpVariable.h" |
---|
17 | |
---|
18 | /**********************************************************************/ |
---|
19 | // METHOD: setPath() |
---|
20 | /// Set the path of this object |
---|
21 | /** |
---|
22 | */ |
---|
23 | |
---|
24 | RpVariable& |
---|
25 | RpVariable::setPath(std::string newPath) |
---|
26 | { |
---|
27 | path = newPath; |
---|
28 | return *this; |
---|
29 | } |
---|
30 | |
---|
31 | /**********************************************************************/ |
---|
32 | // METHOD: setDefaultValue() |
---|
33 | /// Set the default value of this object |
---|
34 | /** |
---|
35 | */ |
---|
36 | |
---|
37 | RpVariable& |
---|
38 | RpVariable::setDefaultValue(void* newDefaultVal) |
---|
39 | { |
---|
40 | // who is responsible for freeing the pointer? |
---|
41 | defaultVal = newDefaultVal; |
---|
42 | return *this; |
---|
43 | } |
---|
44 | |
---|
45 | /**********************************************************************/ |
---|
46 | // METHOD: setCurrentValue() |
---|
47 | /// Set the current value of this object |
---|
48 | /** |
---|
49 | */ |
---|
50 | |
---|
51 | RpVariable& |
---|
52 | RpVariable::setCurrentValue(void* newCurrentVal) |
---|
53 | { |
---|
54 | // who is responsible for freeing the pointer? |
---|
55 | currentVal = newCurrentVal; |
---|
56 | return *this; |
---|
57 | } |
---|
58 | |
---|
59 | /**********************************************************************/ |
---|
60 | // METHOD: setLabel() |
---|
61 | /// Set the label of this object |
---|
62 | /** |
---|
63 | */ |
---|
64 | |
---|
65 | RpVariable& |
---|
66 | RpVariable::setLabel(std::string newLabel) |
---|
67 | { |
---|
68 | about.setLabel(newLabel); |
---|
69 | return *this; |
---|
70 | } |
---|
71 | |
---|
72 | /**********************************************************************/ |
---|
73 | // METHOD: setDesc() |
---|
74 | /// Set the desc of this object |
---|
75 | /** |
---|
76 | */ |
---|
77 | |
---|
78 | RpVariable& |
---|
79 | RpVariable::setDesc(std::string newDesc) |
---|
80 | { |
---|
81 | about.setDesc(newDesc); |
---|
82 | return *this; |
---|
83 | } |
---|
84 | |
---|
85 | /**********************************************************************/ |
---|
86 | // METHOD: setHints() |
---|
87 | /// Set the hints of this object |
---|
88 | /** |
---|
89 | */ |
---|
90 | |
---|
91 | RpVariable& |
---|
92 | RpVariable::setHints(std::string newHints) |
---|
93 | { |
---|
94 | about.setHints(newHints); |
---|
95 | return *this; |
---|
96 | } |
---|
97 | |
---|
98 | /**********************************************************************/ |
---|
99 | // METHOD: setColor() |
---|
100 | /// Set the color of this object |
---|
101 | /** |
---|
102 | */ |
---|
103 | |
---|
104 | RpVariable& |
---|
105 | RpVariable::setColor(std::string newColor) |
---|
106 | { |
---|
107 | about.setColor(newColor); |
---|
108 | return *this; |
---|
109 | } |
---|
110 | |
---|
111 | /**********************************************************************/ |
---|
112 | // METHOD: setIcon() |
---|
113 | /// Set the icon of this object |
---|
114 | /** |
---|
115 | */ |
---|
116 | |
---|
117 | RpVariable& |
---|
118 | RpVariable::setIcon(std::string newIcon) |
---|
119 | { |
---|
120 | about.setIcon(newIcon); |
---|
121 | return *this; |
---|
122 | } |
---|
123 | |
---|
124 | |
---|
125 | /**********************************************************************/ |
---|
126 | // METHOD: getPath() |
---|
127 | /// Report the path of this object |
---|
128 | /** |
---|
129 | */ |
---|
130 | |
---|
131 | std::string |
---|
132 | RpVariable::getPath() const |
---|
133 | { |
---|
134 | return path; |
---|
135 | } |
---|
136 | |
---|
137 | /**********************************************************************/ |
---|
138 | // METHOD: getDefaultValue() |
---|
139 | /// Report the default value of the object |
---|
140 | /** |
---|
141 | */ |
---|
142 | |
---|
143 | void* |
---|
144 | RpVariable::getDefaultValue() const |
---|
145 | { |
---|
146 | return defaultVal; |
---|
147 | } |
---|
148 | |
---|
149 | /**********************************************************************/ |
---|
150 | // METHOD: getCurrentValue() |
---|
151 | /// Report the current value of the object |
---|
152 | /** |
---|
153 | */ |
---|
154 | |
---|
155 | void* |
---|
156 | RpVariable::getCurrentValue() const |
---|
157 | { |
---|
158 | return currentVal; |
---|
159 | } |
---|
160 | |
---|
161 | /**********************************************************************/ |
---|
162 | // METHOD: getLabel() |
---|
163 | /// Report the label of the object |
---|
164 | /** |
---|
165 | */ |
---|
166 | |
---|
167 | std::string |
---|
168 | RpVariable::getLabel() const |
---|
169 | { |
---|
170 | return about.getLabel(); |
---|
171 | } |
---|
172 | |
---|
173 | /**********************************************************************/ |
---|
174 | // METHOD: getDesc() |
---|
175 | /// Report the desc of the object |
---|
176 | /** |
---|
177 | */ |
---|
178 | |
---|
179 | std::string |
---|
180 | RpVariable::getDesc() const |
---|
181 | { |
---|
182 | return about.getDesc(); |
---|
183 | } |
---|
184 | |
---|
185 | /**********************************************************************/ |
---|
186 | // METHOD: getHints() |
---|
187 | /// Report the hints of this object |
---|
188 | /** |
---|
189 | */ |
---|
190 | |
---|
191 | std::string |
---|
192 | RpVariable::getHints() const |
---|
193 | { |
---|
194 | return about.getHints(); |
---|
195 | } |
---|
196 | |
---|
197 | /**********************************************************************/ |
---|
198 | // METHOD: getColor() |
---|
199 | /// Report the color of this object |
---|
200 | /** |
---|
201 | */ |
---|
202 | |
---|
203 | std::string |
---|
204 | RpVariable::getColor() const |
---|
205 | { |
---|
206 | return about.getColor(); |
---|
207 | } |
---|
208 | |
---|
209 | /**********************************************************************/ |
---|
210 | // METHOD: getIcon() |
---|
211 | /// Report the icon of this object |
---|
212 | /** |
---|
213 | */ |
---|
214 | |
---|
215 | std::string |
---|
216 | RpVariable::getIcon() const |
---|
217 | { |
---|
218 | return about.getIcon(); |
---|
219 | } |
---|
220 | |
---|
221 | |
---|
222 | // -------------------------------------------------------------------- // |
---|
223 | |
---|