예제 #1
0
void FieldDataVisualizer::setActiveHueLut(vtkSmartPointer<vtkLookupTable>& _hueLut) {
	double scalarRange[2];
	myHMeshToVtkUnstructuredGrid->getVtkUnstructuredGrid()->GetPointData()->GetScalars()->GetRange(scalarRange);
	mySelectedMapper->UseLookupTableScalarRangeOn();
	// Create a lookup table to share between the mapper and the scalarbar
	_hueLut->SetTableRange(scalarRange[0], scalarRange[1]);
	_hueLut->SetHueRange(0.667, 0.0);
	_hueLut->SetValueRange(1, 1);
	_hueLut->Build();

	mySelectedMapper->SetLookupTable(_hueLut);
}
예제 #2
0
void TransferFunction::toBWVtkLookupTable(
         double rangeMin,
         double rangeMax,
         vtkSmartPointer<vtkLookupTable> lt,
         unsigned int size )
{
    SLM_TRACE_FUNC();

    // Configures basic parameters
    lt->Allocate( size, size );
    lt->SetScaleToLinear();

    lt->SetRampToLinear();
    lt->SetTableRange( rangeMin, rangeMax );
    lt->SetAlphaRange( 1.0, 1.0 );
    lt->SetHueRange( 0.0, 0.0 );
    lt->SetSaturationRange( 0.0, 0.0 );
    lt->SetValueRange( 0.0, 1.0 );

    lt->Build();

    lt->Modified();
}