[vtkusers] Possible bug in vtkCursor2D::SetModelBounds

John Drescher drescherjm at gmail.com
Tue Aug 3 15:11:18 EDT 2010


Besides the comment being wrong. I believe the line

 this->ModelBounds[4] = ymin; this->ModelBounds[5] = ymax;

is wrong. I think it should be:

 this->ModelBounds[4] = zmin; this->ModelBounds[5] = zmax;


http://vtk.org/gitweb?p=VTK.git;a=blob_plain;f=Graphics/vtkCursor2D.cxx;hb=HEAD

//---------------------------------------------------------------------------
// Set the boundary of the 3D cursor.
void vtkCursor2D::SetModelBounds(double xmin, double xmax, double
ymin, double ymax,
                                 double zmin, double zmax)
{
  if ( xmin != this->ModelBounds[0] || xmax != this->ModelBounds[1] ||
       ymin != this->ModelBounds[2] || ymax != this->ModelBounds[3] ||
       zmin != this->ModelBounds[4] || zmax != this->ModelBounds[5] )
    {
    this->Modified();

    this->ModelBounds[0] = xmin; this->ModelBounds[1] = xmax;
    this->ModelBounds[2] = ymin; this->ModelBounds[3] = ymax;
    this->ModelBounds[4] = ymin; this->ModelBounds[5] = ymax;

    for (int i=0; i<3; i++)
      {
      if ( this->ModelBounds[2*i] > this->ModelBounds[2*i+1] )
        {
        this->ModelBounds[2*i] = this->ModelBounds[2*i+1];
        }
      }
    }
}

-- 
John M. Drescher



More information about the vtkusers mailing list