Commit 8b32854b authored by Sean McBride's avatar Sean McBride

const improvements to APIs and internal usage

- Made a few APIs' params const
- Changed many usages of the evil GetBounds() to expect a const
  return value, even though it does not (yet?) return const
- Slightly changed return values of vtkTextActor3D::GetBounds()
  to return its own ivar instead of its ImageActor's
parent 644efb1f
......@@ -1056,7 +1056,7 @@ public:
/**
* Are the bounds initialized?
*/
static vtkTypeBool AreBoundsInitialized(double bounds[6]){
static vtkTypeBool AreBoundsInitialized(const double bounds[6]){
if ( bounds[1]-bounds[0]<0.0 )
{
return 0;
......
......@@ -217,7 +217,7 @@ void vtkPoints::PrintSelf(ostream& os, vtkIndent indent)
}
os << indent << "Number Of Points: " << this->GetNumberOfPoints() << "\n";
double *bounds = this->GetBounds();
const double *bounds = this->GetBounds();
os << indent << "Bounds: \n";
os << indent << " Xmin,Xmax: (" << bounds[0] << ", " << bounds[1] << ")\n";
os << indent << " Ymin,Ymax: (" << bounds[2] << ", " << bounds[3] << ")\n";
......
......@@ -228,7 +228,7 @@ void vtkPoints2D::PrintSelf(ostream& os, vtkIndent indent)
}
os << indent << "Number Of Points: " << this->GetNumberOfPoints() << "\n";
double *bounds = this->GetBounds();
const double *bounds = this->GetBounds();
os << indent << "Bounds: \n";
os << indent << " Xmin,Xmax: (" << bounds[0] << ", " << bounds[1] << ")\n";
os << indent << " Ymin,Ymax: (" << bounds[2] << ", " << bounds[3] << ")\n";
......
......@@ -206,7 +206,7 @@ void vtkCell::PrintSelf(ostream& os, vtkIndent indent)
if ( numIds > 0 )
{
double *bounds=this->GetBounds();
const double *bounds=this->GetBounds();
os << indent << "Bounds: \n";
os << indent << " Xmin,Xmax: (" << bounds[0] << ", " << bounds[1] << ")\n";
......
......@@ -1195,7 +1195,7 @@ void vtkCellLocator::ForceBuildLocator()
//
void vtkCellLocator::BuildLocatorInternal()
{
double *bounds, length, cellBounds[6], *boundsPtr;
double length, cellBounds[6], *boundsPtr;
vtkIdType numCells;
int ndivs, product;
int i, j, k, ijkMin[3], ijkMax[3];
......@@ -1227,7 +1227,7 @@ void vtkCellLocator::BuildLocatorInternal()
// Size the root cell. Initialize cell data structure, compute
// level and divisions.
//
bounds = this->DataSet->GetBounds();
const double *bounds = this->DataSet->GetBounds();
length = this->DataSet->GetLength();
for (i=0; i<3; i++)
{
......
......@@ -372,7 +372,8 @@ double *vtkConvexPointSet::GetParametricCoords()
this->ParametricCoords->SetNumberOfComponents(3);
this->ParametricCoords->SetNumberOfTuples(numPts);
double p[3], x[3], *bounds = this->GetBounds();
double p[3], x[3];
const double *bounds = this->GetBounds();
int i, j;
for (i=0; i < numPts; i++)
{
......
......@@ -716,8 +716,6 @@ void vtkDataSet::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
double *bounds;
os << indent << "Number Of Points: " << this->GetNumberOfPoints() << "\n";
os << indent << "Number Of Cells: " << this->GetNumberOfCells() << "\n";
......@@ -727,7 +725,7 @@ void vtkDataSet::PrintSelf(ostream& os, vtkIndent indent)
os << indent << "Point Data:\n";
this->PointData->PrintSelf(os,indent.GetNextIndent());
bounds = this->GetBounds();
const double *bounds = this->GetBounds();
os << indent << "Bounds: \n";
os << indent << " Xmin,Xmax: (" <<bounds[0] << ", " << bounds[1] << ")\n";
os << indent << " Ymin,Ymax: (" <<bounds[2] << ", " << bounds[3] << ")\n";
......
......@@ -181,13 +181,11 @@ vtkPoints *vtkGraph::GetPoints()
//----------------------------------------------------------------------------
void vtkGraph::ComputeBounds()
{
double *bounds;
if ( this->Points )
{
if ( this->GetMTime() >= this->ComputeTime )
{
bounds = this->Points->GetBounds();
const double *bounds = this->Points->GetBounds();
for (int i=0; i<6; i++)
{
this->Bounds[i] = bounds[i];
......
......@@ -851,7 +851,6 @@ void vtkPointLocator::FindPointsWithinRadius(double R, const double x[3],
//
void vtkPointLocator::BuildLocator()
{
double *bounds;
vtkIdType numBuckets;
double level;
int ndivs[3];
......@@ -887,7 +886,7 @@ void vtkPointLocator::BuildLocator()
// Size the root bucket. Initialize bucket data structure, compute
// level and divisions.
//
bounds = this->DataSet->GetBounds();
const double *bounds = this->DataSet->GetBounds();
for (i=0; i<3; i++)
{
this->Bounds[2*i] = bounds[2*i];
......
......@@ -90,13 +90,11 @@ void vtkPointSet::Initialize()
//----------------------------------------------------------------------------
void vtkPointSet::ComputeBounds()
{
double *bounds;
if ( this->Points )
{
if ( this->GetMTime() >= this->ComputeTime )
{
bounds = this->Points->GetBounds();
const double *bounds = this->Points->GetBounds();
for (int i=0; i<6; i++)
{
this->Bounds[i] = bounds[i];
......
......@@ -840,19 +840,16 @@ int vtkPolygon::PointInPolygon (double x[3], int numPts, double *pts,
//
int vtkPolygon::Triangulate(vtkIdList *outTris)
{
int success;
double *bounds, d;
bounds = this->GetBounds();
const double *bounds = this->GetBounds();
d = sqrt((bounds[1]-bounds[0])*(bounds[1]-bounds[0]) +
(bounds[3]-bounds[2])*(bounds[3]-bounds[2]) +
(bounds[5]-bounds[4])*(bounds[5]-bounds[4]));
double d = sqrt((bounds[1]-bounds[0])*(bounds[1]-bounds[0]) +
(bounds[3]-bounds[2])*(bounds[3]-bounds[2]) +
(bounds[5]-bounds[4])*(bounds[5]-bounds[4]));
this->Tolerance = VTK_POLYGON_TOLERANCE * d;
this->SuccessfulTriangulation = 1;
this->Tris->Reset();
success = this->EarCutTriangulation();
int success = this->EarCutTriangulation();
if ( !success ) //degenerate triangle encountered
{
......@@ -1439,16 +1436,15 @@ void vtkPolygon::Contour(double value, vtkDataArray *cellScalars,
vtkCellData *outCd)
{
int i, success;
double *bounds, d;
int p1, p2, p3;
this->TriScalars->SetNumberOfTuples(3);
bounds = this->GetBounds();
const double *bounds = this->GetBounds();
d = sqrt((bounds[1]-bounds[0])*(bounds[1]-bounds[0]) +
(bounds[3]-bounds[2])*(bounds[3]-bounds[2]) +
(bounds[5]-bounds[4])*(bounds[5]-bounds[4]));
double d = sqrt((bounds[1]-bounds[0])*(bounds[1]-bounds[0]) +
(bounds[3]-bounds[2])*(bounds[3]-bounds[2]) +
(bounds[5]-bounds[4])*(bounds[5]-bounds[4]));
this->Tolerance = VTK_POLYGON_TOLERANCE * d;
this->SuccessfulTriangulation = 1;
this->ComputeNormal(this->Points, this->Normal);
......@@ -1694,15 +1690,14 @@ void vtkPolygon::Clip(double value, vtkDataArray *cellScalars,
int insideOut)
{
int i, success;
double *bounds, d;
int p1, p2, p3;
this->TriScalars->SetNumberOfTuples(3);
bounds = this->GetBounds();
d = sqrt((bounds[1]-bounds[0])*(bounds[1]-bounds[0]) +
(bounds[3]-bounds[2])*(bounds[3]-bounds[2]) +
(bounds[5]-bounds[4])*(bounds[5]-bounds[4]));
const double *bounds = this->GetBounds();
double d = sqrt((bounds[1]-bounds[0])*(bounds[1]-bounds[0]) +
(bounds[3]-bounds[2])*(bounds[3]-bounds[2]) +
(bounds[5]-bounds[4])*(bounds[5]-bounds[4]));
this->Tolerance = VTK_POLYGON_TOLERANCE * d;
this->SuccessfulTriangulation = 1;
......
......@@ -1372,7 +1372,6 @@ void vtkStaticPointLocator::FreeSearchStructure()
//
void vtkStaticPointLocator::BuildLocator()
{
double *bounds;
vtkIdType numBuckets;
double level;
int ndivs[3];
......@@ -1405,7 +1404,7 @@ void vtkStaticPointLocator::BuildLocator()
// level and divisions. The GetBounds() method below can be very slow;
// hopefully it is cached or otherwise accelerated.
//
bounds = this->DataSet->GetBounds();
const double *bounds = this->DataSet->GetBounds();
int numNonZeroWidths = 3;
for (i=0; i<3; i++)
{
......
......@@ -74,7 +74,7 @@ int TestPDBBallAndStickShadows(int argc, char *argv[])
// add a plane
vtkNew<vtkPlaneSource> plane;
double *bounds = molmapper->GetBounds();
const double *bounds = molmapper->GetBounds();
plane->SetOrigin(bounds[0], bounds[2], bounds[4]);
plane->SetPoint1(bounds[1], bounds[2], bounds[4]);
plane->SetPoint2(bounds[0], bounds[2], bounds[5]);
......
......@@ -113,7 +113,7 @@ int TestPDBBallAndStickShadowsDOFSSAA(int argc, char *argv[])
// add a plane
vtkNew<vtkPlaneSource> plane;
double *bounds = molmapper->GetBounds();
const double *bounds = molmapper->GetBounds();
plane->SetOrigin(bounds[0], bounds[2], bounds[4]);
plane->SetPoint1(bounds[1], bounds[2], bounds[4]);
plane->SetPoint2(bounds[0], bounds[2], bounds[5]);
......
......@@ -119,7 +119,7 @@ void gridLayoutActors( std::vector<vtkActor*> actors )
{
// move to the origin
(*it)->SetPosition( 0.0, 0.0, 0.0 );
double *b = (*it)->GetBounds();
const double *b = (*it)->GetBounds();
// X
if( b[0]<bounds[0] ) bounds[0] = b[0];
if( b[1]>bounds[1] ) bounds[1] = b[1];
......
......@@ -876,7 +876,7 @@ void vtkDataObjectGenerator::MakeValues(vtkDataSet *ds)
for (vtkIdType i = 0; i < num; i++)
{
ids->SetValue(i, this->CellIdCounter++);
double *bds = ds->GetCell(i)->GetBounds();
const double *bds = ds->GetCell(i)->GetBounds();
xcoords->SetValue(i, (bds[0]+bds[1])*0.5);
ycoords->SetValue(i, (bds[2]+bds[3])*0.5);
zcoords->SetValue(i, (bds[4]+bds[5])*0.5);
......
......@@ -141,7 +141,7 @@ int vtkDecimatePro::RequestData(
vtkIdType pt1, pt2, cellId, fedges[2];
vtkIdType *cells;
vtkIdList *CollapseTris;
double max, *bounds;
double max;
if (!input)
{
vtkErrorMacro(<<"No input!");
......@@ -166,7 +166,7 @@ int vtkDecimatePro::RequestData(
}
// Initialize
bounds = input->GetBounds();
const double *bounds = input->GetBounds();
for (max=0.0, i=0; i<3; i++)
{
max = ((bounds[2*i+1]-bounds[2*i]) > max ?
......
......@@ -321,7 +321,6 @@ int vtkDelaunay2D::RequestData(
double center[3], radius, tol, x[3];
double n1[3], n2[3];
int *triUse = NULL;
double *bounds;
vtkDebugMacro(<<"Generating 2D Delaunay triangulation");
......@@ -404,7 +403,7 @@ int vtkDelaunay2D::RequestData(
tPoints = NULL;
}
bounds = points->GetBounds();
const double *bounds = points->GetBounds();
center[0] = (bounds[0]+bounds[1])/2.0;
center[1] = (bounds[2]+bounds[3])/2.0;
center[2] = (bounds[4]+bounds[5])/2.0;
......
......@@ -484,7 +484,7 @@ int vtkHull::RequestData(
vtkIdType numPoints;
vtkPoints *outPoints;
vtkCellArray *outPolys;
double *bounds = input->GetBounds();
const double *bounds = input->GetBounds();
// Get the number of points in the input data
numPoints = input->GetNumberOfPoints();
......@@ -572,7 +572,7 @@ void vtkHull::ComputePlaneDistances(vtkPolyData *input)
// other planes to clip this polygon.
void vtkHull::ClipPolygonsFromPlanes( vtkPoints *outPoints,
vtkCellArray *outPolys,
double *bounds)
const double *bounds)
{
int i, j, k, q;
double previousD, d, crosspoint;
......@@ -686,7 +686,7 @@ void vtkHull::ClipPolygonsFromPlanes( vtkPoints *outPoints,
delete [] pnts;
}
void vtkHull::CreateInitialPolygon( double *verts, int i, double *bounds)
void vtkHull::CreateInitialPolygon( double *verts, int i, const double *bounds)
{
double center[3], d, planeCenter[3];
double v1[3], v2[3], norm, dotProduct;
......
......@@ -184,12 +184,12 @@ protected:
// Internal method used to create the actual polygons from the set
// of planes
void ClipPolygonsFromPlanes( vtkPoints *points, vtkCellArray *polys,
double *bounds );
const double *bounds );
// Internal method used to create the initial "big" polygon from the
// plane equation. This polygon is clipped by all other planes to form
// the final polygon (or it may be clipped entirely)
void CreateInitialPolygon( double *, int, double * );
void CreateInitialPolygon( double *, int, const double * );
// The method that does it all...
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) VTK_OVERRIDE;
......
......@@ -1959,7 +1959,7 @@ void vtkTableBasedClipDataSet::ClipImageData( vtkDataSet * inputGrd,
vtkImageData * volImage = vtkImageData::SafeDownCast( inputGrd );
volImage->GetDimensions( dataDims );
volImage->GetSpacing( spacings );
double * dataBBox = volImage->GetBounds();
const double * dataBBox = volImage->GetBounds();
vtkDoubleArray * pxCoords = vtkDoubleArray::New();
vtkDoubleArray * pyCoords = vtkDoubleArray::New();
......
......@@ -160,14 +160,13 @@ int TestEmpty(ostream &strm)
strm<<"NewPointIterator() end"<<endl;
double bounds[6];
double *b;
double center[3];
double *c;
const double epsilon=0.000001; // 10^{-6}
strm<<"GetBounds() start"<<endl;
b=ds->GetBounds();
const double *b=ds->GetBounds();
MacroTest(strm,indent,"volatile bounds exist",b!=0);
MacroTest(strm,indent,"default volatile bounds",!vtkMath::AreBoundsInitialized(b));
......@@ -359,14 +358,13 @@ int TestWithPoints(ostream &strm)
strm<<"NewPointIterator() end"<<endl;
double bounds[6];
double *b;
double center[3];
double *c;
const double epsilon=0.000001; // 10^{-6}
strm<<"GetBounds() start"<<endl;
b=ds->GetBounds();
const double *b=ds->GetBounds();
MacroTest(strm,indent,"volatile bounds exist",b!=0);
//strm<<"bounds=("<<b[0]<<','<<b[1]<<','<<b[2]<<','<<b[3]<<','<<b[4]<<','<<b[5]<<')'<<endl;
......@@ -807,14 +805,13 @@ int TestWithPointsAndCells(ostream &strm)
double bounds[6];
double *b;
double center[3];
double *c;
const double epsilon=0.000001; // 10^{-6}
strm<<"GetBounds() start"<<endl;
b=ds->GetBounds();
const double *b=ds->GetBounds();
MacroTest(strm,indent,"volatile bounds exist",b!=0);
strm<<"bounds=("<<b[0]<<','<<b[1]<<','<<b[2]<<','<<b[3]<<','<<b[4]<<','<<b[5]<<')'<<endl;
......@@ -1185,14 +1182,13 @@ int TestWithPointsAndCellsAndPointData(ostream &strm)
strm<<"NewPointIterator() end"<<endl;
double bounds[6];
double *b;
double center[3];
double *c=0;
const double epsilon=0.000001; // 10^{-6}
strm<<"GetBounds() start"<<endl;
b=ds->GetBounds();
const double *b=ds->GetBounds();
MacroTest(strm,indent,"volatile bounds exist",b!=0);
strm<<"bounds=("<<b[0]<<','<<b[1]<<','<<b[2]<<','<<b[3]<<','<<b[4]<<','<<b[5]<<')'<<endl;
......
......@@ -367,7 +367,7 @@ static VTK_THREAD_RETURN_TYPE vtkImplicitModeller_ThreadedAppend( void *arg )
vtkImageData *output;
double maxDistance;
int i;
double *bounds, adjBounds[6];
double adjBounds[6];
double *spacing;
double *origin;
int slabSize, slabMin, slabMax;
......@@ -414,7 +414,7 @@ static VTK_THREAD_RETURN_TYPE vtkImplicitModeller_ThreadedAppend( void *arg )
}
bounds = userData->Input[threadId]->GetBounds();
const double *bounds = userData->Input[threadId]->GetBounds();
for (i=0; i<3; i++)
{
adjBounds[2*i] = bounds[2*i] - maxDistance;
......@@ -495,7 +495,7 @@ void vtkImplicitModellerAppendExecute(vtkImplicitModeller *self,
{
int i, j, k, updateTime;
vtkIdType cellNum;
double *bounds, adjBounds[6];
double adjBounds[6];
double pcoords[3];
int outExt[6];
double x[3], prevDistance2, distance, distance2;
......@@ -539,7 +539,7 @@ void vtkImplicitModellerAppendExecute(vtkImplicitModeller *self,
for (cellNum=0; cellNum < input->GetNumberOfCells(); cellNum++)
{
cell = input->GetCell(cellNum);
bounds = cell->GetBounds();
const double *bounds = cell->GetBounds();
for (i=0; i<3; i++)
{
adjBounds[2*i] = bounds[2*i] - maxDistance;
......@@ -912,7 +912,8 @@ int vtkImplicitModeller::RequestData(
// Compute ModelBounds from input geometry.
double vtkImplicitModeller::ComputeModelBounds(vtkDataSet *input)
{
double *bounds, maxDist;
const double * bounds;
double maxDist;
int i;
vtkImageData *output=this->GetOutput();
double tempd[3];
......
......@@ -82,7 +82,6 @@ int vtkCutMaterial::RequestData(
vtkThreshold *thresh;
vtkCutter *cutter;
double *bds;
// Check to see if we have the required field arrays.
if (this->MaterialArrayName == NULL || this->ArrayName == NULL)
......@@ -110,7 +109,7 @@ int vtkCutMaterial::RequestData(
thresh->ThresholdBetween(this->Material-0.5, this->Material+0.5);
thresh->Update();
bds = thresh->GetOutput()->GetBounds();
const double *bds = thresh->GetOutput()->GetBounds();
this->CenterPoint[0] = 0.5 * (bds[0] + bds[1]);
this->CenterPoint[1] = 0.5 * (bds[2] + bds[3]);
this->CenterPoint[2] = 0.5 * (bds[4] + bds[5]);
......@@ -172,7 +171,6 @@ void vtkCutMaterial::ComputeMaximumPoint(vtkDataSet *input)
vtkIdType idx, bestIdx, num;
double comp, best;
vtkCell *cell;
double *bds;
// Find the maximum value.
data = input->GetCellData()->GetArray(this->ArrayName);
......@@ -203,7 +201,7 @@ void vtkCutMaterial::ComputeMaximumPoint(vtkDataSet *input)
// Get the cell with the larges value.
cell = input->GetCell(bestIdx);
bds = cell->GetBounds();
const double *bds = cell->GetBounds();
this->MaximumPoint[0] = (bds[0] + bds[1]) * 0.5;
this->MaximumPoint[1] = (bds[2] + bds[3]) * 0.5;
this->MaximumPoint[2] = (bds[4] + bds[5]) * 0.5;
......
......@@ -614,7 +614,7 @@ void FindNeighbors(diy::mpi::communicator comm,
vtkDataSet *ds = inputBlocks[b];
if (ds)
{
double *ibounds = ds->GetBounds();
const double *ibounds = ds->GetBounds();
if ((intersects = vtkBoundingBox(sbounds).Intersects(ibounds)) == true)
{
break;
......
......@@ -407,7 +407,7 @@ void vtkPointDensityFilter::
ComputeModelBounds(vtkDataSet *input, vtkImageData *output,
vtkInformation *outInfo)
{
double *bounds;
const double *bounds;
int i, adjustBounds=0;
// compute model bounds if not set previously
......
......@@ -66,7 +66,6 @@ int vtkTextureMapToPlane::RequestData(
vtkFloatArray *newTCoords;
vtkIdType i;
int j;
double *bounds;
double proj, minProj, axis[3], sAxis[3], tAxis[3];
int dir = 0;
double s, t, sSf, tSf, p[3];
......@@ -138,7 +137,7 @@ int vtkTextureMapToPlane::RequestData(
// between s_range and t_range. Simplest to do by projecting maximum
// corner of bounding box unto plane and backing out scale factors.
//
bounds = output->GetBounds();
const double *bounds = output->GetBounds();
for (i=0; i<3; i++)
{
axis[i] = bounds[2*i+1] - bounds[2*i];
......@@ -239,7 +238,6 @@ void vtkTextureMapToPlane::ComputeNormal(vtkDataSet *output)
vtkIdType ptId;
int dir = 0, i;
double length, w, *c1, *c2, *c3, det;
double *bounds;
// First thing to do is to get an initial normal and point to define
// the plane. Then, use this information to construct better
......@@ -247,7 +245,7 @@ void vtkTextureMapToPlane::ComputeNormal(vtkDataSet *output)
// fallback value.
//
// Get minimum width of bounding box.
bounds = output->GetBounds();
const double *bounds = output->GetBounds();
length = output->GetLength();
for (w=length, i=0; i<3; i++)
......
......@@ -270,7 +270,7 @@ bool vtkGeoProjectionSource::FetchRoot(vtkGeoTreeNode* r)
transformFilter->SetInputConnection(grat->GetOutputPort());
transformFilter->Update();
double* realBounds = transformFilter->GetOutput()->GetBounds();
const double *realBounds = transformFilter->GetOutput()->GetBounds();
// Extend the bounds just a tad to be safe
double bounds[4];
......
......@@ -672,7 +672,7 @@ void vtkOpenGLGL2PSExporter::DrawTextActor3D(vtkTextActor3D *textAct,
// Get actor info
vtkMatrix4x4 *actorMatrix = textAct->GetMatrix();
double *actorBounds = textAct->GetBounds();
const double *actorBounds = textAct->GetBounds();
double textPos[3] = {(actorBounds[1] + actorBounds[0]) * 0.5,
(actorBounds[3] + actorBounds[2]) * 0.5,
(actorBounds[5] + actorBounds[4]) * 0.5};
......@@ -837,7 +837,7 @@ void vtkOpenGLGL2PSExporter::DrawTexturedActor2D(vtkTexturedActor2D *act,
vtkPolyData* poly = vtkPolyData::SafeDownCast(mapper->GetInputDataObject(0, 0));
if (poly)
{
double *bounds = poly->GetBounds();
const double *bounds = poly->GetBounds();
rect[0] += static_cast<int>(bounds[0] + 0.5);
rect[1] += static_cast<int>(bounds[2] + 0.5);
rect[2] = static_cast<int>(bounds[1] - bounds[0] + 0.5);
......
......@@ -111,8 +111,8 @@ bool DoDataObjectsDiffer(vtkDataObject *dobj1, vtkDataObject *dobj2)
cerr << "Number of Cells/Points test failed" << endl;
return true;
}
double *bds1 = ds1->GetBounds();
double *bds2 = ds2->GetBounds();
const double *bds1 = ds1->GetBounds();
const double *bds2 = ds2->GetBounds();
if ((bds1[0]!=bds2[0]) ||
(bds1[1]!=bds2[1]) ||
(bds1[2]!=bds2[2]) ||
......
......@@ -82,7 +82,7 @@ int ImageAutoRange(int argc, char *argv[])
vtkSmartPointer<vtkImageSliceMapper>::New();
imageMapper->SetInputConnection(reader->GetOutputPort());
double *bounds = imageMapper->GetBounds();
const double *bounds = imageMapper->GetBounds();
double point[3];
point[0] = 0.5*(bounds[0] + bounds[1]);
point[1] = 0.5*(bounds[2] + bounds[3]);
......
......@@ -176,7 +176,7 @@ int ImageBSplineCoefficients(int argc, char *argv[])
imageMapper->SetInputConnection(coeffs->GetOutputPort());
}
double *bounds = imageMapper->GetBounds();
const double *bounds = imageMapper->GetBounds();
double point[3];
point[0] = 0.5*(bounds[0] + bounds[1]);
point[1] = 0.5*(bounds[2] + bounds[3]);
......
......@@ -81,7 +81,7 @@ int ImageHistogram(int argc, char *argv[])
imageMapper->BorderOn();
}
double *bounds = imageMapper->GetBounds();
const double *bounds = imageMapper->GetBounds();
double point[3];
point[0] = 0.5*(bounds[0] + bounds[1]);
point[1] = 0.5*(bounds[2] + bounds[3]);
......
......@@ -102,7 +102,7 @@ int ImageResize(int argc, char *argv[])
renWin->AddRenderer(renderer);
// use center point to set camera
double *bounds = imageMapper->GetBounds();
const double *bounds = imageMapper->GetBounds();
double point[3];
point[0] = 0.5*(bounds[0] + bounds[1]);
point[1] = 0.5*(bounds[2] + bounds[3]);
......
......@@ -106,7 +106,7 @@ int ImageResize3D(int argc, char *argv[])
renWin->AddRenderer(renderer);
// use center point to set camera
double *bounds = imageMapper->GetBounds();
const double *bounds = imageMapper->GetBounds();
double point[3];
point[0] = 0.5*(bounds[0] + bounds[1]);
point[1] = 0.5*(bounds[2] + bounds[3]);
......
......@@ -104,7 +104,7 @@ int ImageReslice(int argc, char *argv[])
renWin->AddRenderer(renderer.Get());
// use center point to set camera
double *bounds = imageMapper->GetBounds();
const double *bounds = imageMapper->GetBounds();
double point[3];
point[0] = 0.5*(bounds[0] + bounds[1]);
point[1] = 0.5*(bounds[2] + bounds[3]);
......
......@@ -407,7 +407,7 @@ const char *vtkImageBSplineCoefficients::GetOutputScalarTypeAsString()
//----------------------------------------------------------------------------
int vtkImageBSplineCoefficients::CheckBounds(const double point[3])
{
double *bounds = this->GetOutput()->GetBounds();
const double *bounds = this->GetOutput()->GetBounds();
for (int i = 0; i < 3; i++)
{
double a = bounds[0];
......
......@@ -762,7 +762,7 @@ void vtkCheckerboardSplatter::ComputeModelBounds(vtkDataSet *input,
vtkImageData *output,
vtkInformation *outInfo)
{
double *bounds;
const double *bounds;
int i, adjustBounds=0;