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

Method changeTransformation

src/model/Space.cpp:208–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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;

Callers 5

combineSpacesMethod · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45
translateModelPrivateMethod · 0.45
translateThermalZoneMethod · 0.45

Calls 14

surfacesMethod · 0.95
shadingSurfaceGroupsMethod · 0.95
luminairesMethod · 0.95
daylightingControlsMethod · 0.95
illuminanceMapsMethod · 0.95
inverseMethod · 0.80
transformationMethod · 0.45
setVerticesMethod · 0.45
verticesMethod · 0.45
getMethod · 0.45
nameMethod · 0.45

Tested by 2

TEST_FFunction · 0.36
TEST_FFunction · 0.36