src/model/SurfacePropertySurroundingSurfaces.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_SURFACEPROPERTYSURROUNDINGSURFACES_HPP | ||
| 7 | #define MODEL_SURFACEPROPERTYSURROUNDINGSURFACES_HPP | ||
| 8 | |||
| 9 | #include "ModelAPI.hpp" | ||
| 10 | #include "ModelObject.hpp" | ||
| 11 | #include "Schedule.hpp" | ||
| 12 | |||
| 13 | namespace openstudio { | ||
| 14 | |||
| 15 | namespace model { | ||
| 16 | |||
| 17 | class SurfacePropertyLocalEnvironment; | ||
| 18 | |||
| 19 | namespace detail { | ||
| 20 | |||
| 21 | class SurfacePropertySurroundingSurfaces_Impl; | ||
| 22 | |||
| 23 | } // namespace detail | ||
| 24 | |||
| 25 | /** This class implements an extensible group */ | ||
| 26 | class MODEL_API SurroundingSurfaceGroup | ||
| 27 | { | ||
| 28 | public: | ||
| 29 | SurroundingSurfaceGroup(std::string surroundingSurfaceName, double viewFactor, const Schedule& temperatureSchedule); | ||
| 30 | |||
| 31 | std::string surroundingSurfaceName() const; | ||
| 32 | double viewFactor() const; | ||
| 33 | Schedule temperatureSchedule() const; | ||
| 34 | |||
| 35 | private: | ||
| 36 | // From | ||
| 37 | std::string m_surroundingSurfaceName; | ||
| 38 | double m_viewFactor; | ||
| 39 | Schedule m_tempSch; | ||
| 40 | − | REGISTER_LOGGER("openstudio.model.SurroundingSurfaceGroup"); | |
| 41 | }; | ||
| 42 | |||
| 43 | // Overload operator<< | ||
| 44 | MODEL_API std::ostream& operator<<(std::ostream& out, const openstudio::model::SurroundingSurfaceGroup& surroundingSurfaceGroup); | ||
| 45 | |||
| 46 | /** SurfacePropertySurroundingSurfaces is a ModelObject that wraps the OpenStudio IDD object 'OS:SurfaceProperty:SurroundingSurfaces'. */ | ||
| 47 | class MODEL_API SurfacePropertySurroundingSurfaces : public ModelObject | ||
| 48 | { | ||
| 49 | public: | ||
| 50 | /** @name Constructors and Destructors */ | ||
| 51 | //@{ | ||
| 52 | |||
| 53 | explicit SurfacePropertySurroundingSurfaces(const Model& model); | ||
| 54 | |||
| 55 | 53 | virtual ~SurfacePropertySurroundingSurfaces() override = default; | |
| 56 | |||
| 57 | //@} | ||
| 58 | |||
| 59 | static IddObjectType iddObjectType(); | ||
| 60 | |||
| 61 | /** @name Getters */ | ||
| 62 | //@{ | ||
| 63 | |||
| 64 | boost::optional<double> skyViewFactor() const; | ||
| 65 | |||
| 66 | bool isSkyViewFactorAutocalculated() const; | ||
| 67 | |||
| 68 | boost::optional<Schedule> skyTemperatureSchedule() const; | ||
| 69 | |||
| 70 | boost::optional<double> groundViewFactor() const; | ||
| 71 | |||
| 72 | bool isGroundViewFactorAutocalculated() const; | ||
| 73 | |||
| 74 | boost::optional<Schedule> groundTemperatureSchedule() const; | ||
| 75 | |||
| 76 | //@} | ||
| 77 | /** @name Setters */ | ||
| 78 | //@{ | ||
| 79 | |||
| 80 | bool setSkyViewFactor(double skyViewFactor); | ||
| 81 | void autocalculateSkyViewFactor(); | ||
| 82 | |||
| 83 | bool setSkyTemperatureSchedule(Schedule& schedule); | ||
| 84 | void resetSkyTemperatureSchedule(); | ||
| 85 | |||
| 86 | bool setGroundViewFactor(double groundViewFactor); | ||
| 87 | void autocalculateGroundViewFactor(); | ||
| 88 | |||
| 89 | bool setGroundTemperatureSchedule(Schedule& schedule); | ||
| 90 | void resetGroundTemperatureSchedule(); | ||
| 91 | |||
| 92 | //@} | ||
| 93 | /** @name Other */ | ||
| 94 | //@{ | ||
| 95 | |||
| 96 | // Helper to get the parent SurfaceProperty:LocalEnvironment object | ||
| 97 | boost::optional<SurfacePropertyLocalEnvironment> surfacePropertyLocalEnvironment() const; | ||
| 98 | |||
| 99 | // Handle this object's extensible fields. | ||
| 100 | std::vector<SurroundingSurfaceGroup> surroundingSurfaceGroups() const; | ||
| 101 | |||
| 102 | unsigned int numberofSurroundingSurfaceGroups() const; | ||
| 103 | |||
| 104 | /** Looks up by Surface Name (case-insensitive) */ | ||
| 105 | boost::optional<unsigned> surroundingSurfaceGroupIndex(const SurroundingSurfaceGroup& surroundingSurfaceGroup) const; | ||
| 106 | boost::optional<unsigned> surroundingSurfaceGroupIndex(const std::string& surroundingSurfaceName) const; | ||
| 107 | |||
| 108 | boost::optional<SurroundingSurfaceGroup> getSurroundingSurfaceGroup(unsigned groupIndex) const; | ||
| 109 | |||
| 110 | /** If a surroundingSurfaceGroup group is already present (cf `surroundingSurfaceGroupIndex()`), it will Warn and override the surroundingSurfaceGroup value */ | ||
| 111 | bool addSurroundingSurfaceGroup(const SurroundingSurfaceGroup& surroundingSurfaceGroup); | ||
| 112 | |||
| 113 | // Overloads, it creates a SurroundingSurfaceGroup wrapper, then call `addSurroundingSurfaceGroup(const SurroundingSurfaceGroup& surroundingSurfaceGroup)` | ||
| 114 | bool addSurroundingSurfaceGroup(const std::string& surroundingSurfaceName, double viewFactor, const Schedule& temperatureSchedule); | ||
| 115 | |||
| 116 | bool addSurroundingSurfaceGroups(const std::vector<SurroundingSurfaceGroup>& surroundingSurfaceGroups); | ||
| 117 | |||
| 118 | bool removeSurroundingSurfaceGroup(unsigned groupIndex); | ||
| 119 | |||
| 120 | void removeAllSurroundingSurfaceGroups(); | ||
| 121 | |||
| 122 | //@} | ||
| 123 | protected: | ||
| 124 | /// @cond | ||
| 125 | using ImplType = detail::SurfacePropertySurroundingSurfaces_Impl; | ||
| 126 | |||
| 127 | explicit SurfacePropertySurroundingSurfaces(std::shared_ptr<detail::SurfacePropertySurroundingSurfaces_Impl> impl); | ||
| 128 | |||
| 129 | friend class detail::SurfacePropertySurroundingSurfaces_Impl; | ||
| 130 | friend class Model; | ||
| 131 | friend class IdfObject; | ||
| 132 | friend class openstudio::detail::IdfObject_Impl; | ||
| 133 | /// @endcond | ||
| 134 | private: | ||
| 135 | REGISTER_LOGGER("openstudio.model.SurfacePropertySurroundingSurfaces"); | ||
| 136 | }; | ||
| 137 | |||
| 138 | /** \relates SurfacePropertySurroundingSurfaces*/ | ||
| 139 | using OptionalSurfacePropertySurroundingSurfaces = boost::optional<SurfacePropertySurroundingSurfaces>; | ||
| 140 | |||
| 141 | /** \relates SurfacePropertySurroundingSurfaces*/ | ||
| 142 | using SurfacePropertySurroundingSurfacesVector = std::vector<SurfacePropertySurroundingSurfaces>; | ||
| 143 | |||
| 144 | } // namespace model | ||
| 145 | } // namespace openstudio | ||
| 146 | |||
| 147 | #endif // MODEL_SURFACEPROPERTYSURROUNDINGSURFACES_HPP | ||
| 148 |