src/airflow/SurfaceNetworkBuilder.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 AIRFLOW_SURFACENETWORKBUILDER_HPP | ||
| 7 | #define AIRFLOW_SURFACENETWORKBUILDER_HPP | ||
| 8 | |||
| 9 | #include <vector> | ||
| 10 | |||
| 11 | #include "AirflowAPI.hpp" | ||
| 12 | |||
| 13 | #include "../utilities/core/Logger.hpp" | ||
| 14 | #include "../utilities/core/StringStreamLogSink.hpp" | ||
| 15 | |||
| 16 | namespace openstudio { | ||
| 17 | |||
| 18 | class ProgressBar; | ||
| 19 | namespace model { | ||
| 20 | class Model; | ||
| 21 | class Space; | ||
| 22 | class ThermalZone; | ||
| 23 | class SubSurface; | ||
| 24 | class Surface; | ||
| 25 | } // namespace model | ||
| 26 | |||
| 27 | namespace airflow { | ||
| 28 | |||
| 29 | /** SurfaceNetworkBuilder objects walk the OpenStudio model as a network of surfaces. | ||
| 30 | * | ||
| 31 | * The SurfaceNetworkBuilder object walks the OpenStudio model as a network of surface, | ||
| 32 | * calling a different function once for each pair of interior surfaces or subsurfaces and | ||
| 33 | * once for each exterior surface or subsurface. The intended usage is to subclass for a | ||
| 34 | * specific application. | ||
| 35 | * | ||
| 36 | */ | ||
| 37 | class AIRFLOW_API SurfaceNetworkBuilder | ||
| 38 | { | ||
| 39 | public: | ||
| 40 | /** @name Constructors and Destructors */ | ||
| 41 | //@{ | ||
| 42 | /** Construct a new object. */ | ||
| 43 | explicit SurfaceNetworkBuilder(ProgressBar* progressBar = nullptr); | ||
| 44 | /** Destroy the translator.*/ | ||
| 45 | 6 | virtual ~SurfaceNetworkBuilder() = default; | |
| 46 | |||
| 47 | //@} | ||
| 48 | /** @name Network Construction Functions */ | ||
| 49 | //@{ | ||
| 50 | |||
| 51 | bool build(model::Model& model); | ||
| 52 | |||
| 53 | //@} | ||
| 54 | /** @name Getters and Setters */ | ||
| 55 | //@{ | ||
| 56 | |||
| 57 | /** Returns the progress bar currently associated with the object. */ | ||
| 58 | ProgressBar* progressBar() const; | ||
| 59 | |||
| 60 | /** Sets the progress bar to be updated by the object. */ | ||
| 61 | void setProgressBar(ProgressBar* progressBar); | ||
| 62 | |||
| 63 | //@} | ||
| 64 | /** @name Miscellaneous Functions */ | ||
| 65 | //@{ | ||
| 66 | |||
| 67 | /** Clear any internally stored information in the builder object. */ | ||
| 68 | ✗ | virtual void clear() {} | |
| 69 | |||
| 70 | /** Returns warning messages generated by the last translation. */ | ||
| 71 | std::vector<LogMessage> warnings() const; | ||
| 72 | |||
| 73 | /** Returns error messages generated by the last translation. */ | ||
| 74 | std::vector<LogMessage> errors() const; | ||
| 75 | |||
| 76 | /** Returns error messages generated by the last translation. */ | ||
| 77 | std::vector<LogMessage> logMessages() const; | ||
| 78 | |||
| 79 | //@} | ||
| 80 | |||
| 81 | protected: | ||
| 82 | void progress(); | ||
| 83 | void initProgress(int max, std::string label); | ||
| 84 | |||
| 85 | virtual bool linkExteriorSurface(model::ThermalZone zone, model::Space space, model::Surface surface); | ||
| 86 | virtual bool linkExteriorSubSurface(model::ThermalZone zone, model::Space space, model::Surface surface, model::SubSurface subSurface); | ||
| 87 | virtual bool linkInteriorSurface(model::ThermalZone zone, model::Space space, model::Surface surface, model::Surface adjacentSurface, | ||
| 88 | model::Space adjacentSpace, model::ThermalZone adjacentZone); | ||
| 89 | virtual bool linkInteriorSubSurface(model::ThermalZone zone, model::Space space, model::Surface surface, model::SubSurface subSurface, | ||
| 90 | model::SubSurface adjacentSubSurface, model::Surface adjacentSurface, model::Space adjacentSpace, | ||
| 91 | model::ThermalZone adjacentZone); | ||
| 92 | |||
| 93 | private: | ||
| 94 | ProgressBar* m_progressBar; | ||
| 95 | StringStreamLogSink m_logSink; | ||
| 96 | |||
| 97 | − | REGISTER_LOGGER("openstudio.airflow.SurfaceNetworkBuilder"); | |
| 98 | }; | ||
| 99 | |||
| 100 | } // namespace airflow | ||
| 101 | } // namespace openstudio | ||
| 102 | |||
| 103 | #endif // AIRFLOW_SURFACENETWORKBUILDER_HPP | ||
| 104 |