Commit 32754eaa authored by Utkarsh Ayachit's avatar Utkarsh Ayachit

Fixed updating for lod rendering when setting was changed.

As user toggled the use outline for lod setting, the rendering mode won't
immediately update. This happened as the delivery mechanism didn't think it
needed to request new data. Ensure that it happens so.
parent 91e64b03
......@@ -253,6 +253,10 @@ int vtkGeometryRepresentation::ProcessViewRequest(
{
if (inInfo->Has(vtkPVRenderView::USE_OUTLINE_FOR_LOD()))
{
// HACK to ensure that when Decimator is next employed, it delivers a
// new geometry.
this->Decimator->Modified();
this->LODOutlineFilter->Update();
// Pass along the LOD geometry to the view so that it can deliver it to
// the rendering node as and when needed.
......@@ -261,6 +265,10 @@ int vtkGeometryRepresentation::ProcessViewRequest(
}
else
{
// HACK to ensure that when Decimator is next employed, it delivers a
// new geometry.
this->LODOutlineFilter->Modified();
if (inInfo->Has(vtkPVRenderView::LOD_RESOLUTION()))
{
int division = static_cast<int>(150 *
......
......@@ -465,7 +465,19 @@ void vtkPVDataDeliveryManager::SetPiece(
{
vtkPVDataRepresentationPipeline* executive =
vtkPVDataRepresentationPipeline::SafeDownCast(repr->GetExecutive());
if (executive && executive->GetDataTime() > item->GetTimeStamp())
// SetPiece() is called in every REQUEST_UPDATE() or REQUEST_UPDATE_LOD()
// pass irrespective of whether the data has actually changed.
// (I think that's a mistake, but the fact that representations can be
// updated without view makes it tricky since we cannot set the data to
// deliver in vtkPVDataRepresentation::RequestData() easily). Hence we need
// to ensure that the data we are getting is newer than what we have.
unsigned long data_time = executive? executive->GetDataTime() : 0;
if (data && (data->GetMTime() > data_time))
{
data_time = data->GetMTime();
}
if (data_time > item->GetTimeStamp())
{
item->SetDataObject(data);
}
......
......@@ -215,7 +215,6 @@ int vtkUnstructuredGridVolumeRepresentation::ProcessViewRequest(
{
this->LODGeometryFilter->SetUseOutline(
inInfo->Has(vtkPVRenderView::USE_OUTLINE_FOR_LOD())? 1 : 0);
this->LODGeometryFilter->SetUseOutline(0);
this->LODGeometryFilter->Update();
}
vtkPVRenderView::SetPieceLOD(inInfo, this,
......
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