Commit b4046e84 authored by Ken Martin's avatar Ken Martin
Browse files

fixed error in Print method and GetBounds when mapper not set

parent 86e29e05
...@@ -283,9 +283,14 @@ float *vtkActor::GetBounds() ...@@ -283,9 +283,14 @@ float *vtkActor::GetBounds()
float *result; float *result;
vtkMatrix4x4 matrix; vtkMatrix4x4 matrix;
// get the bounds of the Mapper // get the bounds of the Mapper if we have one
if (!this->Mapper)
{
return this->Bounds;
}
bounds = this->Mapper->GetBounds(); bounds = this->Mapper->GetBounds();
// fill out vertices of a bounding box // fill out vertices of a bounding box
bbox[ 0] = bounds[1]; bbox[ 1] = bounds[3]; bbox[ 2] = bounds[5]; bbox[ 0] = bounds[1]; bbox[ 1] = bounds[3]; bbox[ 2] = bounds[5];
bbox[ 3] = bounds[1]; bbox[ 4] = bounds[2]; bbox[ 5] = bounds[5]; bbox[ 3] = bounds[1]; bbox[ 4] = bounds[2]; bbox[ 5] = bounds[5];
...@@ -362,11 +367,18 @@ void vtkActor::PrintSelf(ostream& os, vtkIndent indent) ...@@ -362,11 +367,18 @@ void vtkActor::PrintSelf(ostream& os, vtkIndent indent)
vtkObject::PrintSelf(os,indent); vtkObject::PrintSelf(os,indent);
// make sure our bounds are up to date // make sure our bounds are up to date
this->GetBounds(); if ( this->Mapper )
os << indent << "Bounds: \n"; {
os << indent << " Xmin,Xmax: (" << this->Bounds[0] << ", " << this->Bounds[1] << ")\n"; this->GetBounds();
os << indent << " Ymin,Ymax: (" << this->Bounds[2] << ", " << this->Bounds[3] << ")\n"; os << indent << "Bounds: \n";
os << indent << " Zmin,Zmax: (" << this->Bounds[4] << ", " << this->Bounds[5] << ")\n"; os << indent << " Xmin,Xmax: (" << this->Bounds[0] << ", " << this->Bounds[1] << ")\n";
os << indent << " Ymin,Ymax: (" << this->Bounds[2] << ", " << this->Bounds[3] << ")\n";
os << indent << " Zmin,Zmax: (" << this->Bounds[4] << ", " << this->Bounds[5] << ")\n";
}
else
{
os << indent << "Bounds: (not defined)\n";
}
os << indent << "Dragable: " << (this->Dragable ? "On\n" : "Off\n"); os << indent << "Dragable: " << (this->Dragable ? "On\n" : "Off\n");
if ( this->Mapper ) if ( this->Mapper )
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment