src/model/ZonePropertyUserViewFactorsBySurfaceName.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_ZONEPROPERTYUSERVIEWFACTORSBYSURFACENAME_HPP | ||
| 7 | #define MODEL_ZONEPROPERTYUSERVIEWFACTORSBYSURFACENAME_HPP | ||
| 8 | |||
| 9 | #include <vector> | ||
| 10 | #include "ModelAPI.hpp" | ||
| 11 | #include "ModelObject.hpp" | ||
| 12 | |||
| 13 | #include "Surface.hpp" | ||
| 14 | #include "Surface_Impl.hpp" | ||
| 15 | #include "SubSurface.hpp" | ||
| 16 | #include "SubSurface_Impl.hpp" | ||
| 17 | #include "InternalMass.hpp" | ||
| 18 | #include "InternalMass_Impl.hpp" | ||
| 19 | |||
| 20 | namespace openstudio { | ||
| 21 | namespace model { | ||
| 22 | |||
| 23 | class ThermalZone; | ||
| 24 | /* class Surface; | ||
| 25 | class SubSurface; | ||
| 26 | class InternalMass; */ | ||
| 27 | |||
| 28 | namespace detail { | ||
| 29 | |||
| 30 | class ZonePropertyUserViewFactorsBySurfaceName_Impl; | ||
| 31 | |||
| 32 | } // namespace detail | ||
| 33 | |||
| 34 | /** This class implements a view factor */ | ||
| 35 | class MODEL_API ViewFactor | ||
| 36 | { | ||
| 37 | public: | ||
| 38 | /* Only accepts ModelObjects that are of type Surface, Subsurface or InternalMass, will throw otherwise */ | ||
| 39 | ViewFactor(const ModelObject& fromSurface, const ModelObject& toSurface, double viewFactor); | ||
| 40 | |||
| 41 | ModelObject fromSurface() const; | ||
| 42 | ModelObject toSurface() const; | ||
| 43 | double viewFactor() const; | ||
| 44 | |||
| 45 | private: | ||
| 46 | // From | ||
| 47 | ModelObject m_from_surface; | ||
| 48 | ModelObject m_to_surface; | ||
| 49 | double m_view_factor; | ||
| 50 | − | REGISTER_LOGGER("openstudio.model.ViewFactor"); | |
| 51 | }; | ||
| 52 | |||
| 53 | // Overload operator<< | ||
| 54 | MODEL_API std::ostream& operator<<(std::ostream& out, const openstudio::model::ViewFactor& viewFactor); | ||
| 55 | |||
| 56 | /** ZonePropertyUserViewFactorsBySurfaceName is a ModelObject that wraps the OpenStudio IDD object 'OS:ZoneProperty:UserViewFactors:BySurfaceName'. */ | ||
| 57 | class MODEL_API ZonePropertyUserViewFactorsBySurfaceName : public ModelObject | ||
| 58 | { | ||
| 59 | public: | ||
| 60 | /** @name Constructors and Destructors */ | ||
| 61 | //@{ | ||
| 62 | |||
| 63 | /* | ||
| 64 | * This constructor shouldn't be used, ThermalZone::getZonePropertyUserViewFactorsBySurfaceName should be preferred | ||
| 65 | * as it will either instantiate a new object or return the existing one. | ||
| 66 | * A ThermalZone should not have more than one ZonePropertyUserViewFactorsBySurfaceName. If you try to instantiate a second one for a given | ||
| 67 | * ThermalZone this constructor will throw | ||
| 68 | */ | ||
| 69 | explicit ZonePropertyUserViewFactorsBySurfaceName(const ThermalZone& thermalZone); | ||
| 70 | |||
| 71 | 27 | virtual ~ZonePropertyUserViewFactorsBySurfaceName() override = default; | |
| 72 | // Default the copy and move operators because the virtual dtor is explicit | ||
| 73 | 3 | ZonePropertyUserViewFactorsBySurfaceName(const ZonePropertyUserViewFactorsBySurfaceName& other) = default; | |
| 74 | 12 | ZonePropertyUserViewFactorsBySurfaceName(ZonePropertyUserViewFactorsBySurfaceName&& other) = default; | |
| 75 | ✗ | ZonePropertyUserViewFactorsBySurfaceName& operator=(const ZonePropertyUserViewFactorsBySurfaceName&) = default; | |
| 76 | ✗ | ZonePropertyUserViewFactorsBySurfaceName& operator=(ZonePropertyUserViewFactorsBySurfaceName&&) = default; | |
| 77 | |||
| 78 | //@} | ||
| 79 | |||
| 80 | static IddObjectType iddObjectType(); | ||
| 81 | |||
| 82 | /** @name Getters */ | ||
| 83 | //@{ | ||
| 84 | |||
| 85 | ThermalZone thermalZone() const; | ||
| 86 | |||
| 87 | std::vector<ViewFactor> viewFactors() const; | ||
| 88 | |||
| 89 | unsigned int numberofViewFactors() const; | ||
| 90 | |||
| 91 | /** If a viewFactor group is already present (cf `viewFactorIndex()`), it will Warn and override the viewFactor value */ | ||
| 92 | boost::optional<unsigned> viewFactorIndex(const ViewFactor& viewFactor) const; | ||
| 93 | |||
| 94 | boost::optional<ViewFactor> getViewFactor(unsigned groupIndex) const; | ||
| 95 | |||
| 96 | //@} | ||
| 97 | /** @name Setters */ | ||
| 98 | //@{ | ||
| 99 | |||
| 100 | /** If a viewFactor group is already present (cf `viewFactorIndex()`), it will Warn and override the viewFactor value */ | ||
| 101 | bool addViewFactor(const ViewFactor& viewFactor); | ||
| 102 | |||
| 103 | // Overloads, they create a ViewFactor wrapper, then call `addViewFactor(const ViewFactor& viewFactor)` | ||
| 104 | bool addViewFactor(const Surface& fromSurface, const Surface& toSurface, double viewFactor); | ||
| 105 | |||
| 106 | bool addViewFactor(const Surface& fromSurface, const SubSurface& toSubSurface, double viewFactor); | ||
| 107 | |||
| 108 | bool addViewFactor(const Surface& fromSurface, const InternalMass& toInternalMass, double viewFactor); | ||
| 109 | |||
| 110 | bool addViewFactor(const SubSurface& fromSubSurface, const SubSurface& toSubSurface, double viewFactor); | ||
| 111 | |||
| 112 | bool addViewFactor(const SubSurface& fromSubSurface, const Surface& toSurface, double viewFactor); | ||
| 113 | |||
| 114 | bool addViewFactor(const SubSurface& fromSubSurface, const InternalMass& toInternalMass, double viewFactor); | ||
| 115 | |||
| 116 | bool addViewFactor(const InternalMass& fromInternalMass, const InternalMass& toInernalMass, double viewFactor); | ||
| 117 | |||
| 118 | bool addViewFactor(const InternalMass& fromInternalMass, const Surface& toSurface, double viewFactor); | ||
| 119 | |||
| 120 | bool addViewFactor(const InternalMass& fromInternalMass, const SubSurface& toSubSurface, double viewFactor); | ||
| 121 | |||
| 122 | bool addViewFactors(const std::vector<ViewFactor>& viewFactors); | ||
| 123 | |||
| 124 | void removeViewFactor(int groupIndex); | ||
| 125 | |||
| 126 | void removeAllViewFactors(); | ||
| 127 | |||
| 128 | //@} | ||
| 129 | /** @name Other */ | ||
| 130 | //@{ | ||
| 131 | |||
| 132 | //@} | ||
| 133 | protected: | ||
| 134 | /// @cond | ||
| 135 | using ImplType = detail::ZonePropertyUserViewFactorsBySurfaceName_Impl; | ||
| 136 | |||
| 137 | explicit ZonePropertyUserViewFactorsBySurfaceName(std::shared_ptr<detail::ZonePropertyUserViewFactorsBySurfaceName_Impl> impl); | ||
| 138 | |||
| 139 | friend class detail::ZonePropertyUserViewFactorsBySurfaceName_Impl; | ||
| 140 | friend class Model; | ||
| 141 | friend class IdfObject; | ||
| 142 | friend class openstudio::detail::IdfObject_Impl; | ||
| 143 | /// @endcond | ||
| 144 | private: | ||
| 145 | − | REGISTER_LOGGER("openstudio.model.ZonePropertyUserViewFactorsBySurfaceName"); | |
| 146 | }; | ||
| 147 | |||
| 148 | /** \relates ZonePropertyUserViewFactorsBySurfaceName*/ | ||
| 149 | using OptionalZonePropertyUserViewFactorsBySurfaceName = boost::optional<ZonePropertyUserViewFactorsBySurfaceName>; | ||
| 150 | |||
| 151 | /** \relates ZonePropertyUserViewFactorsBySurfaceName*/ | ||
| 152 | using ZonePropertyUserViewFactorsBySurfaceNameVector = std::vector<ZonePropertyUserViewFactorsBySurfaceName>; | ||
| 153 | |||
| 154 | } // namespace model | ||
| 155 | } // namespace openstudio | ||
| 156 | |||
| 157 | #endif // MODEL_ZONEPROPERTYUSERVIEWFACTORSBYSURFACENAME_HPP | ||
| 158 |