src/model/Material.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_MATERIAL_HPP | ||
| 7 | #define MODEL_MATERIAL_HPP | ||
| 8 | |||
| 9 | #include "ModelAPI.hpp" | ||
| 10 | #include "ResourceObject.hpp" | ||
| 11 | |||
| 12 | namespace openstudio { | ||
| 13 | namespace model { | ||
| 14 | |||
| 15 | class StandardsInformationMaterial; | ||
| 16 | |||
| 17 | namespace detail { | ||
| 18 | class Material_Impl; | ||
| 19 | } | ||
| 20 | |||
| 21 | /** A Material is a ResourceObject that serves as a base class for all objects that can be used | ||
| 22 | * in \link LayeredConstruction LayeredConstructions \endlink. */ | ||
| 23 | class MODEL_API Material : public ResourceObject | ||
| 24 | { | ||
| 25 | public: | ||
| 26 | /** @name Constructors and Destructors */ | ||
| 27 | //@{ | ||
| 28 | |||
| 29 | 173675 | virtual ~Material() override = default; | |
| 30 | // Default the copy and move operators because the virtual dtor is explicit | ||
| 31 | 32470 | Material(const Material& other) = default; | |
| 32 | 93800 | Material(Material&& other) = default; | |
| 33 | 14 | Material& operator=(const Material&) = default; | |
| 34 | 4835 | Material& operator=(Material&&) = default; | |
| 35 | |||
| 36 | //@} | ||
| 37 | /** @name Getters */ | ||
| 38 | //@{ | ||
| 39 | |||
| 40 | // Get the thickness of the material. Virtual implementation. For some materials, 0.0 is always returned. | ||
| 41 | double thickness() const; | ||
| 42 | |||
| 43 | // Get the visible transmittance of the material. Virtual implementation. | ||
| 44 | boost::optional<double> getVisibleTransmittance() const; | ||
| 45 | |||
| 46 | // Get the interiorVisibleAbsorptance of the material. Virtual implementation. | ||
| 47 | boost::optional<double> interiorVisibleAbsorptance() const; | ||
| 48 | |||
| 49 | // Get the exteriorVisibleAbsorptance of the material. Virtual implementation. | ||
| 50 | boost::optional<double> exteriorVisibleAbsorptance() const; | ||
| 51 | |||
| 52 | /** Returns this materials's standards information, constructing a new object if necessary. */ | ||
| 53 | StandardsInformationMaterial standardsInformation() const; | ||
| 54 | |||
| 55 | //@} | ||
| 56 | /** @name Setters */ | ||
| 57 | //@{ | ||
| 58 | |||
| 59 | // Set thickness to value (m). For some materials, false is always returned. | ||
| 60 | bool setThickness(double value); | ||
| 61 | |||
| 62 | //@} | ||
| 63 | protected: | ||
| 64 | /// @cond | ||
| 65 | using ImplType = detail::Material_Impl; | ||
| 66 | |||
| 67 | friend class Model; | ||
| 68 | friend class openstudio::IdfObject; | ||
| 69 | friend class openstudio::detail::IdfObject_Impl; | ||
| 70 | friend class detail::Material_Impl; | ||
| 71 | |||
| 72 | Material(IddObjectType type, const Model& model); | ||
| 73 | |||
| 74 | explicit Material(std::shared_ptr<detail::Material_Impl> impl); | ||
| 75 | |||
| 76 | /// @endcond | ||
| 77 | private: | ||
| 78 | REGISTER_LOGGER("openstudio.model.Material"); | ||
| 79 | }; | ||
| 80 | |||
| 81 | /** \relates Material */ | ||
| 82 | using OptionalMaterial = boost::optional<Material>; | ||
| 83 | |||
| 84 | /** \relates Material */ | ||
| 85 | using MaterialVector = std::vector<Material>; | ||
| 86 | |||
| 87 | } // namespace model | ||
| 88 | } // namespace openstudio | ||
| 89 | |||
| 90 | #endif // MODEL_MATERIAL_HPP | ||
| 91 |