MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / ceilingHeight

Method ceilingHeight

src/model/Space.cpp:860–894  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

858 }
859
860 double Space_Impl::ceilingHeight() const {
861 boost::optional<double> value = getDouble(OS_SpaceFields::CeilingHeight, true);
862 if (value) {
863 return value.get();
864 }
865
866 double result = 0;
867
868 // TODO: need a better method
869 double roofHeight = 0;
870 int numRoof = 0;
871 double floorHeight = 0;
872 int numFloor = 0;
873 for (const Surface& surface : this->surfaces()) {
874 if (istringEqual(surface.surfaceType(), "Floor")) {
875 for (const Point3d& point : surface.vertices()) {
876 floorHeight += point.z();
877 ++numFloor;
878 }
879 } else if (istringEqual(surface.surfaceType(), "RoofCeiling")) {
880 for (const Point3d& point : surface.vertices()) {
881 roofHeight += point.z();
882 ++numRoof;
883 }
884 }
885 }
886
887 if ((numRoof > 0) && (numFloor > 0)) {
888 roofHeight /= numRoof;
889 floorHeight /= numFloor;
890 result = roofHeight - floorHeight;
891 }
892
893 return result;
894 }
895
896 bool Space_Impl::isCeilingHeightDefaulted() const {
897 return isEmpty(OS_SpaceFields::CeilingHeight);

Callers 5

volumeMethod · 0.95
mergeThermalZoneMethod · 0.45
TEST_FFunction · 0.45
translateThermalZoneMethod · 0.45
translateSpaceMethod · 0.45

Calls 6

surfacesMethod · 0.95
istringEqualFunction · 0.85
getMethod · 0.45
surfaceTypeMethod · 0.45
verticesMethod · 0.45
zMethod · 0.45

Tested by 1

TEST_FFunction · 0.36