MCPcopy Create free account
hub / github.com/Kitware/VTK / BuildOpacityTable

Method BuildOpacityTable

Rendering/OpenGL2/vtkOpenGLPointGaussianMapper.cxx:869–890  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

867
868//------------------------------------------------------------------------------
869void vtkOpenGLPointGaussianMapper::BuildOpacityTable()
870{
871 double range[2];
872
873 // if a piecewise function was provided, use it to map the opacities
874 vtkPiecewiseFunction* pwf = this->GetScalarOpacityFunction();
875 int tableSize = this->GetOpacityTableSize();
876
877 delete[] this->OpacityTable;
878 this->OpacityTable = new float[tableSize + 1];
879 if (pwf)
880 {
881 // build the interpolation table
882 pwf->GetRange(range);
883 pwf->GetTable(range[0], range[1], tableSize, this->OpacityTable);
884 // duplicate the last value for bilinear interp edge case
885 this->OpacityTable[tableSize] = this->OpacityTable[tableSize - 1];
886 this->OpacityScale = (tableSize - 1.0) / (range[1] - range[0]);
887 this->OpacityOffset = range[0];
888 }
889 this->Modified();
890}
891
892//------------------------------------------------------------------------------
893int vtkOpenGLPointGaussianMapper::FillInputPortInformation(

Callers 1

RenderMethod · 0.95

Calls 4

GetRangeMethod · 0.45
GetTableMethod · 0.45
ModifiedMethod · 0.45

Tested by

no test coverage detected