From f91373ee930e93ff55acd82f266fbefbb61bbc17 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Mon, 23 Sep 2013 21:12:20 -0400 Subject: [PATCH] Added 'const' to several public setters Made some pointer/array parameters const. Change-Id: I5f00b580e7478623d72c13cdca605aaa2bec7b56 --- Accelerators/Piston/vtkPistonDataObject.cxx | 4 ++-- Accelerators/Piston/vtkPistonDataObject.h | 4 ++-- Common/DataModel/vtkAMRInformation.cxx | 2 +- Common/DataModel/vtkBox.cxx | 4 ++-- Common/DataModel/vtkBox.h | 4 ++-- Common/DataModel/vtkKdNode.cxx | 8 ++++---- Common/DataModel/vtkKdNode.h | 10 +++++----- Common/DataModel/vtkOctreePointLocatorNode.h | 2 +- Filters/General/vtkCursor2D.cxx | 2 +- Filters/General/vtkCursor2D.h | 2 +- Filters/General/vtkCursor3D.cxx | 2 +- Filters/General/vtkCursor3D.h | 2 +- Filters/Sources/vtkCubeSource.cxx | 2 +- Filters/Sources/vtkCubeSource.h | 2 +- Imaging/Hybrid/vtkSampleFunction.cxx | 2 +- Imaging/Hybrid/vtkSampleFunction.h | 2 +- Imaging/Hybrid/vtkVoxelModeller.cxx | 2 +- Imaging/Hybrid/vtkVoxelModeller.h | 2 +- Interaction/Widgets/vtkAffineRepresentation2D.h | 2 +- Rendering/Annotation/vtkAxisActor.cxx | 2 +- Rendering/Annotation/vtkAxisActor.h | 2 +- Rendering/Core/vtkLight.h | 2 +- Rendering/Core/vtkProp3D.h | 2 +- 23 files changed, 34 insertions(+), 34 deletions(-) diff --git a/Accelerators/Piston/vtkPistonDataObject.cxx b/Accelerators/Piston/vtkPistonDataObject.cxx index 449594786c3..b3820487e53 100644 --- a/Accelerators/Piston/vtkPistonDataObject.cxx +++ b/Accelerators/Piston/vtkPistonDataObject.cxx @@ -161,7 +161,7 @@ void vtkPistonDataObject::GetBounds(double bounds[6]) } //---------------------------------------------------------------------------- -void vtkPistonDataObject::SetBounds(double bounds[6]) +void vtkPistonDataObject::SetBounds(const double bounds[6]) { bool modified = false; for (int i=0; i<6; i++) @@ -194,7 +194,7 @@ void vtkPistonDataObject::GetOrigin(double origin[3]) } //---------------------------------------------------------------------------- -void vtkPistonDataObject::SetOrigin(double origin[3]) +void vtkPistonDataObject::SetOrigin(const double origin[3]) { bool modified = false; for (int i=0; i<3; i++) diff --git a/Accelerators/Piston/vtkPistonDataObject.h b/Accelerators/Piston/vtkPistonDataObject.h index 325c41d0039..c3ee5a90fe0 100644 --- a/Accelerators/Piston/vtkPistonDataObject.h +++ b/Accelerators/Piston/vtkPistonDataObject.h @@ -74,12 +74,12 @@ public: // (xmin,xmax, ymin,ymax, zmin,zmax). double *GetBounds(); void GetBounds(double bounds[6]); - void SetBounds(double bounds[6]); + void SetBounds(const double bounds[6]); // Description: double *GetOrigin(); void GetOrigin(double origin[3]); - void SetOrigin(double origin[3]); + void SetOrigin(const double origin[3]); // Description: double *GetSpacing(); diff --git a/Common/DataModel/vtkAMRInformation.cxx b/Common/DataModel/vtkAMRInformation.cxx index a35fc568683..6f6aa3f47ce 100644 --- a/Common/DataModel/vtkAMRInformation.cxx +++ b/Common/DataModel/vtkAMRInformation.cxx @@ -386,7 +386,7 @@ double* vtkAMRInformation::GetOrigin() return this->Origin; } -void vtkAMRInformation::SetOrigin( const double* origin) +void vtkAMRInformation::SetOrigin(const double* origin) { for(int d=0; d<3; d++) { diff --git a/Common/DataModel/vtkBox.cxx b/Common/DataModel/vtkBox.cxx index 78a83849c9a..8fc3268935c 100644 --- a/Common/DataModel/vtkBox.cxx +++ b/Common/DataModel/vtkBox.cxx @@ -56,7 +56,7 @@ void vtkBox::SetBounds(double xMin, double xMax, } //---------------------------------------------------------------------------- -void vtkBox::SetBounds(double bounds[6]) +void vtkBox::SetBounds(const double bounds[6]) { this->SetBounds(bounds[0],bounds[1], bounds[2],bounds[3], bounds[4],bounds[5]); @@ -114,7 +114,7 @@ double* vtkBox::GetBounds() } //---------------------------------------------------------------------------- -void vtkBox::AddBounds(double bounds[6]) +void vtkBox::AddBounds(const double bounds[6]) { vtkBoundingBox bbox(*(this->BBox)); this->BBox->AddBounds(bounds); diff --git a/Common/DataModel/vtkBox.h b/Common/DataModel/vtkBox.h index 594593f749d..90abfcb7559 100644 --- a/Common/DataModel/vtkBox.h +++ b/Common/DataModel/vtkBox.h @@ -67,7 +67,7 @@ public: void SetBounds(double xMin, double xMax, double yMin, double yMax, double zMin, double zMax); - void SetBounds(double bounds[6]); + void SetBounds(const double bounds[6]); void GetBounds(double &xMin, double &xMax, double &yMin, double &yMax, double &zMin, double &zMax); @@ -79,7 +79,7 @@ public: // Start with a SetBounds(). Subsequent AddBounds() methods are union set // operations on the original bounds. Retrieve the final bounds with a // GetBounds() method. - void AddBounds(double bounds[6]); + void AddBounds(const double bounds[6]); // Description: // Bounding box intersection modified from Graphics Gems Vol I. The method diff --git a/Common/DataModel/vtkKdNode.cxx b/Common/DataModel/vtkKdNode.cxx index 174f52ef33b..02aeb357e47 100644 --- a/Common/DataModel/vtkKdNode.cxx +++ b/Common/DataModel/vtkKdNode.cxx @@ -73,7 +73,7 @@ void vtkKdNode::SetBounds(double x1,double x2,double y1,double y2,double z1, } // ---------------------------------------------------------------------------- -void vtkKdNode::SetMinBounds(double *b) +void vtkKdNode::SetMinBounds(const double *b) { this->Min[0] = b[0]; this->Min[1] = b[1]; @@ -81,7 +81,7 @@ void vtkKdNode::SetMinBounds(double *b) } // ---------------------------------------------------------------------------- -void vtkKdNode::SetMaxBounds(double *b) +void vtkKdNode::SetMaxBounds(const double *b) { this->Max[0] = b[0]; this->Max[1] = b[1]; @@ -89,7 +89,7 @@ void vtkKdNode::SetMaxBounds(double *b) } // ---------------------------------------------------------------------------- -void vtkKdNode::SetMinDataBounds(double *b) +void vtkKdNode::SetMinDataBounds(const double *b) { this->MinVal[0] = b[0]; this->MinVal[1] = b[1]; @@ -97,7 +97,7 @@ void vtkKdNode::SetMinDataBounds(double *b) } // ---------------------------------------------------------------------------- -void vtkKdNode::SetMaxDataBounds(double *b) +void vtkKdNode::SetMaxDataBounds(const double *b) { this->MaxVal[0] = b[0]; this->MaxVal[1] = b[1]; diff --git a/Common/DataModel/vtkKdNode.h b/Common/DataModel/vtkKdNode.h index b9727c8ced1..2321f30bfeb 100644 --- a/Common/DataModel/vtkKdNode.h +++ b/Common/DataModel/vtkKdNode.h @@ -65,7 +65,7 @@ public: // Set/Get the bounds of the spatial region represented by this node. // Caller allocates storage for 6-vector in GetBounds. void SetBounds(double x1,double x2,double y1,double y2,double z1,double z2); - void SetBounds(double b[6]) + void SetBounds(const double b[6]) { this->SetBounds(b[0], b[1], b[2], b[3], b[4], b[5]); } @@ -91,11 +91,11 @@ public: // Description: // Set the xmin, ymin and zmin value of the bounds of this region - void SetMinBounds(double *mb); + void SetMinBounds(const double *mb); // Description: // Set the xmax, ymax and zmax value of the bounds of this region - void SetMaxBounds(double *mb); + void SetMaxBounds(const double *mb); // Description: // Get a pointer to the 3 data bound minima (xmin, ymin and zmin) or the @@ -106,12 +106,12 @@ public: // Description: // Set the xmin, ymin and zmin value of the bounds of this // data within this region - void SetMinDataBounds(double *mb); + void SetMinDataBounds(const double *mb); // Description: // Set the xmax, ymax and zmax value of the bounds of this // data within this region - void SetMaxDataBounds(double *mb); + void SetMaxDataBounds(const double *mb); // Description: // Set/Get the ID associated with the region described by this node. If diff --git a/Common/DataModel/vtkOctreePointLocatorNode.h b/Common/DataModel/vtkOctreePointLocatorNode.h index 2906647aea1..5162506e11e 100644 --- a/Common/DataModel/vtkOctreePointLocatorNode.h +++ b/Common/DataModel/vtkOctreePointLocatorNode.h @@ -61,7 +61,7 @@ public: // Caller allocates storage for 6-vector in GetBounds. void SetBounds(double xMin, double xMax, double yMin, double yMax, double zMin, double zMax); - void SetBounds(double b[6]) + void SetBounds(const double b[6]) { this->SetBounds(b[0], b[1], b[2], b[3], b[4], b[5]); } diff --git a/Filters/General/vtkCursor2D.cxx b/Filters/General/vtkCursor2D.cxx index 253b44a14e7..c58e2449876 100644 --- a/Filters/General/vtkCursor2D.cxx +++ b/Filters/General/vtkCursor2D.cxx @@ -308,7 +308,7 @@ void vtkCursor2D::SetFocalPoint(double x[3]) } //--------------------------------------------------------------------------- -void vtkCursor2D::SetModelBounds(double bounds[6]) +void vtkCursor2D::SetModelBounds(const double bounds[6]) { this->SetModelBounds(bounds[0], bounds[1], bounds[2], bounds[3], bounds[6], bounds[5]); } diff --git a/Filters/General/vtkCursor2D.h b/Filters/General/vtkCursor2D.h index 5bfd5eb63e9..edf1874d39b 100644 --- a/Filters/General/vtkCursor2D.h +++ b/Filters/General/vtkCursor2D.h @@ -47,7 +47,7 @@ public: // of the cursor, and where the focal point should lie. void SetModelBounds(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax); - void SetModelBounds(double bounds[6]); + void SetModelBounds(const double bounds[6]); vtkGetVectorMacro(ModelBounds,double,6); // Description: diff --git a/Filters/General/vtkCursor3D.cxx b/Filters/General/vtkCursor3D.cxx index c74753230a5..ec050f9aa69 100644 --- a/Filters/General/vtkCursor3D.cxx +++ b/Filters/General/vtkCursor3D.cxx @@ -475,7 +475,7 @@ void vtkCursor3D::SetFocalPoint(double x[3]) } } -void vtkCursor3D::SetModelBounds(double bounds[6]) +void vtkCursor3D::SetModelBounds(const double bounds[6]) { this->SetModelBounds(bounds[0], bounds[1], bounds[2], bounds[3], bounds[4], bounds[5]); diff --git a/Filters/General/vtkCursor3D.h b/Filters/General/vtkCursor3D.h index 49c4d92da8c..c3687be3de0 100644 --- a/Filters/General/vtkCursor3D.h +++ b/Filters/General/vtkCursor3D.h @@ -45,7 +45,7 @@ public: // Set / get the boundary of the 3D cursor. void SetModelBounds(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax); - void SetModelBounds(double bounds[6]); + void SetModelBounds(const double bounds[6]); vtkGetVectorMacro(ModelBounds,double,6); // Description: diff --git a/Filters/Sources/vtkCubeSource.cxx b/Filters/Sources/vtkCubeSource.cxx index 8eec798c21a..98886633c27 100644 --- a/Filters/Sources/vtkCubeSource.cxx +++ b/Filters/Sources/vtkCubeSource.cxx @@ -181,7 +181,7 @@ void vtkCubeSource::SetBounds(double xMin, double xMax, this->SetBounds (bounds); } -void vtkCubeSource::SetBounds(double bounds[6]) +void vtkCubeSource::SetBounds(const double bounds[6]) { this->SetXLength(bounds[1]-bounds[0]); this->SetYLength(bounds[3]-bounds[2]); diff --git a/Filters/Sources/vtkCubeSource.h b/Filters/Sources/vtkCubeSource.h index 7df89d6721d..002c14a7983 100644 --- a/Filters/Sources/vtkCubeSource.h +++ b/Filters/Sources/vtkCubeSource.h @@ -56,7 +56,7 @@ public: void SetBounds(double xMin, double xMax, double yMin, double yMax, double zMin, double zMax); - void SetBounds(double bounds[6]); + void SetBounds(const double bounds[6]); protected: vtkCubeSource(double xL=1.0, double yL=1.0, double zL=1.0); diff --git a/Imaging/Hybrid/vtkSampleFunction.cxx b/Imaging/Hybrid/vtkSampleFunction.cxx index d08f0746a21..7057e408d47 100644 --- a/Imaging/Hybrid/vtkSampleFunction.cxx +++ b/Imaging/Hybrid/vtkSampleFunction.cxx @@ -97,7 +97,7 @@ void vtkSampleFunction::SetSampleDimensions(int dim[3]) } // Set the bounds of the model -void vtkSampleFunction::SetModelBounds(double bounds[6]) +void vtkSampleFunction::SetModelBounds(const double bounds[6]) { this->SetModelBounds(bounds[0], bounds[1], bounds[2], bounds[3], diff --git a/Imaging/Hybrid/vtkSampleFunction.h b/Imaging/Hybrid/vtkSampleFunction.h index c2ff41cd80c..ae834556a5a 100644 --- a/Imaging/Hybrid/vtkSampleFunction.h +++ b/Imaging/Hybrid/vtkSampleFunction.h @@ -92,7 +92,7 @@ public: // Description: // Specify the region in space over which the sampling occurs. The // bounds is specified as (xMin,xMax, yMin,yMax, zMin,zMax). - void SetModelBounds(double bounds[6]); + void SetModelBounds(const double bounds[6]); void SetModelBounds(double xMin, double xMax, double yMin, double yMax, double zMin, double zMax); diff --git a/Imaging/Hybrid/vtkVoxelModeller.cxx b/Imaging/Hybrid/vtkVoxelModeller.cxx index ddcf80fb0b5..c959ba01857 100644 --- a/Imaging/Hybrid/vtkVoxelModeller.cxx +++ b/Imaging/Hybrid/vtkVoxelModeller.cxx @@ -53,7 +53,7 @@ vtkVoxelModeller::vtkVoxelModeller() } // Specify the position in space to perform the voxelization. -void vtkVoxelModeller::SetModelBounds(double bounds[6]) +void vtkVoxelModeller::SetModelBounds(const double bounds[6]) { vtkVoxelModeller::SetModelBounds(bounds[0], bounds[1], bounds[2], bounds[3], bounds[4], bounds[5]); diff --git a/Imaging/Hybrid/vtkVoxelModeller.h b/Imaging/Hybrid/vtkVoxelModeller.h index b2d641b7f9b..7463d6d6749 100644 --- a/Imaging/Hybrid/vtkVoxelModeller.h +++ b/Imaging/Hybrid/vtkVoxelModeller.h @@ -65,7 +65,7 @@ public: // Description: // Specify the position in space to perform the voxelization. // Default is (0, 0, 0, 0, 0, 0) - void SetModelBounds(double bounds[6]); + void SetModelBounds(const double bounds[6]); void SetModelBounds(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax); vtkGetVectorMacro(ModelBounds,double,6); diff --git a/Interaction/Widgets/vtkAffineRepresentation2D.h b/Interaction/Widgets/vtkAffineRepresentation2D.h index 0edc7489fbd..51c1aac67b6 100644 --- a/Interaction/Widgets/vtkAffineRepresentation2D.h +++ b/Interaction/Widgets/vtkAffineRepresentation2D.h @@ -83,7 +83,7 @@ public: // Specify the origin of the widget (in world coordinates). The origin // is the point where the widget places itself. Note that rotations and // scaling occurs around the origin. - void SetOrigin(double o[3]) {this->SetOrigin(o[0],o[1],o[2]);} + void SetOrigin(const double o[3]) {this->SetOrigin(o[0],o[1],o[2]);} void SetOrigin(double ox, double oy, double oz); vtkGetVector3Macro(Origin,double); diff --git a/Rendering/Annotation/vtkAxisActor.cxx b/Rendering/Annotation/vtkAxisActor.cxx index 57a5cf2b9ea..abf8a082ec7 100644 --- a/Rendering/Annotation/vtkAxisActor.cxx +++ b/Rendering/Annotation/vtkAxisActor.cxx @@ -1581,7 +1581,7 @@ bool vtkAxisActor::TickVisibilityChanged() // Set the bounds for this actor to use. Sets timestamp BoundsModified. // ********************************************************************* void -vtkAxisActor::SetBounds(double b[6]) +vtkAxisActor::SetBounds(const double b[6]) { if ((this->Bounds[0] != b[0]) || (this->Bounds[1] != b[1]) || diff --git a/Rendering/Annotation/vtkAxisActor.h b/Rendering/Annotation/vtkAxisActor.h index 6b6d2ed2482..613ecaedce7 100644 --- a/Rendering/Annotation/vtkAxisActor.h +++ b/Rendering/Annotation/vtkAxisActor.h @@ -119,7 +119,7 @@ class VTKRENDERINGANNOTATION_EXPORT vtkAxisActor : public vtkActor // Description: // Set or get the bounds for this Actor as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax). - void SetBounds(double bounds[6]); + void SetBounds(const double bounds[6]); void SetBounds(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax); double *GetBounds(void); void GetBounds(double bounds[6]); diff --git a/Rendering/Core/vtkLight.h b/Rendering/Core/vtkLight.h index c9d620dd24a..45489489ba2 100644 --- a/Rendering/Core/vtkLight.h +++ b/Rendering/Core/vtkLight.h @@ -176,7 +176,7 @@ public: // Angles are given in degrees. If the light is a // positional light, it is made directional instead. void SetDirectionAngle(double elevation, double azimuth); - void SetDirectionAngle(double ang[2]) { + void SetDirectionAngle(const double ang[2]) { this->SetDirectionAngle(ang[0], ang[1]); }; // Description: diff --git a/Rendering/Core/vtkProp3D.h b/Rendering/Core/vtkProp3D.h index 3261a7199aa..1b5caf0ff70 100644 --- a/Rendering/Core/vtkProp3D.h +++ b/Rendering/Core/vtkProp3D.h @@ -91,7 +91,7 @@ public: this->IsIdentity = 0; } }; - virtual void SetOrigin(double pos[3]) + virtual void SetOrigin(const double pos[3]) { this->SetOrigin(pos[0], pos[1], pos[2]); } vtkGetVectorMacro(Origin, double, 3); -- GitLab