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

Globally defined distance based LOD threshold properties

Change-Id: I7415056cc2d25d2c4ef75b8afcbafea590fb7bec
parent 704956c2
......@@ -173,11 +173,16 @@ vtkPolarAxesActor::vtkPolarAxesActor() : vtkActor()
// Base offset for followers
double offset = this->LabelScreenOffset + this->ScreenSize * 0.5;
// By default enable distance based LOD
this->EnableDistanceLOD = 1;
this->DistanceLODThreshold = .7;
// Set polar axis title follower (label followers not built yet)
vtkAxisFollower* follower = this->PolarAxis->GetTitleActor();
follower->SetAxis( this->PolarAxis );
follower->SetScreenOffset( 2.0 * offset + 5 );
follower->SetEnableDistanceLOD( this->EnableDistanceLOD );
follower->SetDistanceLODThreshold( .8 * this->DistanceLODThreshold );
// Properties of the radial axes, with default color black
this->RadialAxesProperty = vtkProperty::New();
......@@ -199,6 +204,7 @@ vtkPolarAxesActor::vtkPolarAxesActor() : vtkActor()
axis->GetTitleActor()->SetAxis( axis );
axis->GetTitleActor()->SetScreenOffset( .67 * offset );
axis->GetTitleActor()->SetEnableDistanceLOD( this->EnableDistanceLOD );
axis->GetTitleActor()->SetDistanceLODThreshold( this->DistanceLODThreshold );
} // for ( int i = 0; i < VTK_MAXIMUM_NUMBER_OF_RADIAL_AXES; ++ i )
// Create and set polar arcs and ancillary objects, with default color white
......@@ -209,7 +215,7 @@ vtkPolarAxesActor::vtkPolarAxesActor() : vtkActor()
this->PolarArcsActor->SetMapper( this->PolarArcsMapper );
this->PolarArcsActor->GetProperty()->SetColor( 1., 1., 1. );
// Default title for polar axis (can also be called "Radius")
// Default title for polar axis (sometimes also called "Radius")
this->PolarAxisTitle = new char[16];
sprintf(this->PolarAxisTitle, "%s", "Radial Distance");
this->PolarLabelFormat = new char[8];
......@@ -228,12 +234,15 @@ vtkPolarAxesActor::vtkPolarAxesActor() : vtkActor()
// By default polar arcs are visible
this->PolarArcsVisibility = 1;
// Default title scale
this->TitleScale = -1.;
// Default label scale
this->LabelScale = -1.;
this->RenderCount = 0;
this->RenderSomething = 0;
this->LabelScale = -1.0;
this->TitleScale = -1.0;
}
//-----------------------------------------------------------------------------
......@@ -725,7 +734,8 @@ void vtkPolarAxesActor::BuildPolarAxisLabelsArcs( double* O )
{
labelActors[i]->SetAxis( axis );
labelActors[i]->SetScreenOffset( this->LabelScreenOffset );
labelActors[i]->SetEnableDistanceLOD( EnableDistanceLOD );
labelActors[i]->SetEnableDistanceLOD( this->EnableDistanceLOD );
labelActors[i]->SetDistanceLODThreshold( .9 * this->DistanceLODThreshold );
}
}
......
......@@ -337,7 +337,7 @@ protected:
int EnableDistanceLOD;
// Description:
// Default is 0.80.
// Default is 0.80
// This determines at what fraction of camera far clip range, actor is not visible.
double DistanceLODThreshold;
......
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