GCC Code Coverage Report


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

src/model/GlareSensor.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_GLARESENSOR_HPP
7 #define MODEL_GLARESENSOR_HPP
8
9 #include "ModelAPI.hpp"
10 #include "SpaceItem.hpp"
11
12 namespace openstudio {
13
14 class Point3d;
15 class Transformation;
16
17 namespace model {
18
19 namespace detail {
20
21 class GlareSensor_Impl;
22
23 } // namespace detail
24
25 /** GlareSensor is a SpaceItem that wraps the OpenStudio IDD object 'OS:Glare:Sensor'. */
26 class MODEL_API GlareSensor : public SpaceItem
27 {
28 public:
29 /** @name Constructors and Destructors */
30 //@{
31
32 explicit GlareSensor(const Model& model);
33
34 647 virtual ~GlareSensor() override = default;
35 // Default the copy and move operators because the virtual dtor is explicit
36 1 GlareSensor(const GlareSensor& other) = default;
37 238 GlareSensor(GlareSensor&& other) = default;
38 ✗ GlareSensor& operator=(const GlareSensor&) = default;
39 ✗ GlareSensor& operator=(GlareSensor&&) = default;
40
41 //@}
42 /** @name Static Methods */
43 //@{
44
45 static IddObjectType iddObjectType();
46
47 //@}
48 /** @name Getters */
49 //@{
50
51 double positionXCoordinate() const;
52
53 double positionYCoordinate() const;
54
55 double positionZCoordinate() const;
56
57 double psiRotationAroundXAxis() const;
58
59 bool isPsiRotationAroundXAxisDefaulted() const;
60
61 double thetaRotationAroundYAxis() const;
62
63 bool isThetaRotationAroundYAxisDefaulted() const;
64
65 double phiRotationAroundZAxis() const;
66
67 bool isPhiRotationAroundZAxisDefaulted() const;
68
69 int numberofGlareViewVectors() const;
70
71 boost::optional<double> maximumAllowableDaylightGlareProbability() const;
72
73 //@}
74 /** @name Setters */
75 //@{
76
77 bool setPositionXCoordinate(double positionXCoordinate);
78
79 bool setPositionYCoordinate(double positionYCoordinate);
80
81 bool setPositionZCoordinate(double positionZCoordinate);
82
83 bool setPsiRotationAroundXAxis(double psiRotationAroundXAxis);
84
85 void resetPsiRotationAroundXAxis();
86
87 bool setThetaRotationAroundYAxis(double thetaRotationAroundYAxis);
88
89 void resetThetaRotationAroundYAxis();
90
91 bool setPhiRotationAroundZAxis(double phiRotationAroundZAxis);
92
93 void resetPhiRotationAroundZAxis();
94
95 bool setNumberofGlareViewVectors(int numberofGlareViewVectors);
96
97 void resetNumberofGlareViewVectors();
98
99 bool setMaximumAllowableDaylightGlareProbability(double maximumAllowableDaylightGlareProbability);
100
101 void resetMaximumAllowableDaylightGlareProbability();
102
103 //@}
104
105 /// Returns a Point3d representing position only in meters relative to the Space.
106 openstudio::Point3d position() const;
107
108 /// Sets a Point3d representing position only position in meters relative to the Space.
109 /// Does not change the orientation of the GlareSensor.
110 bool setPosition(const openstudio::Point3d& position);
111
112 /// Returns a Transformation representing position and orientation in meters relative to the Space.
113 openstudio::Transformation transformation() const;
114
115 /** Sets a Transformation representing position and orientation in meters relative to the Space. */
116 bool setTransformation(const openstudio::Transformation& transformation);
117
118 /// Keeps current position and orients the view towards the target, target is in space coordinates.
119 bool aimAt(const Point3d& target);
120
121 protected:
122 /// @cond
123 using ImplType = detail::GlareSensor_Impl;
124
125 friend class Model;
126 friend class openstudio::IdfObject;
127
128 explicit GlareSensor(std::shared_ptr<detail::GlareSensor_Impl> impl);
129
130 /// @endcond
131 private:
132 REGISTER_LOGGER("openstudio.model.GlareSensor");
133 };
134
135 /** \relates GlareSensor*/
136 using OptionalGlareSensor = boost::optional<GlareSensor>;
137
138 /** \relates GlareSensor*/
139 using GlareSensorVector = std::vector<GlareSensor>;
140
141 } // namespace model
142 } // namespace openstudio
143
144 #endif // MODEL_GLARESENSOR_HPP
145