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/SubSurface_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_SUBSURFACE_IMPL_HPP
7 #define MODEL_SUBSURFACE_IMPL_HPP
8
9 #include "ModelAPI.hpp"
10 #include "PlanarSurface_Impl.hpp"
11
12 namespace openstudio {
13 namespace model {
14
15 class AirflowNetworkComponent;
16 class AirflowNetworkSurface;
17 class Surface;
18 class SubSurface;
19 class ShadingSurface;
20 class ShadingControl;
21 class ShadingSurfaceGroup;
22 class DaylightingDeviceShelf;
23 class DaylightingDeviceTubular;
24 class DaylightingDeviceLightWell;
25 class WindowPropertyFrameAndDivider;
26 class SurfacePropertyOtherSideCoefficients;
27 class SurfacePropertyOtherSideConditionsModel;
28 class SurfacePropertyConvectionCoefficients;
29 class SurfacePropertyLocalEnvironment;
30 class SurfacePropertyIncidentSolarMultiplier;
31
32 namespace detail {
33
34 /** SubSurface_Impl is a PlanarSurface_Impl that is the implementation class for SubSurface.*/
35 class MODEL_API SubSurface_Impl : public PlanarSurface_Impl
36 {
37 public:
38 /** @name Constructors and Destructors */
39 //@{
40
41 SubSurface_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle);
42
43 SubSurface_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle);
44
45 SubSurface_Impl(const SubSurface_Impl& other, Model_Impl* model, bool keepHandle);
46
47 11198 virtual ~SubSurface_Impl() override = default;
48
49 //@}
50
51 // return the parent object in the hierarchy
52 virtual boost::optional<ParentObject> parent() const override;
53
54 /// set the parent, child may have to call methods on the parent
55 virtual bool setParent(ParentObject& newParent) override;
56
57 // return any children objects in the hierarchy
58 virtual std::vector<ModelObject> children() const override;
59
60 /// remove self and all children objects recursively
61 virtual std::vector<IdfObject> remove() override;
62
63 virtual ModelObject clone(Model model) const override;
64
65 virtual const std::vector<std::string>& outputVariableNames() const override;
66
67 virtual IddObjectType iddObjectType() const override;
68
69 /// should subtract this surface from parent's gross area for net area
70 virtual bool subtractFromGrossArea() const override;
71
72 /// get the construction object
73 /// if the planar surface is paired with an adjacent planar surface, attempts to resolve any surface matching conflict
74 virtual boost::optional<ConstructionBase> construction() const override;
75
76 /// get the construction object and the search distance that was needed to find the construction
77 /// does not consider adjacent planar surfaces
78 virtual boost::optional<std::pair<ConstructionBase, int>> constructionWithSearchDistance() const override;
79
80 /// Returns true if the construction is not directly referenced by this surface .
81 virtual bool isConstructionDefaulted() const override;
82
83 virtual bool setVertices(const std::vector<Point3d>& vertices) override;
84
85 /// set the construction object
86 virtual bool setConstruction(const ConstructionBase& construction) override;
87
88 /// Resets the construction object.
89 virtual void resetConstruction() override;
90
91 /// Returns the containing PlanarSurfaceGroup if available.
92 virtual boost::optional<PlanarSurfaceGroup> planarSurfaceGroup() const override;
93
94 /// Returns the containing Space if available.
95 virtual boost::optional<Space> space() const override;
96
97 /** Get the u-factor of this surface. Includes film coefficients. */
98 virtual boost::optional<double> uFactor() const override;
99
100 /** Get the conductance of this surface. Does not include film coefficients. */
101 virtual boost::optional<double> thermalConductance() const override;
102
103 /** Set the u-factor of this surface in W/m^2*K, if possible. value should already include appropriate
104 * film coefficients. By default, assumes still air indoors and 15 mph outdoor air speed. */
105 virtual bool setUFactor(double value) override;
106
107 /** Set the conductance of this surface in W/m^2*K, if possible. value should not include any film
108 * coefficients. */
109 virtual bool setThermalConductance(double value) override;
110
111 /** @name Getters */
112 //@{
113
114 std::string subSurfaceType() const;
115
116 bool isSubSurfaceTypeDefaulted() const;
117
118 std::vector<std::string> subSurfaceTypeValues() const;
119
120 boost::optional<double> viewFactortoGround() const;
121
122 bool isViewFactortoGroundDefaulted() const;
123
124 bool isViewFactortoGroundAutocalculated() const;
125
126 bool allowShadingControl() const;
127
128 std::vector<ShadingControl> shadingControls() const;
129
130 unsigned int numberofShadingControls() const;
131
132 bool allowWindowPropertyFrameAndDivider() const;
133
134 boost::optional<WindowPropertyFrameAndDivider> windowPropertyFrameAndDivider() const;
135
136 double multiplier() const;
137
138 bool isMultiplierDefaulted() const;
139
140 boost::optional<double> numberofVertices() const;
141
142 bool isNumberofVerticesDefaulted() const;
143
144 bool isNumberofVerticesAutocalculated() const;
145
146 // Assembly methods
147
148 boost::optional<double> assemblyUFactor() const;
149
150 boost::optional<double> assemblySHGC() const;
151
152 boost::optional<double> assemblyVisibleTransmittance() const;
153
154 //@}
155 /** @name Setters */
156 //@{
157
158 bool setSubSurfaceType(const std::string& subSurfaceType);
159
160 void resetSubSurfaceType();
161
162 bool setViewFactortoGround(boost::optional<double> viewFactortoGround);
163
164 bool setViewFactortoGround(double viewFactortoGround);
165
166 void resetViewFactortoGround();
167
168 void autocalculateViewFactortoGround();
169
170 bool addShadingControl(ShadingControl& shadingControl);
171
172 bool addShadingControls(std::vector<ShadingControl>& shadingControls);
173
174 void removeShadingControl(ShadingControl& shadingControl);
175
176 void removeAllShadingControls();
177
178 bool setWindowPropertyFrameAndDivider(const WindowPropertyFrameAndDivider& windowPropertyFrameAndDivider);
179
180 void resetWindowPropertyFrameAndDivider();
181
182 bool setMultiplier(double multiplier);
183
184 void resetMultiplier();
185
186 bool setNumberofVertices(boost::optional<double> numberofVertices);
187
188 bool setNumberofVertices(double numberofVertices);
189
190 void resetNumberofVertices();
191
192 void autocalculateNumberofVertices();
193
194 //@}
195
196 /// get the surface
197 boost::optional<Surface> surface() const;
198
199 /// set the surface
200 bool setSurface(const Surface& surface);
201
202 /// get the adjacent subsurface
203 boost::optional<SubSurface> adjacentSubSurface() const;
204
205 /// set the adjacent subsurface, will fail unless both sub surfaces are parented by surfaces
206 /// which are adjacent
207 bool setAdjacentSubSurface(SubSurface& subSurface);
208
209 /// reset the adjacent subsurface, will clear references on both this and adjacent sub surface
210 void resetAdjacentSubSurface();
211
212 /** Returns the surface property convection coefficients */
213 // cppcheck-suppress [duplInheritedMember] because PlanarSurface is dumb and returns a vector
214 boost::optional<SurfacePropertyConvectionCoefficients> surfacePropertyConvectionCoefficients() const;
215 boost::optional<SurfacePropertyLocalEnvironment> surfacePropertyLocalEnvironment() const;
216
217 boost::optional<SurfacePropertyIncidentSolarMultiplier> surfacePropertyIncidentSolarMultiplier() const;
218
219 /** Returns the adjacent SurfaceSurfacePropertyOtherSideCoefficients, if it exists. */
220 boost::optional<SurfacePropertyOtherSideCoefficients> surfacePropertyOtherSideCoefficients() const;
221
222 /** Sets the SurfacePropertyOtherSideCoefficients. */
223 bool setSurfacePropertyOtherSideCoefficients(const SurfacePropertyOtherSideCoefficients& otherSideCoefficients);
224
225 /** Resets the SurfacePropertyOtherSideCoefficients. */
226 void resetSurfacePropertyOtherSideCoefficients();
227
228 /** Returns the adjacent SurfacePropertyOtherSideConditionsModel, if it exists. */
229 boost::optional<SurfacePropertyOtherSideConditionsModel> surfacePropertyOtherSideConditionsModel() const;
230
231 /** Sets the SurfacePropertyOtherSideConditionsModel. */
232 bool setSurfacePropertyOtherSideConditionsModel(const SurfacePropertyOtherSideConditionsModel& otherSideModel);
233
234 /** Resets the SurfacePropertyOtherSideConditionsModel. */
235 void resetSurfacePropertyOtherSideConditionsModel();
236
237 /** Default sub surface type based on vertices. */
238 std::string defaultSubSurfaceType() const;
239
240 /** Assign default sub surface type based on vertices. */
241 void assignDefaultSubSurfaceType();
242
243 /** Return the surface()'s outsideBoundaryCondition, or an empty string. */
244 std::string outsideBoundaryCondition() const;
245
246 /** Add an overhang to the sub surface, only valid for fixed windows, operable windows, and glass doors. */
247 boost::optional<ShadingSurface> addOverhang(double depth, double offset);
248
249 /** Add an overhang to the sub surface, only valid for fixed windows, operable windows, and glass doors.
250 * Offset is a fraction of the total window height, projection factor is based on height and offset. */
251 boost::optional<ShadingSurface> addOverhangByProjectionFactor(double projectionFactor, double offsetFraction);
252
253 /** Returns any shading surface groups associated with this sub surface. */
254 std::vector<ShadingSurfaceGroup> shadingSurfaceGroups() const;
255
256 /** Returns true if this sub surface allows the addition of a daylighting light shelf. */
257 bool allowDaylightingDeviceShelf() const;
258
259 /** Get the daylighting light shelf associated with this sub surface if there is one. */
260 boost::optional<DaylightingDeviceShelf> daylightingDeviceShelf() const;
261
262 /** Add a daylighting light shelf associated with this sub surface. Only succeeds if this is a fixed window,
263 * operable window, or glass door. Will return existing daylighting light shelf if there already is one. */
264 boost::optional<DaylightingDeviceShelf> addDaylightingDeviceShelf() const;
265
266 /** Returns true if this sub surface allows the addition of a daylighting light tubular dome. */
267 bool allowDaylightingDeviceTubularDome() const;
268
269 /** Returns true if this sub surface allows the addition of a daylighting light tubular diffuser. */
270 bool allowDaylightingDeviceTubularDiffuser() const;
271
272 /** Get the daylighting light tubular associated with this sub surface if there is one. */
273 boost::optional<DaylightingDeviceTubular> daylightingDeviceTubular() const;
274
275 /** Returns true if this sub surface allows the addition of a daylighting light light well. */
276 bool allowDaylightingDeviceLightWell() const;
277
278 /** Get the daylighting light light well associated with this sub surface if there is one. */
279 boost::optional<DaylightingDeviceLightWell> daylightingDeviceLightWell() const;
280
281 /** Add a daylighting light light well associated with this sub surface. Only succeeds if this is a fixed window,
282 * operable window, or glass door. Will return existing daylighting light light well if there already is one. */
283 boost::optional<DaylightingDeviceLightWell> addDaylightingDeviceLightWell() const;
284
285 AirflowNetworkSurface getAirflowNetworkSurface(const AirflowNetworkComponent& surfaceAirflowLeakage);
286
287 boost::optional<AirflowNetworkSurface> airflowNetworkSurface() const;
288
289 //@}
290 /** @name Queries */
291 //@{
292
293 /** Gets the fenestration value from the sql file **/
294 boost::optional<double> getExteriorFenestrationValue(std::string columnName) const;
295
296 protected:
297 private:
298 friend class openstudio::model::SubSurface;
299
300 − REGISTER_LOGGER("openstudio.model.SubSurface");
301
302 boost::optional<ModelObject> surfaceAsModelObject() const;
303 boost::optional<ModelObject> adjacentSubSurfaceAsModelObject() const;
304
305 bool setSurfaceAsModelObject(const boost::optional<ModelObject>& modelObject);
306 bool setAdjacentSubSurfaceAsModelObject(const boost::optional<ModelObject>& modelObject);
307 };
308
309 } // namespace detail
310
311 } // namespace model
312 } // namespace openstudio
313
314 #endif // MODEL_SUBSURFACE_IMPL_HPP
315