| 206 | } |
| 207 | |
| 208 | bool Space_Impl::changeTransformation(const openstudio::Transformation& transformation) { |
| 209 | Transformation oldTransformation = this->transformation(); |
| 210 | if (!setTransformation(transformation)) { |
| 211 | return false; |
| 212 | } |
| 213 | |
| 214 | // go through and update all child points and transformations so that: |
| 215 | // (Tnew^-1 * Told) * xold = childTransformation * xold = xnew |
| 216 | |
| 217 | Transformation childTransformation = transformation.inverse() * oldTransformation; |
| 218 | |
| 219 | for (Surface& surface : this->surfaces()) { |
| 220 | bool test = surface.setVertices(childTransformation * surface.vertices()); |
| 221 | if (!test) { |
| 222 | LOG(Error, "Could not transform vertices for Surface '" << surface.name().get() << "'."); |
| 223 | } |
| 224 | for (SubSurface& subSurface : surface.subSurfaces()) { |
| 225 | test = subSurface.setVertices(childTransformation * subSurface.vertices()); |
| 226 | if (!test) { |
| 227 | LOG(Error, "Could not transform vertices for SubSurface '" << subSurface.name().get() << "'."); |
| 228 | } |
| 229 | } |
| 230 | } |
| 231 | |
| 232 | for (ShadingSurfaceGroup& shadingSurfaceGroup : this->shadingSurfaceGroups()) { |
| 233 | bool test = shadingSurfaceGroup.setTransformation(childTransformation * shadingSurfaceGroup.transformation()); |
| 234 | OS_ASSERT(test); |
| 235 | } |
| 236 | |
| 237 | for (InteriorPartitionSurfaceGroup& interiorPartitionSurfaceGroup : this->interiorPartitionSurfaceGroups()) { |
| 238 | bool test = interiorPartitionSurfaceGroup.setTransformation(childTransformation * interiorPartitionSurfaceGroup.transformation()); |
| 239 | OS_ASSERT(test); |
| 240 | } |
| 241 | |
| 242 | for (Luminaire& luminaire : this->luminaires()) { |
| 243 | bool test = luminaire.setTransformation(childTransformation * luminaire.transformation()); |
| 244 | OS_ASSERT(test); |
| 245 | } |
| 246 | |
| 247 | for (DaylightingControl& daylightingControl : this->daylightingControls()) { |
| 248 | bool test = daylightingControl.setTransformation(childTransformation * daylightingControl.transformation()); |
| 249 | OS_ASSERT(test); |
| 250 | } |
| 251 | |
| 252 | for (IlluminanceMap& illuminanceMap : this->illuminanceMaps()) { |
| 253 | bool test = illuminanceMap.setTransformation(childTransformation * illuminanceMap.transformation()); |
| 254 | OS_ASSERT(test); |
| 255 | } |
| 256 | |
| 257 | return true; |
| 258 | } |
| 259 | |
| 260 | BoundingBox Space_Impl::boundingBox() const { |
| 261 | BoundingBox result; |