Commit 4a1d88c5 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit

BUG #14729: Fix remote rendering when rendering image volumes.

vtkPVDataDeliveryManager was using incorrect geometry size for
vtkImageVolumeRepresentation. vtkImageVolumeRepresentation needed to
report the true data size to vtkPVDataDeliveryManager for it make the
correct decision. This commit fixes that by adding an API to
vtkPVDataDeliveryManager to pass in a "true-data-size" when passing
dataset to deliver.

Change-Id: Iff1bc45e18f35b1bf1c57739b23daa7441c5ecd8
parent a70fc429
......@@ -58,6 +58,7 @@ vtkImageVolumeRepresentation::vtkImageVolumeRepresentation()
this->Actor->SetLODMapper(this->OutlineMapper);
vtkMath::UninitializeBounds(this->DataBounds);
this->DataSize = 0;
}
//----------------------------------------------------------------------------
......@@ -94,7 +95,12 @@ int vtkImageVolumeRepresentation::ProcessViewRequest(
if (request_type == vtkPVView::REQUEST_UPDATE())
{
vtkPVRenderView::SetPiece(inInfo, this,
this->OutlineSource->GetOutputDataObject(0));
this->OutlineSource->GetOutputDataObject(0),
this->DataSize);
// BUG #14792.
// We report this->DataSize explicitly since the data being "delivered" is
// not the data that should be used to make rendering decisions based on
// data size.
outInfo->Set(vtkPVRenderView::NEED_ORDERED_COMPOSITING(), 1);
vtkPVRenderView::SetGeometryBounds(inInfo, this->DataBounds);
......@@ -150,6 +156,7 @@ int vtkImageVolumeRepresentation::RequestData(vtkInformation* request,
vtkInformationVector** inputVector, vtkInformationVector* outputVector)
{
vtkMath::UninitializeBounds(this->DataBounds);
this->DataSize = 0;
// Pass caching information to the cache keeper.
this->CacheKeeper->SetCachingEnabled(this->GetUseCache());
......@@ -172,6 +179,8 @@ int vtkImageVolumeRepresentation::RequestData(vtkInformation* request,
this->CacheKeeper->GetOutputDataObject(0))->GetBounds());
this->OutlineSource->GetBounds(this->DataBounds);
this->OutlineSource->Update();
this->DataSize = this->CacheKeeper->GetOutputDataObject(0)->GetActualMemorySize();
}
else
{
......
......@@ -142,6 +142,7 @@ protected:
vtkOutlineSource* OutlineSource;
vtkPolyDataMapper* OutlineMapper;;
unsigned long DataSize;
double DataBounds[6];
private:
......
......@@ -125,6 +125,11 @@ public:
this->TimeStamp = ts;
}
void SetActualMemorySize(unsigned long size)
{
this->ActualMemorySize = size;
}
void SetDeliveredDataObject(vtkDataObject* data)
{
this->DeliveredDataObject = data;
......@@ -352,7 +357,8 @@ void vtkPVDataDeliveryManager::SetStreamable(
//----------------------------------------------------------------------------
void vtkPVDataDeliveryManager::SetPiece(
vtkPVDataRepresentation* repr, vtkDataObject* data, bool low_res)
vtkPVDataRepresentation* repr, vtkDataObject* data, bool low_res,
unsigned long trueSize)
{
vtkInternals::vtkItem* item = this->Internals->GetItem(repr, low_res);
if (item)
......@@ -367,6 +373,10 @@ void vtkPVDataDeliveryManager::SetPiece(
{
item->SetDataObject(data);
}
if (trueSize > 0)
{
item->SetActualMemorySize(trueSize);
}
}
else
{
......
......@@ -66,7 +66,8 @@ public:
// method to register the geometry type they are rendering. Every
// representation that requires delivering of any geometry must register with
// the vtkPVDataDeliveryManager and never manage the delivery on its own.
void SetPiece(vtkPVDataRepresentation* repr, vtkDataObject* data, bool low_res);
void SetPiece(vtkPVDataRepresentation* repr, vtkDataObject* data,
bool low_res, unsigned long trueSize=0);
void SetPiece(unsigned int repr_id, vtkDataObject* data, bool low_res);
// Description:
......
......@@ -1241,7 +1241,8 @@ int vtkPVRenderView::GetDataDistributionMode(bool use_remote_rendering)
//----------------------------------------------------------------------------
void vtkPVRenderView::SetPiece(vtkInformation* info,
vtkPVDataRepresentation* repr, vtkDataObject* data)
vtkPVDataRepresentation* repr, vtkDataObject* data,
unsigned long trueSize/*=0*/)
{
vtkPVRenderView* view = vtkPVRenderView::SafeDownCast(info->Get(VIEW()));
if (!view)
......@@ -1250,7 +1251,7 @@ void vtkPVRenderView::SetPiece(vtkInformation* info,
return;
}
view->GetDeliveryManager()->SetPiece(repr, data, false);
view->GetDeliveryManager()->SetPiece(repr, data, false, trueSize);
}
//----------------------------------------------------------------------------
......
......@@ -322,8 +322,10 @@ public:
// Description:
// Convenience methods used by representations to pass represented data.
// If trueSize is non-zero, then that's the size used in making decisions
// about LOD/remote rendering etc and not the actual size of the dataset.
static void SetPiece(vtkInformation* info,
vtkPVDataRepresentation* repr, vtkDataObject* data);
vtkPVDataRepresentation* repr, vtkDataObject* data, unsigned long trueSize=0);
static vtkAlgorithmOutput* GetPieceProducer(vtkInformation* info,
vtkPVDataRepresentation* repr);
static void SetPieceLOD(vtkInformation* info,
......
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