Commit 47c813aa authored by hrchilds's avatar hrchilds

Update from December 21, 2004

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@384 18c085ea-50e0-402c-830e-de6fd14e8384
parent 81700f06
......@@ -91,7 +91,7 @@ SRC=\
avtWholeImageCompositerNoZ.C \
avtWorldSpaceToImageSpaceTransform.C
CPPFLAGS=@COMPONENT_CPPFLAGS@ @CPPFLAGS@
CPPFLAGS=-I../../include @COMPONENT_CPPFLAGS@ @CPPFLAGS@
SEROBJ=$(SRC:.C=.o)
PAROBJ=$(SRC:.C=_par.o)
......
......@@ -126,17 +126,20 @@ avtImageCommunicator::Execute(void)
//
// Get the scanlines for this processor.
//
int minW, maxW, minH, maxH;
imagePartition->GetThisPartition(minW, maxW, minH, maxH);
int width = (maxW-minW)+1;
if (width < 0)
width = 0;
int height = (maxH-minH)+1;
if (height < 0)
height = 0;
unsigned char *data = NULL;
int width = 0;
int height = 0;
if (GetImageRep().Valid())
if (GetImageRep().Valid() && width > 0 && height > 0)
{
vtkImageData *image = GetImageRep().GetImageVTK();
data = (unsigned char *) image->GetScalarPointer(0, 0, 0);
int extents[6];
image->GetExtent(extents);
width = extents[1] - extents[0] + 1;
height = extents[3] - extents[2] + 1;
}
//
......@@ -193,8 +196,8 @@ avtImageCommunicator::Execute(void)
//
if (myRank == 0)
{
height = imagePartition->GetHeight();
width = imagePartition->GetWidth();
height = imagePartition->GetTileHeight();
width = imagePartition->GetTileWidth();
vtkImageData *newimage = avtImageRepresentation::NewImage(width,
height);
......
......@@ -251,6 +251,13 @@ avtMassVoxelExtractor::SetGridsAreInWorldSpace(bool val, const avtViewInfo &v,
// Programmer: Hank Childs
// Creation: November 19, 2004
//
// Modifications:
//
// Hank Childs, Fri Dec 10 10:36:40 PST 2004
// Use the "restricted" screen space. This will normally be the whole
// screen space, but if we are tiling, then it will correspond to only
// the tile.
//
// ****************************************************************************
void
......@@ -271,10 +278,10 @@ avtMassVoxelExtractor::ExtractWorldSpaceGrid(vtkRectilinearGrid *rgrid)
int height_min[max_ranges];
int height_max[max_ranges];
int curRange = 0;
width_min[curRange] = 0;
width_max[curRange] = width;
height_min[curRange] = 0;
height_max[curRange] = height;
width_min[curRange] = restrictedMinWidth;
width_max[curRange] = restrictedMaxWidth+1;
height_min[curRange] = restrictedMinHeight;
height_max[curRange] = restrictedMaxHeight+1;
curRange++;
while (curRange > 0)
......@@ -440,8 +447,7 @@ avtMassVoxelExtractor::GetSegment(int w, int h, float *origin, float *terminus)
// easiest place to fix it. I haven't tracked down where it is, but it
// would appear to a problem with the interface from our images to VTK's.
//
//view[0] = (w - width/2.)/(width/2.);
view[0] = (width/2. - w)/(width/2.);
view[0] = (w - width/2.)/(width/2.);
view[1] = (h - height/2.)/(height/2.);
view[2] = cur_clip_range[0];
view[3] = 1.;
......@@ -453,7 +459,7 @@ avtMassVoxelExtractor::GetSegment(int w, int h, float *origin, float *terminus)
origin[2] /= origin[3];
}
view[0] = (width/2. - w)/(width/2.);
view[0] = (w - width/2.)/(width/2.);
view[1] = (h - height/2.)/(height/2.);
view[2] = cur_clip_range[1];
view[3] = 1.;
......@@ -512,16 +518,16 @@ avtMassVoxelExtractor::FrustumIntersectsGrid(int w_min, int w_max, int h_min,
// subtleties with putting the arguments in the right order.
//
float normal[3];
FindPlaneNormal(bl_start, ul_start, bl_end, normal);
FindPlaneNormal(bl_start, bl_end, ul_start, normal);
if (!GridOnPlusSideOfPlane(bl_start, normal))
return false;
FindPlaneNormal(bl_start, br_end, br_start, normal);
FindPlaneNormal(bl_start, br_start, br_end, normal);
if (!GridOnPlusSideOfPlane(bl_start, normal))
return false;
FindPlaneNormal(ur_start, ur_end, ul_start, normal);
FindPlaneNormal(ur_start, ul_start, ur_end, normal);
if (!GridOnPlusSideOfPlane(ur_start, normal))
return false;
FindPlaneNormal(ur_start, br_start, ur_end, normal);
FindPlaneNormal(ur_start, ur_end, br_start, normal);
if (!GridOnPlusSideOfPlane(ur_start, normal))
return false;
......
......@@ -399,13 +399,20 @@ avtRayCompositer::Execute(void)
int i, j;
avtVolume *volume = GetTypedInput()->GetVolume();
//
// Determine the size of the screen.
//
int height = volume->GetRestrictedVolumeHeight();
int width = volume->GetRestrictedVolumeWidth();
//
// This is a test to determine if there is nothing in the partition we
// are supposed to composite -- since we don't have access to the
// partition, this is a bit of a hack and assumes how the partitioning
// is done.
//
if (volume->GetRestrictedMinHeight() >= volume->GetVolumeHeight())
if (volume->GetRestrictedMinHeight() >= volume->GetVolumeHeight() ||
height <= 0 || width <= 0)
{
SetOutputImage(NULL);
return;
......@@ -413,12 +420,6 @@ avtRayCompositer::Execute(void)
volume->SetProgressCallback(RCPixelProgressCallback, this);
//
// Determine the size of the screen.
//
int height = volume->GetRestrictedVolumeHeight();
int width = volume->GetRestrictedVolumeWidth();
//
// Create an image that we can place each pixel into.
//
......@@ -485,7 +486,7 @@ avtRayCompositer::Execute(void)
for (int j = 0 ; j < height ; j++)
{
int index = j*width + i;
int opaqueImageIndex = (j+minH)*width + (i+minW);
int opaqueImageIndex = (j+minH)*fullWidth + (i+minW);
zbuffer[index] = opaqueImageZB[opaqueImageIndex];
if (zbuffer[index] != 1.)
{
......
// ************************************************************************* //
// avtRayTracer.h //
// avtRayTracer.C //
// ************************************************************************* //
#include <avtRayTracer.h>
#include <vector>
#include <visit-config.h>
#include <avtCommonDataFunctions.h>
#include <avtDataset.h>
#include <avtDatasetExaminer.h>
......@@ -223,6 +225,9 @@ avtRayTracer::SetGradientBackgroundColors(const float bg1[3],
// Hank Childs, Thu Dec 2 09:26:28 PST 2004
// No longer tighten clipping planes ['5699].
//
// Hank Childs, Thu Dec 9 17:15:44 PST 2004
// Cast rays in tiles for big images ['1948].
//
// ****************************************************************************
void
......@@ -266,12 +271,6 @@ avtRayTracer::Execute(void)
avtDataObject_p samples = extractor.GetOutput();
#ifdef PARALLEL
//
// Create an image partition that will be passed around between parallel
// modules in an effort to minimize communication.
//
avtImagePartition imagePartition(screen[0], screen[1]);
//
// Tell the sample point extractor that we would like to send cells
// instead of sample points when appropriate.
......@@ -295,7 +294,6 @@ avtRayTracer::Execute(void)
// Communicate the samples to the other processors.
//
avtSamplePointCommunicator sampleCommunicator;
sampleCommunicator.SetImagePartition(&imagePartition);
sampleCommunicator.SetInput(extractor.GetOutput());
samples = sampleCommunicator.GetOutput();
......@@ -320,7 +318,6 @@ avtRayTracer::Execute(void)
// Communicate the screen to the root processor.
//
avtImageCommunicator imageCommunicator;
imageCommunicator.SetImagePartition(&imagePartition);
avtDataObject_p dob;
CopyTo(dob, image);
imageCommunicator.SetInput(dob);
......@@ -328,9 +325,65 @@ avtRayTracer::Execute(void)
#endif
//
// Force an update so everything will be current.
// Update the pipeline several times, once for each tile.
// The tiles are important to make sure that we never need too much
// memory.
//
image->Update(GetGeneralPipelineSpecification());
VISIT_LONG_LONG numSamps = screen[0]*screen[1]*samplesPerRay;
int sampLimitPerProc = 25000000; // 25M
numSamps /= PAR_Size();
int numTiles = numSamps/sampLimitPerProc;
int numDivisions = (int) sqrt(numTiles);
if (numDivisions < 1)
numDivisions = 1;
int IStep = screen[0] / numDivisions;
int JStep = screen[1] / numDivisions;
avtImage_p whole_image;
if (PAR_Rank() == 0)
{
whole_image = new avtImage(this);
whole_image->GetImage() = avtImageRepresentation::NewImage(screen[0],
screen[1]);
}
for (int i = 0 ; i < numDivisions ; i++)
for (int j = 0 ; j < numDivisions ; j++)
{
int IStart = i*IStep;
int IEnd = (i == (numDivisions-1) ? screen[0] : (i+1)*IStep);
int JStart = j*JStep;
int JEnd = (j == (numDivisions-1) ? screen[1] : (j+1)*JStep);
#ifdef PARALLEL
//
// Create an image partition that will be passed around between
// parallel modules in an effort to minimize communication.
//
avtImagePartition imagePartition(screen[0], screen[1]);
imagePartition.RestrictToTile(IStart, IEnd, JStart, JEnd);
sampleCommunicator.SetImagePartition(&imagePartition);
imageCommunicator.SetImagePartition(&imagePartition);
#endif
extractor.RestrictToTile(IStart, IEnd, JStart, JEnd);
image->Update(GetGeneralPipelineSpecification());
if (PAR_Rank() == 0)
{
unsigned char *whole_rgb =
whole_image->GetImage().GetRGBBuffer();
unsigned char *tile = image->GetImage().GetRGBBuffer();
for (int jj = JStart ; jj < JEnd ; jj++)
for (int ii = IStart ; ii < IEnd ; ii++)
{
int index = screen[0]*jj + ii;
int index2 = (IEnd-IStart)*(jj-JStart) + (ii-IStart);
whole_rgb[3*index+0] = tile[3*index2+0];
whole_rgb[3*index+1] = tile[3*index2+1];
whole_rgb[3*index+2] = tile[3*index2+2];
}
}
}
if (PAR_Rank() == 0)
image->Copy(*whole_image);
//
// Make our output image look the same as the ray compositer's.
......
......@@ -105,6 +105,9 @@ avtSamplePointCommunicator::SetImagePartition(avtImagePartition *ip)
// Hank Childs, Tue Dec 18 08:24:00 PST 2001
// Changed location of calls to free memory to reduce size of peak memory.
//
// Hank Childs, Sat Dec 11 11:27:16 PST 2004
// Add support multiple executions that come about because of tiling.
//
// ****************************************************************************
void
......@@ -215,8 +218,14 @@ avtSamplePointCommunicator::Execute(void)
outMaxHeight);
int nv = GetTypedInput()->GetNumberOfVariables();
nv = UnifyMaximumValue(nv);
GetTypedOutput()->SetNumberOfVariables(nv);
GetTypedOutput()->SetVolume(volumeWidth, volumeHeight, volumeDepth);
if (GetTypedOutput()->GetVolume() == NULL)
{
GetTypedOutput()->SetNumberOfVariables(nv);
GetTypedOutput()->SetVolume(volumeWidth, volumeHeight, volumeDepth);
}
else
GetTypedOutput()->GetVolume()->ResetSamples();
avtVolume *outvolume = GetTypedOutput()->GetVolume();
outvolume->Restrict(outMinWidth, outMaxWidth, outMinHeight, outMaxHeight);
......
......@@ -58,6 +58,9 @@
// Hank Childs, Fri Nov 19 13:57:02 PST 2004
// Initialized rectilinearGridsAreInWorldSpace.
//
// Hank Childs, Fri Dec 10 09:59:57 PST 2004
// Initialized shouldDoTiling.
//
// ****************************************************************************
avtSamplePointExtractor::avtSamplePointExtractor(int w, int h, int d)
......@@ -80,6 +83,8 @@ avtSamplePointExtractor::avtSamplePointExtractor(int w, int h, int d)
rectilinearGridsAreInWorldSpace = false;
aspect = 1.;
shouldDoTiling = false;
}
......@@ -148,6 +153,29 @@ avtSamplePointExtractor::SetRectilinearGridsAreInWorldSpace(bool val,
}
// ****************************************************************************
// Method: avtSamplePointExtractor::RestrictToTile
//
// Purpose:
// Tells the extractor whether or not it should only sample within a tile.
//
// Programmer: Hank Childs
// Creation: November 19, 2004
//
// ****************************************************************************
void
avtSamplePointExtractor::RestrictToTile(int wmin, int wmax, int hmin, int hmax)
{
shouldDoTiling = true;
width_min = wmin;
width_max = wmax;
height_min = hmin;
height_max = hmax;
modified = true;
}
// ****************************************************************************
// Method: avtSamplePointExtractor::Execute
//
......@@ -212,6 +240,9 @@ avtSamplePointExtractor::Execute(void)
// Hank Childs, Sun Dec 14 11:07:56 PST 2003
// Set up massVoxelExtractor.
//
// Hank Childs, Fri Dec 10 09:59:57 PST 2004
// Do the sampling in tiles if necessary.
//
// ****************************************************************************
void
......@@ -219,8 +250,18 @@ avtSamplePointExtractor::SetUpExtractors(void)
{
avtSamplePoints_p output = GetTypedOutput();
output->SetVolume(width, height, depth);
//
// This will always be NULL the first time through. For subsequent tiles
// (provided we are doing tiling) will not have this issue.
//
if (output->GetVolume() == NULL)
output->SetVolume(width, height, depth);
else
output->GetVolume()->ResetSamples();
output->ResetCellList();
avtVolume *volume = output->GetVolume();
if (shouldDoTiling)
volume->Restrict(width_min, width_max-1, height_min, height_max-1);
if (hexExtractor != NULL)
{
......@@ -258,6 +299,18 @@ avtSamplePointExtractor::SetUpExtractors(void)
tetExtractor->SendCellsMode(sendCells);
wedgeExtractor->SendCellsMode(sendCells);
pyramidExtractor->SendCellsMode(sendCells);
if (shouldDoTiling)
{
hexExtractor->Restrict(width_min, width_max-1, height_min, height_max-1);
massVoxelExtractor->Restrict(width_min, width_max-1,
height_min, height_max-1);
tetExtractor->Restrict(width_min, width_max-1, height_min, height_max-1);
wedgeExtractor->Restrict(width_min, width_max-1, height_min,
height_max-1);
pyramidExtractor->Restrict(width_min, width_max-1,
height_min, height_max-1);
}
}
......
......@@ -74,11 +74,17 @@ class AVTFILTERS_API avtSamplePointExtractor
void SendCellsMode(bool);
void SetRectilinearGridsAreInWorldSpace(bool,
const avtViewInfo &,double);
void RestrictToTile(int, int, int, int);
void StopTiling(void) { shouldDoTiling = false; };
protected:
int width, height, depth;
int currentNode, totalNodes;
bool shouldDoTiling;
int width_min, width_max;
int height_min, height_max;
avtHexahedronExtractor *hexExtractor;
avtMassVoxelExtractor *massVoxelExtractor;
avtPyramidExtractor *pyramidExtractor;
......
......@@ -151,6 +151,10 @@ avtWorldSpaceToImageSpaceTransform::~avtWorldSpaceToImageSpaceTransform()
// Hank Childs, Mon Jul 7 22:32:37 PDT 2003
// Add support for image pan and zoom.
//
// Hank Childs, Mon Dec 20 11:19:49 PST 2004
// No longer reflect across the X-axis. It was a mistake to do this in
// the first place.
//
// ****************************************************************************
void
......@@ -190,38 +194,22 @@ avtWorldSpaceToImageSpaceTransform::CalculateTransform(const avtViewInfo &view,
imageZoomAndPan->SetElement(0, 3, 2*view.imagePan[0]*view.imageZoom);
imageZoomAndPan->SetElement(1, 3, 2*view.imagePan[1]*view.imageZoom);
//
// World space is a left-handed coordinate system. Image space (as used
// in the sample point extractor) is a right-handed coordinate system.
// This is because large X is at the right and large Y is at the top.
// The z-buffer has the closest points at z=0, so Z is going away from the
// screen ===> left handed coordinate system. If we reflect across X,
// we will really have transformed it into image space.
//
vtkMatrix4x4 *reflectTrans = vtkMatrix4x4::New();
reflectTrans->Identity();
reflectTrans->SetElement(0, 0, -1.);
//
// Right multiplying the matrices in the order you want them to applied
// "makes sense" to me, so I am going to jump through hoops by Transposing
// them so I am sure everything will work.
//
vtkMatrix4x4 *tmp = vtkMatrix4x4::New();
vtkMatrix4x4 *tmp2 = vtkMatrix4x4::New();
viewtrans->Transpose();
imageZoomAndPan->Transpose();
vtkMatrix4x4::Multiply4x4(viewtrans, scaletrans, tmp);
vtkMatrix4x4::Multiply4x4(tmp, imageZoomAndPan, tmp2);
vtkMatrix4x4::Multiply4x4(tmp2, reflectTrans, trans);
vtkMatrix4x4::Multiply4x4(tmp, imageZoomAndPan, trans);
trans->Transpose();
viewtrans->Delete();
scaletrans->Delete();
imageZoomAndPan->Delete();
reflectTrans->Delete();
tmp->Delete();
tmp2->Delete();
}
......
......@@ -105,6 +105,9 @@ avtExtractor::~avtExtractor()
// Hank Childs, Tue Feb 26 11:29:26 PST 2002
// Pick up another case for numerical errors.
//
// Hank Childs, Tue Dec 21 11:30:28 PST 2004
// Change test for 'out of frustum' to accomodate tiling.
//
// ****************************************************************************
void
......@@ -138,7 +141,9 @@ avtExtractor::ExtractTriangle(int xi, const float const_y[3],
// We could be out of the region we are interested in finding sample
// points for, so lets make an explicit check.
//
if (y[0] > FRUSTUM_MAX_Y || y[2] < FRUSTUM_MIN_Y)
float smallest_y = YFromIndex(restrictedMinHeight);
float biggest_y = YFromIndex(restrictedMaxHeight);
if (y[0] > biggest_y || y[2] < smallest_y)
{
return;
}
......@@ -159,7 +164,7 @@ avtExtractor::ExtractTriangle(int xi, const float const_y[3],
//
y_top = SnapYBottom(y[2]);
y_bottom = SnapYTop(y[1]);
if (y_bottom <= y_top && y[2] != y[1])
if (y_bottom <= y_top && y[2] != y[1] && y[1] < biggest_y)
{
double z_slope_12 = (z[1] - z[2]) / fabs((y[2] - y[1]));
double z_slope_02 = (z[0] - z[2]) / fabs((y[2] - y[0]));
......@@ -212,7 +217,7 @@ avtExtractor::ExtractTriangle(int xi, const float const_y[3],
//
y_top = SnapYBottom(y[1]);
y_bottom = SnapYTop(y[0]);
if (y_bottom <= y_top && y[0] != y[1])
if (y_bottom <= y_top && y[0] != y[1] && y[1] > smallest_y)
{
double z_slope_01 = (z[1] - z[0]) / fabs((y[1] - y[0]));
double z_slope_02 = (z[2] - z[0]) / fabs((y[0] - y[2]));
......@@ -486,6 +491,11 @@ avtExtractor::SendCellsMode(bool mode)
// Programmer: Hank Childs
// Creation: January 27, 2001
//
// Modifications:
//
// Hank Childs, Tue Dec 21 11:30:28 PST 2004
// Change test for 'out of frustum' to accomodate tiling.
//
// ****************************************************************************
int
......@@ -530,8 +540,12 @@ avtExtractor::ConstructBounds(const float (*pts)[3], int npts)
// We can get snapped to the frustum if we are outside it, so explicitly
// check for this.
//
if (fmaxx < FRUSTUM_MIN_X || fminx > FRUSTUM_MAX_X ||
fmaxy < FRUSTUM_MIN_Y || fminy > FRUSTUM_MAX_Y ||
float smallest_x = XFromIndex(restrictedMinWidth);
float biggest_x = XFromIndex(restrictedMaxWidth);
float smallest_y = YFromIndex(restrictedMinHeight);
float biggest_y = YFromIndex(restrictedMaxHeight);
if (fmaxx < smallest_x || fminx > biggest_x ||
fmaxy < smallest_y || fminy > biggest_y ||
fmaxz < FRUSTUM_MIN_Z || fminz > FRUSTUM_MAX_Z)
{
return 0;
......@@ -549,6 +563,13 @@ avtExtractor::ConstructBounds(const float (*pts)[3], int npts)
minz = SnapZBack(fminz);
maxz = SnapZFront(fmaxz);
if (minx > maxx)
return 0;
if (miny > maxy)
return 0;
if (minz > maxz)
return 0;
//
// Return the number of samples in the bounding box.
//
......@@ -572,6 +593,11 @@ avtExtractor::ConstructBounds(const float (*pts)[3], int npts)
// Programmer: Hank Childs
// Creation: January 23, 2002
//
// Modifications:
//
// Hank Childs, Tue Dec 21 11:30:28 PST 2004
// Change test for 'out of frustum' to accomodate tiling.
//
// ****************************************************************************
void
......@@ -590,11 +616,14 @@ avtExtractor::ContributeSmallCell(const float (*pts)[3],
// rare cases when we are resampling onto a very small rectilinear grid
// (often for the preview method -- hardware accelerated).
//
for (int i = 0 ; i < npts ; i++)
{
if (pts[i][0] < FRUSTUM_MIN_X || pts[i][0] > FRUSTUM_MAX_X ||
pts[i][1] < FRUSTUM_MIN_Y || pts[i][1] > FRUSTUM_MAX_Y ||
float smallest_x = XFromIndex(restrictedMinWidth);
float biggest_x = XFromIndex(restrictedMaxWidth);
float smallest_y = YFromIndex(restrictedMinHeight);
float biggest_y = YFromIndex(restrictedMaxHeight);
if (pts[i][0] < smallest_x || pts[i][0] > biggest_x ||
pts[i][1] < smallest_y || pts[i][1] > biggest_y ||
pts[i][2] < FRUSTUM_MIN_Z || pts[i][2] > FRUSTUM_MAX_Z)
{
continue;
......
......@@ -357,6 +357,10 @@ avtHexahedronExtractor::~avtHexahedronExtractor()
// Hank Childs, Wed Jan 23 11:05:37 PST 2002
// Turned on contribution of small cells.
//
// Hank Childs, Tue Dec 21 15:53:29 PST 2004
// Added an optimization for tiling where we only iterate over x-slices
// within the tile.
//
// ****************************************************************************
void
......@@ -379,7 +383,9 @@ avtHexahedronExtractor::Extract(const avtHexahedron &hex)
//
// minx and maxx are calculated in ConstructBounds.
//
for (int xi = minx ; xi <= maxx ; xi++)
int minx_iter = (minx < restrictedMinWidth ? restrictedMinWidth : minx);
int maxx_iter = (maxx > restrictedMaxWidth ? restrictedMaxWidth : maxx);
for (int xi = minx_iter ; xi <= maxx_iter ; xi++)
{
float x = XFromIndex(xi);
......
......@@ -49,6 +49,9 @@ void QuicksortTuple3(Tuple3 *, int);
// Hank Childs, Tue Jul 1 21:13:38 PDT 2003
// Assume we are running in serial if it is not specified.
//
// Hank Childs, Fri Dec 10 10:49:43 PST 2004
// Initialize shouldDoTiling.
//
// ****************************************************************************
avtImagePartition::avtImagePartition(int w, int h, int np, int tp)
......@@ -100,6 +103,7 @@ avtImagePartition::avtImagePartition(int w, int h, int np, int tp)
}
establishedPartitionBoundaries = false;
shouldDoTiling = false;
}
......@@ -144,6 +148,28 @@ avtImagePartition::~avtImagePartition()
}
// ****************************************************************************
// Method: avtImagePartition::RestrictToTile
//
// Purpose:
// Restricts the set of pixels that are being partitioned.
//
// Programmer: Hank Childs
// Creation: December 10, 2004
//
// ****************************************************************************
void
avtImagePartition::RestrictToTile(int wmin, int wmax, int hmin, int hmax)
{
shouldDoTiling = true;
tile_width_min = wmin;
tile_width_max = wmax;
tile_height_min = hmin;
tile_height_max = hmax;
}
// ****************************************************************************
// Method: avtImagePartition::GetThisPartition
//
......@@ -192,6 +218,9 @@ avtImagePartition::GetThisPartition(int &minW, int &maxW, int &minH, int &maxH)
// Hank Childs, Tue Jan 1 11:39:20 PST 2002
// Reflect that partitions are no longer necessarily even distributed.
//
// Hank Childs, Fri Dec 10 10:49:43 PST 2004
// Account for tiling.
//
// ****************************************************************************
void
......@@ -200,6 +229,11 @@ avtImagePartition::GetPartition(int part, int &minW, int &maxW, int &minH,
{
minW = 0;
maxW = width-1;
if (shouldDoTiling)
{
minW = tile_width_min;
maxW = tile_width_max-1;
}
minH = partitionStartsOnScanline[part];
maxH = partitionStopsOnScanline[part];
......@@ -230,6 +264,9 @@ avtImagePartition::GetPartition(int part, int &minW, int &maxW, int &minH,
// Account for problems with overflows when counting total number of
// samples.
//
// Hank Childs, Fri Dec 10 11:07:07 PST 2004
// Account for tiles.
//
// ****************************************************************************
void
......@@ -237,6 +274,9 @@ avtImagePartition::EstablishPartitionBoundaries(int *samples)
{
int i;
int first_scanline = (shouldDoTiling ? tile_height_min : 0);
int last_scanline = (shouldDoTiling ? tile_height_max : height);
//
// Find out how many samples there are in each scanline across all procs.
//
......@@ -247,7 +287,7 @@ avtImagePartition::EstablishPartitionBoundaries(int *samples)
// Find out how many total samples there are and what the target is.
//
int totalSamples = 0;
for (i = 0 ; i < height ; i++)
for (i = first_scanline ; i < last_scanline ; i++)
{
//
// There has been some problems with overflows when we have lots of
......@@ -274,8 +314,8 @@ avtImagePartition::EstablishPartitionBoundaries(int *samples)
int currentPartition = 0;