Commit 91edcaf7 authored by Aashish Chaudhary's avatar Aashish Chaudhary
Browse files

Title offset now considers screen size as well

Change-Id: Id9027ed5633f19ed6a6d571b871e19b2ae30ebc1
parent 0e39eefc
......@@ -104,7 +104,7 @@ int TestCubeAxes3( int argc, char * argv [] )
axes2->SetYLabelFormat("%6.1f");
axes2->SetZLabelFormat("%6.1f");
axes2->SetFlyModeToClosestTriad();
axes2->SetScreenSize(15.0);
axes2->SetScreenSize(25.0);
ren2->AddViewProp(axes2.GetPointer());
renWin->Render();
......
......@@ -69,9 +69,7 @@ vtkCxxSetObjectMacro(vtkCubeAxesActor, Camera,vtkCamera);
//
// *************************************************************************
vtkCubeAxesActor::vtkCubeAxesActor() : vtkActor(),
LabelScreenOffset(20),
TitleScreenOffset(40)
vtkCubeAxesActor::vtkCubeAxesActor() : vtkActor()
{
this->Bounds[0] = -1.0; this->Bounds[1] = 1.0;
this->Bounds[2] = -1.0; this->Bounds[3] = 1.0;
......@@ -114,6 +112,11 @@ vtkCubeAxesActor::vtkCubeAxesActor() : vtkActor(),
this->ZAxes[i]->SetCalculateTitleOffset(0);
this->ZAxes[i]->SetCalculateLabelOffset(0);
this->ScreenSize = 10.0;
this->LabelScreenOffset = 20.0;
this->TitleScreenOffset =
this->LabelScreenOffset * 2.0 + this->ScreenSize;
// Pass information to axes followers.
this->XAxes[i]->GetTitleActor()->SetAxes(this->XAxes[i],
......@@ -236,8 +239,6 @@ vtkCubeAxesActor::vtkCubeAxesActor() : vtkActor(),
this->LabelScale = -1.0;
this->TitleScale = -1.0;
this->ScreenSize = 10.0;
}
// ****************************************************************************
......@@ -1462,6 +1463,9 @@ void vtkCubeAxesActor::BuildAxes(vtkViewport *viewport)
}
}
// Scale appropriately.
this->AutoScale(viewport);
this->RenderSomething = 1;
this->BuildTime.Modified();
this->LastFlyMode = this->FlyMode;
......
......@@ -339,8 +339,8 @@ protected:
int RenderSomething;
const int LabelScreenOffset;
const int TitleScreenOffset;
int LabelScreenOffset;
int TitleScreenOffset;
private:
vtkCubeAxesActor(const vtkCubeAxesActor&); // Not implemented
......
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