Commit a8100e8b authored by Utkarsh Ayachit's avatar Utkarsh Ayachit

Cleaning up View/Representation API.

Adding a new key, VIEW(), to the ProcessViewRequest() call to make it easier for
representations to access the view that is calling the passes.
parent 488ffef9
......@@ -58,6 +58,9 @@ SET (Kit_SRCS
vtkPVDataInformation.cxx
vtkPVDataRepresentation.cxx
vtkPVDataRepresentationPipeline.cxx
vtkProcessModuleAutoMPI.cxx
vtkProcessModule.cxx
vtkPVDataDeliveryManager.cxx
vtkPVDataSetAttributesInformation.cxx
vtkPVDataSizeInformation.cxx
vtkPVDisplayInformation.cxx
......@@ -77,24 +80,24 @@ SET (Kit_SRCS
vtkPVOptionsXMLParser.cxx
vtkPVParallelCoordinatesChartView.cxx
vtkPVParallelCoordinatesRepresentation.cxx
vtkPVPlotMatrixView.cxx
vtkPVPlotMatrixRepresentation.cxx
vtkPVPlotMatrixView.cxx
vtkPVPlugin.cxx
vtkPVPluginLoader.cxx
vtkPVPluginTracker.cxx
vtkPVPluginsInformation.cxx
vtkPVPluginTracker.cxx
vtkPVProgressHandler.cxx
vtkPVPythonModule.cxx
vtkPVPythonPluginInterface.cxx
vtkPVRenderView.cxx
vtkPVRepresentedDataInformation.cxx
vtkPVSILInformation.cxx
vtkPVSingleOutputExtractSelection.cxx
vtkPVSelectionInformation.cxx
vtkPVServerInformation.cxx
vtkPVServerManagerPluginInterface.cxx
vtkPVServerOptions.cxx
vtkPVSession.cxx
vtkPVSILInformation.cxx
vtkPVSingleOutputExtractSelection.cxx
vtkPVSynchronizedRenderer.cxx
vtkPVSynchronizedRenderWindows.cxx
vtkPVSystemInformation.cxx
......@@ -102,9 +105,6 @@ SET (Kit_SRCS
vtkPVTimerInformation.cxx
vtkPVView.cxx
vtkPVXYChartView.cxx
vtkProcessModule.cxx
vtkProcessModuleAutoMPI.cxx
vtkRepresentedDataStorage.cxx
vtkSelectionDeliveryFilter.cxx
vtkSelectionRepresentation.cxx
vtkSession.cxx
......
......@@ -196,23 +196,36 @@ int vtkGeometryRepresentation::ProcessViewRequest(
{
// provide the "geometry" to the view so the view can delivery it to the
// rendering nodes as and when needed.
// When this process doesn't have any valid input, the cache-keeper is setup
// to provide a place-holder dataset of the right type.
vtkPVRenderView::SetPiece(
inInfo, this, this->CacheKeeper->GetOutputDataObject(0));
// to provide a place-holder dataset of the right type. This is essential
// since the vtkPVRenderView uses the type specified to decide on the
// delivery mechanism, among other things.
vtkPVRenderView::SetPiece(inInfo, this,
this->CacheKeeper->GetOutputDataObject(0));
// Since we are rendering polydata, it can be redistributed when ordered
// compositing is needed. So let the view know that it can feel free to
// redistribute data as and when needed.
vtkPVRenderView::MarkAsRedistributable(inInfo, this);
// Tell the view if this representation needs ordered compositing. We need
// ordered compositing when rendering translucent geometry.
if (this->Actor->GetProperty()->GetOpacity() < 1.0)
{
// We need to extend this condition to consider translucent LUTs once we
// start supporting them,
outInfo->Set(vtkPVRenderView::NEED_ORDERED_COMPOSITING(), 1);
}
// Set the data-bounds.
//double bounds[6];
// Finally, let the view know about the geometry bounds. The view uses this
// information for resetting camera and clip planes. Since this
// representation allows users to transform the geometry, we need to ensure
// that the bounds we report include the transformation as well.
vtkNew<vtkMatrix4x4> matrix;
this->Actor->GetMatrix(matrix.GetPointer());
vtkPVRenderView::SetGeometryBounds(
inInfo, this->DataBounds, matrix.GetPointer());
vtkPVRenderView::SetGeometryBounds(inInfo, this->DataBounds,
matrix.GetPointer());
}
else if (request_type == vtkPVView::REQUEST_UPDATE_LOD())
{
......@@ -229,6 +242,9 @@ int vtkGeometryRepresentation::ProcessViewRequest(
}
this->Decimator->Update();
// Pass along the LOD geometry to the view so that it can deliver it to
// the rendering node as and when needed.
vtkPVRenderView::SetPieceLOD(inInfo, this,
this->Decimator->GetOutputDataObject(0));
}
......
......@@ -12,20 +12,21 @@
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkRepresentedDataStorage
// .NAME vtkPVDataDeliveryManager - manager for data-delivery.
// .SECTION Description
// vtkRepresentedDataStorage is used by views and representations in ParaView to
// manage datasets that are "represented" by the representations. Typically
// representations use data-store instead of directly use the data from its
// input to ensure that data delivery mechanisms can provide data to the
// processes that need it.
// vtkPVDataDeliveryManager manages geometry delivering for rendering. It is
// used by vtkPVRenderView to manage the delivery of geometry to the nodes where
// rendering is happening. This class helps us consolidate all the code for
// delivering different types of geometries to all the nodes involved as well we
// a managing idiosyncrasies like requiring delivering to all nodes,
// redistributing for ordered compositing, etc.
#ifndef __vtkRepresentedDataStorage_h
#define __vtkRepresentedDataStorage_h
#ifndef __vtkPVDataDeliveryManager_h
#define __vtkPVDataDeliveryManager_h
#include "vtkObject.h"
#include "vtkWeakPointer.h"
#include "vtkSmartPointer.h"
#include "vtkSmartPointer.h" // needed for iVar.
#include "vtkWeakPointer.h" // needed for iVar.
class vtkAlgorithmOutput;
class vtkDataObject;
......@@ -37,11 +38,11 @@ class vtkPKdTree;
#include <vector>
//ETX
class VTK_EXPORT vtkRepresentedDataStorage : public vtkObject
class VTK_EXPORT vtkPVDataDeliveryManager : public vtkObject
{
public:
static vtkRepresentedDataStorage* New();
vtkTypeMacro(vtkRepresentedDataStorage, vtkObject);
static vtkPVDataDeliveryManager* New();
vtkTypeMacro(vtkPVDataDeliveryManager, vtkObject);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
......@@ -53,55 +54,98 @@ public:
void UnRegisterRepresentation(vtkPVDataRepresentation*);
// Description:
void SetPiece(vtkPVDataRepresentation*, vtkDataObject* data, bool low_res);
// Representations (indirectly via vtkPVRenderView::SetPiece()) call this
// 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(unsigned int repr_id, vtkDataObject* data, bool low_res);
// Description:
// Provides access to the producer port for the geometry of a registered
// representation. Representations use these methods (indirectly via
// vtkPVRenderView::GetPieceProducer() and GetPieceProducerLOD()) to obtain
// the geometry producer for the geometry to be rendered.
vtkAlgorithmOutput* GetProducer(vtkPVDataRepresentation*, bool low_res);
vtkAlgorithmOutput* GetProducer(unsigned int, bool low_res);
// Description:
// By default, this class only delivers geometries to nodes that are doing the
// rendering at a given stage. However, certain representations, such as
// data-label representation, or cube-axes representation, need to the
// geometry to be delivered to all nodes always. That can be done by using
// this method (via vtkPVRenderView::SetDeliverToAllProcesses()).
void SetDeliverToAllProcesses(vtkPVDataRepresentation*, bool flag, bool low_res);
void SetPiece(unsigned int, vtkDataObject* data, bool low_res);
vtkAlgorithmOutput* GetProducer(unsigned int, bool low_res);
// Description:
// Under certain cases, e.g. when remote rendering in parallel with
// translucent geometry, the geometry may need to be redistributed to ensure
// ordered compositing can be employed correctly. Marking geometry provided by
// 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*);
// Description:
// Returns the size for all visible geometry.
// Returns the size for all visible geometry. If low_res is true, and low-res
// data is not available for a particular representation, then it's high-res
// data size will be used assuming that the representation is going to render
// the high-res geometry for low-res rendering as well.
unsigned long GetVisibleDataSize(bool low_res);
void Deliver(int use_low_res, unsigned int size, unsigned int *keys);
// Description:
// Provides access to the partitioning kd-tree that was generated using the
// data provided by the representations. The view uses this kd-tree to decide
// on the compositing order when ordered compositing is being used.
vtkPKdTree* GetKdTree();
// Description:
// Get/Set the render-view. The view is not reference counted.
void SetRenderView(vtkPVRenderView*);
vtkPVRenderView* GetRenderView();
void SetView(vtkPVRenderView*);
vtkPVRenderView* GetView();
//BTX
// Description:
// Internal method used to determine the list of representations that need
// their geometry delivered. This is done on the "client" side, with the
// client decide what geometries it needs and then requests those from the
// server-sides using Deliver().
bool NeedsDelivery(unsigned long timestamp,
std::vector<unsigned int>& keys_to_deliver, bool use_low_res);
//ETX
// Description:
// Render-view specific API to mark a piece as "re-distributable" i.e. it
// needs to be "moved around" when ordered compositing is needed.
void MarkAsRedistributable(vtkPVDataRepresentation*);
// Triggers delivery for the geometries of indicated representations.
void Deliver(int use_low_res, unsigned int size, unsigned int *keys);
// *******************************************************************
// UNDER CONSTRUCTION STREAMING API
// *******************************************************************
// Description:
// Mark a representation as streamable. Currently only
// vtkAMRVolumeRepresentation is supported.
void SetStreamable(vtkPVDataRepresentation*, bool);
vtkPKdTree* GetKdTree();
// Description:
// Based on the current camera and currently available datasets, build a
// priority queue.
bool BuildPriorityQueue(double planes[24]);
unsigned int GetRepresentationIdFromQueue();
void StreamingDeliver(unsigned int key);
// *******************************************************************
//BTX
bool NeedsDelivery(unsigned long timestamp,
std::vector<unsigned int>& keys_to_deliver, bool use_low_res);
protected:
vtkRepresentedDataStorage();
~vtkRepresentedDataStorage();
vtkPVDataDeliveryManager();
~vtkPVDataDeliveryManager();
vtkWeakPointer<vtkPVRenderView> View;
vtkWeakPointer<vtkPVRenderView> RenderView;
vtkSmartPointer<vtkPKdTree> KdTree;
private:
vtkRepresentedDataStorage(const vtkRepresentedDataStorage&); // Not implemented
void operator=(const vtkRepresentedDataStorage&); // Not implemented
vtkPVDataDeliveryManager(const vtkPVDataDeliveryManager&); // Not implemented
void operator=(const vtkPVDataDeliveryManager&); // Not implemented
class vtkInternals;
vtkInternals* Internals;
......
......@@ -32,6 +32,13 @@ public:
vtkTypeMacro(vtkPVDataRepresentationPipeline, vtkCompositeDataPipeline);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Exposes the internal time-step updated when the RequestData() method on the
// representation is called. This makes it easier for us to determine when the
// representation executed.
unsigned long GetDataTime() const
{ return this->DataTime; }
//BTX
protected:
vtkPVDataRepresentationPipeline();
......
......@@ -12,26 +12,14 @@
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkPVRenderView
// .NAME vtkPVRenderView - Render View for ParaView.
// .SECTION Description
// vtkRenderViewBase equivalent that is specialized for ParaView. Eventually
// vtkRenderViewBase should have a abstract base-class that this will derive from
// instead of vtkRenderViewBase since we do not use the labelling/icon stuff from
// vtkRenderViewBase.
// FIXME: Following is temporary -- until I decide if that's necessary at all.
// vtkPVRenderView has two types of public methods:
// 1. @CallOnAllProcessess -- must be called on all processes with exactly the
// same values.
// 2. @CallOnClientOnly -- can be called only on the "client" process. These
// typically encapsulate client-side logic such as
// deciding if we are doing remote rendering or local
// rendering etc.
// Utkarsh: Try to use methods that will be called on all processes for most
// decision making similar to what ResetCamera() does. This will avoid the need
// to have special code in vtkSMRenderViewProxy and will simplify life when
// creating new views. "Move logic to VTK" -- that's the Mantra.
// vtkRenderView equivalent that is specialized for ParaView. vtkRenderView
// handles polygonal rendering for ParaView in all the different modes of
// operation. vtkPVRenderView instance must be created on all involved
// processes. vtkPVRenderView uses the information about what process it has
// been created on to decide what part of the "rendering" happens on the
// process.
#ifndef __vtkPVRenderView_h
#define __vtkPVRenderView_h
......@@ -44,8 +32,6 @@ class vtkCameraManipulator;
class vtkInformationDoubleKey;
class vtkInformationDoubleVectorKey;
class vtkInformationIntegerKey;
class vtkInformationObjectBaseKey;
class vtkInformationRequestKey;
class vtkInteractorStyleRubberBand3D;
class vtkInteractorStyleRubberBandZoom;
class vtkLight;
......@@ -59,11 +45,10 @@ class vtkPVGenericRenderWindowInteractor;
class vtkPVHardwareSelector;
class vtkPVInteractorStyle;
class vtkPVSynchronizedRenderer;
class vtkPVSynchronizedRenderWindows;
class vtkRenderer;
class vtkRenderViewBase;
class vtkRenderWindow;
class vtkRepresentedDataStorage;
class vtkPVDataDeliveryManager;
class vtkTexture;
class VTK_EXPORT vtkPVRenderView : public vtkPVView
......@@ -170,13 +155,6 @@ public:
// @CallOnAllProcessess
virtual void InteractiveRender();
// Description:
// Returns the representation id which is going to deliver the next piece for
// streaming.
unsigned int GetNextPieceToDeliver(double planes[24]);
void StreamingUpdate();
// Description:
// Get/Set the reduction-factor to use when for StillRender(). This is
// typically set to 1, but in some cases with terrible connectivity or really
......@@ -247,10 +225,10 @@ public:
vtkBooleanMacro(UseLightKit, bool);
// Description:
// Key used to pass the internal vtkRepresentedDataStorage instance to the
// representations to get/set datasets to be delivered to rendering
// processes.
static vtkInformationObjectBaseKey* REPRESENTED_DATA_STORE();
// EXPERIMENTAL: Components of the streaming API for the render view. This is
// still under development.
unsigned int GetNextPieceToDeliver(double planes[24]);
void StreamingUpdate();
// Description:
// USE_LOD indicates if LOD is being used for the current render/update.
......@@ -354,10 +332,6 @@ public:
static void SetStreamable(
vtkInformation* info, vtkPVDataRepresentation* repr, bool streamable);
public:
//*****************************************************************
// Methods merely exposing methods for internal objects.
// Description:
// Turn on/off the default light in the 3D renderer.
void SetLightSwitch(bool enable);
......@@ -486,7 +460,7 @@ public:
// Description:
// Provides access to the geometry storage for this view.
vtkRepresentedDataStorage* GetGeometryStore();
vtkPVDataDeliveryManager* GetDeliveryManager();
// Description:
// Returns true when ordered compositing is needed on the current group of
......@@ -501,6 +475,9 @@ public:
// Synchronizes core ivars for multi-client setups.
bool SynchronizeForCollaboration();
// Description:
// SynchronizationCounter is used in multi-clients mode to ensure that the
// views on two different clients are in the same state as the server side.
vtkGetMacro(SynchronizationCounter, int);
//BTX
......
......@@ -16,6 +16,7 @@
#include "vtkCacheSizeKeeper.h"
#include "vtkInformation.h"
#include "vtkInformationObjectBaseKey.h"
#include "vtkInformationRequestKey.h"
#include "vtkInformationVector.h"
#include "vtkObjectFactory.h"
......@@ -58,11 +59,12 @@ public:
vtkPVView::vtkInternals::MapOfSynchronizedWindows
vtkPVView::vtkInternals::SynchronizedWindows;
vtkInformationKeyMacro(vtkPVView, REQUEST_UPDATE, Request);
vtkInformationKeyMacro(vtkPVView, REQUEST_UPDATE_LOD, Request);
vtkInformationKeyMacro(vtkPVView, REQUEST_RENDER, Request);
vtkInformationKeyMacro(vtkPVView, REQUEST_UPDATE_LOD, Request);
vtkInformationKeyMacro(vtkPVView, REQUEST_UPDATE, Request);
vtkInformationKeyRestrictedMacro(vtkPVView, VIEW, ObjectBase, "vtkPVView");
bool vtkPVView::EnableStreaming = true;
bool vtkPVView::EnableStreaming = false;
//----------------------------------------------------------------------------
void vtkPVView::SetEnableStreaming(bool val)
{
......@@ -278,6 +280,11 @@ void vtkPVView::CallProcessViewRequest(
}
}
// NOTE: This will create a reference loop (depending on what inInfo is). If
// it's this->RequestInformation, then we have a loop and hence it's
// essential to call vtkInformation::Clear() before this method returns.
inInfo->Set(VIEW(), this);
for (int cc=0; cc < num_reprs; cc++)
{
vtkInformation* outInfo = outVec->GetInformationObject(cc);
......
......@@ -26,6 +26,7 @@
#include "vtkView.h"
class vtkInformation;
class vtkInformationObjectBaseKey;
class vtkInformationRequestKey;
class vtkInformationVector;
class vtkPVSynchronizedRenderWindows;
......@@ -113,6 +114,12 @@ public:
virtual void PrepareForScreenshot();
virtual void CleanupAfterScreenshot();
// Description:
// Key used to pass the vtkPVView pointer to the representation during any of
// the view passes such as REQUEST_UPDATE(), REQUEST_UPDATE_LOD(),
// REQUEST_RENDER(), etc.
static vtkInformationObjectBaseKey* VIEW();
// Description:
// This is a Update-Data pass. All representations are expected to update
// their inputs and prepare geometries for rendering. All heavy work that has
......@@ -127,9 +134,9 @@ public:
static vtkInformationRequestKey* REQUEST_UPDATE_LOD();
// Description:
// This is a render pass. This happens only after
// REQUEST_PREPARE_FOR_RENDER() (and optionally REQUEST_DELIVERY()) has happened.
// This is called for every render.
// This is a render pass. This is called for every render, hence
// representations should not do any work that doesn't depend on things that
// could change every render.
static vtkInformationRequestKey* REQUEST_RENDER();
// Description:
......
/*=========================================================================
Program: Visualization Toolkit
Module: $RCSfile$
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkRepresentedDataStorageInternals
// .SECTION Description
#ifndef __vtkRepresentedDataStorageInternals_h
#define __vtkRepresentedDataStorageInternals_h
#include "vtkDataObject.h"
#include "vtkPVDataRepresentation.h"
#include "vtkPVTrivialProducer.h"
#include "vtkSmartPointer.h"
#include "vtkWeakPointer.h"
#include <map>
#include <queue>
#include <utility>
class vtkRepresentedDataStorage::vtkInternals
{
public:
class vtkPriorityQueueItem
{
public:
unsigned int RepresentationId;
unsigned int BlockId;
unsigned int Level;
unsigned int Index;
double Priority;
vtkPriorityQueueItem() :
RepresentationId(0), BlockId(0),
Level(0), Index(0), Priority(0)
{
}
bool operator < (const vtkPriorityQueueItem& other) const
{
return this->Priority < other.Priority;
}
};
typedef std::priority_queue<vtkPriorityQueueItem> PriorityQueueType;
PriorityQueueType PriorityQueue;
class vtkItem
{
vtkSmartPointer<vtkPVTrivialProducer> Producer;
vtkWeakPointer<vtkDataObject> DataObject;
unsigned long TimeStamp;
unsigned long ActualMemorySize;
public:
vtkWeakPointer<vtkPVDataRepresentation> Representation;
bool AlwaysClone;
bool Redistributable;
bool Streamable;
vtkItem() :
Producer(vtkSmartPointer<vtkPVTrivialProducer>::New()),
TimeStamp(0),
ActualMemorySize(0),
AlwaysClone(false),
Redistributable(false),
Streamable(false)
{ }
void SetDataObject(vtkDataObject* data)
{
if (data && data->GetMTime() > this->TimeStamp)
{
this->DataObject = data;
this->Producer->SetOutput(data);
// the vtkTrivialProducer's MTime is is changed whenever the data itself
// changes or the data's mtime changes and hence we get a good indication
// of when we have a new piece for real.
this->TimeStamp = this->Producer->GetMTime();
this->ActualMemorySize = data? data->GetActualMemorySize() : 0;
}
}
vtkPVTrivialProducer* GetProducer() const
{ return this->Producer.GetPointer(); }
vtkDataObject* GetDataObject() const
{ return this->DataObject.GetPointer(); }
unsigned long GetTimeStamp() const
{ return this->TimeStamp; }
unsigned long GetVisibleDataSize()
{
if (this->Representation && this->Representation->GetVisibility())
{
return this->ActualMemorySize;
}
return 0;
}
};
typedef std::map<unsigned int, std::pair<vtkItem, vtkItem> > ItemsMapType;
vtkItem* GetItem(unsigned int index, bool use_second)
{
if (this->ItemsMap.find(index) != this->ItemsMap.end())
{
return use_second? &(this->ItemsMap[index].second) :
&(this->ItemsMap[index].first);
}
return NULL;
}
vtkItem* GetItem(vtkPVDataRepresentation* repr, bool use_second)
{
RepresentationToIdMapType::iterator iter =
this->RepresentationToIdMap.find(repr);
if (iter != this->RepresentationToIdMap.end())
{
unsigned int index = iter->second;
return use_second? &(this->ItemsMap[index].second) :
&(this->ItemsMap[index].first);
}
return NULL;
}
unsigned long GetVisibleDataSize(bool use_second_if_available)
{
unsigned long size = 0;
ItemsMapType::iterator iter;
for (iter = this->ItemsMap.begin(); iter != this->ItemsMap.end(); ++iter)
{
if (use_second_if_available && iter->second.second.GetDataObject())
{
size += iter->second.second.GetVisibleDataSize();
}
else
{
size += iter->second.first.GetVisibleDataSize();
}
}
return size;
}
typedef std::map<vtkPVDataRepresentation*, unsigned int>
RepresentationToIdMapType;
RepresentationToIdMapType RepresentationToIdMap;
ItemsMapType ItemsMap;
};
#endif
......@@ -16,12 +16,10 @@
#include "vtkCamera.h"
#include "vtkClientServerStream.h"
#include "vtkCommand.h"
#include "vtkObjectFactory.h"
#include "vtkObjectFactory.h"
#include "vtkPVDataDeliveryManager.h"
#include "vtkPVRenderView.h"
#include "vtkRenderer.h"
#include "vtkRepresentedDataStorage.h"
#include "vtkSMSession.h"
#include "vtkSMViewProxy.h"
#include "vtkTimerLog.h"
......@@ -30,53 +28,23 @@
vtkStandardNewMacro(vtkSMDataDeliveryManager);
//----------------------------------------------------------------------------
vtkSMDataDeliveryManager::vtkSMDataDeliveryManager():
UpdateObserverTag(0)
vtkSMDataDeliveryManager::vtkSMDataDeliveryManager()
{
}
//----------------------------------------------------------------------------
vtkSMDataDeliveryManager::~vtkSMDataDeliveryManager()
{
if (this->ViewProxy && this->UpdateObserverTag)
{
this->ViewProxy->RemoveObserver(this->UpdateObserverTag);
this->UpdateObserverTag = 0;
}
}
//----------------------------------------------------------------------------
void vtkSMDataDeliveryManager::SetViewProxy(vtkSMViewProxy* viewproxy)
{
if (viewproxy == this->ViewProxy)
{
return;
}
if (this->ViewProxy && this->UpdateObserverTag)
if (viewproxy != this->ViewProxy)
{
this->ViewProxy->RemoveObserver(this->UpdateObserverTag);
this->UpdateObserverTag = 0;
this->ViewProxy = viewproxy;
this->Modified();
}
this->ViewProxy = viewproxy;
if (this->ViewProxy)
{
this->UpdateObserverTag = this->ViewProxy->AddObserver(
vtkCommand::UpdateDataEvent,
this, &vtkSMDataDeliveryManager::OnViewUpdated);
}
this->Modified();
this->ViewUpdateStamp.Modified();
}
//----------------------------------------------------------------------------
void vtkSMDataDeliveryManager::OnViewUpdated()
{
// Update the timestamp so we realize that view was updated. Hence, we can
// expect new geometry needs to be delivered. Otherwise that code is
// short-circuited for better rendering performance.
this->ViewUpdateStamp.Modified();
}
//----------------------------------------------------------------------------
......@@ -88,12 +56,14 @@ void vtkSMDataDeliveryManager::Deliver(bool interactive)
this->ViewProxy->GetClientSideObject());
bool use_lod = interactive && view->GetUseLODForInteractiveRender();
unsigned long update_ts = this->ViewProxy->GetUpdateTimeStamp();
// Delivery the "base" geometries for all representations. This is true,
// irrespective of whether we are streaming datasets. When a representation is
// updated, it provides a base-geometry that gets delivered for rendering (if
// any). This code handles that.
if ( (!use_lod && this->ViewUpdateStamp < this->GeometryDeliveryStamp) ||
(use_lod && this->ViewUpdateStamp < this->LODGeometryDeliveryStamp) )
if ( (!use_lod && update_ts < this->GeometryDeliveryStamp) ||
(use_lod && update_ts < this->LODGeometryDeliveryStamp) )
{
return;
}