src/model/CurveCubic.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_CURVECUBIC_HPP | ||
| 7 | #define MODEL_CURVECUBIC_HPP | ||
| 8 | |||
| 9 | #include "ModelAPI.hpp" | ||
| 10 | #include "Curve.hpp" | ||
| 11 | |||
| 12 | namespace openstudio { | ||
| 13 | namespace model { | ||
| 14 | |||
| 15 | namespace detail { | ||
| 16 | |||
| 17 | class CurveCubic_Impl; | ||
| 18 | |||
| 19 | } // namespace detail | ||
| 20 | |||
| 21 | /** CurveCubic is a Curve that wraps the OpenStudio IDD object 'OS:Curve:Cubic'. The | ||
| 22 | * functional form is \f$f(x) = c_1 + c_2 \cdot x + c_3 \cdot x^2 + c_4 \cdot x^3\f$ */ | ||
| 23 | class MODEL_API CurveCubic : public Curve | ||
| 24 | { | ||
| 25 | public: | ||
| 26 | /** @name Constructors and Destructors */ | ||
| 27 | //@{ | ||
| 28 | |||
| 29 | /** Sets \f$c_1 = c_2 = c_3 = 0.0,\ c_4 = 1.0\f$, and sets the range for x at [0.0,1.0]. */ | ||
| 30 | explicit CurveCubic(const Model& model); | ||
| 31 | |||
| 32 | 1491 | virtual ~CurveCubic() override = default; | |
| 33 | // Default the copy and move operators because the virtual dtor is explicit | ||
| 34 | 41 | CurveCubic(const CurveCubic& other) = default; | |
| 35 | 239 | CurveCubic(CurveCubic&& other) = default; | |
| 36 | ✗ | CurveCubic& operator=(const CurveCubic&) = default; | |
| 37 | 10 | CurveCubic& operator=(CurveCubic&&) = default; | |
| 38 | |||
| 39 | //@} | ||
| 40 | |||
| 41 | static IddObjectType iddObjectType(); | ||
| 42 | |||
| 43 | static std::vector<std::string> validInputUnitTypeforXValues(); | ||
| 44 | |||
| 45 | static std::vector<std::string> validOutputUnitTypeValues(); | ||
| 46 | |||
| 47 | /** @name Getters */ | ||
| 48 | //@{ | ||
| 49 | |||
| 50 | double coefficient1Constant() const; | ||
| 51 | |||
| 52 | double coefficient2x() const; | ||
| 53 | |||
| 54 | double coefficient3xPOW2() const; | ||
| 55 | |||
| 56 | double coefficient4xPOW3() const; | ||
| 57 | |||
| 58 | double minimumValueofx() const; | ||
| 59 | |||
| 60 | double maximumValueofx() const; | ||
| 61 | |||
| 62 | boost::optional<double> minimumCurveOutput() const; | ||
| 63 | |||
| 64 | boost::optional<double> maximumCurveOutput() const; | ||
| 65 | |||
| 66 | std::string inputUnitTypeforX() const; | ||
| 67 | |||
| 68 | bool isInputUnitTypeforXDefaulted() const; | ||
| 69 | |||
| 70 | std::string outputUnitType() const; | ||
| 71 | |||
| 72 | bool isOutputUnitTypeDefaulted() const; | ||
| 73 | |||
| 74 | //@} | ||
| 75 | /** @name Setters */ | ||
| 76 | //@{ | ||
| 77 | |||
| 78 | bool setCoefficient1Constant(double coefficient1Constant); | ||
| 79 | |||
| 80 | bool setCoefficient2x(double coefficient2x); | ||
| 81 | |||
| 82 | bool setCoefficient3xPOW2(double coefficient3xPOW2); | ||
| 83 | |||
| 84 | bool setCoefficient4xPOW3(double coefficient4xPOW3); | ||
| 85 | |||
| 86 | bool setMinimumValueofx(double minimumValueofx); | ||
| 87 | |||
| 88 | bool setMaximumValueofx(double maximumValueofx); | ||
| 89 | |||
| 90 | bool setMinimumCurveOutput(double minimumCurveOutput); | ||
| 91 | |||
| 92 | void resetMinimumCurveOutput(); | ||
| 93 | |||
| 94 | bool setMaximumCurveOutput(double maximumCurveOutput); | ||
| 95 | |||
| 96 | void resetMaximumCurveOutput(); | ||
| 97 | |||
| 98 | bool setInputUnitTypeforX(const std::string& inputUnitTypeforX); | ||
| 99 | |||
| 100 | void resetInputUnitTypeforX(); | ||
| 101 | |||
| 102 | bool setOutputUnitType(const std::string& outputUnitType); | ||
| 103 | |||
| 104 | void resetOutputUnitType(); | ||
| 105 | |||
| 106 | //@} | ||
| 107 | /** @name Other */ | ||
| 108 | //@{ | ||
| 109 | |||
| 110 | //@} | ||
| 111 | protected: | ||
| 112 | /// @cond | ||
| 113 | using ImplType = detail::CurveCubic_Impl; | ||
| 114 | |||
| 115 | explicit CurveCubic(std::shared_ptr<detail::CurveCubic_Impl> impl); | ||
| 116 | |||
| 117 | friend class detail::CurveCubic_Impl; | ||
| 118 | friend class Model; | ||
| 119 | friend class IdfObject; | ||
| 120 | friend class openstudio::detail::IdfObject_Impl; | ||
| 121 | |||
| 122 | /// @endcond | ||
| 123 | private: | ||
| 124 | REGISTER_LOGGER("openstudio.model.CurveCubic"); | ||
| 125 | }; | ||
| 126 | |||
| 127 | /** \relates CurveCubic*/ | ||
| 128 | using OptionalCurveCubic = boost::optional<CurveCubic>; | ||
| 129 | |||
| 130 | /** \relates CurveCubic*/ | ||
| 131 | using CurveCubicVector = std::vector<CurveCubic>; | ||
| 132 | |||
| 133 | } // namespace model | ||
| 134 | } // namespace openstudio | ||
| 135 | |||
| 136 | #endif // MODEL_CURVECUBIC_HPP | ||
| 137 |