Skip to content

Commit

Permalink
STYLE: Make style consistent with the ITK style
Browse files Browse the repository at this point in the history
Make style consistent with the ITK style:
- Use medial capitals in variable names, starting with lower case.
  • Loading branch information
jhlegarreta authored and dzenanz committed May 30, 2022
1 parent 7ba787a commit 8f4939d
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 37 deletions.
22 changes: 11 additions & 11 deletions Modules/IO/MeshBase/include/itkMeshFileTestHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ TestCellDataContainer(typename TMesh::CellDataContainerPointer cellData0,

template <typename TMesh>
int
test(char * INfilename, char * OUTfilename, bool IsBinary)
test(char * inputFileName, char * outputFileName, bool isBinary)
{
using MeshType = TMesh;

Expand All @@ -258,14 +258,14 @@ test(char * INfilename, char * OUTfilename, bool IsBinary)
using MeshFileWriterPointer = typename MeshFileWriterType::Pointer;

MeshFileReaderPointer reader = MeshFileReaderType::New();
reader->SetFileName(INfilename);
reader->SetFileName(inputFileName);
try
{
reader->Update();
}
catch (const itk::ExceptionObject & err)
{
std::cerr << "Read file " << INfilename << " failed " << std::endl;
std::cerr << "Read file " << inputFileName << " failed " << std::endl;
std::cerr << err << std::endl;
return EXIT_FAILURE;
}
Expand All @@ -278,16 +278,16 @@ test(char * INfilename, char * OUTfilename, bool IsBinary)
}

MeshFileWriterPointer writer = MeshFileWriterType::New();
if (itksys::SystemTools::GetFilenameLastExtension(INfilename) ==
itksys::SystemTools::GetFilenameLastExtension(OUTfilename))
if (itksys::SystemTools::GetFilenameLastExtension(inputFileName) ==
itksys::SystemTools::GetFilenameLastExtension(outputFileName))
{
writer->SetMeshIO(reader->GetModifiableMeshIO());
}
writer->SetFileName(OUTfilename);
writer->SetFileName(outputFileName);
writer->SetInput(reader->GetOutput());

// NOTE ALEX: we should document the usage
if (IsBinary)
if (isBinary)
{
writer->SetFileTypeAsBINARY();
}
Expand All @@ -298,25 +298,25 @@ test(char * INfilename, char * OUTfilename, bool IsBinary)
}
catch (const itk::ExceptionObject & err)
{
std::cerr << "Write file " << OUTfilename << " failed " << std::endl;
std::cerr << "Write file " << outputFileName << " failed " << std::endl;
std::cerr << err << std::endl;
return EXIT_FAILURE;
}

if (!itksys::SystemTools::FilesDiffer(INfilename, OUTfilename))
if (!itksys::SystemTools::FilesDiffer(inputFileName, outputFileName))
{
return EXIT_SUCCESS;
}

auto reader1 = MeshFileReaderType::New();
reader1->SetFileName(OUTfilename);
reader1->SetFileName(outputFileName);
try
{
reader1->Update();
}
catch (const itk::ExceptionObject & err)
{
std::cerr << "Read file " << OUTfilename << " failed " << std::endl;
std::cerr << "Read file " << outputFileName << " failed " << std::endl;
std::cerr << err << std::endl;
return EXIT_FAILURE;
}
Expand Down
52 changes: 26 additions & 26 deletions Modules/IO/MeshBase/include/itkMeshIOBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,9 @@ class ITKIOMeshBase_EXPORT MeshIOBase : public LightProcessObject

template <typename T>
void
SetPixelType(const T & itkNotUsed(dummy), bool UsePointPixel = true)
SetPixelType(const T & itkNotUsed(dummy), bool usePointPixel = true)
{
if (UsePointPixel)
if (usePointPixel)
{
SetNumberOfPointPixelComponents(1);
SetPointPixelComponentType(MapComponentType<T>::CType);
Expand All @@ -222,9 +222,9 @@ class ITKIOMeshBase_EXPORT MeshIOBase : public LightProcessObject

template <typename T>
void
SetPixelType(const RGBPixel<T> & itkNotUsed(dummy), bool UsePointPixel = true)
SetPixelType(const RGBPixel<T> & itkNotUsed(dummy), bool usePointPixel = true)
{
if (UsePointPixel)
if (usePointPixel)
{
SetNumberOfPointPixelComponents(3);
SetPointPixelComponentType(MapComponentType<T>::CType);
Expand All @@ -240,9 +240,9 @@ class ITKIOMeshBase_EXPORT MeshIOBase : public LightProcessObject

template <typename T>
void
SetPixelType(const RGBAPixel<T> & itkNotUsed(dummy), bool UsePointPixel = true)
SetPixelType(const RGBAPixel<T> & itkNotUsed(dummy), bool usePointPixel = true)
{
if (UsePointPixel)
if (usePointPixel)
{
SetNumberOfPointPixelComponents(4);
SetPointPixelComponentType(MapComponentType<T>::CType);
Expand All @@ -258,9 +258,9 @@ class ITKIOMeshBase_EXPORT MeshIOBase : public LightProcessObject

template <typename T, unsigned int VLength>
void
SetPixelType(const Vector<T, VLength> & itkNotUsed(dummy), bool UsePointPixel = true)
SetPixelType(const Vector<T, VLength> & itkNotUsed(dummy), bool usePointPixel = true)
{
if (UsePointPixel)
if (usePointPixel)
{
SetNumberOfPointPixelComponents(VLength);
SetPointPixelComponentType(MapComponentType<T>::CType);
Expand All @@ -276,9 +276,9 @@ class ITKIOMeshBase_EXPORT MeshIOBase : public LightProcessObject

template <typename T, unsigned int VLength>
void
SetPixelType(const CovariantVector<T, VLength> & itkNotUsed(dummy), bool UsePointPixel = true)
SetPixelType(const CovariantVector<T, VLength> & itkNotUsed(dummy), bool usePointPixel = true)
{
if (UsePointPixel)
if (usePointPixel)
{
SetNumberOfPointPixelComponents(VLength);
SetPointPixelComponentType(MapComponentType<T>::CType);
Expand All @@ -294,9 +294,9 @@ class ITKIOMeshBase_EXPORT MeshIOBase : public LightProcessObject

template <typename T, unsigned int VLength>
void
SetPixelType(const FixedArray<T, VLength> & itkNotUsed(dummy), bool UsePointPixel = true)
SetPixelType(const FixedArray<T, VLength> & itkNotUsed(dummy), bool usePointPixel = true)
{
if (UsePointPixel)
if (usePointPixel)
{
SetNumberOfPointPixelComponents(VLength);
SetPointPixelComponentType(MapComponentType<T>::CType);
Expand All @@ -312,9 +312,9 @@ class ITKIOMeshBase_EXPORT MeshIOBase : public LightProcessObject

template <typename T, unsigned int VLength>
void
SetPixelType(const SymmetricSecondRankTensor<T, VLength> itkNotUsed(dummy), bool UsePointPixel = true)
SetPixelType(const SymmetricSecondRankTensor<T, VLength> itkNotUsed(dummy), bool usePointPixel = true)
{
if (UsePointPixel)
if (usePointPixel)
{
SetNumberOfPointPixelComponents(VLength * (VLength + 1) / 2);
SetPointPixelComponentType(MapComponentType<T>::CType);
Expand All @@ -330,9 +330,9 @@ class ITKIOMeshBase_EXPORT MeshIOBase : public LightProcessObject

template <typename T>
void
SetPixelType(const DiffusionTensor3D<T> & itkNotUsed(dummy), bool UsePointPixel = true)
SetPixelType(const DiffusionTensor3D<T> & itkNotUsed(dummy), bool usePointPixel = true)
{
if (UsePointPixel)
if (usePointPixel)
{
SetNumberOfPointPixelComponents(6);
SetPointPixelComponentType(MapComponentType<T>::CType);
Expand All @@ -348,9 +348,9 @@ class ITKIOMeshBase_EXPORT MeshIOBase : public LightProcessObject

template <typename T, unsigned int VRows, unsigned int VColumns>
void
SetPixelType(const Matrix<T, VRows, VColumns> & itkNotUsed(dummy), bool UsePointPixel = true)
SetPixelType(const Matrix<T, VRows, VColumns> & itkNotUsed(dummy), bool usePointPixel = true)
{
if (UsePointPixel)
if (usePointPixel)
{
SetNumberOfPointPixelComponents(VRows * VColumns);
SetPointPixelComponentType(MapComponentType<T>::CType);
Expand All @@ -366,9 +366,9 @@ class ITKIOMeshBase_EXPORT MeshIOBase : public LightProcessObject

template <typename T>
void
SetPixelType(const std::complex<T> & itkNotUsed(dummy), bool UsePointPixel = true)
SetPixelType(const std::complex<T> & itkNotUsed(dummy), bool usePointPixel = true)
{
if (UsePointPixel)
if (usePointPixel)
{
SetNumberOfPointPixelComponents(2);
SetPointPixelComponentType(MapComponentType<T>::CType);
Expand All @@ -384,9 +384,9 @@ class ITKIOMeshBase_EXPORT MeshIOBase : public LightProcessObject

template <typename T>
void
SetPixelType(const Array<T> & array, bool UsePointPixel = true)
SetPixelType(const Array<T> & array, bool usePointPixel = true)
{
if (UsePointPixel)
if (usePointPixel)
{
SetNumberOfPointPixelComponents(array.Size());
SetPointPixelComponentType(MapComponentType<T>::CType);
Expand All @@ -402,9 +402,9 @@ class ITKIOMeshBase_EXPORT MeshIOBase : public LightProcessObject

template <typename T>
void
SetPixelType(const VariableLengthVector<T> & vector, bool UsePointPixel = true)
SetPixelType(const VariableLengthVector<T> & vector, bool usePointPixel = true)
{
if (UsePointPixel)
if (usePointPixel)
{
SetNumberOfPointPixelComponents(vector.Size());
SetPointPixelComponentType(MapComponentType<T>::CType);
Expand All @@ -420,9 +420,9 @@ class ITKIOMeshBase_EXPORT MeshIOBase : public LightProcessObject

template <typename T>
void
SetPixelType(const VariableSizeMatrix<T> & matrix, bool UsePointPixel = true)
SetPixelType(const VariableSizeMatrix<T> & matrix, bool usePointPixel = true)
{
if (UsePointPixel)
if (usePointPixel)
{
SetNumberOfPointPixelComponents(matrix.Rows() * matrix.Cols());
SetPointPixelComponentType(MapComponentType<T>::CType);
Expand Down

0 comments on commit 8f4939d

Please sign in to comment.