Commit de38fae7 authored by Ken Martin's avatar Ken Martin
Browse files

some bug fixes from the main tree

parent f5fed540
......@@ -20,7 +20,7 @@
#include "vtkObjectFactory.h"
#include "vtkSource.h"
vtkCxxRevisionMacro(vtkDataObject, "1.96");
vtkCxxRevisionMacro(vtkDataObject, "1.96.2.1");
vtkStandardNewMacro(vtkDataObject);
vtkCxxSetObjectMacro(vtkDataObject,FieldData,vtkFieldData);
......@@ -330,19 +330,6 @@ void vtkDataObject::TriggerAsynchronousUpdate()
void vtkDataObject::UpdateData()
{
// This condition gives the default behavior if the user asks
// for a piece that cannot be generated by the source.
// Just ignore the request and return empty.
if (this->MaximumNumberOfPieces > 0 &&
this->UpdatePiece >= this->MaximumNumberOfPieces)
{
this->Initialize();
this->Piece = this->UpdatePiece;
this->NumberOfPieces = this->UpdateNumberOfPieces;
this->GhostLevel = this->UpdateGhostLevel;
return;
}
// If we need to update due to PipelineMTime, or the fact that our
// data was released, then propagate the UpdateData to the source
// if there is one.
......
......@@ -21,7 +21,7 @@
#include "vtkGarbageCollector.h"
#include "vtkObjectFactory.h"
vtkCxxRevisionMacro(vtkSource, "1.107");
vtkCxxRevisionMacro(vtkSource, "1.107.2.1");
#ifndef NULL
#define NULL 0
......@@ -389,6 +389,15 @@ void vtkSource::UpdateData(vtkDataObject *output)
}
}
// This condition gives the default behavior if the user asks
// for a piece that cannot be generated by the source.
// Just ignore the request and return empty.
if (output && output->GetMaximumNumberOfPieces() > 0 &&
output->GetUpdatePiece() >= output->GetMaximumNumberOfPieces())
{
skipExecute = 1;
}
if (!skipExecute)
{
// Pass the vtkDataObject's field data from the first input
......
......@@ -20,7 +20,7 @@
#include "vtkPropCollection.h"
#include "vtkWindow.h"
vtkCxxRevisionMacro(vtkViewport, "1.58");
vtkCxxRevisionMacro(vtkViewport, "1.58.2.1");
// Create a vtkViewport with a black background, a white ambient light,
// two-sided lighting turned on, a viewport of (0,0,1,1), and backface culling
......@@ -637,12 +637,24 @@ void vtkViewport::GetTiledSize(int *usize, int *vsize)
void vtkViewport::GetTiledSizeAndOrigin(int *usize, int *vsize,
int *lowerLeftU, int *lowerLeftV)
{
double *vport;
// find out if we should stereo render
vport = this->GetViewport();
double *tileViewPort = this->GetVTKWindow()->GetTileViewport();
// if there is no window assume 0 1
double tileViewPort[4];
if (this->GetVTKWindow())
{
this->GetVTKWindow()->GetTileViewport(tileViewPort);
}
else
{
tileViewPort[0] = 0;
tileViewPort[1] = 0;
tileViewPort[2] = 1;
tileViewPort[3] = 1;
}
double vpu, vpv;
// find the lower left corner of the viewport, taking into account the
......
......@@ -24,7 +24,7 @@
// rendering features such as two-sided lighting can also be controlled.
// .SECTION See Also
// vtkWindow vtkImager vtkRenderer
// vtkWindow vtkRenderer
#ifndef __vtkViewport_h
#define __vtkViewport_h
......
......@@ -24,7 +24,7 @@
#include <math.h>
vtkCxxRevisionMacro(vtkSphereSource, "1.65");
vtkCxxRevisionMacro(vtkSphereSource, "1.65.2.1");
vtkStandardNewMacro(vtkSphereSource);
//----------------------------------------------------------------------------
......@@ -288,5 +288,5 @@ void vtkSphereSource::PrintSelf(ostream& os, vtkIndent indent)
//----------------------------------------------------------------------------
void vtkSphereSource::ExecuteInformation()
{
this->GetOutput()->SetMaximumNumberOfPieces(this->ThetaResolution);
this->GetOutput()->SetMaximumNumberOfPieces(-1);
}
......@@ -20,7 +20,7 @@
#include "vtkProp.h"
#include "vtkRenderer.h"
vtkCxxRevisionMacro(vtkFrustumCoverageCuller, "1.31");
vtkCxxRevisionMacro(vtkFrustumCoverageCuller, "1.31.6.1");
vtkStandardNewMacro(vtkFrustumCoverageCuller);
// Create a frustum coverage culler with default values
......@@ -54,7 +54,6 @@ double vtkFrustumCoverageCuller::Cull( vtkRenderer *ren,
double *distanceList;
int index1, index2;
double tmp;
double aspect[2];
// We will create a center distance entry for each prop in the list
// If SortingStyle is set to BackToFront or FrontToBack we will then
......@@ -66,9 +65,9 @@ double vtkFrustumCoverageCuller::Cull( vtkRenderer *ren,
// normalization.
total_time = 0;
ren->GetAspect( aspect );
// Get the view frustum planes from the active camera
ren->GetActiveCamera()->GetFrustumPlanes( (aspect[0] / aspect[1]), planes );
ren->GetActiveCamera()->GetFrustumPlanes(
ren->GetTiledAspectRatio(), planes );
// Keep a list of allocated times to help with sorting / removing
// props later
......
......@@ -33,7 +33,7 @@
#include "vtkTimerLog.h"
#include "vtkVolume.h"
vtkCxxRevisionMacro(vtkRenderer, "1.205");
vtkCxxRevisionMacro(vtkRenderer, "1.205.2.1");
//----------------------------------------------------------------------------
// Needed when we don't use the vtkStandardNewMacro.
......@@ -979,30 +979,10 @@ void vtkRenderer::ViewToWorld(double &x, double &y, double &z)
vtkMatrix4x4 *mat = vtkMatrix4x4::New();
double result[4];
int usize, vsize;
this->GetTiledSize(&usize,&vsize);
// some renderer subclasses may have more complicated computations for the
// aspect ratio. SO take that into account by computing the difference
// between our simple aspect ratio and what the actual renderer is
// reporting.
double aspect[2];
this->ComputeAspect();
this->GetAspect(aspect);
double aspect2[2];
this->vtkViewport::ComputeAspect();
this->vtkViewport::GetAspect(aspect2);
double aspectModification = aspect[0]*aspect2[1]/(aspect[1]*aspect2[0]);
double finalAspect = 1.0;
if(vsize)
{
finalAspect = aspectModification*usize/vsize;
}
// get the perspective transformation from the active camera
mat->DeepCopy(this->ActiveCamera->
GetCompositePerspectiveTransformMatrix(finalAspect,0,1));
GetCompositePerspectiveTransformMatrix(
this->GetTiledAspectRatio(),0,1));
// use the inverse matrix
mat->Invert();
......@@ -1043,30 +1023,10 @@ void vtkRenderer::WorldToView(double &x, double &y, double &z)
vtkMatrix4x4 *matrix = vtkMatrix4x4::New();
double view[4];
int usize, vsize;
this->GetTiledSize(&usize,&vsize);
// some renderer subclasses may have more complicated computations for the
// aspect ratio. SO take that into account by computing the difference
// between our simple aspect ratio and what the actual renderer is
// reporting.
double aspect[2];
this->ComputeAspect();
this->GetAspect(aspect);
double aspect2[2];
this->vtkViewport::ComputeAspect();
this->vtkViewport::GetAspect(aspect2);
double aspectModification = aspect[0]*aspect2[1]/(aspect[1]*aspect2[0]);
double finalAspect = 1.0;
if(vsize)
{
finalAspect = aspectModification*usize/vsize;
}
// get the perspective transformation from the active camera
matrix->DeepCopy(this->ActiveCamera->
GetCompositePerspectiveTransformMatrix(finalAspect,0,1));
GetCompositePerspectiveTransformMatrix(
this->GetTiledAspectRatio(),0,1));
view[0] = x*matrix->Element[0][0] + y*matrix->Element[0][1] +
z*matrix->Element[0][2] + matrix->Element[0][3];
......@@ -1404,4 +1364,27 @@ int vtkRenderer::Transparent()
return (this->Layer == 0 ? 0 : 1);
}
double vtkRenderer::GetTiledAspectRatio()
{
int usize, vsize;
this->GetTiledSize(&usize,&vsize);
// some renderer subclasses may have more complicated computations for the
// aspect ratio. SO take that into account by computing the difference
// between our simple aspect ratio and what the actual renderer is
// reporting.
double aspect[2];
this->ComputeAspect();
this->GetAspect(aspect);
double aspect2[2];
this->vtkViewport::ComputeAspect();
this->vtkViewport::GetAspect(aspect2);
double aspectModification = aspect[0]*aspect2[1]/(aspect[1]*aspect2[0]);
double finalAspect = 1.0;
if(vsize && usize)
{
finalAspect = aspectModification*usize/vsize;
}
return finalAspect;
}
......@@ -344,6 +344,13 @@ public:
// vtkIceTRenderer in ParaView.
virtual void StereoMidpoint() { return; };
// Description:
// Compute the aspect ratio of this renderer for the current tile. When
// tiled displays are used the aspect ratio of the renderer for a given
// tile may be diferent that the aspect ratio of the renderer when rendered
// in it entirity
double GetTiledAspectRatio();
protected:
vtkRenderer();
~vtkRenderer();
......
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