GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 79.9% 287 / 0 / 359
Functions: 79.0% 83 / 0 / 105
Branches: 57.7% 176 / 0 / 305

src/model/CurveBicubic.cpp
Line Branch Exec Source
1 /***********************************************************************************************************************
2 * OpenStudio(R), Copyright (c) Alliance for Energy Innovation, LLC.
3 * See also https://openstudio.net/license
4 ***********************************************************************************************************************/
5
6 #include "CurveBicubic.hpp"
7 #include "CurveBicubic_Impl.hpp"
8
9 #include <utilities/idd/IddFactory.hxx>
10
11 #include <utilities/idd/OS_Curve_Bicubic_FieldEnums.hxx>
12 #include <utilities/idd/IddEnums.hxx>
13
14 #include "../utilities/core/Assert.hpp"
15
16 #include <cmath>
17
18 using namespace std;
19
20 namespace openstudio {
21 namespace model {
22
23 namespace detail {
24
25 150 CurveBicubic_Impl::CurveBicubic_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle) : Curve_Impl(idfObject, model, keepHandle) {
26
4/6
✓ Branch 1 taken 150 times.
✓ Branch 4 taken 150 times.
✓ Branch 7 taken 150 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 150 times.
✗ Branch 13 not taken.
150 OS_ASSERT(idfObject.iddObject().type() == CurveBicubic::iddObjectType());
27 150 }
28
29 6 CurveBicubic_Impl::CurveBicubic_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle)
30 6 : Curve_Impl(other, model, keepHandle) {
31
4/6
✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
✓ Branch 7 taken 6 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 6 times.
✗ Branch 13 not taken.
6 OS_ASSERT(other.iddObject().type() == CurveBicubic::iddObjectType());
32 6 }
33
34 69 CurveBicubic_Impl::CurveBicubic_Impl(const CurveBicubic_Impl& other, Model_Impl* model, bool keepHandle) : Curve_Impl(other, model, keepHandle) {}
35
36 ✗ const std::vector<std::string>& CurveBicubic_Impl::outputVariableNames() const {
37 static const std::vector<std::string> result{"Performance Curve Output Value", "Performance Curve Input Variable 1 Value",
38 ✗ "Performance Curve Input Variable 2 Value"};
39 ✗ return result;
40 ✗ }
41
42 ✗ IddObjectType CurveBicubic_Impl::iddObjectType() const {
43 ✗ return CurveBicubic::iddObjectType();
44 }
45
46 ✗ int CurveBicubic_Impl::numVariables() const {
47 ✗ return 2;
48 }
49
50 16 double CurveBicubic_Impl::evaluate(const std::vector<double>& independentVariables) const {
51
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 16 times.
16 OS_ASSERT(independentVariables.size() == 2u);
52
53 16 double x = independentVariables[0];
54
2/2
✓ Branch 1 taken 4 times.
✓ Branch 2 taken 12 times.
16 if (x < minimumValueofx()) {
55
5/5
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
✓ Branch 13 taken 4 times.
4 LOG(Warn, "Supplied x is below the minimumValueofx, resetting it.");
56 4 x = minimumValueofx();
57 }
58
2/2
✓ Branch 1 taken 4 times.
✓ Branch 2 taken 12 times.
16 if (x > maximumValueofx()) {
59
5/5
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
✓ Branch 13 taken 4 times.
4 LOG(Warn, "Supplied x is above the maximumValueofx, resetting it.");
60 4 x = maximumValueofx();
61 }
62
63 16 double y = independentVariables[1];
64
2/2
✓ Branch 1 taken 4 times.
✓ Branch 2 taken 12 times.
16 if (y < minimumValueofy()) {
65
5/5
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
✓ Branch 13 taken 4 times.
4 LOG(Warn, "Supplied y is below the minimumValueofy, resetting it.");
66 4 y = minimumValueofy();
67 }
68
2/2
✓ Branch 1 taken 4 times.
✓ Branch 2 taken 12 times.
16 if (y > maximumValueofy()) {
69
5/5
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
✓ Branch 13 taken 4 times.
4 LOG(Warn, "Supplied y is above the maximumValueofy, resetting it.");
70 4 y = maximumValueofy();
71 }
72
73 16 double result = coefficient1Constant();
74 16 double x2 = std::pow(x, 2);
75 16 double y2 = std::pow(y, 2);
76 16 result += coefficient2x() * x;
77 16 result += coefficient3xPOW2() * x2;
78 16 result += coefficient4y() * y;
79 16 result += coefficient5yPOW2() * y2;
80 16 result += coefficient6xTIMESY() * x * y;
81 16 result += coefficient7xPOW3() * std::pow(x, 3);
82 16 result += coefficient8yPOW3() * std::pow(y, 3);
83 16 result += coefficient9xPOW2TIMESY() * x2 * y;
84 16 result += coefficient10xTIMESYPOW2() * x * y2;
85
86
3/3
✓ Branch 1 taken 16 times.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 14 times.
32 if (boost::optional<double> _minVal = minimumCurveOutput()) {
87
1/1
✓ Branch 1 taken 2 times.
2 double minVal = _minVal.get();
88
2/2
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 1 time.
2 if (result < minVal) {
89
5/5
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✓ Branch 13 taken 1 time.
1 LOG(Warn, "Calculated curve output is below minimumCurveOutput, resetting it.");
90 1 result = minVal;
91 }
92 }
93
94
3/3
✓ Branch 1 taken 16 times.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 14 times.
32 if (boost::optional<double> _maxVal = maximumCurveOutput()) {
95
1/1
✓ Branch 1 taken 2 times.
2 double maxVal = _maxVal.get();
96
2/2
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 1 time.
2 if (result > maxVal) {
97
5/5
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✓ Branch 13 taken 1 time.
1 LOG(Warn, "Calculated curve output is above maximumCurveOutput, resetting it.");
98 1 result = maxVal;
99 }
100 }
101
102 16 return result;
103 }
104
105 25 double CurveBicubic_Impl::coefficient1Constant() const {
106
1/1
✓ Branch 1 taken 25 times.
25 boost::optional<double> value = getDouble(OS_Curve_BicubicFields::Coefficient1Constant, true);
107
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 25 times.
✗ Branch 4 not taken.
25 OS_ASSERT(value);
108
1/1
✓ Branch 1 taken 25 times.
50 return value.get();
109 }
110
111 25 double CurveBicubic_Impl::coefficient2x() const {
112
1/1
✓ Branch 1 taken 25 times.
25 boost::optional<double> value = getDouble(OS_Curve_BicubicFields::Coefficient2x, true);
113
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 25 times.
✗ Branch 4 not taken.
25 OS_ASSERT(value);
114
1/1
✓ Branch 1 taken 25 times.
50 return value.get();
115 }
116
117 25 double CurveBicubic_Impl::coefficient3xPOW2() const {
118
1/1
✓ Branch 1 taken 25 times.
25 boost::optional<double> value = getDouble(OS_Curve_BicubicFields::Coefficient3x_POW_2, true);
119
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 25 times.
✗ Branch 4 not taken.
25 OS_ASSERT(value);
120
1/1
✓ Branch 1 taken 25 times.
50 return value.get();
121 }
122
123 25 double CurveBicubic_Impl::coefficient4y() const {
124
1/1
✓ Branch 1 taken 25 times.
25 boost::optional<double> value = getDouble(OS_Curve_BicubicFields::Coefficient4y, true);
125
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 25 times.
✗ Branch 4 not taken.
25 OS_ASSERT(value);
126
1/1
✓ Branch 1 taken 25 times.
50 return value.get();
127 }
128
129 25 double CurveBicubic_Impl::coefficient5yPOW2() const {
130
1/1
✓ Branch 1 taken 25 times.
25 boost::optional<double> value = getDouble(OS_Curve_BicubicFields::Coefficient5y_POW_2, true);
131
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 25 times.
✗ Branch 4 not taken.
25 OS_ASSERT(value);
132
1/1
✓ Branch 1 taken 25 times.
50 return value.get();
133 }
134
135 25 double CurveBicubic_Impl::coefficient6xTIMESY() const {
136
1/1
✓ Branch 1 taken 25 times.
25 boost::optional<double> value = getDouble(OS_Curve_BicubicFields::Coefficient6x_TIMES_y, true);
137
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 25 times.
✗ Branch 4 not taken.
25 OS_ASSERT(value);
138
1/1
✓ Branch 1 taken 25 times.
50 return value.get();
139 }
140
141 25 double CurveBicubic_Impl::coefficient7xPOW3() const {
142
1/1
✓ Branch 1 taken 25 times.
25 boost::optional<double> value = getDouble(OS_Curve_BicubicFields::Coefficient7x_POW_3, true);
143
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 25 times.
✗ Branch 4 not taken.
25 OS_ASSERT(value);
144
1/1
✓ Branch 1 taken 25 times.
50 return value.get();
145 }
146
147 25 double CurveBicubic_Impl::coefficient8yPOW3() const {
148
1/1
✓ Branch 1 taken 25 times.
25 boost::optional<double> value = getDouble(OS_Curve_BicubicFields::Coefficient8y_POW_3, true);
149
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 25 times.
✗ Branch 4 not taken.
25 OS_ASSERT(value);
150
1/1
✓ Branch 1 taken 25 times.
50 return value.get();
151 }
152
153 25 double CurveBicubic_Impl::coefficient9xPOW2TIMESY() const {
154
1/1
✓ Branch 1 taken 25 times.
25 boost::optional<double> value = getDouble(OS_Curve_BicubicFields::Coefficient9x_POW_2_TIMES_y, true);
155
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 25 times.
✗ Branch 4 not taken.
25 OS_ASSERT(value);
156
1/1
✓ Branch 1 taken 25 times.
50 return value.get();
157 }
158
159 25 double CurveBicubic_Impl::coefficient10xTIMESYPOW2() const {
160
1/1
✓ Branch 1 taken 25 times.
25 boost::optional<double> value = getDouble(OS_Curve_BicubicFields::Coefficient10x_TIMES_y_POW_2, true);
161
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 25 times.
✗ Branch 4 not taken.
25 OS_ASSERT(value);
162
1/1
✓ Branch 1 taken 25 times.
50 return value.get();
163 }
164
165 29 double CurveBicubic_Impl::minimumValueofx() const {
166
1/1
✓ Branch 1 taken 29 times.
29 boost::optional<double> value = getDouble(OS_Curve_BicubicFields::MinimumValueofx, true);
167
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 29 times.
✗ Branch 4 not taken.
29 OS_ASSERT(value);
168
1/1
✓ Branch 1 taken 29 times.
58 return value.get();
169 }
170
171 29 double CurveBicubic_Impl::maximumValueofx() const {
172
1/1
✓ Branch 1 taken 29 times.
29 boost::optional<double> value = getDouble(OS_Curve_BicubicFields::MaximumValueofx, true);
173
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 29 times.
✗ Branch 4 not taken.
29 OS_ASSERT(value);
174
1/1
✓ Branch 1 taken 29 times.
58 return value.get();
175 }
176
177 29 double CurveBicubic_Impl::minimumValueofy() const {
178
1/1
✓ Branch 1 taken 29 times.
29 boost::optional<double> value = getDouble(OS_Curve_BicubicFields::MinimumValueofy, true);
179
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 29 times.
✗ Branch 4 not taken.
29 OS_ASSERT(value);
180
1/1
✓ Branch 1 taken 29 times.
58 return value.get();
181 }
182
183 29 double CurveBicubic_Impl::maximumValueofy() const {
184
1/1
✓ Branch 1 taken 29 times.
29 boost::optional<double> value = getDouble(OS_Curve_BicubicFields::MaximumValueofy, true);
185
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 29 times.
✗ Branch 4 not taken.
29 OS_ASSERT(value);
186
1/1
✓ Branch 1 taken 29 times.
58 return value.get();
187 }
188
189 26 boost::optional<double> CurveBicubic_Impl::minimumCurveOutput() const {
190 26 return getDouble(OS_Curve_BicubicFields::MinimumCurveOutput, true);
191 }
192
193 26 boost::optional<double> CurveBicubic_Impl::maximumCurveOutput() const {
194 26 return getDouble(OS_Curve_BicubicFields::MaximumCurveOutput, true);
195 }
196
197 ✗ std::string CurveBicubic_Impl::inputUnitTypeforX() const {
198 ✗ boost::optional<std::string> value = getString(OS_Curve_BicubicFields::InputUnitTypeforX, true);
199 ✗ OS_ASSERT(value);
200 ✗ return value.get();
201 ✗ }
202
203 7 bool CurveBicubic_Impl::isInputUnitTypeforXDefaulted() const {
204 7 return isEmpty(OS_Curve_BicubicFields::InputUnitTypeforX);
205 }
206
207 ✗ std::string CurveBicubic_Impl::inputUnitTypeforY() const {
208 ✗ boost::optional<std::string> value = getString(OS_Curve_BicubicFields::InputUnitTypeforY, true);
209 ✗ OS_ASSERT(value);
210 ✗ return value.get();
211 ✗ }
212
213 7 bool CurveBicubic_Impl::isInputUnitTypeforYDefaulted() const {
214 7 return isEmpty(OS_Curve_BicubicFields::InputUnitTypeforY);
215 }
216
217 ✗ std::string CurveBicubic_Impl::outputUnitType() const {
218 ✗ boost::optional<std::string> value = getString(OS_Curve_BicubicFields::OutputUnitType, true);
219 ✗ OS_ASSERT(value);
220 ✗ return value.get();
221 ✗ }
222
223 7 bool CurveBicubic_Impl::isOutputUnitTypeDefaulted() const {
224 7 return isEmpty(OS_Curve_BicubicFields::OutputUnitType);
225 }
226
227 128 bool CurveBicubic_Impl::setCoefficient1Constant(double coefficient1Constant) {
228 128 bool result = setDouble(OS_Curve_BicubicFields::Coefficient1Constant, coefficient1Constant);
229
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 128 times.
128 OS_ASSERT(result);
230 128 return result;
231 }
232
233 128 bool CurveBicubic_Impl::setCoefficient2x(double coefficient2x) {
234 128 bool result = setDouble(OS_Curve_BicubicFields::Coefficient2x, coefficient2x);
235
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 128 times.
128 OS_ASSERT(result);
236 128 return result;
237 }
238
239 128 bool CurveBicubic_Impl::setCoefficient3xPOW2(double coefficient3xPOW2) {
240 128 bool result = setDouble(OS_Curve_BicubicFields::Coefficient3x_POW_2, coefficient3xPOW2);
241
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 128 times.
128 OS_ASSERT(result);
242 128 return result;
243 }
244
245 90 bool CurveBicubic_Impl::setCoefficient4y(double coefficient4y) {
246 90 bool result = setDouble(OS_Curve_BicubicFields::Coefficient4y, coefficient4y);
247
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 90 times.
90 OS_ASSERT(result);
248 90 return result;
249 }
250
251 90 bool CurveBicubic_Impl::setCoefficient5yPOW2(double coefficient5yPOW2) {
252 90 bool result = setDouble(OS_Curve_BicubicFields::Coefficient5y_POW_2, coefficient5yPOW2);
253
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 90 times.
90 OS_ASSERT(result);
254 90 return result;
255 }
256
257 90 bool CurveBicubic_Impl::setCoefficient6xTIMESY(double coefficient6xTIMESY) {
258 90 bool result = setDouble(OS_Curve_BicubicFields::Coefficient6x_TIMES_y, coefficient6xTIMESY);
259
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 90 times.
90 OS_ASSERT(result);
260 90 return result;
261 }
262
263 128 bool CurveBicubic_Impl::setCoefficient7xPOW3(double coefficient7xPOW3) {
264 128 bool result = setDouble(OS_Curve_BicubicFields::Coefficient7x_POW_3, coefficient7xPOW3);
265
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 128 times.
128 OS_ASSERT(result);
266 128 return result;
267 }
268
269 90 bool CurveBicubic_Impl::setCoefficient8yPOW3(double coefficient8yPOW3) {
270 90 bool result = setDouble(OS_Curve_BicubicFields::Coefficient8y_POW_3, coefficient8yPOW3);
271
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 90 times.
90 OS_ASSERT(result);
272 90 return result;
273 }
274
275 90 bool CurveBicubic_Impl::setCoefficient9xPOW2TIMESY(double coefficient9xPOW2TIMESY) {
276 90 bool result = setDouble(OS_Curve_BicubicFields::Coefficient9x_POW_2_TIMES_y, coefficient9xPOW2TIMESY);
277
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 90 times.
90 OS_ASSERT(result);
278 90 return result;
279 }
280
281 90 bool CurveBicubic_Impl::setCoefficient10xTIMESYPOW2(double coefficient10xTIMESYPOW2) {
282 90 bool result = setDouble(OS_Curve_BicubicFields::Coefficient10x_TIMES_y_POW_2, coefficient10xTIMESYPOW2);
283
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 90 times.
90 OS_ASSERT(result);
284 90 return result;
285 }
286
287 128 bool CurveBicubic_Impl::setMinimumValueofx(double minimumValueofx) {
288 128 bool result = setDouble(OS_Curve_BicubicFields::MinimumValueofx, minimumValueofx);
289
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 128 times.
128 OS_ASSERT(result);
290 128 return result;
291 }
292
293 128 bool CurveBicubic_Impl::setMaximumValueofx(double maximumValueofx) {
294 128 bool result = setDouble(OS_Curve_BicubicFields::MaximumValueofx, maximumValueofx);
295
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 128 times.
128 OS_ASSERT(result);
296 128 return result;
297 }
298
299 90 bool CurveBicubic_Impl::setMinimumValueofy(double minimumValueofy) {
300 90 bool result = setDouble(OS_Curve_BicubicFields::MinimumValueofy, minimumValueofy);
301
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 90 times.
90 OS_ASSERT(result);
302 90 return result;
303 }
304
305 90 bool CurveBicubic_Impl::setMaximumValueofy(double maximumValueofy) {
306 90 bool result = setDouble(OS_Curve_BicubicFields::MaximumValueofy, maximumValueofy);
307
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 90 times.
90 OS_ASSERT(result);
308 90 return result;
309 }
310
311 2 bool CurveBicubic_Impl::setMinimumCurveOutput(boost::optional<double> minimumCurveOutput) {
312 2 bool result = false;
313
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
2 if (minimumCurveOutput) {
314 2 result = setDouble(OS_Curve_BicubicFields::MinimumCurveOutput, minimumCurveOutput.get());
315 } else {
316 ✗ result = setString(OS_Curve_BicubicFields::MinimumCurveOutput, "");
317 }
318
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 OS_ASSERT(result);
319 2 return result;
320 }
321
322 ✗ void CurveBicubic_Impl::resetMinimumCurveOutput() {
323 ✗ bool result = setString(OS_Curve_BicubicFields::MinimumCurveOutput, "");
324 ✗ OS_ASSERT(result);
325 ✗ }
326
327 2 bool CurveBicubic_Impl::setMaximumCurveOutput(boost::optional<double> maximumCurveOutput) {
328 2 bool result = false;
329
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
2 if (maximumCurveOutput) {
330 2 result = setDouble(OS_Curve_BicubicFields::MaximumCurveOutput, maximumCurveOutput.get());
331 } else {
332 ✗ result = setString(OS_Curve_BicubicFields::MaximumCurveOutput, "");
333 }
334
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 OS_ASSERT(result);
335 2 return result;
336 }
337
338 ✗ void CurveBicubic_Impl::resetMaximumCurveOutput() {
339 ✗ bool result = setString(OS_Curve_BicubicFields::MaximumCurveOutput, "");
340 ✗ OS_ASSERT(result);
341 ✗ }
342
343 83 bool CurveBicubic_Impl::setInputUnitTypeforX(const std::string& inputUnitTypeforX) {
344 83 bool result = setString(OS_Curve_BicubicFields::InputUnitTypeforX, inputUnitTypeforX);
345 83 return result;
346 }
347
348 ✗ void CurveBicubic_Impl::resetInputUnitTypeforX() {
349 ✗ bool result = setString(OS_Curve_BicubicFields::InputUnitTypeforX, "");
350 ✗ OS_ASSERT(result);
351 ✗ }
352
353 83 bool CurveBicubic_Impl::setInputUnitTypeforY(const std::string& inputUnitTypeforY) {
354 83 bool result = setString(OS_Curve_BicubicFields::InputUnitTypeforY, inputUnitTypeforY);
355 83 return result;
356 }
357
358 ✗ void CurveBicubic_Impl::resetInputUnitTypeforY() {
359 ✗ bool result = setString(OS_Curve_BicubicFields::InputUnitTypeforY, "");
360 ✗ OS_ASSERT(result);
361 ✗ }
362
363 83 bool CurveBicubic_Impl::setOutputUnitType(const std::string& outputUnitType) {
364 83 bool result = setString(OS_Curve_BicubicFields::OutputUnitType, outputUnitType);
365 83 return result;
366 }
367
368 ✗ void CurveBicubic_Impl::resetOutputUnitType() {
369 ✗ bool result = setString(OS_Curve_BicubicFields::OutputUnitType, "");
370 ✗ OS_ASSERT(result);
371 ✗ }
372
373 } // namespace detail
374
375 144 CurveBicubic::CurveBicubic(const Model& model) : Curve(CurveBicubic::iddObjectType(), model) {
376
1/3
✗ Branch 2 not taken.
✓ Branch 3 taken 144 times.
✗ Branch 5 not taken.
144 OS_ASSERT(getImpl<detail::CurveBicubic_Impl>());
377
1/1
✓ Branch 1 taken 144 times.
144 setDouble(OS_Curve_BicubicFields::Coefficient1Constant, 0.0);
378
1/1
✓ Branch 1 taken 144 times.
144 setDouble(OS_Curve_BicubicFields::Coefficient2x, 0.0);
379
1/1
✓ Branch 1 taken 144 times.
144 setDouble(OS_Curve_BicubicFields::Coefficient3x_POW_2, 0.0);
380
1/1
✓ Branch 1 taken 144 times.
144 setDouble(OS_Curve_BicubicFields::Coefficient4y, 0.0);
381
1/1
✓ Branch 1 taken 144 times.
144 setDouble(OS_Curve_BicubicFields::Coefficient5y_POW_2, 0.0);
382
1/1
✓ Branch 1 taken 144 times.
144 setDouble(OS_Curve_BicubicFields::Coefficient6x_TIMES_y, 0.0);
383
1/1
✓ Branch 1 taken 144 times.
144 setDouble(OS_Curve_BicubicFields::Coefficient7x_POW_3, 0.0);
384
1/1
✓ Branch 1 taken 144 times.
144 setDouble(OS_Curve_BicubicFields::Coefficient8y_POW_3, 0.0);
385
1/1
✓ Branch 1 taken 144 times.
144 setDouble(OS_Curve_BicubicFields::Coefficient9x_POW_2_TIMES_y, 0.0);
386
1/1
✓ Branch 1 taken 144 times.
144 setDouble(OS_Curve_BicubicFields::Coefficient10x_TIMES_y_POW_2, 0.0);
387
1/1
✓ Branch 1 taken 144 times.
144 setDouble(OS_Curve_BicubicFields::MinimumValueofx, 0.0);
388
1/1
✓ Branch 1 taken 144 times.
144 setDouble(OS_Curve_BicubicFields::MaximumValueofx, 1.0);
389
1/1
✓ Branch 1 taken 144 times.
144 setDouble(OS_Curve_BicubicFields::MinimumValueofy, 0.0);
390
1/1
✓ Branch 1 taken 144 times.
144 setDouble(OS_Curve_BicubicFields::MaximumValueofy, 1.0);
391 144 }
392
393 8040 IddObjectType CurveBicubic::iddObjectType() {
394
1/1
✓ Branch 1 taken 8040 times.
8040 IddObjectType result(IddObjectType::OS_Curve_Bicubic);
395 8040 return result;
396 }
397
398 ✗ std::vector<std::string> CurveBicubic::validInputUnitTypeforXValues() {
399 ✗ return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_Curve_BicubicFields::InputUnitTypeforX);
400 }
401
402 ✗ std::vector<std::string> CurveBicubic::validInputUnitTypeforYValues() {
403 ✗ return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_Curve_BicubicFields::InputUnitTypeforY);
404 }
405
406 ✗ std::vector<std::string> CurveBicubic::validOutputUnitTypeValues() {
407 ✗ return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_Curve_BicubicFields::OutputUnitType);
408 }
409
410 9 double CurveBicubic::coefficient1Constant() const {
411
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::CurveBicubic_Impl>()->coefficient1Constant();
412 }
413
414 9 double CurveBicubic::coefficient2x() const {
415
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::CurveBicubic_Impl>()->coefficient2x();
416 }
417
418 9 double CurveBicubic::coefficient3xPOW2() const {
419
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::CurveBicubic_Impl>()->coefficient3xPOW2();
420 }
421
422 9 double CurveBicubic::coefficient4y() const {
423
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::CurveBicubic_Impl>()->coefficient4y();
424 }
425
426 9 double CurveBicubic::coefficient5yPOW2() const {
427
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::CurveBicubic_Impl>()->coefficient5yPOW2();
428 }
429
430 9 double CurveBicubic::coefficient6xTIMESY() const {
431
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::CurveBicubic_Impl>()->coefficient6xTIMESY();
432 }
433
434 9 double CurveBicubic::coefficient7xPOW3() const {
435
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::CurveBicubic_Impl>()->coefficient7xPOW3();
436 }
437
438 9 double CurveBicubic::coefficient8yPOW3() const {
439
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::CurveBicubic_Impl>()->coefficient8yPOW3();
440 }
441
442 9 double CurveBicubic::coefficient9xPOW2TIMESY() const {
443
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::CurveBicubic_Impl>()->coefficient9xPOW2TIMESY();
444 }
445
446 9 double CurveBicubic::coefficient10xTIMESYPOW2() const {
447
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::CurveBicubic_Impl>()->coefficient10xTIMESYPOW2();
448 }
449
450 9 double CurveBicubic::minimumValueofx() const {
451
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::CurveBicubic_Impl>()->minimumValueofx();
452 }
453
454 9 double CurveBicubic::maximumValueofx() const {
455
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::CurveBicubic_Impl>()->maximumValueofx();
456 }
457
458 9 double CurveBicubic::minimumValueofy() const {
459
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::CurveBicubic_Impl>()->minimumValueofy();
460 }
461
462 9 double CurveBicubic::maximumValueofy() const {
463
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::CurveBicubic_Impl>()->maximumValueofy();
464 }
465
466 10 boost::optional<double> CurveBicubic::minimumCurveOutput() const {
467
1/1
✓ Branch 3 taken 10 times.
10 return getImpl<detail::CurveBicubic_Impl>()->minimumCurveOutput();
468 }
469
470 10 boost::optional<double> CurveBicubic::maximumCurveOutput() const {
471
1/1
✓ Branch 3 taken 10 times.
10 return getImpl<detail::CurveBicubic_Impl>()->maximumCurveOutput();
472 }
473
474 ✗ std::string CurveBicubic::inputUnitTypeforX() const {
475 ✗ return getImpl<detail::CurveBicubic_Impl>()->inputUnitTypeforX();
476 }
477
478 7 bool CurveBicubic::isInputUnitTypeforXDefaulted() const {
479
1/1
✓ Branch 3 taken 7 times.
7 return getImpl<detail::CurveBicubic_Impl>()->isInputUnitTypeforXDefaulted();
480 }
481
482 ✗ std::string CurveBicubic::inputUnitTypeforY() const {
483 ✗ return getImpl<detail::CurveBicubic_Impl>()->inputUnitTypeforY();
484 }
485
486 7 bool CurveBicubic::isInputUnitTypeforYDefaulted() const {
487
1/1
✓ Branch 3 taken 7 times.
7 return getImpl<detail::CurveBicubic_Impl>()->isInputUnitTypeforYDefaulted();
488 }
489
490 ✗ std::string CurveBicubic::outputUnitType() const {
491 ✗ return getImpl<detail::CurveBicubic_Impl>()->outputUnitType();
492 }
493
494 7 bool CurveBicubic::isOutputUnitTypeDefaulted() const {
495
1/1
✓ Branch 3 taken 7 times.
7 return getImpl<detail::CurveBicubic_Impl>()->isOutputUnitTypeDefaulted();
496 }
497
498 128 bool CurveBicubic::setCoefficient1Constant(double coefficient1Constant) {
499
1/1
✓ Branch 3 taken 128 times.
128 return getImpl<detail::CurveBicubic_Impl>()->setCoefficient1Constant(coefficient1Constant);
500 }
501
502 128 bool CurveBicubic::setCoefficient2x(double coefficient2x) {
503
1/1
✓ Branch 3 taken 128 times.
128 return getImpl<detail::CurveBicubic_Impl>()->setCoefficient2x(coefficient2x);
504 }
505
506 128 bool CurveBicubic::setCoefficient3xPOW2(double coefficient3xPOW2) {
507
1/1
✓ Branch 3 taken 128 times.
128 return getImpl<detail::CurveBicubic_Impl>()->setCoefficient3xPOW2(coefficient3xPOW2);
508 }
509
510 90 bool CurveBicubic::setCoefficient4y(double coefficient4y) {
511
1/1
✓ Branch 3 taken 90 times.
90 return getImpl<detail::CurveBicubic_Impl>()->setCoefficient4y(coefficient4y);
512 }
513
514 90 bool CurveBicubic::setCoefficient5yPOW2(double coefficient5yPOW2) {
515
1/1
✓ Branch 3 taken 90 times.
90 return getImpl<detail::CurveBicubic_Impl>()->setCoefficient5yPOW2(coefficient5yPOW2);
516 }
517
518 90 bool CurveBicubic::setCoefficient6xTIMESY(double coefficient6xTIMESY) {
519
1/1
✓ Branch 3 taken 90 times.
90 return getImpl<detail::CurveBicubic_Impl>()->setCoefficient6xTIMESY(coefficient6xTIMESY);
520 }
521
522 128 bool CurveBicubic::setCoefficient7xPOW3(double coefficient7xPOW3) {
523
1/1
✓ Branch 3 taken 128 times.
128 return getImpl<detail::CurveBicubic_Impl>()->setCoefficient7xPOW3(coefficient7xPOW3);
524 }
525
526 90 bool CurveBicubic::setCoefficient8yPOW3(double coefficient8yPOW3) {
527
1/1
✓ Branch 3 taken 90 times.
90 return getImpl<detail::CurveBicubic_Impl>()->setCoefficient8yPOW3(coefficient8yPOW3);
528 }
529
530 90 bool CurveBicubic::setCoefficient9xPOW2TIMESY(double coefficient9xPOW2TIMESY) {
531
1/1
✓ Branch 3 taken 90 times.
90 return getImpl<detail::CurveBicubic_Impl>()->setCoefficient9xPOW2TIMESY(coefficient9xPOW2TIMESY);
532 }
533
534 90 bool CurveBicubic::setCoefficient10xTIMESYPOW2(double coefficient10xTIMESYPOW2) {
535
1/1
✓ Branch 3 taken 90 times.
90 return getImpl<detail::CurveBicubic_Impl>()->setCoefficient10xTIMESYPOW2(coefficient10xTIMESYPOW2);
536 }
537
538 128 bool CurveBicubic::setMinimumValueofx(double minimumValueofx) {
539
1/1
✓ Branch 3 taken 128 times.
128 return getImpl<detail::CurveBicubic_Impl>()->setMinimumValueofx(minimumValueofx);
540 }
541
542 128 bool CurveBicubic::setMaximumValueofx(double maximumValueofx) {
543
1/1
✓ Branch 3 taken 128 times.
128 return getImpl<detail::CurveBicubic_Impl>()->setMaximumValueofx(maximumValueofx);
544 }
545
546 90 bool CurveBicubic::setMinimumValueofy(double minimumValueofy) {
547
1/1
✓ Branch 3 taken 90 times.
90 return getImpl<detail::CurveBicubic_Impl>()->setMinimumValueofy(minimumValueofy);
548 }
549
550 90 bool CurveBicubic::setMaximumValueofy(double maximumValueofy) {
551
1/1
✓ Branch 3 taken 90 times.
90 return getImpl<detail::CurveBicubic_Impl>()->setMaximumValueofy(maximumValueofy);
552 }
553
554 2 bool CurveBicubic::setMinimumCurveOutput(double minimumCurveOutput) {
555
2/2
✓ Branch 3 taken 2 times.
✓ Branch 6 taken 2 times.
2 return getImpl<detail::CurveBicubic_Impl>()->setMinimumCurveOutput(minimumCurveOutput);
556 }
557
558 ✗ void CurveBicubic::resetMinimumCurveOutput() {
559 ✗ getImpl<detail::CurveBicubic_Impl>()->resetMinimumCurveOutput();
560 ✗ }
561
562 2 bool CurveBicubic::setMaximumCurveOutput(double maximumCurveOutput) {
563
2/2
✓ Branch 3 taken 2 times.
✓ Branch 6 taken 2 times.
2 return getImpl<detail::CurveBicubic_Impl>()->setMaximumCurveOutput(maximumCurveOutput);
564 }
565
566 ✗ void CurveBicubic::resetMaximumCurveOutput() {
567 ✗ getImpl<detail::CurveBicubic_Impl>()->resetMaximumCurveOutput();
568 ✗ }
569
570 83 bool CurveBicubic::setInputUnitTypeforX(const std::string& inputUnitTypeforX) {
571
1/1
✓ Branch 3 taken 83 times.
83 return getImpl<detail::CurveBicubic_Impl>()->setInputUnitTypeforX(inputUnitTypeforX);
572 }
573
574 ✗ void CurveBicubic::resetInputUnitTypeforX() {
575 ✗ getImpl<detail::CurveBicubic_Impl>()->resetInputUnitTypeforX();
576 ✗ }
577
578 83 bool CurveBicubic::setInputUnitTypeforY(const std::string& inputUnitTypeforY) {
579
1/1
✓ Branch 3 taken 83 times.
83 return getImpl<detail::CurveBicubic_Impl>()->setInputUnitTypeforY(inputUnitTypeforY);
580 }
581
582 ✗ void CurveBicubic::resetInputUnitTypeforY() {
583 ✗ getImpl<detail::CurveBicubic_Impl>()->resetInputUnitTypeforY();
584 ✗ }
585
586 83 bool CurveBicubic::setOutputUnitType(const std::string& outputUnitType) {
587
1/1
✓ Branch 3 taken 83 times.
83 return getImpl<detail::CurveBicubic_Impl>()->setOutputUnitType(outputUnitType);
588 }
589
590 ✗ void CurveBicubic::resetOutputUnitType() {
591 ✗ getImpl<detail::CurveBicubic_Impl>()->resetOutputUnitType();
592 ✗ }
593
594 /// @cond
595
1/1
✓ Branch 3 taken 54 times.
54 CurveBicubic::CurveBicubic(std::shared_ptr<detail::CurveBicubic_Impl> impl) : Curve(std::move(impl)) {}
596 /// @endcond
597
598 } // namespace model
599 } // namespace openstudio
600