Skip to content
  • Rusty Blue's avatar
    Fix issue of GetBounds() computing the wrong bounds for non-Linear user matrx · 9a18b4cc
    Rusty Blue authored
    A non-trivial last row of a user matrix (or transform) (something other than
    [0 0 0 1]) is used correctly by OpenGL, but the GetBounds calculation in
    vtkActor (as well as vtkImageActor and vtkVolume) used
    this->Transform->TransformPoint() to trasnform the bbox from the mapper.  As
    this->Transform is a vtkLinearTransform, the final row of the matrix is ignored
    within TransformPoint (actually vtkLinearTransform::InternalTransformPoint(),
    which is what is ultimately called).  Instead, we now use
    vtkMatrix4x4::MultiplyPoint() to do the transformation.
    
    Note, this change also includes  "cleanup" of several lines before and after
    the for loop where we trasnform the points (within GetBounds() fn), replacing
    the, with just this->ComputeMatrix().  This is a subset of what was removed,
    as it was being called by this->GetMatrix(), but also note that internally
    vtkProp3D::ComputeMatrix() does a Push() and Pop() on this->Transform just
    as was done in the code that was removed.  There is a potential issue (I'm
    looking for an extra set of eyes, or many eyes, to scrutinize) with the
    GetOrientation() call (in ComputeMatrix()), which occurs before Push() and
    which might screw things up since it results in vtkTransform::InternalUpdate()
    which might mess up the Concatentation if doTheLegacyHack == true.  Even if
    it is a (potential) problem, moving Push() before GetOrientation() (in
    ComputeMatrix()) should (I believe) rectify the potential for a problem,
    though I did NOT make that change... yet (waiting for feedback)
    
    Change-Id: I122940f1c2142d4c64502a8a54c44a4e18bdc124
    9a18b4cc