Commit 15e306fe authored by David Gobbi's avatar David Gobbi
Browse files

Use const char pointer for array name APIs.

parent 201cac9a
......@@ -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;
......
......@@ -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;
......
......@@ -59,7 +59,7 @@ vtkMapArrayValues::~vtkMapArrayValues()
delete this->Map;
}
void vtkMapArrayValues::AddToMap(char *from, int to)
void vtkMapArrayValues::AddToMap(const char *from, int to)
{
vtkVariant fromVar(from);
vtkVariant toVar(to);
......@@ -77,7 +77,7 @@ void vtkMapArrayValues::AddToMap(int from, int to)
this->Modified();
}
void vtkMapArrayValues::AddToMap(int from, char *to)
void vtkMapArrayValues::AddToMap(int from, const char *to)
{
vtkVariant fromVar(from);
vtkVariant toVar(to);
......@@ -86,7 +86,7 @@ void vtkMapArrayValues::AddToMap(int from, char *to)
this->Modified();
}
void vtkMapArrayValues::AddToMap(char *from, char *to)
void vtkMapArrayValues::AddToMap(const char *from, const char *to)
{
vtkVariant fromVar(from);
vtkVariant toVar(to);
......
......@@ -116,9 +116,9 @@ public:
*/
void AddToMap(vtkVariant from, vtkVariant to);
void AddToMap(int from, int to);
void AddToMap(int from, char *to);
void AddToMap(char *from, int to);
void AddToMap(char *from, char *to);
void AddToMap(int from, const char *to);
void AddToMap(const char *from, int to);
void AddToMap(const char *from, const char *to);
//@}
/**
......
......@@ -207,7 +207,8 @@ void vtkPolyDataMapper2D::ColorByArrayComponent(int arrayNum, int component)
}
//----------------------------------------------------------------------------
void vtkPolyDataMapper2D::ColorByArrayComponent(char* arrayName, int component)
void vtkPolyDataMapper2D::ColorByArrayComponent(const char* arrayName,
int component)
{
if (strcmp(this->ArrayName, arrayName) == 0 &&
component == this->ArrayComponent &&
......
......@@ -162,13 +162,13 @@ public:
* Choose which component of which field data array to color by.
*/
void ColorByArrayComponent(int arrayNum, int component);
void ColorByArrayComponent(char* arrayName, int component);
void ColorByArrayComponent(const char* arrayName, int component);
//@}
/**
* Get the array name or number and component to color by.
*/
char* GetArrayName() { return this->ArrayName; }
const char* GetArrayName() { return this->ArrayName; }
int GetArrayId() { return this->ArrayId; }
int GetArrayAccessMode() { return this->ArrayAccessMode; }
int GetArrayComponent() { return this->ArrayComponent; }
......
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