src/model/PlanarSurface_Impl.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_PLANARSURFACE_IMPL_HPP | ||
| 7 | #define MODEL_PLANARSURFACE_IMPL_HPP | ||
| 8 | |||
| 9 | #include "ParentObject_Impl.hpp" | ||
| 10 | |||
| 11 | #include "../utilities/geometry/Plane.hpp" | ||
| 12 | #include "../utilities/geometry/Point3d.hpp" | ||
| 13 | #include "../utilities/geometry/Vector3d.hpp" | ||
| 14 | |||
| 15 | #include <nano/nano_signal_slot.hpp> // Signal-Slot replacement | ||
| 16 | |||
| 17 | namespace openstudio { | ||
| 18 | |||
| 19 | class Surface3d; | ||
| 20 | |||
| 21 | namespace model { | ||
| 22 | |||
| 23 | class PlanarSurfaceGroup; | ||
| 24 | class PlanarSurface; | ||
| 25 | class Space; | ||
| 26 | class ConstructionBase; | ||
| 27 | class GeneratorPhotovoltaic; | ||
| 28 | class SurfacePropertyConvectionCoefficients; | ||
| 29 | |||
| 30 | namespace detail { | ||
| 31 | |||
| 32 | // derive PlanarSurface_Impl from ParentObject_Impl to override virtual methods | ||
| 33 | class MODEL_API PlanarSurface_Impl : public ParentObject_Impl | ||
| 34 | { | ||
| 35 | |||
| 36 | // includes film coefficients. may require simulation results. | ||
| 37 | |||
| 38 | // does not include film coefficients. may require simulation results. | ||
| 39 | |||
| 40 | // may require simulation results. | ||
| 41 | |||
| 42 | // may require simulation results. | ||
| 43 | |||
| 44 | // may require simulation results. | ||
| 45 | |||
| 46 | // relationships | ||
| 47 | |||
| 48 | public: | ||
| 49 | /** @name Constructors and Destructors */ | ||
| 50 | //@{ | ||
| 51 | |||
| 52 | // constructor | ||
| 53 | PlanarSurface_Impl(IddObjectType type, Model_Impl* model); | ||
| 54 | |||
| 55 | // constructor | ||
| 56 | PlanarSurface_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle); | ||
| 57 | |||
| 58 | // construct from workspace | ||
| 59 | PlanarSurface_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle); | ||
| 60 | |||
| 61 | // clone copy constructor | ||
| 62 | PlanarSurface_Impl(const PlanarSurface_Impl& other, Model_Impl* model, bool keepHandle); | ||
| 63 | |||
| 64 | 99795 | virtual ~PlanarSurface_Impl() override = default; | |
| 65 | |||
| 66 | //@} | ||
| 67 | /** @name Getters */ | ||
| 68 | //@{ | ||
| 69 | |||
| 70 | virtual boost::optional<ConstructionBase> construction() const; | ||
| 71 | |||
| 72 | virtual boost::optional<std::pair<ConstructionBase, int>> constructionWithSearchDistance() const = 0; | ||
| 73 | |||
| 74 | virtual bool isConstructionDefaulted() const = 0; | ||
| 75 | |||
| 76 | virtual boost::optional<PlanarSurfaceGroup> planarSurfaceGroup() const = 0; | ||
| 77 | |||
| 78 | virtual boost::optional<Space> space() const = 0; | ||
| 79 | |||
| 80 | std::vector<Point3d> vertices() const; | ||
| 81 | |||
| 82 | //@} | ||
| 83 | /** @name Setters */ | ||
| 84 | |||
| 85 | virtual bool setVertices(const std::vector<Point3d>& vertices); | ||
| 86 | |||
| 87 | virtual bool setConstruction(const ConstructionBase& construction) = 0; | ||
| 88 | |||
| 89 | virtual void resetConstruction() = 0; | ||
| 90 | |||
| 91 | virtual bool setUFactor(double value); | ||
| 92 | |||
| 93 | bool setUFactor(boost::optional<double> value); | ||
| 94 | |||
| 95 | virtual bool setThermalConductance(double value); | ||
| 96 | |||
| 97 | bool setThermalConductance(boost::optional<double> value); | ||
| 98 | |||
| 99 | //@} | ||
| 100 | /** @name Queries */ | ||
| 101 | //@{ | ||
| 102 | |||
| 103 | bool isAirWall() const; | ||
| 104 | |||
| 105 | double grossArea() const; | ||
| 106 | |||
| 107 | virtual bool subtractFromGrossArea() const = 0; | ||
| 108 | |||
| 109 | double netArea() const; | ||
| 110 | |||
| 111 | Vector3d outwardNormal() const; | ||
| 112 | |||
| 113 | double tilt() const; | ||
| 114 | |||
| 115 | double azimuth() const; | ||
| 116 | |||
| 117 | virtual boost::optional<double> uFactor() const; | ||
| 118 | |||
| 119 | virtual boost::optional<double> thermalConductance() const; | ||
| 120 | |||
| 121 | boost::optional<double> heatCapacity() const; | ||
| 122 | |||
| 123 | boost::optional<double> interiorVisibleAbsorptance() const; | ||
| 124 | |||
| 125 | boost::optional<double> exteriorVisibleAbsorptance() const; | ||
| 126 | |||
| 127 | boost::optional<double> visibleTransmittance() const; | ||
| 128 | |||
| 129 | bool equalVertices(const PlanarSurface& other) const; | ||
| 130 | |||
| 131 | bool reverseEqualVertices(const PlanarSurface& other) const; | ||
| 132 | |||
| 133 | Plane plane() const; | ||
| 134 | |||
| 135 | Surface3d surface3d() const; | ||
| 136 | |||
| 137 | bool isConvex() const; | ||
| 138 | |||
| 139 | std::vector<std::vector<Point3d>> triangulation() const; | ||
| 140 | |||
| 141 | Point3d centroid() const; | ||
| 142 | |||
| 143 | std::vector<ModelObject> solarCollectors() const; | ||
| 144 | |||
| 145 | std::vector<GeneratorPhotovoltaic> generatorPhotovoltaics() const; | ||
| 146 | |||
| 147 | std::vector<SurfacePropertyConvectionCoefficients> surfacePropertyConvectionCoefficients() const; | ||
| 148 | |||
| 149 | //@} | ||
| 150 | protected: | ||
| 151 | boost::optional<ModelObject> spaceAsModelObject() const; | ||
| 152 | |||
| 153 | //private slots: | ||
| 154 | private: | ||
| 155 | void clearCachedVariables(); | ||
| 156 | |||
| 157 | private: | ||
| 158 | − | REGISTER_LOGGER("openstudio.model.PlanarSurface"); | |
| 159 | |||
| 160 | boost::optional<ModelObject> constructionAsModelObject() const; | ||
| 161 | boost::optional<ModelObject> planarSurfaceGroupAsModelObject() const; | ||
| 162 | |||
| 163 | bool setConstructionAsModelObject(boost::optional<ModelObject> modelObject); | ||
| 164 | |||
| 165 | mutable boost::optional<std::vector<Point3d>> m_cachedVertices; | ||
| 166 | mutable boost::optional<Plane> m_cachedPlane; | ||
| 167 | mutable boost::optional<Vector3d> m_cachedOutwardNormal; | ||
| 168 | mutable std::vector<std::vector<Point3d>> m_cachedTriangulation; | ||
| 169 | }; | ||
| 170 | |||
| 171 | } // namespace detail | ||
| 172 | } // namespace model | ||
| 173 | } // namespace openstudio | ||
| 174 | |||
| 175 | #endif | ||
| 176 |