Updates will be applied April 15th at 12pm EDT (UTC-0400). GitLab could be a little slow between 12 - 12:45pm EDT.

Commit f91373ee authored by Sean McBride's avatar Sean McBride

Added 'const' to several public setters

Made some pointer/array parameters const.

Change-Id: I5f00b580e7478623d72c13cdca605aaa2bec7b56
parent 07904db4
...@@ -161,7 +161,7 @@ void vtkPistonDataObject::GetBounds(double bounds[6]) ...@@ -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; bool modified = false;
for (int i=0; i<6; i++) for (int i=0; i<6; i++)
...@@ -194,7 +194,7 @@ void vtkPistonDataObject::GetOrigin(double origin[3]) ...@@ -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; bool modified = false;
for (int i=0; i<3; i++) for (int i=0; i<3; i++)
......
...@@ -74,12 +74,12 @@ public: ...@@ -74,12 +74,12 @@ public:
// (xmin,xmax, ymin,ymax, zmin,zmax). // (xmin,xmax, ymin,ymax, zmin,zmax).
double *GetBounds(); double *GetBounds();
void GetBounds(double bounds[6]); void GetBounds(double bounds[6]);
void SetBounds(double bounds[6]); void SetBounds(const double bounds[6]);
// Description: // Description:
double *GetOrigin(); double *GetOrigin();
void GetOrigin(double origin[3]); void GetOrigin(double origin[3]);
void SetOrigin(double origin[3]); void SetOrigin(const double origin[3]);
// Description: // Description:
double *GetSpacing(); double *GetSpacing();
......
...@@ -386,7 +386,7 @@ double* vtkAMRInformation::GetOrigin() ...@@ -386,7 +386,7 @@ double* vtkAMRInformation::GetOrigin()
return this->Origin; return this->Origin;
} }
void vtkAMRInformation::SetOrigin( const double* origin) void vtkAMRInformation::SetOrigin(const double* origin)
{ {
for(int d=0; d<3; d++) for(int d=0; d<3; d++)
{ {
......
...@@ -56,7 +56,7 @@ void vtkBox::SetBounds(double xMin, double xMax, ...@@ -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], this->SetBounds(bounds[0],bounds[1], bounds[2],bounds[3],
bounds[4],bounds[5]); bounds[4],bounds[5]);
...@@ -114,7 +114,7 @@ double* vtkBox::GetBounds() ...@@ -114,7 +114,7 @@ double* vtkBox::GetBounds()
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void vtkBox::AddBounds(double bounds[6]) void vtkBox::AddBounds(const double bounds[6])
{ {
vtkBoundingBox bbox(*(this->BBox)); vtkBoundingBox bbox(*(this->BBox));
this->BBox->AddBounds(bounds); this->BBox->AddBounds(bounds);
......
...@@ -67,7 +67,7 @@ public: ...@@ -67,7 +67,7 @@ public:
void SetBounds(double xMin, double xMax, void SetBounds(double xMin, double xMax,
double yMin, double yMax, double yMin, double yMax,
double zMin, double zMax); double zMin, double zMax);
void SetBounds(double bounds[6]); void SetBounds(const double bounds[6]);
void GetBounds(double &xMin, double &xMax, void GetBounds(double &xMin, double &xMax,
double &yMin, double &yMax, double &yMin, double &yMax,
double &zMin, double &zMax); double &zMin, double &zMax);
...@@ -79,7 +79,7 @@ public: ...@@ -79,7 +79,7 @@ public:
// Start with a SetBounds(). Subsequent AddBounds() methods are union set // Start with a SetBounds(). Subsequent AddBounds() methods are union set
// operations on the original bounds. Retrieve the final bounds with a // operations on the original bounds. Retrieve the final bounds with a
// GetBounds() method. // GetBounds() method.
void AddBounds(double bounds[6]); void AddBounds(const double bounds[6]);
// Description: // Description:
// Bounding box intersection modified from Graphics Gems Vol I. The method // Bounding box intersection modified from Graphics Gems Vol I. The method
......
...@@ -73,7 +73,7 @@ void vtkKdNode::SetBounds(double x1,double x2,double y1,double y2,double z1, ...@@ -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[0] = b[0];
this->Min[1] = b[1]; this->Min[1] = b[1];
...@@ -81,7 +81,7 @@ void vtkKdNode::SetMinBounds(double *b) ...@@ -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[0] = b[0];
this->Max[1] = b[1]; this->Max[1] = b[1];
...@@ -89,7 +89,7 @@ void vtkKdNode::SetMaxBounds(double *b) ...@@ -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[0] = b[0];
this->MinVal[1] = b[1]; this->MinVal[1] = b[1];
...@@ -97,7 +97,7 @@ void vtkKdNode::SetMinDataBounds(double *b) ...@@ -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[0] = b[0];
this->MaxVal[1] = b[1]; this->MaxVal[1] = b[1];
......
...@@ -65,7 +65,7 @@ public: ...@@ -65,7 +65,7 @@ public:
// Set/Get the bounds of the spatial region represented by this node. // Set/Get the bounds of the spatial region represented by this node.
// Caller allocates storage for 6-vector in GetBounds. // 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 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]); this->SetBounds(b[0], b[1], b[2], b[3], b[4], b[5]);
} }
...@@ -91,11 +91,11 @@ public: ...@@ -91,11 +91,11 @@ public:
// Description: // Description:
// Set the xmin, ymin and zmin value of the bounds of this region // Set the xmin, ymin and zmin value of the bounds of this region
void SetMinBounds(double *mb); void SetMinBounds(const double *mb);
// Description: // Description:
// Set the xmax, ymax and zmax value of the bounds of this region // Set the xmax, ymax and zmax value of the bounds of this region
void SetMaxBounds(double *mb); void SetMaxBounds(const double *mb);
// Description: // Description:
// Get a pointer to the 3 data bound minima (xmin, ymin and zmin) or the // Get a pointer to the 3 data bound minima (xmin, ymin and zmin) or the
...@@ -106,12 +106,12 @@ public: ...@@ -106,12 +106,12 @@ public:
// Description: // Description:
// Set the xmin, ymin and zmin value of the bounds of this // Set the xmin, ymin and zmin value of the bounds of this
// data within this region // data within this region
void SetMinDataBounds(double *mb); void SetMinDataBounds(const double *mb);
// Description: // Description:
// Set the xmax, ymax and zmax value of the bounds of this // Set the xmax, ymax and zmax value of the bounds of this
// data within this region // data within this region
void SetMaxDataBounds(double *mb); void SetMaxDataBounds(const double *mb);
// Description: // Description:
// Set/Get the ID associated with the region described by this node. If // Set/Get the ID associated with the region described by this node. If
......
...@@ -61,7 +61,7 @@ public: ...@@ -61,7 +61,7 @@ public:
// Caller allocates storage for 6-vector in GetBounds. // Caller allocates storage for 6-vector in GetBounds.
void SetBounds(double xMin, double xMax, double yMin, void SetBounds(double xMin, double xMax, double yMin,
double yMax, double zMin, double zMax); 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]); this->SetBounds(b[0], b[1], b[2], b[3], b[4], b[5]);
} }
......
...@@ -308,7 +308,7 @@ void vtkCursor2D::SetFocalPoint(double x[3]) ...@@ -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]); this->SetModelBounds(bounds[0], bounds[1], bounds[2], bounds[3], bounds[6], bounds[5]);
} }
......
...@@ -47,7 +47,7 @@ public: ...@@ -47,7 +47,7 @@ public:
// of the cursor, and where the focal point should lie. // of the cursor, and where the focal point should lie.
void SetModelBounds(double xmin, double xmax, double ymin, double ymax, void SetModelBounds(double xmin, double xmax, double ymin, double ymax,
double zmin, double zmax); double zmin, double zmax);
void SetModelBounds(double bounds[6]); void SetModelBounds(const double bounds[6]);
vtkGetVectorMacro(ModelBounds,double,6); vtkGetVectorMacro(ModelBounds,double,6);
// Description: // Description:
......
...@@ -475,7 +475,7 @@ void vtkCursor3D::SetFocalPoint(double x[3]) ...@@ -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], this->SetModelBounds(bounds[0], bounds[1], bounds[2], bounds[3], bounds[4],
bounds[5]); bounds[5]);
......
...@@ -45,7 +45,7 @@ public: ...@@ -45,7 +45,7 @@ public:
// Set / get the boundary of the 3D cursor. // Set / get the boundary of the 3D cursor.
void SetModelBounds(double xmin, double xmax, double ymin, double ymax, void SetModelBounds(double xmin, double xmax, double ymin, double ymax,
double zmin, double zmax); double zmin, double zmax);
void SetModelBounds(double bounds[6]); void SetModelBounds(const double bounds[6]);
vtkGetVectorMacro(ModelBounds,double,6); vtkGetVectorMacro(ModelBounds,double,6);
// Description: // Description:
......
...@@ -181,7 +181,7 @@ void vtkCubeSource::SetBounds(double xMin, double xMax, ...@@ -181,7 +181,7 @@ void vtkCubeSource::SetBounds(double xMin, double xMax,
this->SetBounds (bounds); this->SetBounds (bounds);
} }
void vtkCubeSource::SetBounds(double bounds[6]) void vtkCubeSource::SetBounds(const double bounds[6])
{ {
this->SetXLength(bounds[1]-bounds[0]); this->SetXLength(bounds[1]-bounds[0]);
this->SetYLength(bounds[3]-bounds[2]); this->SetYLength(bounds[3]-bounds[2]);
......
...@@ -56,7 +56,7 @@ public: ...@@ -56,7 +56,7 @@ public:
void SetBounds(double xMin, double xMax, void SetBounds(double xMin, double xMax,
double yMin, double yMax, double yMin, double yMax,
double zMin, double zMax); double zMin, double zMax);
void SetBounds(double bounds[6]); void SetBounds(const double bounds[6]);
protected: protected:
vtkCubeSource(double xL=1.0, double yL=1.0, double zL=1.0); vtkCubeSource(double xL=1.0, double yL=1.0, double zL=1.0);
......
...@@ -97,7 +97,7 @@ void vtkSampleFunction::SetSampleDimensions(int dim[3]) ...@@ -97,7 +97,7 @@ void vtkSampleFunction::SetSampleDimensions(int dim[3])
} }
// Set the bounds of the model // 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], this->SetModelBounds(bounds[0], bounds[1],
bounds[2], bounds[3], bounds[2], bounds[3],
......
...@@ -92,7 +92,7 @@ public: ...@@ -92,7 +92,7 @@ public:
// Description: // Description:
// Specify the region in space over which the sampling occurs. The // Specify the region in space over which the sampling occurs. The
// bounds is specified as (xMin,xMax, yMin,yMax, zMin,zMax). // 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, void SetModelBounds(double xMin, double xMax,
double yMin, double yMax, double yMin, double yMax,
double zMin, double zMax); double zMin, double zMax);
......
...@@ -53,7 +53,7 @@ vtkVoxelModeller::vtkVoxelModeller() ...@@ -53,7 +53,7 @@ vtkVoxelModeller::vtkVoxelModeller()
} }
// Specify the position in space to perform the voxelization. // 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], vtkVoxelModeller::SetModelBounds(bounds[0], bounds[1], bounds[2], bounds[3],
bounds[4], bounds[5]); bounds[4], bounds[5]);
......
...@@ -65,7 +65,7 @@ public: ...@@ -65,7 +65,7 @@ public:
// Description: // Description:
// Specify the position in space to perform the voxelization. // Specify the position in space to perform the voxelization.
// Default is (0, 0, 0, 0, 0, 0) // 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); void SetModelBounds(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax);
vtkGetVectorMacro(ModelBounds,double,6); vtkGetVectorMacro(ModelBounds,double,6);
......
...@@ -83,7 +83,7 @@ public: ...@@ -83,7 +83,7 @@ public:
// Specify the origin of the widget (in world coordinates). The origin // Specify the origin of the widget (in world coordinates). The origin
// is the point where the widget places itself. Note that rotations and // is the point where the widget places itself. Note that rotations and
// scaling occurs around the origin. // 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); void SetOrigin(double ox, double oy, double oz);
vtkGetVector3Macro(Origin,double); vtkGetVector3Macro(Origin,double);
......
...@@ -1581,7 +1581,7 @@ bool vtkAxisActor::TickVisibilityChanged() ...@@ -1581,7 +1581,7 @@ bool vtkAxisActor::TickVisibilityChanged()
// Set the bounds for this actor to use. Sets timestamp BoundsModified. // Set the bounds for this actor to use. Sets timestamp BoundsModified.
// ********************************************************************* // *********************************************************************
void void
vtkAxisActor::SetBounds(double b[6]) vtkAxisActor::SetBounds(const double b[6])
{ {
if ((this->Bounds[0] != b[0]) || if ((this->Bounds[0] != b[0]) ||
(this->Bounds[1] != b[1]) || (this->Bounds[1] != b[1]) ||
......
...@@ -119,7 +119,7 @@ class VTKRENDERINGANNOTATION_EXPORT vtkAxisActor : public vtkActor ...@@ -119,7 +119,7 @@ class VTKRENDERINGANNOTATION_EXPORT vtkAxisActor : public vtkActor
// Description: // Description:
// Set or get the bounds for this Actor as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax). // 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); void SetBounds(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax);
double *GetBounds(void); double *GetBounds(void);
void GetBounds(double bounds[6]); void GetBounds(double bounds[6]);
......
...@@ -176,7 +176,7 @@ public: ...@@ -176,7 +176,7 @@ public:
// Angles are given in degrees. If the light is a // Angles are given in degrees. If the light is a
// positional light, it is made directional instead. // positional light, it is made directional instead.
void SetDirectionAngle(double elevation, double azimuth); void SetDirectionAngle(double elevation, double azimuth);
void SetDirectionAngle(double ang[2]) { void SetDirectionAngle(const double ang[2]) {
this->SetDirectionAngle(ang[0], ang[1]); }; this->SetDirectionAngle(ang[0], ang[1]); };
// Description: // Description:
......
...@@ -91,7 +91,7 @@ public: ...@@ -91,7 +91,7 @@ public:
this->IsIdentity = 0; this->IsIdentity = 0;
} }
}; };
virtual void SetOrigin(double pos[3]) virtual void SetOrigin(const double pos[3])
{ this->SetOrigin(pos[0], pos[1], pos[2]); } { this->SetOrigin(pos[0], pos[1], pos[2]); }
vtkGetVectorMacro(Origin, double, 3); vtkGetVectorMacro(Origin, double, 3);
......
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