Commit 7df7c32c authored by Sean McBride's avatar Sean McBride Committed by Kitware Robot

Merge topic 'MoreVtkBool'

91a8e3a8 Fixed all compiler errors when vtkTypeBool is actually bool
322410ee Introduce typedef unsigned int vtkTypeUBool
e3cce433 Changed more int to vtkTypeBool
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: David Gobbi's avatarDavid Gobbi <david.gobbi@gmail.com>
Acked-by: Cory Quammen's avatarCory Quammen <cory.quammen@kitware.com>
Merge-request: !3721
parents 1a0beaad 91a8e3a8
......@@ -113,9 +113,9 @@ public:
/**
* Turn on/off flag to control whether scalar data is used to color objects.
*/
vtkSetMacro(ScalarVisibility,int);
vtkGetMacro(ScalarVisibility,int);
vtkBooleanMacro(ScalarVisibility,int);
vtkSetMacro(ScalarVisibility,vtkTypeBool);
vtkGetMacro(ScalarVisibility,vtkTypeBool);
vtkBooleanMacro(ScalarVisibility,vtkTypeBool);
//@}
//@{
......@@ -161,7 +161,7 @@ protected:
*/
vtkScalarsToColors *LookupTable;
vtkUnsignedCharArray *Colors;
int ScalarVisibility;
vtkTypeBool ScalarVisibility;
vtkStdString ColorArrayName;
//@}
......
......@@ -107,9 +107,9 @@ public:
/**
* Turn on/off flag to control whether scalar data is used to color objects.
*/
vtkSetMacro(ScalarVisibility,int);
vtkGetMacro(ScalarVisibility,int);
vtkBooleanMacro(ScalarVisibility,int);
vtkSetMacro(ScalarVisibility,vtkTypeBool);
vtkGetMacro(ScalarVisibility,vtkTypeBool);
vtkBooleanMacro(ScalarVisibility,vtkTypeBool);
//@}
//@{
......@@ -280,7 +280,7 @@ protected:
*/
vtkScalarsToColors *LookupTable;
vtkUnsignedCharArray *Colors;
int ScalarVisibility;
vtkTypeBool ScalarVisibility;
vtkStdString ColorArrayName;
//@}
......
......@@ -152,27 +152,27 @@ public:
/**
* Set/Get the flag which joins the first triangle strip to the last one.
*/
vtkSetClampMacro(JoinU,int,0,1);
vtkGetMacro(JoinU,int);
vtkBooleanMacro(JoinU,int);
vtkSetClampMacro(JoinU,vtkTypeBool,0,1);
vtkGetMacro(JoinU,vtkTypeBool);
vtkBooleanMacro(JoinU,vtkTypeBool);
//@}
//@{
/**
* Set/Get the flag which joins the ends of the triangle strips.
*/
vtkSetClampMacro(JoinV, int, 0, 1);
vtkGetMacro(JoinV, int);
vtkBooleanMacro(JoinV, int);
vtkSetClampMacro(JoinV, vtkTypeBool, 0, 1);
vtkGetMacro(JoinV, vtkTypeBool);
vtkBooleanMacro(JoinV, vtkTypeBool);
//@}
//@{
/**
* Set/Get the flag which joins the ends of the triangle strips.
*/
vtkSetClampMacro(JoinW, int, 0, 1);
vtkGetMacro(JoinW, int);
vtkBooleanMacro(JoinW, int);
vtkSetClampMacro(JoinW, vtkTypeBool, 0, 1);
vtkGetMacro(JoinW, vtkTypeBool);
vtkBooleanMacro(JoinW, vtkTypeBool);
//@}
//@{
......@@ -182,9 +182,9 @@ public:
* JoinU must also be set if this is set.
* Used when building some non-orientable surfaces.
*/
vtkSetClampMacro(TwistU,int,0,1);
vtkGetMacro(TwistU,int);
vtkBooleanMacro(TwistU,int);
vtkSetClampMacro(TwistU,vtkTypeBool,0,1);
vtkGetMacro(TwistU,vtkTypeBool);
vtkBooleanMacro(TwistU,vtkTypeBool);
//@}
//@{
......@@ -194,9 +194,9 @@ public:
* JoinV must also be set if this is set.
* Used when building some non-orientable surfaces.
*/
vtkSetClampMacro(TwistV, int, 0, 1);
vtkGetMacro(TwistV, int);
vtkBooleanMacro(TwistV, int);
vtkSetClampMacro(TwistV, vtkTypeBool, 0, 1);
vtkGetMacro(TwistV, vtkTypeBool);
vtkBooleanMacro(TwistV, vtkTypeBool);
//@}
//@{
......@@ -206,9 +206,9 @@ public:
* JoinW must also be set if this is set.
* Used when building some non-orientable surfaces.
*/
vtkSetClampMacro(TwistW, int, 0, 1);
vtkGetMacro(TwistW, int);
vtkBooleanMacro(TwistW, int);
vtkSetClampMacro(TwistW, vtkTypeBool, 0, 1);
vtkGetMacro(TwistW, vtkTypeBool);
vtkBooleanMacro(TwistW, vtkTypeBool);
//@}
//@{
......@@ -221,9 +221,9 @@ public:
* ordering is anti-clockwise. Default is true (i.e. clockwise
* ordering).
*/
vtkSetClampMacro(ClockwiseOrdering,int,0,1);
vtkGetMacro(ClockwiseOrdering,int);
vtkBooleanMacro(ClockwiseOrdering,int);
vtkSetClampMacro(ClockwiseOrdering,vtkTypeBool,0,1);
vtkGetMacro(ClockwiseOrdering,vtkTypeBool);
vtkBooleanMacro(ClockwiseOrdering,vtkTypeBool);
//@}
//@{
......@@ -232,9 +232,9 @@ public:
* from the parametric function (i.e., whether the Evaluate() method
* returns valid derivatives).
*/
vtkSetClampMacro(DerivativesAvailable,int,0,1);
vtkGetMacro(DerivativesAvailable,int);
vtkBooleanMacro(DerivativesAvailable,int);
vtkSetClampMacro(DerivativesAvailable,vtkTypeBool,0,1);
vtkGetMacro(DerivativesAvailable,vtkTypeBool);
vtkBooleanMacro(DerivativesAvailable,vtkTypeBool);
//@}
protected:
......@@ -249,17 +249,17 @@ protected:
double MinimumW;
double MaximumW;
int JoinU;
int JoinV;
int JoinW;
vtkTypeBool JoinU;
vtkTypeBool JoinV;
vtkTypeBool JoinW;
int TwistU;
int TwistV;
int TwistW;
vtkTypeBool TwistU;
vtkTypeBool TwistV;
vtkTypeBool TwistW;
int ClockwiseOrdering;
vtkTypeBool ClockwiseOrdering;
int DerivativesAvailable;
vtkTypeBool DerivativesAvailable;
private:
vtkParametricFunction(const vtkParametricFunction&) = delete;
......
......@@ -133,9 +133,9 @@ class VTKCOMMONCOMPUTATIONALGEOMETRY_EXPORT vtkParametricRandomHills :
* surface.
* Default is 1.
*/
vtkSetClampMacro(AllowRandomGeneration, int, 0, 1);
vtkGetMacro(AllowRandomGeneration, int);
vtkBooleanMacro(AllowRandomGeneration, int);
vtkSetClampMacro(AllowRandomGeneration, vtkTypeBool, 0, 1);
vtkGetMacro(AllowRandomGeneration, vtkTypeBool);
vtkBooleanMacro(AllowRandomGeneration, vtkTypeBool);
//@}
//@{
......@@ -204,7 +204,7 @@ class VTKCOMMONCOMPUTATIONALGEOMETRY_EXPORT vtkParametricRandomHills :
double XVarianceScaleFactor;
double YVarianceScaleFactor;
double AmplitudeScaleFactor;
int AllowRandomGeneration;
vtkTypeBool AllowRandomGeneration;
// These variables store the previous values of the above ones.
int previousNumberOfHills;
......
......@@ -115,9 +115,9 @@ public:
* a continuous loop: the first and last points are the same, and
* derivatives are continuous.
*/
vtkSetMacro(Closed,int);
vtkGetMacro(Closed,int);
vtkBooleanMacro(Closed,int);
vtkSetMacro(Closed,vtkTypeBool);
vtkGetMacro(Closed,vtkTypeBool);
vtkBooleanMacro(Closed,vtkTypeBool);
//@}
//@{
......@@ -125,9 +125,9 @@ public:
* Control whether the spline is parameterized by length or by point index.
* Default is by length.
*/
vtkSetMacro(ParameterizeByLength,int);
vtkGetMacro(ParameterizeByLength,int);
vtkBooleanMacro(ParameterizeByLength,int);
vtkSetMacro(ParameterizeByLength,vtkTypeBool);
vtkGetMacro(ParameterizeByLength,vtkTypeBool);
vtkBooleanMacro(ParameterizeByLength,vtkTypeBool);
//@}
//@{
......@@ -177,12 +177,12 @@ protected:
vtkSpline *ZSpline;
// Supplemental variables
int Closed;
vtkTypeBool Closed;
int LeftConstraint;
int RightConstraint;
double LeftValue;
double RightValue;
int ParameterizeByLength;
vtkTypeBool ParameterizeByLength;
// Initializing the spline
vtkMTimeType InitializeTime;
......
......@@ -60,15 +60,17 @@
/*--------------------------------------------------------------------------*/
/* If not already defined, define vtkTypeBool. When VTK was started, some */
/* compilers did not yet support the bool type, and so VTK often used int */
/* where it should have used bool. Eventually vtkTypeBool will switch to */
/* real bool. */
/* compilers did not yet support the bool type, and so VTK often used int, */
/* or more rarely unsigned int, where it should have used bool. */
/* Eventually vtkTypeBool will switch to real bool. */
#ifndef VTK_TYPE_BOOL_TYPEDEFED
# define VTK_TYPE_BOOL_TYPEDEFED
# if 1
typedef int vtkTypeBool;
typedef unsigned int vtkTypeUBool;
# else
typedef bool vtkTypeBool;
typedef bool vtkTypeUBool;
# endif
#endif
......
......@@ -238,9 +238,9 @@ public:
/**
* Set whether the below range color should be used.
*/
vtkSetMacro(UseBelowRangeColor, int);
vtkGetMacro(UseBelowRangeColor, int);
vtkBooleanMacro(UseBelowRangeColor, int);
vtkSetMacro(UseBelowRangeColor, vtkTypeBool);
vtkGetMacro(UseBelowRangeColor, vtkTypeBool);
vtkBooleanMacro(UseBelowRangeColor, vtkTypeBool);
//@}
//@{
......@@ -256,9 +256,9 @@ public:
/**
* Set whether the above range color should be used.
*/
vtkSetMacro(UseAboveRangeColor, int);
vtkGetMacro(UseAboveRangeColor, int);
vtkBooleanMacro(UseAboveRangeColor, int);
vtkSetMacro(UseAboveRangeColor, vtkTypeBool);
vtkGetMacro(UseAboveRangeColor, vtkTypeBool);
vtkBooleanMacro(UseAboveRangeColor, vtkTypeBool);
//@}
/**
......@@ -443,9 +443,9 @@ protected:
double AlphaRange[2];
double NanColor[4];
double BelowRangeColor[4];
int UseBelowRangeColor;
vtkTypeBool UseBelowRangeColor;
double AboveRangeColor[4];
int UseAboveRangeColor;
vtkTypeBool UseAboveRangeColor;
int Scale;
int Ramp;
......
......@@ -86,14 +86,14 @@ public:
* is displayed, the user is asked if they want to keep getting
* messages.
*/
vtkBooleanMacro(PromptUser,int);
vtkSetMacro(PromptUser, int);
vtkBooleanMacro(PromptUser,vtkTypeBool);
vtkSetMacro(PromptUser, vtkTypeBool);
//@}
protected:
vtkOutputWindow();
~vtkOutputWindow() override;
int PromptUser;
vtkTypeBool PromptUser;
private:
static vtkOutputWindow* Instance;
private:
......
......@@ -359,15 +359,17 @@ typedef int vtkIdType;
/*--------------------------------------------------------------------------*/
/* If not already defined, define vtkTypeBool. When VTK was started, some */
/* compilers did not yet support the bool type, and so VTK often used int */
/* where it should have used bool. Eventually vtkTypeBool will switch to */
/* real bool. */
/* compilers did not yet support the bool type, and so VTK often used int, */
/* or more rarely unsigned int, where it should have used bool. */
/* Eventually vtkTypeBool will switch to real bool. */
#ifndef VTK_TYPE_BOOL_TYPEDEFED
# define VTK_TYPE_BOOL_TYPEDEFED
# if 1
typedef int vtkTypeBool;
typedef unsigned int vtkTypeUBool;
# else
typedef bool vtkTypeBool;
typedef bool vtkTypeUBool;
# endif
#endif
......
......@@ -1550,83 +1550,83 @@ int vtkDataSetAttributes::GetCopyAttribute (int index, int ctype)
}
//--------------------------------------------------------------------------
void vtkDataSetAttributes::SetCopyScalars(int i, int ctype)
void vtkDataSetAttributes::SetCopyScalars(vtkTypeBool i, int ctype)
{
this->SetCopyAttribute(SCALARS, i, ctype);
}
//--------------------------------------------------------------------------
int vtkDataSetAttributes::GetCopyScalars(int ctype)
vtkTypeBool vtkDataSetAttributes::GetCopyScalars(int ctype)
{
return this->GetCopyAttribute(SCALARS, ctype);
}
//--------------------------------------------------------------------------
void vtkDataSetAttributes::SetCopyVectors(int i, int ctype)
void vtkDataSetAttributes::SetCopyVectors(vtkTypeBool i, int ctype)
{
this->SetCopyAttribute(VECTORS, i, ctype);
}
//--------------------------------------------------------------------------
int vtkDataSetAttributes::GetCopyVectors(int ctype)
vtkTypeBool vtkDataSetAttributes::GetCopyVectors(int ctype)
{
return this->GetCopyAttribute(VECTORS, ctype);
}
//--------------------------------------------------------------------------
void vtkDataSetAttributes::SetCopyNormals(int i, int ctype)
void vtkDataSetAttributes::SetCopyNormals(vtkTypeBool i, int ctype)
{
this->SetCopyAttribute(NORMALS, i, ctype);
}
//--------------------------------------------------------------------------
int vtkDataSetAttributes::GetCopyNormals(int ctype)
vtkTypeBool vtkDataSetAttributes::GetCopyNormals(int ctype)
{
return this->GetCopyAttribute(NORMALS, ctype);
}
//--------------------------------------------------------------------------
void vtkDataSetAttributes::SetCopyTCoords(int i, int ctype)
void vtkDataSetAttributes::SetCopyTCoords(vtkTypeBool i, int ctype)
{
this->SetCopyAttribute(TCOORDS, i, ctype);
}
//--------------------------------------------------------------------------
int vtkDataSetAttributes::GetCopyTCoords(int ctype)
vtkTypeBool vtkDataSetAttributes::GetCopyTCoords(int ctype)
{
return this->GetCopyAttribute(TCOORDS, ctype);
}
//--------------------------------------------------------------------------
void vtkDataSetAttributes::SetCopyTensors(int i, int ctype)
void vtkDataSetAttributes::SetCopyTensors(vtkTypeBool i, int ctype)
{
this->SetCopyAttribute(TENSORS, i, ctype);
}
//--------------------------------------------------------------------------
int vtkDataSetAttributes::GetCopyTensors(int ctype)
vtkTypeBool vtkDataSetAttributes::GetCopyTensors(int ctype)
{
return this->GetCopyAttribute(TENSORS, ctype);
}
//--------------------------------------------------------------------------
void vtkDataSetAttributes::SetCopyGlobalIds(int i, int ctype)
void vtkDataSetAttributes::SetCopyGlobalIds(vtkTypeBool i, int ctype)
{
this->SetCopyAttribute(GLOBALIDS, i, ctype);
}
//--------------------------------------------------------------------------
int vtkDataSetAttributes::GetCopyGlobalIds(int ctype)
vtkTypeBool vtkDataSetAttributes::GetCopyGlobalIds(int ctype)
{
return this->GetCopyAttribute(GLOBALIDS, ctype);
}
//--------------------------------------------------------------------------
void vtkDataSetAttributes::SetCopyPedigreeIds(int i, int ctype)
void vtkDataSetAttributes::SetCopyPedigreeIds(vtkTypeBool i, int ctype)
{
this->SetCopyAttribute(PEDIGREEIDS, i, ctype);
}
//--------------------------------------------------------------------------
int vtkDataSetAttributes::GetCopyPedigreeIds(int ctype)
vtkTypeBool vtkDataSetAttributes::GetCopyPedigreeIds(int ctype)
{
return this->GetCopyAttribute(PEDIGREEIDS, ctype);
}
......
......@@ -349,39 +349,39 @@ public:
int GetCopyAttribute (int index, int ctype);
/// @copydoc vtkDataSetAttributes::SetCopyAttribute()
void SetCopyScalars(int i, int ctype=ALLCOPY);
int GetCopyScalars(int ctype=ALLCOPY);
vtkBooleanMacro(CopyScalars, int);
void SetCopyScalars(vtkTypeBool i, int ctype=ALLCOPY);
vtkTypeBool GetCopyScalars(int ctype=ALLCOPY);
vtkBooleanMacro(CopyScalars, vtkTypeBool);
/// @copydoc vtkDataSetAttributes::SetCopyAttribute()
void SetCopyVectors(int i, int ctype=ALLCOPY);
int GetCopyVectors(int ctype=ALLCOPY);
vtkBooleanMacro(CopyVectors, int);
void SetCopyVectors(vtkTypeBool i, int ctype=ALLCOPY);
vtkTypeBool GetCopyVectors(int ctype=ALLCOPY);
vtkBooleanMacro(CopyVectors, vtkTypeBool);
/// @copydoc vtkDataSetAttributes::SetCopyAttribute()
void SetCopyNormals(int i, int ctype=ALLCOPY);
int GetCopyNormals(int ctype=ALLCOPY);
vtkBooleanMacro(CopyNormals, int);
void SetCopyNormals(vtkTypeBool i, int ctype=ALLCOPY);
vtkTypeBool GetCopyNormals(int ctype=ALLCOPY);
vtkBooleanMacro(CopyNormals, vtkTypeBool);
/// @copydoc vtkDataSetAttributes::SetCopyAttribute()
void SetCopyTCoords(int i, int ctype=ALLCOPY);
int GetCopyTCoords(int ctype=ALLCOPY);
vtkBooleanMacro(CopyTCoords, int);
void SetCopyTCoords(vtkTypeBool i, int ctype=ALLCOPY);
vtkTypeBool GetCopyTCoords(int ctype=ALLCOPY);
vtkBooleanMacro(CopyTCoords, vtkTypeBool);
/// @copydoc vtkDataSetAttributes::SetCopyAttribute()
void SetCopyTensors(int i, int ctype=ALLCOPY);
int GetCopyTensors(int ctype=ALLCOPY);
vtkBooleanMacro(CopyTensors, int);
void SetCopyTensors(vtkTypeBool i, int ctype=ALLCOPY);
vtkTypeBool GetCopyTensors(int ctype=ALLCOPY);
vtkBooleanMacro(CopyTensors, vtkTypeBool);
/// @copydoc vtkDataSetAttributes::SetCopyAttribute()
void SetCopyGlobalIds(int i, int ctype=ALLCOPY);
int GetCopyGlobalIds(int ctype=ALLCOPY);
vtkBooleanMacro(CopyGlobalIds, int);
void SetCopyGlobalIds(vtkTypeBool i, int ctype=ALLCOPY);
vtkTypeBool GetCopyGlobalIds(int ctype=ALLCOPY);
vtkBooleanMacro(CopyGlobalIds, vtkTypeBool);
/// @copydoc vtkDataSetAttributes::SetCopyAttribute()
void SetCopyPedigreeIds(int i, int ctype=ALLCOPY);
int GetCopyPedigreeIds(int ctype=ALLCOPY);
vtkBooleanMacro(CopyPedigreeIds, int);
void SetCopyPedigreeIds(vtkTypeBool i, int ctype=ALLCOPY);
vtkTypeBool GetCopyPedigreeIds(int ctype=ALLCOPY);
vtkBooleanMacro(CopyPedigreeIds, vtkTypeBool);
/// @copydoc vtkDataSetAttributes::SetCopyAttribute()
void CopyAllOn(int ctype=ALLCOPY) override;
......
......@@ -98,9 +98,9 @@ public:
* computed from the accumulated cross product of the edges. You can also
* specify the normal to use.
*/
vtkSetMacro(AutomaticNormalGeneration,int);
vtkGetMacro(AutomaticNormalGeneration,int);
vtkBooleanMacro(AutomaticNormalGeneration,int);
vtkSetMacro(AutomaticNormalGeneration,vtkTypeBool);
vtkGetMacro(AutomaticNormalGeneration,vtkTypeBool);
vtkBooleanMacro(AutomaticNormalGeneration,vtkTypeBool);
//@}
//@{
......@@ -123,7 +123,7 @@ protected:
vtkPoints *Loop;
double Normal[3];
int AutomaticNormalGeneration;
vtkTypeBool AutomaticNormalGeneration;
private:
void Initialize();
......
......@@ -89,9 +89,9 @@ public:
* This process does not otherwise normalize the gradient vector.
* By default, NormalizeByWeight is off.
*/
vtkSetMacro(NormalizeByWeight, int);
vtkGetMacro(NormalizeByWeight, int);
vtkBooleanMacro(NormalizeByWeight, int);
vtkSetMacro(NormalizeByWeight, vtkTypeBool);
vtkGetMacro(NormalizeByWeight, vtkTypeBool);
vtkBooleanMacro(NormalizeByWeight, vtkTypeBool);
//@}
protected:
......@@ -103,7 +103,7 @@ protected:
double TotalWeight;
void CalculateTotalWeight(void);
int NormalizeByWeight;
vtkTypeBool NormalizeByWeight;
private:
vtkImplicitSum(const vtkImplicitSum&) = delete;
......
......@@ -85,9 +85,9 @@ public:
/**
* Set/Get whether the search octree is built as a cubic shape or not.
*/
vtkSetMacro( BuildCubicOctree, int );
vtkGetMacro( BuildCubicOctree, int );
vtkBooleanMacro( BuildCubicOctree, int );
vtkSetMacro( BuildCubicOctree, vtkTypeBool );
vtkGetMacro( BuildCubicOctree, vtkTypeBool );
vtkBooleanMacro( BuildCubicOctree, vtkTypeBool );
//@}
//@{
......@@ -320,7 +320,7 @@ protected:
private:
int BuildCubicOctree;
vtkTypeBool BuildCubicOctree;
int MaxPointsPerLeaf;
double InsertTolerance2;
double OctreeMaxDimSize;
......
......@@ -95,9 +95,9 @@ public:
* Force the algorithm to check the mean distance between two iterations.
* Default is Off.
*/
vtkSetMacro(CheckMeanDistance, int);
vtkGetMacro(CheckMeanDistance, int);
vtkBooleanMacro(CheckMeanDistance, int);
vtkSetMacro(CheckMeanDistance, vtkTypeBool);
vtkGetMacro(CheckMeanDistance, vtkTypeBool);
vtkBooleanMacro(CheckMeanDistance, vtkTypeBool);
//@}