Пример #1
0
 def getDimensions(self):
     '''
     Get the scaled dimensions of the texture block
     '''
     scale = self.getScale()
     scaled_dimensions = elmult(self._dimensions_px, scale)
     return scaled_dimensions
Пример #2
0
 def setScale(self, scale):
     '''
     Don't call this 'setScale' method directly let the main model do that
     this way we can ensure that the two scale fields have the same
     values.
     '''
     fieldmodule = self._scale_field.getFieldmodule()
     fieldcache = fieldmodule.createFieldcache()
     fieldmodule.beginChange()
     self._scale_field.assignReal(fieldcache, scale)
     fieldmodule.endChange()
     # Do I also need to set the dimensions for the self._plane?
     # I'm going to go with yes.
     plane_centre = calculateCentroid(self._plane.getRotationPoint(), self._plane.getNormal(), elmult(self._dimensions_px, scale))
     self._plane.setRotationPoint(plane_centre)  # (elmult(self._dimensions_px, scale))