src/model/ShadowCalculation.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_SHADOWCALCULATION_HPP | ||
| 7 | #define MODEL_SHADOWCALCULATION_HPP | ||
| 8 | |||
| 9 | #include "ModelAPI.hpp" | ||
| 10 | #include "ModelObject.hpp" | ||
| 11 | |||
| 12 | namespace openstudio { | ||
| 13 | namespace model { | ||
| 14 | |||
| 15 | // Forward declarations | ||
| 16 | class ThermalZone; | ||
| 17 | |||
| 18 | namespace detail { | ||
| 19 | class ShadowCalculation_Impl; | ||
| 20 | } // namespace detail | ||
| 21 | |||
| 22 | /** ShadowCalculation derives from ModelObject and is an interface to the OpenStudio IDD object named "ShadowCalculation". | ||
| 23 | * | ||
| 24 | * ShadowCalculation defines how often shadowing calculations should be performed in EnergyPlus simulations | ||
| 25 | * as well as how many overlapping figures can be considered in a shadow calculation. | ||
| 26 | * ShadowCalculation does not have a public constructor because it is a unique ModelObject. | ||
| 27 | * To get the ShadowCalculation object for a Model or create one if it does not yet exist use model.getUniqueObject<ShadowCalculation>(). | ||
| 28 | * To get the ShadowCalculation object for a Model but not create one if it does not yet exist use model.getOptionalUniqueObject<ShadowCalculation>(). | ||
| 29 | */ | ||
| 30 | class MODEL_API ShadowCalculation : public ModelObject | ||
| 31 | { | ||
| 32 | public: | ||
| 33 | 500 | virtual ~ShadowCalculation() override = default; | |
| 34 | // Default the copy and move operators because the virtual dtor is explicit | ||
| 35 | 20 | ShadowCalculation(const ShadowCalculation& other) = default; | |
| 36 | 81 | ShadowCalculation(ShadowCalculation&& other) = default; | |
| 37 | ✗ | ShadowCalculation& operator=(const ShadowCalculation&) = default; | |
| 38 | ✗ | ShadowCalculation& operator=(ShadowCalculation&&) = default; | |
| 39 | |||
| 40 | /** @name Static Methods */ | ||
| 41 | //@{ | ||
| 42 | |||
| 43 | static IddObjectType iddObjectType(); | ||
| 44 | |||
| 45 | static std::vector<std::string> shadingCalculationMethodValues(); | ||
| 46 | static std::vector<std::string> validShadingCalculationMethodValues(); | ||
| 47 | |||
| 48 | static std::vector<std::string> shadingCalculationUpdateFrequencyMethodValues(); | ||
| 49 | static std::vector<std::string> validShadingCalculationUpdateFrequencyMethodValues(); | ||
| 50 | |||
| 51 | static std::vector<std::string> polygonClippingAlgorithmValues(); | ||
| 52 | static std::vector<std::string> validPolygonClippingAlgorithmValues(); | ||
| 53 | |||
| 54 | static std::vector<std::string> skyDiffuseModelingAlgorithmValues(); | ||
| 55 | static std::vector<std::string> validSkyDiffuseModelingAlgorithmValues(); | ||
| 56 | |||
| 57 | //@} | ||
| 58 | /** @name Getters */ | ||
| 59 | //@{ | ||
| 60 | |||
| 61 | // new field | ||
| 62 | std::string shadingCalculationMethod() const; | ||
| 63 | // bool isShadingCalculationMethodDefaulted() const; | ||
| 64 | |||
| 65 | // renamed method, used to be 'calculationMethod' | ||
| 66 | std::string shadingCalculationUpdateFrequencyMethod() const; | ||
| 67 | bool isShadingCalculationUpdateFrequencyMethodDefaulted() const; | ||
| 68 | |||
| 69 | int shadingCalculationUpdateFrequency() const; | ||
| 70 | bool isShadingCalculationUpdateFrequencyDefaulted() const; | ||
| 71 | |||
| 72 | int maximumFiguresInShadowOverlapCalculations() const; | ||
| 73 | bool isMaximumFiguresInShadowOverlapCalculationsDefaulted() const; | ||
| 74 | |||
| 75 | std::string polygonClippingAlgorithm() const; | ||
| 76 | |||
| 77 | int pixelCountingResolution() const; | ||
| 78 | |||
| 79 | std::string skyDiffuseModelingAlgorithm() const; | ||
| 80 | |||
| 81 | bool outputExternalShadingCalculationResults() const; | ||
| 82 | |||
| 83 | bool disableSelfShadingWithinShadingZoneGroups() const; | ||
| 84 | |||
| 85 | bool disableSelfShadingFromShadingZoneGroupstoOtherZones() const; | ||
| 86 | |||
| 87 | unsigned int numberofShadingZoneGroups() const; | ||
| 88 | std::vector<ThermalZone> getShadingZoneGroup(unsigned groupIndex) const; | ||
| 89 | |||
| 90 | //@} | ||
| 91 | /** @name Setters */ | ||
| 92 | //@{ | ||
| 93 | |||
| 94 | bool setShadingCalculationMethod(const std::string& shadingCalculationMethod); | ||
| 95 | // void resetShadingCalculationMethod(); | ||
| 96 | |||
| 97 | bool setShadingCalculationUpdateFrequencyMethod(const std::string& shadingCalculationUpdateFrequencyMethod); | ||
| 98 | void resetShadingCalculationUpdateFrequencyMethod(); | ||
| 99 | |||
| 100 | bool setShadingCalculationUpdateFrequency(int shadingCalculationUpdateFrequency); | ||
| 101 | void resetShadingCalculationUpdateFrequency(); | ||
| 102 | |||
| 103 | bool setMaximumFiguresInShadowOverlapCalculations(int maximumFiguresInShadowOverlapCalculations); | ||
| 104 | void resetMaximumFiguresInShadowOverlapCalculations(); | ||
| 105 | |||
| 106 | bool setPolygonClippingAlgorithm(const std::string& polygonClippingAlgorithm); | ||
| 107 | void resetPolygonClippingAlgorithm(); | ||
| 108 | |||
| 109 | bool setPixelCountingResolution(int pixelCountingResolution); | ||
| 110 | // void resetPixelCountingResolution(); | ||
| 111 | |||
| 112 | bool setSkyDiffuseModelingAlgorithm(const std::string& skyDiffuseModelingAlgorithm); | ||
| 113 | void resetSkyDiffuseModelingAlgorithm(); | ||
| 114 | |||
| 115 | bool setOutputExternalShadingCalculationResults(bool outputExternalShadingCalculationResults); | ||
| 116 | |||
| 117 | bool setDisableSelfShadingWithinShadingZoneGroups(bool disableSelfShadingWithinShadingZoneGroups); | ||
| 118 | |||
| 119 | bool setDisableSelfShadingFromShadingZoneGroupstoOtherZones(bool disableSelfShadingFromShadingZoneGroupstoOtherZones); | ||
| 120 | |||
| 121 | bool addShadingZoneGroup(const std::vector<ThermalZone>& thermalZones); | ||
| 122 | bool removeShadingZoneGroup(unsigned groupIndex); | ||
| 123 | void removeAllShadingZoneGroups(); | ||
| 124 | |||
| 125 | //@} | ||
| 126 | |||
| 127 | protected: | ||
| 128 | /** @name Constructors and Destructors */ | ||
| 129 | //@{ | ||
| 130 | |||
| 131 | /// Constructs a new ShadowCalculation object in the model. | ||
| 132 | explicit ShadowCalculation(const Model& model); | ||
| 133 | |||
| 134 | //@} | ||
| 135 | |||
| 136 | /// @cond | ||
| 137 | |||
| 138 | using ImplType = detail::ShadowCalculation_Impl; | ||
| 139 | |||
| 140 | friend class Model; | ||
| 141 | friend class openstudio::IdfObject; | ||
| 142 | |||
| 143 | // constructor | ||
| 144 | explicit ShadowCalculation(std::shared_ptr<detail::ShadowCalculation_Impl> impl); | ||
| 145 | |||
| 146 | private: | ||
| 147 | REGISTER_LOGGER("openstudio.model.ShadowCalculation"); | ||
| 148 | |||
| 149 | /// @endcond | ||
| 150 | }; | ||
| 151 | |||
| 152 | /** \relates ShadowCalculation */ | ||
| 153 | using OptionalShadowCalculation = boost::optional<ShadowCalculation>; | ||
| 154 | |||
| 155 | } // namespace model | ||
| 156 | } // namespace openstudio | ||
| 157 | |||
| 158 | #endif // MODEL_SHADOWCALCULATION_HPP | ||
| 159 |