Commit ce1b5c0f authored by Utkarsh Ayachit's avatar Utkarsh Ayachit
Browse files

Added support to compute bounds for data correctly.

We now expect representations to report bounds. This has to be done to avoid the
dependence on geometry to be available for rendering.
parent 85a8d7b6
...@@ -15,11 +15,14 @@ ...@@ -15,11 +15,14 @@
#include "vtkGeometryRepresentation.h" #include "vtkGeometryRepresentation.h"
#include "vtkAlgorithmOutput.h" #include "vtkAlgorithmOutput.h"
#include "vtkBoundingBox.h"
#include "vtkCommand.h" #include "vtkCommand.h"
#include "vtkCompositeDataSet.h" #include "vtkCompositeDataIterator.h"
#include "vtkCompositePolyDataMapper2.h" #include "vtkCompositePolyDataMapper2.h"
#include "vtkInformation.h" #include "vtkInformation.h"
#include "vtkInformationVector.h" #include "vtkInformationVector.h"
#include "vtkMath.h"
#include "vtkMatrix4x4.h"
#include "vtkMultiBlockDataSetAlgorithm.h" #include "vtkMultiBlockDataSetAlgorithm.h"
#include "vtkMultiBlockDataSet.h" #include "vtkMultiBlockDataSet.h"
#include "vtkMultiProcessController.h" #include "vtkMultiProcessController.h"
...@@ -115,6 +118,8 @@ vtkGeometryRepresentation::vtkGeometryRepresentation() ...@@ -115,6 +118,8 @@ vtkGeometryRepresentation::vtkGeometryRepresentation()
this->AllowSpecularHighlightingWithScalarColoring = false; this->AllowSpecularHighlightingWithScalarColoring = false;
vtkMath::UninitializeBounds(this->DataBounds);
this->SetupDefaults(); this->SetupDefaults();
} }
...@@ -140,9 +145,6 @@ void vtkGeometryRepresentation::SetupDefaults() ...@@ -140,9 +145,6 @@ void vtkGeometryRepresentation::SetupDefaults()
this->Decimator->SetCopyCellData(1); this->Decimator->SetCopyCellData(1);
this->Decimator->SetUseInternalTriangles(0); this->Decimator->SetUseInternalTriangles(0);
this->Decimator->SetNumberOfDivisions(10, 10, 10); this->Decimator->SetNumberOfDivisions(10, 10, 10);
// FIXME:STREAMING
//this->LODDeliveryFilter->SetLODMode(true); // tell the filter that it is
// // connected to the LOD pipeline.
vtkPVGeometryFilter::SafeDownCast(this->GeometryFilter)->SetUseOutline(0); vtkPVGeometryFilter::SafeDownCast(this->GeometryFilter)->SetUseOutline(0);
vtkPVGeometryFilter::SafeDownCast(this->GeometryFilter)->SetNonlinearSubdivisionLevel(1); vtkPVGeometryFilter::SafeDownCast(this->GeometryFilter)->SetNonlinearSubdivisionLevel(1);
...@@ -153,11 +155,6 @@ void vtkGeometryRepresentation::SetupDefaults() ...@@ -153,11 +155,6 @@ void vtkGeometryRepresentation::SetupDefaults()
this->CacheKeeper->SetInputConnection(this->MultiBlockMaker->GetOutputPort()); this->CacheKeeper->SetInputConnection(this->MultiBlockMaker->GetOutputPort());
this->Decimator->SetInputConnection(this->CacheKeeper->GetOutputPort()); this->Decimator->SetInputConnection(this->CacheKeeper->GetOutputPort());
// FIXME:STREAMING - Mapper's inputs are directly the data-objects provided by
// the view.
//this->Mapper->SetInputConnection(this->UpdateSuppressor->GetOutputPort());
//this->LODMapper->SetInputConnection(this->LODUpdateSuppressor->GetOutputPort());
this->Actor->SetMapper(this->Mapper); this->Actor->SetMapper(this->Mapper);
this->Actor->SetLODMapper(this->LODMapper); this->Actor->SetLODMapper(this->LODMapper);
this->Actor->SetProperty(this->Property); this->Actor->SetProperty(this->Property);
...@@ -209,6 +206,13 @@ int vtkGeometryRepresentation::ProcessViewRequest( ...@@ -209,6 +206,13 @@ int vtkGeometryRepresentation::ProcessViewRequest(
{ {
outInfo->Set(vtkPVRenderView::NEED_ORDERED_COMPOSITING(), 1); outInfo->Set(vtkPVRenderView::NEED_ORDERED_COMPOSITING(), 1);
} }
// Set the data-bounds.
//double bounds[6];
vtkNew<vtkMatrix4x4> matrix;
this->Actor->GetMatrix(matrix.GetPointer());
vtkPVRenderView::SetGeometryBounds(
inInfo, this->DataBounds, matrix.GetPointer());
} }
else if (request_type == vtkPVView::REQUEST_UPDATE_LOD()) else if (request_type == vtkPVView::REQUEST_UPDATE_LOD())
{ {
...@@ -310,6 +314,8 @@ int vtkGeometryRepresentation::RequestData(vtkInformation* request, ...@@ -310,6 +314,8 @@ int vtkGeometryRepresentation::RequestData(vtkInformation* request,
{ {
// cout << this << ":" << this->DebugString << ":RequestData" << endl; // cout << this << ":" << this->DebugString << ":RequestData" << endl;
vtkMath::UninitializeBounds(this->DataBounds);
// Pass caching information to the cache keeper. // Pass caching information to the cache keeper.
this->CacheKeeper->SetCachingEnabled(this->GetUseCache()); this->CacheKeeper->SetCachingEnabled(this->GetUseCache());
this->CacheKeeper->SetCacheTime(this->GetCacheKey()); this->CacheKeeper->SetCacheTime(this->GetCacheKey());
...@@ -340,6 +346,29 @@ int vtkGeometryRepresentation::RequestData(vtkInformation* request, ...@@ -340,6 +346,29 @@ int vtkGeometryRepresentation::RequestData(vtkInformation* request,
this->GeometryFilter)->SetInputData(0, placeholder.GetPointer()); this->GeometryFilter)->SetInputData(0, placeholder.GetPointer());
} }
this->CacheKeeper->Update(); this->CacheKeeper->Update();
// Determine data bounds.
vtkCompositeDataSet* cd = vtkCompositeDataSet::SafeDownCast(
this->CacheKeeper->GetOutputDataObject(0));
if (cd)
{
vtkBoundingBox bbox;
vtkCompositeDataIterator* iter = cd->NewIterator();
for (iter->InitTraversal(); !iter->IsDoneWithTraversal(); iter->GoToNextItem())
{
vtkDataSet* ds = vtkDataSet::SafeDownCast(iter->GetCurrentDataObject());
if (ds)
{
bbox.AddBounds(ds->GetBounds());
}
}
iter->Delete();
if (bbox.IsValid())
{
bbox.GetBounds(this->DataBounds);
}
}
return this->Superclass::RequestData(request, inputVector, outputVector); return this->Superclass::RequestData(request, inputVector, outputVector);
} }
......
...@@ -259,6 +259,7 @@ protected: ...@@ -259,6 +259,7 @@ protected:
bool SuppressLOD; bool SuppressLOD;
bool AllowSpecularHighlightingWithScalarColoring; bool AllowSpecularHighlightingWithScalarColoring;
bool RequestGhostCellsIfNeeded; bool RequestGhostCellsIfNeeded;
double DataBounds[6];
private: private:
vtkGeometryRepresentation(const vtkGeometryRepresentation&); // Not implemented vtkGeometryRepresentation(const vtkGeometryRepresentation&); // Not implemented
......
...@@ -134,6 +134,13 @@ int vtkImageSliceRepresentation::ProcessViewRequest( ...@@ -134,6 +134,13 @@ int vtkImageSliceRepresentation::ProcessViewRequest(
// to provide a place-holder dataset of the right type. // to provide a place-holder dataset of the right type.
vtkPVRenderView::SetPiece(inInfo, this, vtkPVRenderView::SetPiece(inInfo, this,
this->CacheKeeper->GetOutputDataObject(0)); this->CacheKeeper->GetOutputDataObject(0));
vtkImageData* img = vtkImageData::SafeDownCast(
this->CacheKeeper->GetOutputDataObject(0));
if (img)
{
vtkPVRenderView::SetGeometryBounds(inInfo, img->GetBounds());
}
} }
else if (request_type == vtkPVView::REQUEST_RENDER()) else if (request_type == vtkPVView::REQUEST_RENDER())
{ {
......
...@@ -16,10 +16,10 @@ ...@@ -16,10 +16,10 @@
#include "vtkAlgorithmOutput.h" #include "vtkAlgorithmOutput.h"
#include "vtkCommand.h" #include "vtkCommand.h"
#include "vtkSmartVolumeMapper.h"
#include "vtkImageData.h" #include "vtkImageData.h"
#include "vtkInformation.h" #include "vtkInformation.h"
#include "vtkInformationVector.h" #include "vtkInformationVector.h"
#include "vtkMath.h"
#include "vtkObjectFactory.h" #include "vtkObjectFactory.h"
#include "vtkOutlineSource.h" #include "vtkOutlineSource.h"
#include "vtkPolyDataMapper.h" #include "vtkPolyDataMapper.h"
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "vtkPVRenderView.h" #include "vtkPVRenderView.h"
#include "vtkRenderer.h" #include "vtkRenderer.h"
#include "vtkSmartPointer.h" #include "vtkSmartPointer.h"
#include "vtkSmartVolumeMapper.h"
#include "vtkVolumeProperty.h" #include "vtkVolumeProperty.h"
#include <map> #include <map>
...@@ -56,6 +57,8 @@ vtkImageVolumeRepresentation::vtkImageVolumeRepresentation() ...@@ -56,6 +57,8 @@ vtkImageVolumeRepresentation::vtkImageVolumeRepresentation()
this->CacheKeeper->SetInputData(this->Cache); this->CacheKeeper->SetInputData(this->Cache);
this->Actor->SetLODMapper(this->OutlineMapper); this->Actor->SetLODMapper(this->OutlineMapper);
vtkMath::UninitializeBounds(this->DataBounds);
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
...@@ -102,6 +105,7 @@ int vtkImageVolumeRepresentation::ProcessViewRequest( ...@@ -102,6 +105,7 @@ int vtkImageVolumeRepresentation::ProcessViewRequest(
this->OutlineSource->GetOutputDataObject(0)); this->OutlineSource->GetOutputDataObject(0));
outInfo->Set(vtkPVRenderView::NEED_ORDERED_COMPOSITING(), 1); outInfo->Set(vtkPVRenderView::NEED_ORDERED_COMPOSITING(), 1);
vtkPVRenderView::SetGeometryBounds(inInfo, this->DataBounds);
} }
else if (request_type == vtkPVView::REQUEST_RENDER()) else if (request_type == vtkPVView::REQUEST_RENDER())
{ {
...@@ -120,6 +124,8 @@ int vtkImageVolumeRepresentation::ProcessViewRequest( ...@@ -120,6 +124,8 @@ int vtkImageVolumeRepresentation::ProcessViewRequest(
int vtkImageVolumeRepresentation::RequestData(vtkInformation* request, int vtkImageVolumeRepresentation::RequestData(vtkInformation* request,
vtkInformationVector** inputVector, vtkInformationVector* outputVector) vtkInformationVector** inputVector, vtkInformationVector* outputVector)
{ {
vtkMath::UninitializeBounds(this->DataBounds);
// Pass caching information to the cache keeper. // Pass caching information to the cache keeper.
this->CacheKeeper->SetCachingEnabled(this->GetUseCache()); this->CacheKeeper->SetCachingEnabled(this->GetUseCache());
this->CacheKeeper->SetCacheTime(this->GetCacheKey()); this->CacheKeeper->SetCacheTime(this->GetCacheKey());
...@@ -139,6 +145,7 @@ int vtkImageVolumeRepresentation::RequestData(vtkInformation* request, ...@@ -139,6 +145,7 @@ int vtkImageVolumeRepresentation::RequestData(vtkInformation* request,
this->OutlineSource->SetBounds(vtkImageData::SafeDownCast( this->OutlineSource->SetBounds(vtkImageData::SafeDownCast(
this->CacheKeeper->GetOutputDataObject(0))->GetBounds()); this->CacheKeeper->GetOutputDataObject(0))->GetBounds());
this->OutlineSource->GetBounds(this->DataBounds);
} }
else else
{ {
......
...@@ -158,6 +158,7 @@ protected: ...@@ -158,6 +158,7 @@ protected:
int ColorAttributeType; int ColorAttributeType;
char* ColorArrayName; char* ColorArrayName;
int RequestedRenderMode; int RequestedRenderMode;
double DataBounds[6];
private: private:
vtkImageVolumeRepresentation(const vtkImageVolumeRepresentation&); // Not implemented vtkImageVolumeRepresentation(const vtkImageVolumeRepresentation&); // Not implemented
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "vtkLight.h" #include "vtkLight.h"
#include "vtkLightKit.h" #include "vtkLightKit.h"
#include "vtkMath.h" #include "vtkMath.h"
#include "vtkMatrix4x4.h"
#include "vtkMemberFunctionCommand.h" #include "vtkMemberFunctionCommand.h"
#include "vtkMPIMoveData.h" #include "vtkMPIMoveData.h"
#include "vtkMultiProcessController.h" #include "vtkMultiProcessController.h"
...@@ -90,7 +91,6 @@ vtkInformationKeyMacro(vtkPVRenderView, USE_LOD, Integer); ...@@ -90,7 +91,6 @@ vtkInformationKeyMacro(vtkPVRenderView, USE_LOD, Integer);
vtkInformationKeyMacro(vtkPVRenderView, LOD_RESOLUTION, Double); vtkInformationKeyMacro(vtkPVRenderView, LOD_RESOLUTION, Double);
vtkInformationKeyMacro(vtkPVRenderView, NEED_ORDERED_COMPOSITING, Integer); vtkInformationKeyMacro(vtkPVRenderView, NEED_ORDERED_COMPOSITING, Integer);
vtkInformationKeyMacro(vtkPVRenderView, REPRESENTED_DATA_STORE, ObjectBase); vtkInformationKeyMacro(vtkPVRenderView, REPRESENTED_DATA_STORE, ObjectBase);
vtkInformationKeyRestrictedMacro(vtkPVRenderView, GEOMETRY_BOUNDS, DoubleVector, 6);
vtkCxxSetObjectMacro(vtkPVRenderView, LastSelection, vtkSelection); vtkCxxSetObjectMacro(vtkPVRenderView, LastSelection, vtkSelection);
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
vtkPVRenderView::vtkPVRenderView() vtkPVRenderView::vtkPVRenderView()
...@@ -138,11 +138,6 @@ vtkPVRenderView::vtkPVRenderView() ...@@ -138,11 +138,6 @@ vtkPVRenderView::vtkPVRenderView()
this->PreviousParallelProjectionStatus = 0; this->PreviousParallelProjectionStatus = 0;
this->NeedsOrderedCompositing = false; this->NeedsOrderedCompositing = false;
this->LastComputedBounds[0] = this->LastComputedBounds[2] =
this->LastComputedBounds[4] = -1.0;
this->LastComputedBounds[1] = this->LastComputedBounds[3] =
this->LastComputedBounds[5] = 1.0;
this->SynchronizedRenderers = vtkPVSynchronizedRenderer::New(); this->SynchronizedRenderers = vtkPVSynchronizedRenderer::New();
if (this->SynchronizedWindows->GetLocalProcessIsDriver()) if (this->SynchronizedWindows->GetLocalProcessIsDriver())
...@@ -584,58 +579,41 @@ void vtkPVRenderView::FinishSelection(vtkSelection* sel) ...@@ -584,58 +579,41 @@ void vtkPVRenderView::FinishSelection(vtkSelection* sel)
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void vtkPVRenderView::ResetCameraClippingRange() void vtkPVRenderView::ResetCameraClippingRange()
{ {
//cout << "Clipping Bounds: " if (this->GeometryBounds.IsValid())
// << this->LastComputedBounds[0] << ", " {
// << this->LastComputedBounds[1] << ", " double bounds[6];
// << this->LastComputedBounds[2] << ", " this->GeometryBounds.GetBounds(bounds);
// << this->LastComputedBounds[3] << ", " this->GetRenderer()->ResetCameraClippingRange(bounds);
// << this->LastComputedBounds[4] << ", " this->GetNonCompositedRenderer()->ResetCameraClippingRange(bounds);
// << this->LastComputedBounds[5] << endl; }
this->GetRenderer()->ResetCameraClippingRange(this->LastComputedBounds);
this->GetNonCompositedRenderer()->ResetCameraClippingRange(this->LastComputedBounds);
} }
#define PRINT_BOUNDS(bds)\ #define PRINT_BOUNDS(bds)\
bds[0] << "," << bds[1] << "," << bds[2] << "," << bds[3] << "," << bds[4] << "," << bds[5] << "," bds[0] << "," << bds[1] << "," << bds[2] << "," << bds[3] << "," << bds[4] << "," << bds[5] << ","
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void vtkPVRenderView::GatherBoundsInformation( void vtkPVRenderView::SynchronizeGeometryBounds()
bool using_distributed_rendering)
{ {
vtkMath::UninitializeBounds(this->LastComputedBounds); double bounds[6];
vtkMath::UninitializeBounds(bounds);
if (this->GetLocalProcessDoesRendering(using_distributed_rendering)) if (this->GeometryBounds.IsValid())
{ {
this->CenterAxes->SetUseBounds(0); this->GeometryBounds.GetBounds(bounds);
// if ComputeVisiblePropBounds is called when there's no real window on the
// local process, all vtkWidgetRepresentations return wacky Z bounds which
// screws up the renderer and we don't see any images.
this->GetRenderer()->ComputeVisiblePropBounds(this->LastComputedBounds);
this->CenterAxes->SetUseBounds(1);
} }
if (using_distributed_rendering) // sync up bounds across all processes when doing distributed rendering.
this->SynchronizedWindows->SynchronizeBounds(bounds);
if (!vtkMath::AreBoundsInitialized(bounds))
{ {
// sync up bounds across all processes when doing distributed rendering. this->GeometryBounds.SetBounds(-1, 1, -1, 1, -1, 1);
this->SynchronizedWindows->SynchronizeBounds(this->LastComputedBounds);
} }
else
if (!vtkMath::AreBoundsInitialized(this->LastComputedBounds))
{ {
this->LastComputedBounds[0] = this->LastComputedBounds[2] = this->GeometryBounds.SetBounds(bounds);
this->LastComputedBounds[4] = -1.0;
this->LastComputedBounds[1] = this->LastComputedBounds[3] =
this->LastComputedBounds[5] = 1.0;
} }
//cout << "Bounds: "
// << this->LastComputedBounds[0] << ", "
// << this->LastComputedBounds[1] << ", "
// << this->LastComputedBounds[2] << ", "
// << this->LastComputedBounds[3] << ", "
// << this->LastComputedBounds[4] << ", "
// << this->LastComputedBounds[5] << endl;
this->UpdateCenterAxes();
this->ResetCameraClippingRange(); this->ResetCameraClippingRange();
} }
...@@ -671,7 +649,9 @@ void vtkPVRenderView::ResetCamera() ...@@ -671,7 +649,9 @@ void vtkPVRenderView::ResetCamera()
// Remember, vtkRenderer::ResetCamera() calls // Remember, vtkRenderer::ResetCamera() calls
// vtkRenderer::ResetCameraClippingPlanes() with the given bounds. // vtkRenderer::ResetCameraClippingPlanes() with the given bounds.
this->RenderView->GetRenderer()->ResetCamera(this->LastComputedBounds); double bounds[6];
this->GeometryBounds.GetBounds(bounds);
this->RenderView->GetRenderer()->ResetCamera(bounds);
this->InvokeEvent(vtkCommand::ResetCameraEvent); this->InvokeEvent(vtkCommand::ResetCameraEvent);
} }
...@@ -745,6 +725,10 @@ void vtkPVRenderView::Update() ...@@ -745,6 +725,10 @@ void vtkPVRenderView::Update()
{ {
vtkTimerLog::MarkStartEvent("RenderView::Update"); vtkTimerLog::MarkStartEvent("RenderView::Update");
// reset the bounds, so that representations can provide us with bounds
// information during update.
this->GeometryBounds.Reset();
this->RequestInformation->Set(REPRESENTED_DATA_STORE(), this->RequestInformation->Set(REPRESENTED_DATA_STORE(),
this->Internals->GeometryStore.GetPointer()); this->Internals->GeometryStore.GetPointer());
...@@ -800,6 +784,9 @@ void vtkPVRenderView::Update() ...@@ -800,6 +784,9 @@ void vtkPVRenderView::Update()
this->InteractiveRenderProcesses = vtkPVSession::CLIENT_AND_SERVERS; this->InteractiveRenderProcesses = vtkPVSession::CLIENT_AND_SERVERS;
} }
// Synchronize data bounds.
this->SynchronizeGeometryBounds();
vtkTimerLog::MarkEndEvent("RenderView::Update"); vtkTimerLog::MarkEndEvent("RenderView::Update");
} }
...@@ -901,17 +888,6 @@ void vtkPVRenderView::Render(bool interactive, bool skip_rendering) ...@@ -901,17 +888,6 @@ void vtkPVRenderView::Render(bool interactive, bool skip_rendering)
this->InteractiveRenderImageReductionFactor : this->InteractiveRenderImageReductionFactor :
this->StillRenderImageReductionFactor)); this->StillRenderImageReductionFactor));
if (!interactive)
{
// Keep bounds information up-to-date.
// GatherBoundsInformation will not do communication unless using
// distributed rendering.
this->GatherBoundsInformation(
in_cave_mode || use_distributed_rendering);
this->UpdateCenterAxes(this->LastComputedBounds);
}
this->UsedLODForLastRender = use_lod_rendering; this->UsedLODForLastRender = use_lod_rendering;
if (skip_rendering) if (skip_rendering)
...@@ -1091,6 +1067,45 @@ void vtkPVRenderView::SetDeliverLODToAllProcesses(vtkInformation* info, ...@@ -1091,6 +1067,45 @@ void vtkPVRenderView::SetDeliverLODToAllProcesses(vtkInformation* info,
storage->SetDeliverToAllProcesses(repr, clone, true); storage->SetDeliverToAllProcesses(repr, clone, true);
} }
//----------------------------------------------------------------------------
void vtkPVRenderView::SetGeometryBounds(vtkInformation* info,
double bounds[6], vtkMatrix4x4* matrix /*=NULL*/)
{
// FIXME: I need a cleaner way for accessing the render view.
vtkRepresentedDataStorage* storage =
vtkRepresentedDataStorage::SafeDownCast(
info->Get(REPRESENTED_DATA_STORE()));
if (!storage)
{
vtkGenericWarningMacro("Missing REPRESENTED_DATA_STORE().");
return;
}
vtkPVRenderView* self = vtkPVRenderView::SafeDownCast(storage->GetView());
if (self)
{
if (matrix && vtkMath::AreBoundsInitialized(bounds))
{
double min_point[4] = {bounds[0], bounds[2], bounds[4], 1};
double max_point[4] = {bounds[1], bounds[3], bounds[5], 1};
matrix->MultiplyPoint(min_point, min_point);
matrix->MultiplyPoint(max_point, max_point);
double transformed_bounds[6];
transformed_bounds[0] = min_point[0] / min_point[3];
transformed_bounds[2] = min_point[1] / min_point[3];
transformed_bounds[4] = min_point[2] / min_point[3];
transformed_bounds[1] = max_point[0] / max_point[3];
transformed_bounds[3] = max_point[1] / max_point[3];
transformed_bounds[5] = max_point[2] / max_point[3];
self->GeometryBounds.AddBounds(transformed_bounds);
}
else
{
self->GeometryBounds.AddBounds(bounds);
}
}
}
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool vtkPVRenderView::ShouldUseDistributedRendering(double geometry_size) bool vtkPVRenderView::ShouldUseDistributedRendering(double geometry_size)
{ {
...@@ -1203,9 +1218,10 @@ void vtkPVRenderView::RemovePropFromRenderer(vtkProp* prop) ...@@ -1203,9 +1218,10 @@ void vtkPVRenderView::RemovePropFromRenderer(vtkProp* prop)
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void vtkPVRenderView::UpdateCenterAxes(double bounds[6]) void vtkPVRenderView::UpdateCenterAxes()
{ {
vtkBoundingBox bbox(bounds); vtkBoundingBox bbox(this->GeometryBounds);
// include the center of rotation in the axes size determination. // include the center of rotation in the axes size determination.
bbox.AddPoint(this->CenterAxes->GetPosition()); bbox.AddPoint(this->CenterAxes->GetPosition());
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#define __vtkPVRenderView_h #define __vtkPVRenderView_h
#include "vtkPVView.h" #include "vtkPVView.h"
#include "vtkBoundingBox.h" // needed for iVar
class vtkAlgorithmOutput; class vtkAlgorithmOutput;
class vtkCamera; class vtkCamera;
...@@ -49,6 +50,7 @@ class vtkInteractorStyleRubberBand3D; ...@@ -49,6 +50,7 @@ class vtkInteractorStyleRubberBand3D;
class vtkInteractorStyleRubberBandZoom; class vtkInteractorStyleRubberBandZoom;
class vtkLight; class vtkLight;
class vtkLightKit; class vtkLightKit;
class vtkMatrix4x4;
class vtkProp; class vtkProp;
class vtkPVAxesWidget; class vtkPVAxesWidget;
class vtkPVCenterAxesActor; class vtkPVCenterAxesActor;
...@@ -243,17 +245,6 @@ public: ...@@ -243,17 +245,6 @@ public:
// processes. // processes.
static vtkInformationObjectBaseKey* REPRESENTED_DATA_STORE(); static vtkInformationObjectBaseKey* REPRESENTED_DATA_STORE();
// Description:
// vtkDataRepresentation can use this key to publish meta-data about geometry
// bounds in the vtkPVView::REQUEST_UPDATE().
// If this meta-data is available, then the view can make informed
// decisions when resetting camera to the bounds of visible data.
// If no bounds are specified by a representation then the data bounds are
// used, if possible.
// Note that all process don't have to report bounds. The view takes care of
// consolidating the bounds between all views.
static vtkInformationDoubleVectorKey* GEOMETRY_BOUNDS();
// Description: // Description:
// USE_LOD indicates if LOD is being used for the current render/update. // USE_LOD indicates if LOD is being used for the current render/update.
static vtkInformationIntegerKey* USE_LOD(); static vtkInformationIntegerKey* USE_LOD();
...@@ -351,6 +342,8 @@ public: ...@@ -351,6 +342,8 @@ public:
vtkInformation* info, vtkPVDataRepresentation* repr, bool clone); vtkInformation* info, vtkPVDataRepresentation* repr, bool clone);
static void MarkAsRedistributable( static void MarkAsRedistributable(
vtkInformation* info, vtkPVDataRepresentation* repr); vtkInformation* info, vtkPVDataRepresentation* repr);
static void SetGeometryBounds(vtkInformation* info,
double bounds[6], vtkMatrix4x4* transform = NULL);
public: public:
//***************************************************************** //*****************************************************************
...@@ -537,7 +530,7 @@ protected: ...@@ -537,7 +530,7 @@ protected:
// Description: