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

Made the updates more interactive.

Also fixed code to use correct block id when making requests.
parent 69335896
......@@ -32,6 +32,7 @@
#include "vtkRenderer.h"
#include "vtkSmartPointer.h"
#include "vtkSmartVolumeMapper.h"
#include "vtkTimerLog.h"
#include "vtkUniformGrid.h"
#include "vtkVolumeProperty.h"
......@@ -219,9 +220,11 @@ int vtkAMRVolumeRepresentation::ProcessViewRequest(
this->InitializeResampler = false;
}
vtkTimerLog::MarkStartEvent("Resample Volume");
int samples[3]= {40, 40, 40};
this->Resampler->UpdateROI(bounds, samples);
this->Resampler->Update();
vtkTimerLog::MarkEndEvent("Resample Volume");
this->VolumeMapper->SetInputData(this->Resampler->GetGrid());
#endif
}
......
......@@ -62,7 +62,7 @@ vtkInformationKeyMacro(vtkPVView, REQUEST_UPDATE, Request);
vtkInformationKeyMacro(vtkPVView, REQUEST_UPDATE_LOD, Request);
vtkInformationKeyMacro(vtkPVView, REQUEST_RENDER, Request);
bool vtkPVView::EnableStreaming = false;
bool vtkPVView::EnableStreaming = true;
//----------------------------------------------------------------------------
void vtkPVView::SetEnableStreaming(bool val)
{
......
......@@ -407,7 +407,6 @@ bool vtkRepresentedDataStorage::BuildPriorityQueue()
}
// note: amr block ids currently don't match up with composite dataset ids :/.
unsigned int block_id = 0;
// now build a priority queue for absent blocks using the current camera.
for (unsigned int level=0; level < oamr->GetNumberOfLevels(); level++)
{
......@@ -418,13 +417,12 @@ bool vtkRepresentedDataStorage::BuildPriorityQueue()
{
vtkInternals::vtkPriorityQueueItem item;
item.RepresentationId = iter->first;
item.BlockId = block_id;
item.Priority = 1.0 / (1.0 + block_id);
item.BlockId = oamr->GetCompositeIndex(level, index);
item.Priority = 1.0 / (1.0 + item.BlockId);
item.Level = level;
item.Index = index;
this->Internals->PriorityQueue.push(item);
}
block_id++;
}
}
return true;
......
......@@ -151,7 +151,7 @@ bool vtkSMDataDeliveryManager::DeliverNextPiece()
const vtkClientServerStream& result = session->GetLastResult(
vtkPVSession::DATA_SERVER_ROOT);
result.Print(cout);
//result.Print(cout);
// extract the "piece-key" from the result and then request it.
unsigned int representation_id = 0;
......
......@@ -40,10 +40,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "vtkPVView.h"
#include "pqServer.h"
#include "vtkSMSession.h"
#include "vtkPVGenericRenderWindowInteractor.h"
//-----------------------------------------------------------------------------
pqViewStreamingBehavior::pqViewStreamingBehavior(QObject* parentObject)
: Superclass(parentObject), Pass(0)
: Superclass(parentObject), Pass(0), DelayUpdate(false)
{
pqServerManagerModel* smmodel =
pqApplicationCore::instance()->getServerManagerModel();
......@@ -79,9 +80,27 @@ void pqViewStreamingBehavior::onViewUpdated(
{
this->Pass = 0;
this->Timer.start(3000);
rvProxy->GetInteractor()->AddObserver(
vtkCommand::StartInteractionEvent,
this, &pqViewStreamingBehavior::onStartInteractionEvent);
rvProxy->GetInteractor()->AddObserver(
vtkCommand::EndInteractionEvent,
this, &pqViewStreamingBehavior::onEndInteractionEvent);
}
}
//-----------------------------------------------------------------------------
void pqViewStreamingBehavior::onStartInteractionEvent()
{
this->DelayUpdate = true;
}
//-----------------------------------------------------------------------------
void pqViewStreamingBehavior::onEndInteractionEvent()
{
this->DelayUpdate = false;
}
//-----------------------------------------------------------------------------
void pqViewStreamingBehavior::onTimeout()
{
......@@ -92,9 +111,9 @@ void pqViewStreamingBehavior::onTimeout()
view->getProxy());
if (rvProxy->GetSession()->GetPendingProgress() ||
view->getServer()->isProcessingPending())
view->getServer()->isProcessingPending() || this->DelayUpdate)
{
this->Timer.start();
this->Timer.start(1000);
}
else
{
......@@ -103,7 +122,7 @@ void pqViewStreamingBehavior::onTimeout()
if (to_continue)
{
this->Pass++;
this->Timer.start(1000);
this->Timer.start(100);
}
}
}
......
......@@ -59,6 +59,10 @@ private:
Q_DISABLE_COPY(pqViewStreamingBehavior)
QTimer Timer;
int Pass;
bool DelayUpdate;
void onStartInteractionEvent();
void onEndInteractionEvent();
};
#endif
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