GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 80.0% 4 / 0 / 5
Functions: 80.0% 4 / 0 / 5
Branches: -% 0 / 0 / 0

src/model/ShadingSurfaceGroup.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_SHADINGSURFACEGROUP_HPP
7 #define MODEL_SHADINGSURFACEGROUP_HPP
8
9 #include "ModelAPI.hpp"
10 #include "PlanarSurfaceGroup.hpp"
11
12 namespace openstudio {
13
14 class Transformation;
15
16 namespace model {
17
18 class Space;
19 class ShadingSurface;
20 class Surface;
21 class SubSurface;
22
23 namespace detail {
24
25 class ShadingSurfaceGroup_Impl;
26
27 } // namespace detail
28
29 /** ShadingSurfaceGroup is a PlanarSurfaceGroup that wraps the OpenStudio IDD object 'OS_ShadingSurfaceGroup'. */
30 class MODEL_API ShadingSurfaceGroup : public PlanarSurfaceGroup
31 {
32 public:
33 /** @name Constructors and Destructors */
34 //@{
35
36 explicit ShadingSurfaceGroup(const Model& model);
37
38 18806 virtual ~ShadingSurfaceGroup() override = default;
39 // Default the copy and move operators because the virtual dtor is explicit
40 1205 ShadingSurfaceGroup(const ShadingSurfaceGroup& other) = default;
41 10091 ShadingSurfaceGroup(ShadingSurfaceGroup&& other) = default;
42 ✗ ShadingSurfaceGroup& operator=(const ShadingSurfaceGroup&) = default;
43 154 ShadingSurfaceGroup& operator=(ShadingSurfaceGroup&&) = default;
44
45 //@}
46 /** @name Static Methods */
47 //@{
48
49 static IddObjectType iddObjectType();
50
51 static std::vector<std::string> validShadingSurfaceTypeValues();
52
53 //@}
54 /** @name Getters */
55 //@{
56
57 std::string shadingSurfaceType() const;
58
59 //@}
60 /** @name Setters */
61 //@{
62
63 /// this will fail if "Space" and space is not set, use setSpace instead
64 bool setShadingSurfaceType(const std::string& shadingSurfaceType);
65
66 //@}
67
68 /// Returns the parent Space.
69 boost::optional<Space> space() const;
70
71 /// Sets the parent Space.
72 bool setSpace(const Space& space);
73
74 /** If (space()), calls setShadingSurfaceType("Building") to remove the relationship. */
75 void resetSpace();
76
77 /// Returns child shading surfaces.
78 std::vector<ShadingSurface> shadingSurfaces() const;
79
80 /** Returns the specific sub surface shaded by this group if specified. */
81 boost::optional<SubSurface> shadedSubSurface() const;
82
83 /** Returns the surface shaded by this group if specified. */
84 boost::optional<Surface> shadedSurface() const;
85
86 /** Sets the specifc sub surface shaded by this group, sub surface must be in the same parent space. */
87 bool setShadedSubSurface(const SubSurface& subSurface);
88
89 /** Sets the surface shaded by this group, surface must be in the same parent space. */
90 bool setShadedSurface(const Surface& surface);
91
92 /** Resets the sub surface shaded by this group. */
93 void resetShadedObject();
94
95 protected:
96 /// @cond
97 using ImplType = detail::ShadingSurfaceGroup_Impl;
98
99 friend class Model;
100 friend class openstudio::IdfObject;
101
102 explicit ShadingSurfaceGroup(std::shared_ptr<detail::ShadingSurfaceGroup_Impl> impl);
103
104 /// @endcond
105 private:
106 REGISTER_LOGGER("openstudio.model.ShadingSurfaceGroup");
107 };
108
109 /** \relates ShadingSurfaceGroup*/
110 using OptionalShadingSurfaceGroup = boost::optional<ShadingSurfaceGroup>;
111
112 /** \relates ShadingSurfaceGroup*/
113 using ShadingSurfaceGroupVector = std::vector<ShadingSurfaceGroup>;
114
115 } // namespace model
116 } // namespace openstudio
117
118 #endif // MODEL_SHADINGSURFACEGROUP_HPP
119