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