Commit 47089b5c authored by Utkarsh Ayachit's avatar Utkarsh Ayachit

rename API to better reflect implementation.

`vtkPVRenderView::GetUseDistributedRenderingForStillRender` and
`vtkPVRenderView::GetUseDistributedRenderingForInteractiveRender` are
renamed to better reflect the implementation. These are not for still vs
interactive but full-res vs lod. New names avoid that confusion.
parent 0722976d
......@@ -595,9 +595,8 @@ void vtkPVDataDeliveryManager::Deliver(int use_lod, unsigned int size, unsigned
vtkTimerLog::MarkStartEvent(use_lod ? "LowRes Data Migration" : "FullRes Data Migration");
bool using_remote_rendering = use_lod
? this->RenderView->GetUseDistributedRenderingForInteractiveRender()
: this->RenderView->GetUseDistributedRenderingForStillRender();
bool using_remote_rendering = use_lod ? this->RenderView->GetUseDistributedRenderingForLODRender()
: this->RenderView->GetUseDistributedRenderingForRender();
int mode = this->RenderView->GetDataDistributionMode(using_remote_rendering);
for (unsigned int cc = 0; cc < size; cc += 2)
......@@ -864,7 +863,7 @@ void vtkPVDataDeliveryManager::DeliverStreamedPieces(unsigned int size, unsigned
// with only delivering pieces for streaming.
assert(size % 2 == 0);
bool using_remote_rendering = this->RenderView->GetUseDistributedRenderingForStillRender();
bool using_remote_rendering = this->RenderView->GetUseDistributedRenderingForRender();
int mode = this->RenderView->GetDataDistributionMode(using_remote_rendering);
for (unsigned int cc = 0; cc < size; cc += 2)
......
......@@ -186,8 +186,8 @@ int vtkPVGridAxes3DRepresentation::ProcessViewRequest(
vtkPVRenderView* rview = vtkPVRenderView::SafeDownCast(this->GetView());
if (rview)
{
forceOpaque = (rview->GetUseDistributedRenderingForInteractiveRender() ||
rview->GetUseDistributedRenderingForStillRender()) &&
forceOpaque = (rview->GetUseDistributedRenderingForLODRender() ||
rview->GetUseDistributedRenderingForRender()) &&
!rview->GetUseOrderedCompositing();
}
this->GridAxes->SetForceOpaque(forceOpaque);
......
......@@ -350,8 +350,8 @@ vtkPVRenderView::vtkPVRenderView()
this->InteractiveRenderProcesses = vtkPVSession::NONE;
this->UsedLODForLastRender = false;
this->UseLODForInteractiveRender = false;
this->UseDistributedRenderingForStillRender = false;
this->UseDistributedRenderingForInteractiveRender = false;
this->UseDistributedRenderingForRender = false;
this->UseDistributedRenderingForLODRender = false;
this->MakingSelection = false;
this->PreviousSwapBuffers = 0;
this->StillRenderImageReductionFactor = 1;
......@@ -1176,9 +1176,9 @@ void vtkPVRenderView::SynchronizeForCollaboration()
{
vtkMultiProcessStream stream;
stream << (this->UseLODForInteractiveRender ? 1 : 0)
<< (this->UseDistributedRenderingForStillRender ? 1 : 0)
<< (this->UseDistributedRenderingForInteractiveRender ? 1 : 0)
<< this->StillRenderProcesses << this->InteractiveRenderProcesses;
<< (this->UseDistributedRenderingForRender ? 1 : 0)
<< (this->UseDistributedRenderingForLODRender ? 1 : 0) << this->StillRenderProcesses
<< this->InteractiveRenderProcesses;
r_controller->Send(stream, 1, 42000);
}
else
......@@ -1196,8 +1196,8 @@ void vtkPVRenderView::SynchronizeForCollaboration()
stream >> arg1 >> arg2 >> arg3 >> this->StillRenderProcesses >>
this->InteractiveRenderProcesses;
this->UseLODForInteractiveRender = (arg1 == 1);
this->UseDistributedRenderingForStillRender = (arg2 == 1);
this->UseDistributedRenderingForInteractiveRender = (arg3 == 1);
this->UseDistributedRenderingForRender = (arg2 == 1);
this->UseDistributedRenderingForLODRender = (arg3 == 1);
}
}
......@@ -1258,21 +1258,21 @@ void vtkPVRenderView::Update()
// Update decisions about lod-rendering and remote-rendering.
this->UseLODForInteractiveRender = this->ShouldUseLODRendering(local_size);
this->UseDistributedRenderingForStillRender =
this->UseDistributedRenderingForRender =
this->ShouldUseDistributedRendering(local_size, /*using_lod=*/false);
if (!this->UseLODForInteractiveRender)
{
this->UseDistributedRenderingForInteractiveRender = this->UseDistributedRenderingForStillRender;
this->UseDistributedRenderingForLODRender = this->UseDistributedRenderingForRender;
}
this->StillRenderProcesses = this->InteractiveRenderProcesses = vtkPVSession::CLIENT;
bool in_tile_display_mode = this->InTileDisplayMode();
bool in_cave_mode = this->InCaveDisplayMode();
if (in_tile_display_mode || in_cave_mode || this->UseDistributedRenderingForStillRender)
if (in_tile_display_mode || in_cave_mode || this->UseDistributedRenderingForRender)
{
this->StillRenderProcesses = vtkPVSession::CLIENT_AND_SERVERS;
}
if (in_tile_display_mode || in_cave_mode || this->UseDistributedRenderingForInteractiveRender)
if (in_tile_display_mode || in_cave_mode || this->UseDistributedRenderingForLODRender)
{
this->InteractiveRenderProcesses = vtkPVSession::CLIENT_AND_SERVERS;
}
......@@ -1291,11 +1291,10 @@ void vtkPVRenderView::CopyViewUpdateOptions(vtkPVRenderView* otherView)
this->NeedsOrderedCompositing = otherView->NeedsOrderedCompositing;
this->RenderEmptyImages = otherView->RenderEmptyImages;
this->UseLODForInteractiveRender = otherView->UseLODForInteractiveRender;
this->UseDistributedRenderingForStillRender = otherView->UseDistributedRenderingForStillRender;
this->UseDistributedRenderingForRender = otherView->UseDistributedRenderingForRender;
this->StillRenderProcesses = otherView->StillRenderProcesses;
this->InteractiveRenderProcesses = otherView->InteractiveRenderProcesses;
this->UseDistributedRenderingForInteractiveRender =
otherView->UseDistributedRenderingForInteractiveRender;
this->UseDistributedRenderingForLODRender = otherView->UseDistributedRenderingForLODRender;
}
//----------------------------------------------------------------------------
......@@ -1322,13 +1321,13 @@ void vtkPVRenderView::UpdateLOD()
this->SynchronizedWindows->SynchronizeSize(local_size);
// cout << "LOD Geometry size: " << local_size << endl;
this->UseDistributedRenderingForInteractiveRender =
this->UseDistributedRenderingForLODRender =
this->ShouldUseDistributedRendering(local_size, /*using_lod=*/true);
this->InteractiveRenderProcesses = vtkPVSession::CLIENT;
bool in_tile_display_mode = this->InTileDisplayMode();
bool in_cave_mode = this->InCaveDisplayMode();
if (in_tile_display_mode || in_cave_mode || this->UseDistributedRenderingForInteractiveRender)
if (in_tile_display_mode || in_cave_mode || this->UseDistributedRenderingForLODRender)
{
this->InteractiveRenderProcesses = vtkPVSession::CLIENT_AND_SERVERS;
}
......@@ -1369,8 +1368,8 @@ void vtkPVRenderView::Render(bool interactive, bool skip_rendering)
this->UpdateStereoProperties();
if (this->SynchronizedWindows->GetMode() != vtkPVSynchronizedRenderWindows::CLIENT ||
(!interactive && this->UseDistributedRenderingForStillRender) ||
(interactive && this->UseDistributedRenderingForInteractiveRender))
(!interactive && this->UseDistributedRenderingForRender) ||
(interactive && this->UseDistributedRenderingForLODRender))
{
// in multi-client modes, Render() will be called on client always. Now the
// client need to coordinate with server only when we are remote rendering.
......@@ -1430,9 +1429,9 @@ void vtkPVRenderView::Render(bool interactive, bool skip_rendering)
// cout << "Using remote rendering: " << use_distributed_rendering << endl;
// Decide if we are doing remote rendering or local rendering.
bool use_distributed_rendering = interactive
? this->GetUseDistributedRenderingForInteractiveRender()
: this->GetUseDistributedRenderingForStillRender();
bool use_distributed_rendering = use_lod_rendering
? this->GetUseDistributedRenderingForLODRender()
: this->GetUseDistributedRenderingForRender();
if (this->GetUseOrderedCompositing())
{
......@@ -2190,7 +2189,7 @@ void vtkPVRenderView::DeliverStreamedPieces(unsigned int size, unsigned int* rep
vtkTimerLog::MarkStartEvent("vtkPVRenderView::DeliverStreamedPieces");
this->Internals->DeliveryManager->DeliverStreamedPieces(size, representation_ids);
if (this->GetLocalProcessDoesRendering(this->GetUseDistributedRenderingForStillRender()))
if (this->GetLocalProcessDoesRendering(this->GetUseDistributedRenderingForRender()))
{
// tell representations to "deal with" the newly streamed piece on the
// rendering nodes.
......@@ -2763,7 +2762,7 @@ void vtkPVRenderView::SetValueRenderingModeCommand(int mode)
// Fixes issue with the background (black) when coming back from FLOATING_POINT
// mode. FLOATING_POINT mode is only supported in BATCH mode and single process
// CLIENT.
if (this->GetUseDistributedRenderingForStillRender() &&
if (this->GetUseDistributedRenderingForRender() &&
vtkProcessModule::GetProcessType() == vtkProcessModule::PROCESS_CLIENT)
{
vtkWarningMacro("vtkValuePass::FLOATING_POINT mode is only supported in BATCH"
......@@ -2966,7 +2965,7 @@ void vtkPVRenderView::CaptureValuesFloat()
else
#endif
{
if (this->GetUseDistributedRenderingForStillRender() &&
if (this->GetUseDistributedRenderingForRender() &&
vtkProcessModule::GetProcessType() == vtkProcessModule::PROCESS_CLIENT)
{
vtkWarningMacro("vtkValuePass::FLOATING_POINT result is only available in the root"
......@@ -3281,3 +3280,23 @@ void vtkPVRenderView::SetDiscreteCameras(
self->DiscreteCameras = style;
}
//----------------------------------------------------------------------------
#if !defined(VTK_LEGACY_REMOVE)
bool vtkPVRenderView::GetUseDistributedRenderingForStillRender()
{
VTK_LEGACY_REPLACED_BODY(vtkPVRenderView::GetUseDistributedRenderingForStillRender,
"ParaView 5.6", vtkPVRenderView::GetUseDistributedRenderingForRender);
return this->GetUseDistributedRenderingForRender();
}
#endif
//----------------------------------------------------------------------------
#if !defined(VTK_LEGACY_REMOVE)
bool vtkPVRenderView::GetUseDistributedRenderingForInteractiveRender()
{
VTK_LEGACY_REPLACED_BODY(vtkPVRenderView::GetUseDistributedRenderingForInteractiveRender,
"ParaView 5.6", vtkPVRenderView::GetUseDistributedRenderingForLODRender);
return this->GetUseDistributedRenderingForLODRender();
}
#endif
......@@ -681,21 +681,37 @@ public:
//@{
/**
* Returns whether the view will use distributed rendering for the next
* StillRender() call based on the geometry sizes determined by the most
* recent call to Update().
* full-resolution render. This uses the full resolution geometry sizes as
* determined by the most recent call to `Update`.
*/
vtkGetMacro(UseDistributedRenderingForStillRender, bool);
vtkGetMacro(UseDistributedRenderingForRender, bool);
//@}
/**
* @deprecated ParaView 5.6.
*
* Please use `GetUseDistributedRenderingForRender` instead.
* The change was done to make the name better reflect the implementation.
*/
VTK_LEGACY(bool GetUseDistributedRenderingForStillRender());
//@{
/**
* Returns whether the view will use distributed rendering for the next
* InteractiveRender() call based on the geometry sizes determined by the most
* recent calls to Update() and UpdateLOD().
* low-resolution render. This uses the low-resolution (or LOD) geometry sizes
* as determined by the most recent call to `UpdateLOD`.
*/
vtkGetMacro(UseDistributedRenderingForInteractiveRender, bool);
vtkGetMacro(UseDistributedRenderingForLODRender, bool);
//@}
/**
* @deprecated ParaView 5.6.
*
* Please use `GetUseDistributedRenderingForLODRender` instead. The change was
* done to make the name better reflect the implementation.
*/
VTK_LEGACY(bool GetUseDistributedRenderingForInteractiveRender());
//@{
/**
* Returns the processes (vtkPVSession::ServerFlags) that are to be involved
......@@ -1110,8 +1126,8 @@ protected:
bool UsedLODForLastRender;
bool UseLODForInteractiveRender;
bool UseOutlineForLODRendering;
bool UseDistributedRenderingForStillRender;
bool UseDistributedRenderingForInteractiveRender;
bool UseDistributedRenderingForRender;
bool UseDistributedRenderingForLODRender;
vtkTypeUInt32 StillRenderProcesses;
vtkTypeUInt32 InteractiveRenderProcesses;
......
......@@ -58,9 +58,8 @@ void vtkSMDataDeliveryManager::Deliver(bool interactive)
vtkPVRenderView* view = vtkPVRenderView::SafeDownCast(this->ViewProxy->GetClientSideObject());
bool use_lod = interactive && view->GetUseLODForInteractiveRender();
bool use_distributed_rendering = interactive
? view->GetUseDistributedRenderingForInteractiveRender()
: view->GetUseDistributedRenderingForStillRender();
bool use_distributed_rendering = use_lod ? view->GetUseDistributedRenderingForRender()
: view->GetUseDistributedRenderingForLODRender();
if (this->PreviousForceDataDistributionMode != view->GetForceDataDistributionMode())
{
......
......@@ -245,8 +245,8 @@ void pqInteractiveViewLink::renderLinkedView()
if (!this->Internal->Rendering && this->Internal->LinkedView != NULL &&
this->Internal->LinkedPVView != NULL && this->Internal->DisplayPVView != NULL)
{
if (this->Internal->LinkedPVView->GetUseDistributedRenderingForStillRender() ||
this->Internal->DisplayPVView->GetUseDistributedRenderingForStillRender())
if (this->Internal->LinkedPVView->GetUseDistributedRenderingForRender() ||
this->Internal->DisplayPVView->GetUseDistributedRenderingForRender())
{
qCritical() << "Something went wrong, remote rendering should not use "
"pqInteractiveViewLink::renderLinkedView method";
......@@ -327,8 +327,8 @@ void pqInteractiveViewLink::drawViewLink(int setFront)
}
bool visible = this->Internal->LinkedWidget->isVisible();
bool remoteRendering = this->Internal->LinkedPVView->GetUseDistributedRenderingForStillRender() ||
this->Internal->DisplayPVView->GetUseDistributedRenderingForStillRender();
bool remoteRendering = this->Internal->LinkedPVView->GetUseDistributedRenderingForRender() ||
this->Internal->DisplayPVView->GetUseDistributedRenderingForRender();
// getFront is true when remoteRendering a non-visible linked view, false otherwise
bool getFront = remoteRendering && !visible;
......
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