src/model/Luminaire.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_LUMINAIRE_HPP | ||
| 7 | #define MODEL_LUMINAIRE_HPP | ||
| 8 | |||
| 9 | #include "ModelAPI.hpp" | ||
| 10 | #include "SpaceLoadInstance.hpp" | ||
| 11 | |||
| 12 | namespace openstudio { | ||
| 13 | |||
| 14 | class Point3d; | ||
| 15 | class Transformation; | ||
| 16 | |||
| 17 | namespace model { | ||
| 18 | |||
| 19 | class Schedule; | ||
| 20 | class LuminaireDefinition; | ||
| 21 | |||
| 22 | namespace detail { | ||
| 23 | |||
| 24 | class Luminaire_Impl; | ||
| 25 | |||
| 26 | } // namespace detail | ||
| 27 | |||
| 28 | /** Luminaire is a SpaceLoadInstance that wraps the OpenStudio IDD object | ||
| 29 | * 'OS:Luminaire'. \sa LuminaireDefinition */ | ||
| 30 | class MODEL_API Luminaire : public SpaceLoadInstance | ||
| 31 | { | ||
| 32 | public: | ||
| 33 | /** @name Constructors and Destructors */ | ||
| 34 | //@{ | ||
| 35 | |||
| 36 | explicit Luminaire(const LuminaireDefinition& luminaireDefinition); | ||
| 37 | |||
| 38 | 4 | virtual ~Luminaire() override = default; | |
| 39 | // Default the copy and move operators because the virtual dtor is explicit | ||
| 40 | ✗ | Luminaire(const Luminaire& other) = default; | |
| 41 | ✗ | Luminaire(Luminaire&& other) = default; | |
| 42 | ✗ | Luminaire& operator=(const Luminaire&) = default; | |
| 43 | ✗ | Luminaire& operator=(Luminaire&&) = default; | |
| 44 | |||
| 45 | //@} | ||
| 46 | |||
| 47 | static IddObjectType iddObjectType(); | ||
| 48 | |||
| 49 | /** @name Getters */ | ||
| 50 | //@{ | ||
| 51 | |||
| 52 | /** Gets the LuminaireDefinition object. */ | ||
| 53 | LuminaireDefinition luminaireDefinition() const; | ||
| 54 | |||
| 55 | /** Returns the (fractional) lighting schedule. If this object does not | ||
| 56 | * specify a schedule this function will search the hierarchy. */ | ||
| 57 | boost::optional<Schedule> schedule() const; | ||
| 58 | |||
| 59 | /** Returns true if this object does not specify a schedule directly. */ | ||
| 60 | bool isScheduleDefaulted() const; | ||
| 61 | |||
| 62 | double positionXcoordinate() const; | ||
| 63 | |||
| 64 | double positionYcoordinate() const; | ||
| 65 | |||
| 66 | double positionZcoordinate() const; | ||
| 67 | |||
| 68 | double psiRotationAroundXaxis() const; | ||
| 69 | |||
| 70 | bool isPsiRotationAroundXaxisDefaulted() const; | ||
| 71 | |||
| 72 | double thetaRotationAroundYaxis() const; | ||
| 73 | |||
| 74 | bool isThetaRotationAroundYaxisDefaulted() const; | ||
| 75 | |||
| 76 | double phiRotationAroundZaxis() const; | ||
| 77 | |||
| 78 | bool isPhiRotationAroundZaxisDefaulted() const; | ||
| 79 | |||
| 80 | double fractionReplaceable() const; | ||
| 81 | |||
| 82 | bool isFractionReplaceableDefaulted() const; | ||
| 83 | |||
| 84 | std::string endUseSubcategory() const; | ||
| 85 | |||
| 86 | bool isEndUseSubcategoryDefaulted() const; | ||
| 87 | |||
| 88 | //@} | ||
| 89 | /** @name Setters */ | ||
| 90 | //@{ | ||
| 91 | |||
| 92 | /** Sets the LuminaireDefinition object. */ | ||
| 93 | bool setLuminaireDefinition(const LuminaireDefinition& definition); | ||
| 94 | |||
| 95 | /** Sets the (fractional) Schedule. */ | ||
| 96 | bool setSchedule(Schedule& schedule); | ||
| 97 | |||
| 98 | /** Resets the (fractional) Schedule. */ | ||
| 99 | void resetSchedule(); | ||
| 100 | |||
| 101 | bool setPositionXcoordinate(double positionXcoordinate); | ||
| 102 | |||
| 103 | bool setPositionYcoordinate(double positionYcoordinate); | ||
| 104 | |||
| 105 | bool setPositionZcoordinate(double positionZcoordinate); | ||
| 106 | |||
| 107 | bool setPsiRotationAroundXaxis(double psiRotationAroundXaxis); | ||
| 108 | |||
| 109 | void resetPsiRotationAroundXaxis(); | ||
| 110 | |||
| 111 | bool setThetaRotationAroundYaxis(double thetaRotationAroundYaxis); | ||
| 112 | |||
| 113 | void resetThetaRotationAroundYaxis(); | ||
| 114 | |||
| 115 | bool setPhiRotationAroundZaxis(double phiRotationAroundZaxis); | ||
| 116 | |||
| 117 | void resetPhiRotationAroundZaxis(); | ||
| 118 | |||
| 119 | bool setFractionReplaceable(double fractionReplaceable); | ||
| 120 | |||
| 121 | void resetFractionReplaceable(); | ||
| 122 | |||
| 123 | bool setMultiplier(double multiplier); | ||
| 124 | |||
| 125 | void resetMultiplier(); | ||
| 126 | |||
| 127 | bool setEndUseSubcategory(const std::string& endUseSubcategory); | ||
| 128 | |||
| 129 | void resetEndUseSubcategory(); | ||
| 130 | |||
| 131 | //@} | ||
| 132 | /** @name Other */ | ||
| 133 | //@{ | ||
| 134 | |||
| 135 | /// Returns a Point3d representing position only in meters relative to the Space. | ||
| 136 | openstudio::Point3d position() const; | ||
| 137 | |||
| 138 | /// Sets a Point3d representing position only position in meters relative to the Space. | ||
| 139 | /// Does not change the orientation of the Luminaire. | ||
| 140 | bool setPosition(const openstudio::Point3d& position); | ||
| 141 | |||
| 142 | /// Returns a Transformation representing position and orientation in meters relative to the Space. | ||
| 143 | openstudio::Transformation transformation() const; | ||
| 144 | |||
| 145 | /// Sets a Transformation representing position and orientation in meters relative to the Space. | ||
| 146 | bool setTransformation(const openstudio::Transformation& transformation); | ||
| 147 | |||
| 148 | /** Returns the design level represented by this instance. */ | ||
| 149 | double lightingPower() const; | ||
| 150 | |||
| 151 | /** Returns the watts/m^2 represented by this instance, assuming floorArea (m^2). */ | ||
| 152 | double getPowerPerFloorArea(double floorArea) const; | ||
| 153 | |||
| 154 | /** Returns the watts/person represented by this instance, assuming numPeople. */ | ||
| 155 | double getPowerPerPerson(double numPeople) const; | ||
| 156 | |||
| 157 | //@} | ||
| 158 | protected: | ||
| 159 | /// @cond | ||
| 160 | using ImplType = detail::Luminaire_Impl; | ||
| 161 | |||
| 162 | friend class Model; | ||
| 163 | friend class openstudio::IdfObject; | ||
| 164 | |||
| 165 | explicit Luminaire(std::shared_ptr<detail::Luminaire_Impl> impl); | ||
| 166 | |||
| 167 | /// @endcond | ||
| 168 | private: | ||
| 169 | REGISTER_LOGGER("openstudio.model.Luminaire"); | ||
| 170 | }; | ||
| 171 | |||
| 172 | /** \relates Luminaire*/ | ||
| 173 | using OptionalLuminaire = boost::optional<Luminaire>; | ||
| 174 | |||
| 175 | /** \relates Luminaire*/ | ||
| 176 | using LuminaireVector = std::vector<Luminaire>; | ||
| 177 | |||
| 178 | } // namespace model | ||
| 179 | } // namespace openstudio | ||
| 180 | |||
| 181 | #endif // MODEL_LUMINAIRE_HPP | ||
| 182 |