GCC Code Coverage Report


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

src/model/CurveBiquadratic.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_CURVEBIQUADRATIC_HPP
7 #define MODEL_CURVEBIQUADRATIC_HPP
8
9 #include "ModelAPI.hpp"
10 #include "Curve.hpp"
11
12 namespace openstudio {
13 namespace model {
14
15 namespace detail {
16
17 class CurveBiquadratic_Impl;
18
19 } // namespace detail
20
21 /** CurveBiquadratic is a Curve that wraps the OpenStudio IDD object 'OS:Curve:Biquadratic'. 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\f$ */
23 class MODEL_API CurveBiquadratic : public Curve
24 {
25 public:
26 /** @name Constructors and Destructors */
27 //@{
28
29 /** Initializes all coefficients to 0.0, and sets the bounds on x and y to [0.0,1.0]. */
30 explicit CurveBiquadratic(const Model& model);
31
32 3805 virtual ~CurveBiquadratic() override = default;
33 // Default the copy and move operators because the virtual dtor is explicit
34 ✗ CurveBiquadratic(const CurveBiquadratic& other) = default;
35 270 CurveBiquadratic(CurveBiquadratic&& other) = default;
36 ✗ CurveBiquadratic& operator=(const CurveBiquadratic&) = default;
37 ✗ CurveBiquadratic& operator=(CurveBiquadratic&&) = 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 minimumValueofx() const;
65
66 double maximumValueofx() const;
67
68 double minimumValueofy() const;
69
70 double maximumValueofy() const;
71
72 boost::optional<double> minimumCurveOutput() const;
73
74 boost::optional<double> maximumCurveOutput() const;
75
76 std::string inputUnitTypeforX() const;
77
78 bool isInputUnitTypeforXDefaulted() const;
79
80 std::string inputUnitTypeforY() const;
81
82 bool isInputUnitTypeforYDefaulted() const;
83
84 std::string outputUnitType() const;
85
86 bool isOutputUnitTypeDefaulted() const;
87
88 //@}
89 /** @name Setters */
90 //@{
91
92 bool setCoefficient1Constant(double coefficient1Constant);
93
94 bool setCoefficient2x(double coefficient2x);
95
96 bool setCoefficient3xPOW2(double coefficient3xPOW2);
97
98 bool setCoefficient4y(double coefficient4y);
99
100 bool setCoefficient5yPOW2(double coefficient5yPOW2);
101
102 bool setCoefficient6xTIMESY(double coefficient6xTIMESY);
103
104 bool setMinimumValueofx(double minimumValueofx);
105
106 bool setMaximumValueofx(double maximumValueofx);
107
108 bool setMinimumValueofy(double minimumValueofy);
109
110 bool setMaximumValueofy(double maximumValueofy);
111
112 bool setMinimumCurveOutput(double minimumCurveOutput);
113
114 void resetMinimumCurveOutput();
115
116 bool setMaximumCurveOutput(double maximumCurveOutput);
117
118 void resetMaximumCurveOutput();
119
120 bool setInputUnitTypeforX(const std::string& inputUnitTypeforX);
121
122 void resetInputUnitTypeforX();
123
124 bool setInputUnitTypeforY(const std::string& inputUnitTypeforY);
125
126 void resetInputUnitTypeforY();
127
128 bool setOutputUnitType(const std::string& outputUnitType);
129
130 void resetOutputUnitType();
131
132 //@}
133 /** @name Other */
134 //@{
135
136 //@}
137 protected:
138 /// @cond
139 using ImplType = detail::CurveBiquadratic_Impl;
140
141 explicit CurveBiquadratic(std::shared_ptr<detail::CurveBiquadratic_Impl> impl);
142
143 friend class detail::CurveBiquadratic_Impl;
144 friend class Model;
145 friend class IdfObject;
146 friend class openstudio::detail::IdfObject_Impl;
147
148 /// @endcond
149 private:
150 REGISTER_LOGGER("openstudio.model.CurveBiquadratic");
151 };
152
153 /** \relates CurveBiquadratic*/
154 using OptionalCurveBiquadratic = boost::optional<CurveBiquadratic>;
155
156 /** \relates CurveBiquadratic*/
157 using CurveBiquadraticVector = std::vector<CurveBiquadratic>;
158
159 } // namespace model
160 } // namespace openstudio
161
162 #endif // MODEL_CURVEBIQUADRATIC_HPP
163