| 493 | } |
| 494 | |
| 495 | openstudio::Point3dVector ForwardTranslator::getPolygon(const openstudio::model::SubSurface& subSurface) { |
| 496 | Transformation buildingTransformation; |
| 497 | OptionalBuilding building = subSurface.model().getOptionalUniqueModelObject<Building>(); |
| 498 | if (building) { |
| 499 | buildingTransformation = building->transformation(); |
| 500 | } |
| 501 | |
| 502 | Transformation spaceTransformation; |
| 503 | OptionalSurface surface = subSurface.surface(); |
| 504 | if (surface) { |
| 505 | OptionalSpace space = surface->space(); |
| 506 | if (space) { |
| 507 | spaceTransformation = space->transformation(); |
| 508 | } |
| 509 | } else { |
| 510 | LOG(Warn, "Could not retrieve surface for sub surface '" << subSurface.name() << "'"); |
| 511 | } |
| 512 | |
| 513 | openstudio::Point3dVector vertices = subSurface.vertices(); |
| 514 | |
| 515 | // apply frame and divider reveal |
| 516 | boost::optional<openstudio::model::WindowPropertyFrameAndDivider> frameAndDivider = subSurface.windowPropertyFrameAndDivider(); |
| 517 | if (frameAndDivider) { |
| 518 | if (!frameAndDivider->isOutsideRevealDepthDefaulted()) { |
| 519 | openstudio::Vector3d offset = -frameAndDivider->outsideRevealDepth() * subSurface.outwardNormal(); |
| 520 | |
| 521 | for (openstudio::Point3d& vertex : vertices) { |
| 522 | vertex = vertex + offset; |
| 523 | } |
| 524 | } |
| 525 | } |
| 526 | |
| 527 | // convert vertices to absolute coordinates |
| 528 | return buildingTransformation * spaceTransformation * vertices; |
| 529 | } |
| 530 | |
| 531 | openstudio::Point3dVector ForwardTranslator::getPolygon(const openstudio::model::ShadingSurface& shadingSurface) { |
| 532 | Transformation buildingTransformation; |
nothing calls this directly
no test coverage detected