Commit ec133749 authored by Emmanuel Promayon's avatar Emmanuel Promayon
Browse files

FIXED Indent 'switch' blocks



Indent 'switch' blocks  so that the 'case X:'
statements are indented in the switch block

Result after adding the --indent-switches option
to astyle
Signed-off-by: Emmanuel Promayon's avatarEmmanuel Promayon <Emmanuel.Promayon@imag.fr>
parent acba68c7
......@@ -137,13 +137,13 @@ vtkSmartPointer<vtkImageData> AnisotropicDiffusion::itkProcess(vtkSmartPointer<v
vtkSmartPointer<vtkImageData> outputImage = vtkSmartPointer<vtkImageData>::New();
switch (this->getDiffusionType()) {
default:
case AnisotropicDiffusion::GRADIENT:
outputImage = itkProcessGradientAnisotropicDiffusion<InputPixelType, OutputPixelType, dim>(img);
break;
case AnisotropicDiffusion::CURVATURE:
outputImage = itkProcessCurvatureAnisotropicDiffusion<InputPixelType, OutputPixelType, dim>(img);
break;
default:
case AnisotropicDiffusion::GRADIENT:
outputImage = itkProcessGradientAnisotropicDiffusion<InputPixelType, OutputPixelType, dim>(img);
break;
case AnisotropicDiffusion::CURVATURE:
outputImage = itkProcessCurvatureAnisotropicDiffusion<InputPixelType, OutputPixelType, dim>(img);
break;
}
return outputImage;
......
......@@ -126,14 +126,14 @@ vtkSmartPointer<vtkImageData> GaussianFilter::itkProcess(vtkSmartPointer<vtkImag
vtkSmartPointer<vtkImageData> outputImage = NULL;
switch (this->getType()) {
case GaussianFilter::STANDARD:
outputImage = itkProcessStandardGaussian<InputPixelType, OutputPixelType, dim>(img);
break;
case GaussianFilter::RECURSIVE_IIR:
outputImage = itkProcessIIRGaussian<InputPixelType, OutputPixelType, dim>(img);
break;
default:
break;
case GaussianFilter::STANDARD:
outputImage = itkProcessStandardGaussian<InputPixelType, OutputPixelType, dim>(img);
break;
case GaussianFilter::RECURSIVE_IIR:
outputImage = itkProcessIIRGaussian<InputPixelType, OutputPixelType, dim>(img);
break;
default:
break;
}
return outputImage;
......
......@@ -132,56 +132,56 @@ vtkSmartPointer<vtkImageData> MorphologicalOperators::itkProcess(vtkSmartPointer
switch (this->getMorphoType()) {
case MorphologicalOperators::GREY_LEVEL:
case MorphologicalOperators::GREY_LEVEL:
switch (this->getMorphoOperation()) {
case MorphologicalOperators::EROSION:
suffix = "_eroded";
result = greyLevelErosionFilter<InputPixelType, OutputPixelType, dim>(img);
break;
case MorphologicalOperators::DILATION:
suffix = "_dilated";
result = greyLevelDilationFilter<InputPixelType, OutputPixelType, dim>(img);
break;
case MorphologicalOperators::OPENING:
suffix = "_opened";
result = greyLevelOpeningFilter<InputPixelType, OutputPixelType, dim>(img);
break;
case MorphologicalOperators::CLOSING:
suffix = "_closed";
result = greyLevelClosureFilter<InputPixelType, OutputPixelType, dim>(img);
break;
default:
break;
}
switch (this->getMorphoOperation()) {
case MorphologicalOperators::EROSION:
suffix = "_eroded";
result = greyLevelErosionFilter<InputPixelType, OutputPixelType, dim>(img);
break;
case MorphologicalOperators::DILATION:
suffix = "_dilated";
result = greyLevelDilationFilter<InputPixelType, OutputPixelType, dim>(img);
break;
case MorphologicalOperators::OPENING:
suffix = "_opened";
result = greyLevelOpeningFilter<InputPixelType, OutputPixelType, dim>(img);
break;
case MorphologicalOperators::CLOSING:
suffix = "_closed";
result = greyLevelClosureFilter<InputPixelType, OutputPixelType, dim>(img);
break;
default:
break;
}
case MorphologicalOperators::BINARY:
switch (this->getMorphoOperation()) {
case MorphologicalOperators::EROSION:
suffix = "_eroded";
result = binaryErosionFilter<InputPixelType, OutputPixelType, dim>(img);
break;
case MorphologicalOperators::DILATION:
suffix = "_dilated";
result = binaryDilationFilter<InputPixelType, OutputPixelType, dim>(img);
break;
case MorphologicalOperators::OPENING:
suffix = "_opened";
result = binaryOpeningFilter<InputPixelType, OutputPixelType, dim>(img);
break;
case MorphologicalOperators::CLOSING:
suffix = "_closed";
result = binaryClosureFilter<InputPixelType, OutputPixelType, dim>(img);
break;
default:
break;
}
break;
case MorphologicalOperators::BINARY:
switch (this->getMorphoOperation()) {
case MorphologicalOperators::EROSION:
suffix = "_eroded";
result = binaryErosionFilter<InputPixelType, OutputPixelType, dim>(img);
break;
case MorphologicalOperators::DILATION:
suffix = "_dilated";
result = binaryDilationFilter<InputPixelType, OutputPixelType, dim>(img);
break;
case MorphologicalOperators::OPENING:
suffix = "_opened";
result = binaryOpeningFilter<InputPixelType, OutputPixelType, dim>(img);
break;
case MorphologicalOperators::CLOSING:
suffix = "_closed";
result = binaryClosureFilter<InputPixelType, OutputPixelType, dim>(img);
break;
default:
break;
}
break;
default:
break;
}
return result;
......
......@@ -106,151 +106,151 @@ bool ItkImageComponentExtension::save(Component* c) const {
switch (scalarType) {
case VTK_CHAR :
if (dim == 2) {
typedef itk::Image<char, 2> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
else { // if dim == 3
typedef itk::Image<char, 3> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
break;
case VTK_UNSIGNED_CHAR :
if (dim == 2) {
typedef itk::Image<unsigned char, 2> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
else { // if dim == 3
typedef itk::Image<unsigned char, 3> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
break;
case VTK_SIGNED_CHAR :
if (dim == 2) {
typedef itk::Image<signed char, 2> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
else { // if dim == 3
typedef itk::Image<signed char, 3> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
break;
case VTK_SHORT :
if (dim == 2) {
typedef itk::Image<short, 2> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
else { // if dim == 3
typedef itk::Image<short, 3> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
break;
case VTK_UNSIGNED_SHORT :
if (dim == 2) {
typedef itk::Image<unsigned short, 2> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
else { // if dim == 3
typedef itk::Image<unsigned short, 3> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
break;
case VTK_INT :
if (dim == 2) {
typedef itk::Image<int, 2> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
else { // if dim == 3
typedef itk::Image<int, 3> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
break;
case VTK_UNSIGNED_INT :
if (dim == 2) {
typedef itk::Image<unsigned int, 2> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
else { // if dim == 3
typedef itk::Image<unsigned int, 3> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
break;
case VTK_LONG :
if (dim == 2) {
typedef itk::Image<long, 2> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
else { // if dim == 3
typedef itk::Image<long, 3> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
break;
case VTK_UNSIGNED_LONG :
if (dim == 2) {
typedef itk::Image<unsigned long, 2> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
else { // if dim == 3
typedef itk::Image<unsigned long, 3> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
break;
case VTK_FLOAT :
if (dim == 2) {
typedef itk::Image<float, 2> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
else { // if dim == 3
typedef itk::Image<float, 3> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
break;
case VTK_DOUBLE :
if (dim == 2) {
typedef itk::Image<double, 2> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
else { // if dim == 3
typedef itk::Image<double, 3> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
break;
default :
break;
case VTK_CHAR :
if (dim == 2) {
typedef itk::Image<char, 2> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
else { // if dim == 3
typedef itk::Image<char, 3> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
break;
case VTK_UNSIGNED_CHAR :
if (dim == 2) {
typedef itk::Image<unsigned char, 2> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
else { // if dim == 3
typedef itk::Image<unsigned char, 3> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
break;
case VTK_SIGNED_CHAR :
if (dim == 2) {
typedef itk::Image<signed char, 2> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
else { // if dim == 3
typedef itk::Image<signed char, 3> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
break;
case VTK_SHORT :
if (dim == 2) {
typedef itk::Image<short, 2> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
else { // if dim == 3
typedef itk::Image<short, 3> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
break;
case VTK_UNSIGNED_SHORT :
if (dim == 2) {
typedef itk::Image<unsigned short, 2> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
else { // if dim == 3
typedef itk::Image<unsigned short, 3> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
break;
case VTK_INT :
if (dim == 2) {
typedef itk::Image<int, 2> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
else { // if dim == 3
typedef itk::Image<int, 3> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
break;
case VTK_UNSIGNED_INT :
if (dim == 2) {
typedef itk::Image<unsigned int, 2> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
else { // if dim == 3
typedef itk::Image<unsigned int, 3> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
break;
case VTK_LONG :
if (dim == 2) {
typedef itk::Image<long, 2> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
else { // if dim == 3
typedef itk::Image<long, 3> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
break;
case VTK_UNSIGNED_LONG :
if (dim == 2) {
typedef itk::Image<unsigned long, 2> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
else { // if dim == 3
typedef itk::Image<unsigned long, 3> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
break;
case VTK_FLOAT :
if (dim == 2) {
typedef itk::Image<float, 2> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
else { // if dim == 3
typedef itk::Image<float, 3> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
break;
case VTK_DOUBLE :
if (dim == 2) {
typedef itk::Image<double, 2> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
else { // if dim == 3
typedef itk::Image<double, 3> ImageType;
succeed = ItkImageComponentExtension::saveImage<ImageType>(img);
}
break;
default :
break;
}
return succeed;
......
......@@ -517,14 +517,14 @@ CamiTKPropertyList* PMLExplorerWidget::createSCPropertyList ( StructuralComponen
// composed by
QString composedByValue;
switch ( sc->composedBy() ) {
case StructuralComponent::ATOMS:
composedByValue = "Atoms";
break;
case StructuralComponent::CELLS:
composedByValue = "Cells";
break;
default:
composedByValue = "Nothing !";
case StructuralComponent::ATOMS:
composedByValue = "Atoms";
break;
case StructuralComponent::CELLS:
composedByValue = "Cells";
break;
default:
composedByValue = "Nothing !";
}
camitk::Property* composedByProp = new camitk::Property ( "Composed By", composedByValue, "Nature of the structures (cells or atoms)", "" );
composedByProp->setReadOnly ( true );
......
......@@ -85,15 +85,15 @@ void genFromFile(string filename) {
}
cout << "<cellProperties type=\"";
switch (atomRefs.size()) {
case 3:
cout << "TRIANGLE";
break;
case 4:
cout << "QUAD";
break;
default:
cout << "POLY_VERTEX";
break;
case 3:
cout << "TRIANGLE";
break;
case 4:
cout << "QUAD";
break;
default:
cout << "POLY_VERTEX";
break;
}
cout << "\"/>" << endl;
for (unsigned int i = 0; i < atomRefs.size(); i++) {
......
......@@ -170,16 +170,16 @@ void facetsToSC(MultiComponent* mother) {
// create cell depending on type
type = getFacetType();
switch (type) {
case 3:
c = new Cell(NULL, StructureProperties::TRIANGLE);
break;
case 4:
c = new Cell(NULL, StructureProperties::QUAD);
break;
default:
c = NULL;
cerr << "line " << lineNr << ": error: cannot manage facet using " << type << " vertices" << endl;
break;
case 3:
c = new Cell(NULL, StructureProperties::TRIANGLE);
break;
case 4:
c = new Cell(NULL, StructureProperties::QUAD);
break;
default:
c = NULL;
cerr << "line " << lineNr << ": error: cannot manage facet using " << type << " vertices" << endl;
break;
}
if (c != NULL) {
......
......@@ -208,18 +208,18 @@ void Connection::init() {
// -------------------- debug ------------------------
void Connection::debug() {
switch (myCell->getNumberOfStructures()) {
case 2:
cout << "line <";
break;
case 3:
cout << "triangle <";
break;
case 4:
cout << "quad <";
break;
default:
cout << "unknown connection <";
break;
case 2:
cout << "line <";
break;
case 3:
cout << "triangle <";
break;
case 4:
cout << "quad <";
break;
default:
cout << "unknown connection <";
break;
}
unsigned int i;
for (i = 0; i < myCell->getNumberOfStructures(); i++) {
......@@ -356,120 +356,120 @@ StructuralComponent* refine(StructuralComponent* sc) {
// Connections have to be described in anticlockwise (trigonometrywise) when
// looking at them from outside the object
switch (c->getType()) {
case StructureProperties::TETRAHEDRON: {
// tetrahedron are defined as follow:
// 3
// /| \ So to generate the connection list,
// / | \ we just have to loop on all the
// 1..|...\ 2 tetrahedron and add the corresponding 4 facets :
// \ | / f0=0,1,2 f2=0,3,1
// \ | / f1=0,2,3 f3=2,1,3
// \|/
// 0
//insert(new Connection(c->getStructure(0), c->getStructure(1), c->getStructure(2)));
//insert(new Connection(c->getStructure(0), c->getStructure(2), c->getStructure(3)));
//insert(new Connection(c->getStructure(0), c->getStructure(3), c->getStructure(1)));
//insert(new Connection(c->getStructure(2), c->getStructure(1), c->getStructure(3)));
// subdividing facets in case of tetrahedron is not needed... (see part2 of this algo)
//
// So to generate a refined mesh, we just have to create one new atom in
// the center and 4 new tetrahedrons
//