GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 1 / 1 / 2
Functions: 100.0% 1 / 1 / 2
Branches: -% 0 / 1 / 1

src/model/Surface_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_SURFACE_IMPL_HPP
7 #define MODEL_SURFACE_IMPL_HPP
8
9 #include "ModelAPI.hpp"
10 #include "PlanarSurface_Impl.hpp"
11
12 namespace openstudio {
13 class Polygon3d;
14 namespace model {
15
16 class AirflowNetworkSurface;
17 class AirflowNetworkComponent;
18 class Space;
19 class SubSurface;
20 class Surface;
21 class ShadingSurfaceGroup;
22 class SurfaceIntersection;
23 class ConstructionBase;
24 class SurfaceControlMovableInsulation;
25 class SurfacePropertyOtherSideCoefficients;
26 class SurfacePropertyOtherSideConditionsModel;
27 class SurfacePropertyConfectionCoefficients;
28 class SurfacePropertyLocalEnvironment;
29 class SurfacePropertyExposedFoundationPerimeter;
30 class FoundationKiva;
31
32 namespace detail {
33
34 /** Surface_Impl is a PlanarSurface_Impl that is the implementation class for Surface.*/
35 class MODEL_API Surface_Impl : public PlanarSurface_Impl
36 {
37
38 public:
39 /** @name Constructors and Destructors */
40 //@{
41
42 Surface_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle);
43
44 Surface_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle);
45
46 Surface_Impl(const Surface_Impl& other, Model_Impl* model, bool keepHandle);
47
48 84638 virtual ~Surface_Impl() override = default;
49
50 //@}
51
52 virtual boost::optional<ParentObject> parent() const override;
53
54 virtual bool setParent(ParentObject& newParent) override;
55
56 virtual std::vector<ModelObject> children() const override;
57
58 virtual std::vector<IdfObject> remove() override;
59
60 virtual ModelObject clone(Model model) const override;
61
62 virtual std::vector<IddObjectType> allowableChildTypes() const override;
63
64 virtual const std::vector<std::string>& outputVariableNames() const override;
65
66 virtual IddObjectType iddObjectType() const override;
67
68 virtual bool subtractFromGrossArea() const override;
69
70 virtual boost::optional<ConstructionBase> construction() const override;
71
72 virtual boost::optional<std::pair<ConstructionBase, int>> constructionWithSearchDistance() const override;
73
74 virtual bool isConstructionDefaulted() const override;
75
76 virtual bool setVertices(const std::vector<Point3d>& vertices) override;
77
78 virtual bool setConstruction(const ConstructionBase& construction) override;
79
80 virtual void resetConstruction() override;
81
82 virtual boost::optional<PlanarSurfaceGroup> planarSurfaceGroup() const override;
83
84 virtual boost::optional<Space> space() const override;
85
86 virtual boost::optional<double> uFactor() const override;
87
88 virtual boost::optional<double> thermalConductance() const override;
89
90 virtual bool setUFactor(double value) override;
91
92 virtual bool setThermalConductance(double value) override;
93
94 /** @name Getters */
95 //@{
96
97 std::string surfaceType() const;
98
99 std::vector<std::string> surfaceTypeValues() const;
100
101 std::string outsideBoundaryCondition() const;
102
103 std::vector<std::string> outsideBoundaryConditionValues() const;
104
105 bool isGroundSurface() const;
106
107 std::string sunExposure() const;
108
109 std::vector<std::string> sunExposureValues() const;
110
111 bool isSunExposureDefaulted() const;
112
113 std::string windExposure() const;
114
115 std::vector<std::string> windExposureValues() const;
116
117 bool isWindExposureDefaulted() const;
118
119 boost::optional<double> viewFactortoGround() const;
120
121 bool isViewFactortoGroundDefaulted() const;
122
123 bool isViewFactortoGroundAutocalculated() const;
124
125 boost::optional<double> numberofVertices() const;
126
127 bool isNumberofVerticesDefaulted() const;
128
129 bool isNumberofVerticesAutocalculated() const;
130
131 virtual std::vector<EMSActuatorNames> emsActuatorNames() const override;
132
133 virtual std::vector<std::string> emsInternalVariableNames() const override;
134
135 //@}
136 /** @name Setters */
137 //@{
138
139 bool setSurfaceType(const std::string& surfaceType);
140 bool setSurfaceType(const std::string& surfaceType, bool driverMethod);
141
142 bool setOutsideBoundaryCondition(const std::string& outsideBoundaryCondition);
143 bool setOutsideBoundaryCondition(const std::string& outsideBoundaryCondition, bool driverMethod);
144
145 bool setSunExposure(const std::string& sunExposure);
146 bool setSunExposure(const std::string& sunExposure, bool driverMethod);
147
148 void resetSunExposure();
149
150 bool setWindExposure(const std::string& windExposure);
151 bool setWindExposure(const std::string& windExposure, bool driverMethod);
152
153 void resetWindExposure();
154
155 bool setViewFactortoGround(boost::optional<double> viewFactortoGround);
156
157 bool setViewFactortoGround(double viewFactortoGround);
158
159 void resetViewFactortoGround();
160
161 void autocalculateViewFactortoGround();
162
163 bool setNumberofVertices(boost::optional<double> numberofVertices);
164
165 bool setNumberofVertices(double numberofVertices);
166
167 void resetNumberofVertices();
168
169 void autocalculateNumberofVertices();
170
171 //@}
172
173 std::vector<SubSurface> subSurfaces() const;
174
175 bool setSpace(const Space& space);
176
177 boost::optional<Surface> adjacentSurface() const;
178
179 bool setAdjacentSurface(Surface& surface);
180
181 void resetAdjacentSurface();
182
183 boost::optional<SurfaceControlMovableInsulation> surfaceControlMovableInsulation() const;
184
185 // cppcheck-suppress [duplInheritedMember] because PlanarSurface is dumb and returns a vector
186 boost::optional<SurfacePropertyConvectionCoefficients> surfacePropertyConvectionCoefficients() const;
187
188 boost::optional<SurfacePropertyLocalEnvironment> surfacePropertyLocalEnvironment() const;
189
190 boost::optional<SurfacePropertyOtherSideCoefficients> surfacePropertyOtherSideCoefficients() const;
191
192 bool setSurfacePropertyOtherSideCoefficients(const SurfacePropertyOtherSideCoefficients& otherSideCoefficients);
193
194 void resetSurfacePropertyOtherSideCoefficients();
195
196 boost::optional<SurfacePropertyOtherSideConditionsModel> surfacePropertyOtherSideConditionsModel() const;
197
198 bool setSurfacePropertyOtherSideConditionsModel(const SurfacePropertyOtherSideConditionsModel& otherSideModel);
199
200 void resetSurfacePropertyOtherSideConditionsModel();
201
202 bool intersect(Surface& otherSurface);
203 boost::optional<SurfaceIntersection> computeIntersection(Surface& otherSurface);
204
205 boost::optional<Surface> createAdjacentSurface(const Space& otherSpace);
206
207 bool isPartOfEnvelope() const;
208
209 void assignDefaultSurfaceType();
210 void assignDefaultSurfaceType(bool driverMethod);
211
212 void assignDefaultBoundaryCondition();
213 void assignDefaultBoundaryCondition(bool driverMethod);
214
215 void assignDefaultSunExposure();
216 void assignDefaultSunExposure(bool driverMethod);
217
218 void assignDefaultWindExposure();
219 void assignDefaultWindExposure(bool driverMethod);
220
221 double filmResistance() const;
222
223 double windowToWallRatio() const;
224
225 double totalAreaOfSubSurfaces() const;
226
227 double skylightToRoofRatio() const;
228
229 double skylightToProjectedFloorRatio() const;
230
231 boost::optional<SubSurface> setWindowToWallRatio(double wwr);
232
233 boost::optional<SubSurface> setWindowToWallRatio(double wwr, double desiredHeightOffset, bool heightOffsetFromFloor);
234
235 std::vector<SubSurface> applyViewAndDaylightingGlassRatios(double viewGlassToWallRatio, double daylightingGlassToWallRatio,
236 double desiredViewGlassSillHeight, double desiredDaylightingGlassHeaderHeight,
237 double exteriorShadingProjectionFactor, double interiorShelfProjectionFactor,
238 const boost::optional<ConstructionBase>& viewGlassConstruction,
239 const boost::optional<ConstructionBase>& daylightingGlassConstruction);
240
241 std::vector<ShadingSurfaceGroup> shadingSurfaceGroups() const;
242
243 std::vector<Surface> splitSurfaceForSubSurfaces();
244
245 std::vector<SubSurface> createSubSurfaces(const std::vector<std::vector<Point3d>>& faces, double inset,
246 const boost::optional<ConstructionBase>& construction);
247
248 AirflowNetworkSurface getAirflowNetworkSurface(const AirflowNetworkComponent& surfaceAirflowLeakage);
249
250 boost::optional<AirflowNetworkSurface> airflowNetworkSurface() const;
251
252 bool setAdjacentFoundation(const FoundationKiva& kiva);
253
254 boost::optional<FoundationKiva> adjacentFoundation() const;
255
256 void resetAdjacentFoundation();
257
258 // if surface property exposed foundation perimeter already exists, do nothing and return nil; creates the surface property exposed foundation perimeter if it does not already exist and return it;
259 boost::optional<SurfacePropertyExposedFoundationPerimeter>
260 createSurfacePropertyExposedFoundationPerimeter(const std::string& exposedPerimeterCalculationMethod, double exposedPerimeter);
261
262 // returns the surface property exposed foundation perimeter if set
263 boost::optional<SurfacePropertyExposedFoundationPerimeter> surfacePropertyExposedFoundationPerimeter() const;
264
265 // resets the surface property exposed foundation perimeter
266 void resetSurfacePropertyExposedFoundationPerimeter();
267
268 // calculates the exposed perimeter of the surface
269 double exposedPerimeter(const Polygon3d& buildingPerimeter) const;
270
271 protected:
272 private:
273 friend class openstudio::model::Surface;
274
275 − REGISTER_LOGGER("openstudio.model.Surface");
276
277 std::vector<ModelObject> subSurfacesAsModelObjects() const;
278 boost::optional<ModelObject> adjacentSurfaceAsModelObject() const;
279
280 bool setSpaceAsModelObject(const boost::optional<ModelObject>& modelObject);
281 bool setAdjacentSurfaceAsModelObject(const boost::optional<ModelObject>& modelObject);
282 };
283
284 } // namespace detail
285
286 } // namespace model
287 } // namespace openstudio
288
289 #endif // MODEL_SURFACE_IMPL_HPP
290