Commit 92eb350e authored by Mathieu Westphal's avatar Mathieu Westphal Committed by Kitware Robot
Browse files

Merge topic 'PointGaussianRepresentationFix'

cc68987d

 Scale and Opacity table fix for point gaussian representation
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Michael Migliore's avatarMichael Migliore <michael.migliore@kitware.com>
Acked-by: default avatarJoachim Pouderoux <joachim.pouderoux@kitware.com>
Merge-request: !4807
parents c22f5594 cc68987d
......@@ -832,38 +832,42 @@ void vtkOpenGLPointGaussianMapper::Render(
return;
}
// the first step is to update the helpers if needed
if (this->HelperUpdateTime < this->GetInputDataObject(0, 0)->GetMTime() ||
this->HelperUpdateTime < this->GetInputAlgorithm()->GetMTime() ||
this->HelperUpdateTime < this->GetMTime())
// update tables
if (this->GetScaleFunction() && this->GetScaleArray())
{
// update tables
if (this->GetScaleFunction() && this->GetScaleArray() != nullptr)
if (this->ScaleTableUpdateTime < this->GetScaleFunction()->GetMTime() ||
this->ScaleTableUpdateTime < this->GetMTime())
{
this->BuildScaleTable();
this->ScaleTableUpdateTime.Modified();
}
else
{
if (this->ScaleTable)
{
delete [] this->ScaleTable;
this->ScaleTable = nullptr;
}
}
}
else
{
delete [] this->ScaleTable;
this->ScaleTable = nullptr;
}
if (this->GetScalarOpacityFunction() && this->GetOpacityArray() != nullptr)
if (this->GetScalarOpacityFunction() && this->GetOpacityArray())
{
if (this->OpacityTableUpdateTime < this->GetScalarOpacityFunction()->GetMTime() ||
this->OpacityTableUpdateTime < this->GetMTime())
{
this->BuildOpacityTable();
this->OpacityTableUpdateTime.Modified();
}
else
{
if (this->OpacityTable)
{
delete [] this->OpacityTable;
this->OpacityTable = nullptr;
}
}
}
else
{
delete [] this->OpacityTable;
this->OpacityTable = nullptr;
}
// the first step is to update the helpers if needed
if (this->HelperUpdateTime < this->GetInputDataObject(0, 0)->GetMTime() ||
this->HelperUpdateTime < this->GetInputAlgorithm()->GetMTime() ||
this->HelperUpdateTime < this->GetMTime())
{
// clear old helpers
for (auto hiter = this->Helpers.begin(); hiter != this->Helpers.end(); ++hiter)
{
......@@ -1043,6 +1047,7 @@ void vtkOpenGLPointGaussianMapper::BuildScaleTable()
this->ScaleScale = (tableSize - 1.0)/(range[1] - range[0]);
this->ScaleOffset = range[0];
}
this->Modified();
}
//-------------------------------------------------------------------------
......@@ -1066,7 +1071,7 @@ void vtkOpenGLPointGaussianMapper::BuildOpacityTable()
this->OpacityScale = (tableSize - 1.0)/(range[1] - range[0]);
this->OpacityOffset = range[0];
}
this->Modified();
}
//----------------------------------------------------------------------------
......
......@@ -72,6 +72,8 @@ protected:
vtkOpenGLPointGaussianMapperHelper *helper);
vtkTimeStamp HelperUpdateTime;
vtkTimeStamp ScaleTableUpdateTime;
vtkTimeStamp OpacityTableUpdateTime;
// unused
void RenderPiece(vtkRenderer *, vtkActor *) override {};
......
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