Commit f00d05b6 authored by Philippe Pébay's avatar Philippe Pébay
Browse files

Make sure that bounds are recalculated when pole is modified

Change-Id: If38cfd11f68a70f277d1bc55daed0fa9b2207e67
parent a0d9dbb5
......@@ -73,5 +73,4 @@ interactor.SetRenderWindow( window )
# Start interaction
window.Render()
interactor.Start()
......@@ -416,7 +416,6 @@ void vtkPolarAxesActor::ReleaseGraphicsResources( vtkWindow *win )
this->RadialAxes[i]->ReleaseGraphicsResources( win );
}
this->PolarArcsActor->ReleaseGraphicsResources(win);
}
//-----------------------------------------------------------------------------
......@@ -524,6 +523,9 @@ void vtkPolarAxesActor::CalculateBounds()
this->Bounds[4] = this->Pole[2];
// zmax
this->Bounds[5] = this->Pole[2];
// Update modification time of bounds
this->BoundsMTime.Modified();
}
//-----------------------------------------------------------------------------
......@@ -557,7 +559,7 @@ double *vtkPolarAxesActor::GetBounds()
//-----------------------------------------------------------------------------
void vtkPolarAxesActor::BuildAxes( vtkViewport *viewport )
{
if ( ( this->GetMTime() < this->BuildTime.GetMTime() ))
if ( ( this->GetMTime() < this->BuildTime.GetMTime() ) )
{
this->AutoScale( viewport );
return;
......@@ -922,6 +924,30 @@ void vtkPolarAxesActor::AutoScale( vtkViewport *viewport )
}
}
//-----------------------------------------------------------------------------
void vtkPolarAxesActor::SetPole( double p[3] )
{
this->Pole[0] = p[0];
this->Pole[1] = p[1];
this->Pole[2] = p[2];
// Update bounds
this->CalculateBounds();
this->Modified();
}
//-----------------------------------------------------------------------------
void vtkPolarAxesActor::SetPole( double x, double y, double z )
{
this->Pole[0] = x;
this->Pole[1] = y;
this->Pole[2] = z;
// Update bounds
this->CalculateBounds();
this->Modified();
}
//-----------------------------------------------------------------------------
void vtkPolarAxesActor::SetPolarAxisProperty( vtkProperty *prop )
{
......
......@@ -64,8 +64,8 @@ public:
// Description:
// Explicitly specify the coordinate of the pole.
// The default coordinates are (0,0,0).
vtkSetVector3Macro( Pole, double );
virtual void SetPole( double[3] );
virtual void SetPole( double, double, double );
vtkGetVector3Macro( Pole, double );
// Description:
......@@ -288,6 +288,7 @@ protected:
// Description:
// Coordinates of the pole
// Default: (0,0,0).
double Pole[3];
// Description:
......
Markdown is supported
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