GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 80.0% 4 / 0 / 5
Functions: 80.0% 4 / 0 / 5
Branches: -% 0 / 0 / 0

src/model/CurveBicubic.hpp
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 #ifndef MODEL_CURVEBICUBIC_HPP
7 #define MODEL_CURVEBICUBIC_HPP
8
9 #include "ModelAPI.hpp"
10 #include "Curve.hpp"
11
12 namespace openstudio {
13 namespace model {
14
15 namespace detail {
16
17 class CurveBicubic_Impl;
18
19 } // namespace detail
20
21 /** CurveBicubic is a Curve that wraps the OpenStudio IDD object 'OS:Curve:Bicubic'. The
22 * functional form is \f$f(x) = c_1 + c_2 \cdot x + c_3 \cdot x^2 + c_4 \cdot y + c_5 \cdot y^2 + c_6 \cdot x \cdot y + c_7 \cdot x^3 + c_8 \cdot y^3 + c_9 \cdot x^2 \cdot y + c_{10} \cdot x \cdot y^2\f$ */
23 class MODEL_API CurveBicubic : public Curve
24 {
25 public:
26 /** @name Constructors and Destructors */
27 //@{
28
29 /** Initializes all coefficients to 0.0, and bounds x and y within [0.0,1.0]. */
30 explicit CurveBicubic(const Model& model);
31
32 314 virtual ~CurveBicubic() override = default;
33 // Default the copy and move operators because the virtual dtor is explicit
34 30 CurveBicubic(const CurveBicubic& other) = default;
35 88 CurveBicubic(CurveBicubic&& other) = default;
36 ✗ CurveBicubic& operator=(const CurveBicubic&) = default;
37 7 CurveBicubic& operator=(CurveBicubic&&) = default;
38
39 //@}
40
41 static IddObjectType iddObjectType();
42
43 static std::vector<std::string> validInputUnitTypeforXValues();
44
45 static std::vector<std::string> validInputUnitTypeforYValues();
46
47 static std::vector<std::string> validOutputUnitTypeValues();
48
49 /** @name Getters */
50 //@{
51
52 double coefficient1Constant() const;
53
54 double coefficient2x() const;
55
56 double coefficient3xPOW2() const;
57
58 double coefficient4y() const;
59
60 double coefficient5yPOW2() const;
61
62 double coefficient6xTIMESY() const;
63
64 double coefficient7xPOW3() const;
65
66 double coefficient8yPOW3() const;
67
68 double coefficient9xPOW2TIMESY() const;
69
70 double coefficient10xTIMESYPOW2() const;
71
72 double minimumValueofx() const;
73
74 double maximumValueofx() const;
75
76 double minimumValueofy() const;
77
78 double maximumValueofy() const;
79
80 boost::optional<double> minimumCurveOutput() const;
81
82 boost::optional<double> maximumCurveOutput() const;
83
84 std::string inputUnitTypeforX() const;
85
86 bool isInputUnitTypeforXDefaulted() const;
87
88 std::string inputUnitTypeforY() const;
89
90 bool isInputUnitTypeforYDefaulted() const;
91
92 std::string outputUnitType() const;
93
94 bool isOutputUnitTypeDefaulted() const;
95
96 //@}
97 /** @name Setters */
98 //@{
99
100 bool setCoefficient1Constant(double coefficient1Constant);
101
102 bool setCoefficient2x(double coefficient2x);
103
104 bool setCoefficient3xPOW2(double coefficient3xPOW2);
105
106 bool setCoefficient4y(double coefficient4y);
107
108 bool setCoefficient5yPOW2(double coefficient5yPOW2);
109
110 bool setCoefficient6xTIMESY(double coefficient6xTIMESY);
111
112 bool setCoefficient7xPOW3(double coefficient7xPOW3);
113
114 bool setCoefficient8yPOW3(double coefficient8yPOW3);
115
116 bool setCoefficient9xPOW2TIMESY(double coefficient9xPOW2TIMESY);
117
118 bool setCoefficient10xTIMESYPOW2(double coefficient10xTIMESYPOW2);
119
120 bool setMinimumValueofx(double minimumValueofx);
121
122 bool setMaximumValueofx(double maximumValueofx);
123
124 bool setMinimumValueofy(double minimumValueofy);
125
126 bool setMaximumValueofy(double maximumValueofy);
127
128 bool setMinimumCurveOutput(double minimumCurveOutput);
129
130 void resetMinimumCurveOutput();
131
132 bool setMaximumCurveOutput(double maximumCurveOutput);
133
134 void resetMaximumCurveOutput();
135
136 bool setInputUnitTypeforX(const std::string& inputUnitTypeforX);
137
138 void resetInputUnitTypeforX();
139
140 bool setInputUnitTypeforY(const std::string& inputUnitTypeforY);
141
142 void resetInputUnitTypeforY();
143
144 bool setOutputUnitType(const std::string& outputUnitType);
145
146 void resetOutputUnitType();
147
148 //@}
149 /** @name Other */
150 //@{
151
152 //@}
153 protected:
154 /// @cond
155 using ImplType = detail::CurveBicubic_Impl;
156
157 explicit CurveBicubic(std::shared_ptr<detail::CurveBicubic_Impl> impl);
158
159 friend class detail::CurveBicubic_Impl;
160 friend class Model;
161 friend class IdfObject;
162 friend class openstudio::detail::IdfObject_Impl;
163
164 /// @endcond
165 private:
166 REGISTER_LOGGER("openstudio.model.CurveBicubic");
167 };
168
169 /** \relates CurveBicubic*/
170 using OptionalCurveBicubic = boost::optional<CurveBicubic>;
171
172 /** \relates CurveBicubic*/
173 using CurveBicubicVector = std::vector<CurveBicubic>;
174
175 } // namespace model
176 } // namespace openstudio
177
178 #endif // MODEL_CURVEBICUBIC_HPP
179