Commit 69dfc499 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit

BUG: Avoid redistribution of stuctured grid when volume rendering.

Due to a bug in logic, despite best intentions
vtkStructuredGridVolumeRepresentation was ending up marking its data as
redistributable. Consequently, vtkPVDataDeliveryManager was redistributing it
which was negating the whole purpose of having
vtkStructuredGridVolumeRepresentation. This fixes that issues by adding API to
vtkPVRenderView to call MarkAsRedistributable() to unmark the representation as
redistributable.

Change-Id: I8474d2f9246b90b3989510688e2a6d67223f5fcb
parent 65fa9097
......@@ -297,14 +297,14 @@ void vtkPVDataDeliveryManager::SetDeliverToAllProcesses(
//----------------------------------------------------------------------------
void vtkPVDataDeliveryManager::MarkAsRedistributable(
vtkPVDataRepresentation* repr)
vtkPVDataRepresentation* repr, bool value/*=true*/)
{
vtkInternals::vtkItem* item = this->Internals->GetItem(repr, false);
vtkInternals::vtkItem* low_item = this->Internals->GetItem(repr, true);
if (item)
{
item->Redistributable = true;
low_item->Redistributable = true;
item->Redistributable = value;
low_item->Redistributable = value;
}
else
{
......
......@@ -92,7 +92,7 @@ public:
// a representation as redistributable makes it possible for this class to
// redistribute the geometry as needed. Only vtkPolyData, vtkUnstructuredGrid
// or a multi-block comprising of vtkPolyData is currently supported.
void MarkAsRedistributable(vtkPVDataRepresentation*);
void MarkAsRedistributable(vtkPVDataRepresentation*, bool value=true);
// Description:
// Returns the size for all visible geometry. If low_res is true, and low-res
......
......@@ -1249,7 +1249,7 @@ vtkAlgorithmOutput* vtkPVRenderView::GetPieceProducerLOD(vtkInformation* info,
//----------------------------------------------------------------------------
void vtkPVRenderView::MarkAsRedistributable(
vtkInformation* info, vtkPVDataRepresentation* repr)
vtkInformation* info, vtkPVDataRepresentation* repr, bool value/*=true*/)
{
vtkPVRenderView* view = vtkPVRenderView::SafeDownCast(info->Get(VIEW()));
if (!view)
......@@ -1258,7 +1258,7 @@ void vtkPVRenderView::MarkAsRedistributable(
return;
}
view->GetDeliveryManager()->MarkAsRedistributable(repr);
view->GetDeliveryManager()->MarkAsRedistributable(repr, value);
}
//----------------------------------------------------------------------------
......
......@@ -329,7 +329,7 @@ public:
static void SetDeliverLODToAllProcesses(
vtkInformation* info, vtkPVDataRepresentation* repr, bool clone);
static void MarkAsRedistributable(
vtkInformation* info, vtkPVDataRepresentation* repr);
vtkInformation* info, vtkPVDataRepresentation* repr, bool value=true);
static void SetGeometryBounds(vtkInformation* info,
double bounds[6], vtkMatrix4x4* transform = NULL);
static void SetStreamable(
......
......@@ -186,6 +186,12 @@ int vtkStructuredGridVolumeRepresentation::ProcessViewRequest(
vtkPVRenderView::SetOrderedCompositingInformation(inInfo, this,
NULL, whole_extent, origin, spacing);
}
// this is essential since this->Superclass::ProcessViewRequest(..) marks
// the data as redistributable, which it isn't in our case. We don't want
// the unstructured-grid we created from the structured-grid to be
// redistributed.
vtkPVRenderView::MarkAsRedistributable(inInfo, this, false);
}
return 1;
......
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