Commit 6a58312b authored by David Gobbi's avatar David Gobbi Committed by Kitware Robot
Browse files

Merge topic 'const-char'

bda2e98d Use const char pointer for field name
fecf3a44 Fix constness of keysym argument
21d710f1 Use const char pointer for filenames.
15e306fe Use const char pointer for array name APIs.
201cac9a Use const char pointer for AddIconType
4a85a50e

 Constify the SetWindowInfo parameter
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Allison Vacanti's avatarAllison Vacanti <allison.vacanti@kitware.com>
Acked-by: Cory Quammen's avatarCory Quammen <cory.quammen@kitware.com>
Merge-request: !4483
parents a4df3012 bda2e98d
Pipeline #109135 canceled with stage
in 0 seconds
......@@ -50,8 +50,8 @@ public:
virtual void *GetGenericParentId() = 0;
virtual void *GetGenericContext() = 0;
virtual void *GetGenericDrawable() = 0;
virtual void SetWindowInfo(char *) = 0;
virtual void SetParentInfo(char *) = 0;
virtual void SetWindowInfo(const char *) = 0;
virtual void SetParentInfo(const char *) = 0;
//@}
//@{
......
......@@ -440,7 +440,7 @@ void vtkDataObjectToDataSetFilter::PrintSelf(ostream& os, vtkIndent indent)
// Stuff related to points --------------------------------------------
//
void vtkDataObjectToDataSetFilter::SetPointComponent(int comp,
char *arrayName,
const char *arrayName,
int arrayComp,
int min, int max,
int normalize)
......@@ -724,7 +724,7 @@ vtkIdType vtkDataObjectToDataSetFilter::ConstructPoints(vtkDataObject *input,
//----------------------------------------------------------------------------
// Stuff related to vtkPolyData --------------------------------------------
//
void vtkDataObjectToDataSetFilter::SetVertsComponent(char *arrayName,
void vtkDataObjectToDataSetFilter::SetVertsComponent(const char *arrayName,
int arrayComp,
int min, int max)
{
......@@ -772,7 +772,7 @@ int vtkDataObjectToDataSetFilter::GetVertsComponentMaxRange()
}
//----------------------------------------------------------------------------
void vtkDataObjectToDataSetFilter::SetLinesComponent(char *arrayName,
void vtkDataObjectToDataSetFilter::SetLinesComponent(const char *arrayName,
int arrayComp,
int min, int max)
{
......@@ -820,7 +820,7 @@ int vtkDataObjectToDataSetFilter::GetLinesComponentMaxRange()
}
//----------------------------------------------------------------------------
void vtkDataObjectToDataSetFilter::SetPolysComponent(char *arrayName,
void vtkDataObjectToDataSetFilter::SetPolysComponent(const char *arrayName,
int arrayComp,
int min, int max)
{
......@@ -868,7 +868,7 @@ int vtkDataObjectToDataSetFilter::GetPolysComponentMaxRange()
}
//----------------------------------------------------------------------------
void vtkDataObjectToDataSetFilter::SetStripsComponent(char *arrayName,
void vtkDataObjectToDataSetFilter::SetStripsComponent(const char *arrayName,
int arrayComp,
int min, int max)
{
......@@ -917,7 +917,7 @@ int vtkDataObjectToDataSetFilter::GetStripsComponentMaxRange()
//----------------------------------------------------------------------------
// Stuff related to vtkUnstructuredGrid --------------------------------------
void vtkDataObjectToDataSetFilter::SetCellTypeComponent(char *arrayName, int arrayComp,
void vtkDataObjectToDataSetFilter::SetCellTypeComponent(const char *arrayName, int arrayComp,
int min, int max)
{
vtkFieldDataToAttributeDataFilter::SetArrayName(
......@@ -965,7 +965,7 @@ int vtkDataObjectToDataSetFilter::GetCellTypeComponentMaxRange()
//----------------------------------------------------------------------------
void vtkDataObjectToDataSetFilter::SetCellConnectivityComponent(
char *arrayName, int arrayComp, int min, int max)
const char *arrayName, int arrayComp, int min, int max)
{
vtkFieldDataToAttributeDataFilter::SetArrayName(
this, this->CellConnectivityArray, arrayName);
......@@ -1269,7 +1269,7 @@ vtkCellArray *vtkDataObjectToDataSetFilter::ConstructCellArray(
//----------------------------------------------------------------------------
// Alternative methods for Dimensions, Spacing, and Origin -------------------
//
void vtkDataObjectToDataSetFilter::SetDimensionsComponent(char *arrayName,
void vtkDataObjectToDataSetFilter::SetDimensionsComponent(const char *arrayName,
int arrayComp,
int min, int max)
{
......@@ -1293,7 +1293,7 @@ void vtkDataObjectToDataSetFilter::SetDimensionsComponent(char *arrayName,
}
//----------------------------------------------------------------------------
void vtkDataObjectToDataSetFilter::SetSpacingComponent(char *arrayName,
void vtkDataObjectToDataSetFilter::SetSpacingComponent(const char *arrayName,
int arrayComp,
int min, int max)
{
......@@ -1317,7 +1317,7 @@ void vtkDataObjectToDataSetFilter::SetSpacingComponent(char *arrayName,
}
//----------------------------------------------------------------------------
void vtkDataObjectToDataSetFilter::SetOriginComponent(char *arrayName,
void vtkDataObjectToDataSetFilter::SetOriginComponent(const char *arrayName,
int arrayComp,
int min, int max)
{
......
......@@ -138,9 +138,9 @@ public:
* provided which does not require setting the (min,max) component range or
* the normalize flag (normalize is set to DefaulatNormalize value).
*/
void SetPointComponent(int comp, char *arrayName, int arrayComp,
void SetPointComponent(int comp, const char *arrayName, int arrayComp,
int min, int max, int normalize);
void SetPointComponent(int comp, char *arrayName, int arrayComp)
void SetPointComponent(int comp, const char *arrayName, int arrayComp)
{this->SetPointComponent(comp, arrayName, arrayComp, -1, -1, this->DefaultNormalize);};
const char *GetPointComponentArrayName(int comp);
int GetPointComponentArrayComponent(int comp);
......@@ -159,29 +159,29 @@ public:
* points per cell, and then the cell connectivity. (This is the vtk file
* format described in in the textbook or User's Guide.)
*/
void SetVertsComponent(char *arrayName, int arrayComp, int min, int max);
void SetVertsComponent(char *arrayName, int arrayComp)
void SetVertsComponent(const char *arrayName, int arrayComp, int min, int max);
void SetVertsComponent(const char *arrayName, int arrayComp)
{this->SetVertsComponent(arrayName, arrayComp, -1, -1);};
const char *GetVertsComponentArrayName();
int GetVertsComponentArrayComponent();
int GetVertsComponentMinRange();
int GetVertsComponentMaxRange();
void SetLinesComponent(char *arrayName, int arrayComp, int min, int max);
void SetLinesComponent(char *arrayName, int arrayComp)
void SetLinesComponent(const char *arrayName, int arrayComp, int min, int max);
void SetLinesComponent(const char *arrayName, int arrayComp)
{this->SetLinesComponent(arrayName, arrayComp, -1, -1);};
const char *GetLinesComponentArrayName();
int GetLinesComponentArrayComponent();
int GetLinesComponentMinRange();
int GetLinesComponentMaxRange();
void SetPolysComponent(char *arrayName, int arrayComp, int min, int max);
void SetPolysComponent(char *arrayName, int arrayComp)
void SetPolysComponent(const char *arrayName, int arrayComp, int min, int max);
void SetPolysComponent(const char *arrayName, int arrayComp)
{this->SetPolysComponent(arrayName, arrayComp, -1, -1);};
const char *GetPolysComponentArrayName();
int GetPolysComponentArrayComponent();
int GetPolysComponentMinRange();
int GetPolysComponentMaxRange();
void SetStripsComponent(char *arrayName, int arrayComp, int min, int max);
void SetStripsComponent(char *arrayName, int arrayComp)
void SetStripsComponent(const char *arrayName, int arrayComp, int min, int max);
void SetStripsComponent(const char *arrayName, int arrayComp)
{this->SetStripsComponent(arrayName, arrayComp, -1, -1);};
const char *GetStripsComponentArrayName();
int GetStripsComponentArrayComponent();
......@@ -199,17 +199,17 @@ public:
* then the cell connectivity. (This is the vtk file format described in
* in the textbook or User's Guide.)
*/
void SetCellTypeComponent(char *arrayName, int arrayComp,
void SetCellTypeComponent(const char *arrayName, int arrayComp,
int min, int max);
void SetCellTypeComponent(char *arrayName, int arrayComp)
void SetCellTypeComponent(const char *arrayName, int arrayComp)
{this->SetCellTypeComponent(arrayName, arrayComp, -1, -1);};
const char *GetCellTypeComponentArrayName();
int GetCellTypeComponentArrayComponent();
int GetCellTypeComponentMinRange();
int GetCellTypeComponentMaxRange();
void SetCellConnectivityComponent(char *arrayName, int arrayComp,
void SetCellConnectivityComponent(const char *arrayName, int arrayComp,
int min, int max);
void SetCellConnectivityComponent(char *arrayName, int arrayComp)
void SetCellConnectivityComponent(const char *arrayName, int arrayComp)
{this->SetCellConnectivityComponent(arrayName, arrayComp, -1, -1);};
const char *GetCellConnectivityComponentArrayName();
int GetCellConnectivityComponentArrayComponent();
......@@ -262,14 +262,14 @@ public:
* the component of the array, and the range of the array (min,max). These methods
* will override the information given by the previous methods.
*/
void SetDimensionsComponent(char *arrayName, int arrayComp, int min, int max);
void SetDimensionsComponent(char *arrayName, int arrayComp)
void SetDimensionsComponent(const char *arrayName, int arrayComp, int min, int max);
void SetDimensionsComponent(const char *arrayName, int arrayComp)
{this->SetDimensionsComponent(arrayName, arrayComp, -1, -1);};
void SetSpacingComponent(char *arrayName, int arrayComp, int min, int max);
void SetSpacingComponent(char *arrayName, int arrayComp)
void SetSpacingComponent(const char *arrayName, int arrayComp, int min, int max);
void SetSpacingComponent(const char *arrayName, int arrayComp)
{this->SetSpacingComponent(arrayName, arrayComp, -1, -1);};
void SetOriginComponent(char *arrayName, int arrayComp, int min, int max);
void SetOriginComponent(char *arrayName, int arrayComp)
void SetOriginComponent(const char *arrayName, int arrayComp, int min, int max);
void SetOriginComponent(const char *arrayName, int arrayComp)
{this->SetOriginComponent(arrayName, arrayComp, -1, -1);};
//@}
......
......@@ -1054,7 +1054,8 @@ int vtkFieldDataToAttributeDataFilter::GetComponentsType(int numComp, vtkDataArr
}
vtkDataArray *vtkFieldDataToAttributeDataFilter::GetFieldArray(vtkFieldData *fd,
char *name, int comp)
const char *name,
int comp)
{
vtkDataArray *da = nullptr;
int numComp;
......
......@@ -237,7 +237,7 @@ public:
/**
* Return an array of a particular name from field data and do error checking.
*/
static vtkDataArray *GetFieldArray(vtkFieldData *fd, char *name, int comp);
static vtkDataArray *GetFieldArray(vtkFieldData *fd, const char *name, int comp);
/**
* Specify an array name for one of the components.
......
......@@ -161,12 +161,12 @@ void vtkDSPFilterDefinition::PushBackForwardNumeratorWeight(double a_value)
}
//----------------------------------------------------------------------------
void vtkDSPFilterDefinition::SetInputVariableName(char *a_value)
void vtkDSPFilterDefinition::SetInputVariableName(const char *a_value)
{
this->InputVariableName->m_string = a_value;
}
//----------------------------------------------------------------------------
void vtkDSPFilterDefinition::SetOutputVariableName(char *a_value)
void vtkDSPFilterDefinition::SetOutputVariableName(const char *a_value)
{
this->OutputVariableName->m_string = a_value;
}
......
......@@ -57,8 +57,8 @@ class VTKFILTERSHYBRID_EXPORT vtkDSPFilterDefinition : public vtkObject
void PushBackNumeratorWeight(double a_value);
void PushBackDenominatorWeight(double a_value);
void PushBackForwardNumeratorWeight(double a_value);
void SetInputVariableName(char *a_value);
void SetOutputVariableName(char *a_value);
void SetInputVariableName(const char *a_value);
void SetOutputVariableName(const char *a_value);
const char *GetInputVariableName();
const char *GetOutputVariableName();
......
......@@ -149,7 +149,7 @@ void vtkDSPFilterGroup::AddFilter(vtkDSPFilterDefinition *filter)
}
//----------------------------------------------------------------------------
void vtkDSPFilterGroup::RemoveFilter(char *a_outputVariableName)
void vtkDSPFilterGroup::RemoveFilter(const char *a_outputVariableName)
{
std::vector<vtkDSPFilterDefinition *>::iterator l_iter;
std::vector< std::vector<vtkFloatArray *> >::iterator l_cachedOutputsIter = this->CachedOutputs->m_vector.begin();
......
......@@ -50,7 +50,7 @@ public:
void AddFilter(vtkDSPFilterDefinition *filter);
void RemoveFilter(char *a_outputVariableName);
void RemoveFilter(const char *a_outputVariableName);
bool IsThisInputVariableInstanceNeeded( const char *a_name, int a_timestep, int a_outputTimestep );
bool IsThisInputVariableInstanceCached( const char *a_name, int a_timestep );
......
......@@ -642,14 +642,14 @@ vtkFiberSurface::vtkFiberSurface()
//----------------------------------------------------------------------------
void vtkFiberSurface::SetField1(char* nm)
void vtkFiberSurface::SetField1(const char* nm)
{
this->Fields[0] = nm;
}
//----------------------------------------------------------------------------
void vtkFiberSurface::SetField2(char* nm)
void vtkFiberSurface::SetField2(const char* nm)
{
this->Fields[1] = nm;
}
......
......@@ -329,12 +329,12 @@ public:
/**
* Specify the first field name to be used in this filter.
*/
void SetField1(char* fieldName);
void SetField1(const char* fieldName);
/**
* Specify the second field name to be used in the filter.
*/
void SetField2(char* fieldName);
void SetField2(const char* fieldName);
/**
* This structure lists the vertices to use for the marching tetrahedra,
......@@ -391,7 +391,7 @@ protected:
int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
// name of the input array names.
char* Fields[2];
const char* Fields[2];
private:
vtkFiberSurface(const vtkFiberSurface&) = delete;
......
......@@ -151,7 +151,7 @@ public:
}
//------------------------------------------------------------------------
void PushImageToQueue(vtkImageData*& data, char* fileName)
void PushImageToQueue(vtkImageData*& data, const char* fileName)
{
this->InputsLock.Lock();
{
......@@ -375,7 +375,8 @@ void vtkThreadedImageWriter::Initialize()
}
//----------------------------------------------------------------------------
void vtkThreadedImageWriter::EncodeAndWrite(vtkImageData* image, char* fileName)
void vtkThreadedImageWriter::EncodeAndWrite(vtkImageData* image,
const char* fileName)
{
// Error checking
if (image == nullptr)
......@@ -388,7 +389,8 @@ void vtkThreadedImageWriter::EncodeAndWrite(vtkImageData* image, char* fileName)
}
//----------------------------------------------------------------------------
void vtkThreadedImageWriter::PushImageToQueue(vtkImageData*& data, char* fileName)
void vtkThreadedImageWriter::PushImageToQueue(vtkImageData*& data,
const char* fileName)
{
this->Internals->SharedData.PushImageToQueue(data, fileName);
assert(data == nullptr);
......
......@@ -52,7 +52,7 @@ public:
* Use vtkErrorMacro to check that image is valid then
* call PushImageToQueue() internally if image is provided.
*/
void EncodeAndWrite(vtkImageData* image, char* fileName);
void EncodeAndWrite(vtkImageData* image, const char* fileName);
/**
* Push an image into the threaded writer. It is not safe to modify the image
......@@ -60,7 +60,7 @@ public:
* You may run into thread safety issues. Typically, the caller code will
* simply release reference to the data and stop using it.
*/
void PushImageToQueue(vtkImageData*& data, char* fileName);
void PushImageToQueue(vtkImageData*& data, const char* fileName);
/**
* Define the number of worker thread to use.
......
......@@ -41,7 +41,7 @@ void vtkRowQuery::PrintSelf(ostream &os, vtkIndent indent)
<< this->CaseSensitiveFieldNames << endl;
}
int vtkRowQuery::GetFieldIndex(char* name)
int vtkRowQuery::GetFieldIndex(const char* name)
{
vtkStdString lcSearchName(name);
std::transform(lcSearchName.begin(),
......
......@@ -92,7 +92,7 @@ public:
* Uses GetNumberOfFields() and GetFieldName()
* to match field name.
*/
int GetFieldIndex(char* name);
int GetFieldIndex(const char* name);
/**
* Advance row, return false if past end.
......
......@@ -63,13 +63,13 @@ vtkContinuousScatterplot::vtkContinuousScatterplot()
this->Fields[0] = this->Fields[1] = nullptr;
}
//----------------------------------------------------------------------------
void vtkContinuousScatterplot::SetField1(char* nm, vtkIdType xRes)
void vtkContinuousScatterplot::SetField1(const char* nm, vtkIdType xRes)
{
this->Fields[0] = nm;
this->ResX = xRes;
}
//----------------------------------------------------------------------------
void vtkContinuousScatterplot::SetField2(char* nm, vtkIdType yRes)
void vtkContinuousScatterplot::SetField2(const char* nm, vtkIdType yRes)
{
this->Fields[1] = nm;
this->ResY = yRes;
......
......@@ -193,13 +193,13 @@ public:
* Specify the name of the first field to be used in subdividing the dataset.
* Specify the resolution along x axis of the output image.
*/
void SetField1(char* fieldName, vtkIdType ResX);
void SetField1(const char* fieldName, vtkIdType ResX);
/**
* Specify the name of the second field to be used in subdividing the dataset.
* Specify the resolution along y axis of the output image.
*/
void SetField2(char* fieldName, vtkIdType ResY);
void SetField2(const char* fieldName, vtkIdType ResY);
protected:
vtkContinuousScatterplot();
......@@ -216,7 +216,7 @@ protected:
double Epsilon;
// Names of the scalar fields to be used in the filter.
char* Fields[2];
const char* Fields[2];
// Resolution of the output image.
vtkIdType ResX, ResY;
......
......@@ -258,8 +258,10 @@ const char *vtkWidgetEventTranslator::GetTranslation(const char *VTKEvent)
//----------------------------------------------------------------------------
unsigned long vtkWidgetEventTranslator::GetTranslation(unsigned long VTKEvent,
int modifier, char keyCode,
int repeatCount, char* keySym)
int modifier,
char keyCode,
int repeatCount,
const char* keySym)
{
EventMapIterator iter = this->EventMap->find(VTKEvent);
if ( iter != this->EventMap->end() )
......@@ -306,8 +308,9 @@ unsigned long vtkWidgetEventTranslator::GetTranslation(vtkEvent *VTKEvent)
//----------------------------------------------------------------------------
int vtkWidgetEventTranslator::RemoveTranslation(unsigned long VTKEvent,
int modifier, char keyCode,
int repeatCount, char* keySym)
int modifier, char keyCode,
int repeatCount,
const char* keySym)
{
vtkSmartPointer< vtkEvent > e = vtkSmartPointer< vtkEvent >::New();
e->SetEventId(VTKEvent);
......
......@@ -83,7 +83,7 @@ public:
unsigned long GetTranslation(unsigned long VTKEvent);
const char *GetTranslation(const char *VTKEvent);
unsigned long GetTranslation(unsigned long VTKEvent, int modifier, char keyCode,
int repeatCount, char* keySym);
int repeatCount, const char* keySym);
unsigned long GetTranslation(unsigned long VTKEvent, vtkEventData *edata);
unsigned long GetTranslation(vtkEvent *VTKEvent);
//@}
......@@ -95,7 +95,7 @@ public:
*/
int RemoveTranslation( unsigned long VTKEvent,
int modifier, char keyCode,
int repeatCount, char* keySym);
int repeatCount, const char* keySym);
int RemoveTranslation( vtkEvent *e );
int RemoveTranslation( vtkEventData *e );
int RemoveTranslation(unsigned long VTKEvent);
......
......@@ -363,7 +363,7 @@ void vtkGraphMapper::SetEdgeLineWidth(float width)
}
//----------------------------------------------------------------------------
void vtkGraphMapper::AddIconType(char *type, int index)
void vtkGraphMapper::AddIconType(const char *type, int index)
{
this->IconTypeToIndex->AddToMap(type, index);
}
......
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