-
-
Notifications
You must be signed in to change notification settings - Fork 663
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
STYLE: Make
PrintSelf
implementation style consistent
Make `PrintSelf`implementation style consistent following the ITK SWG coding style guideline and the available ITK macros: - Always print the superclass first. - Print only the class instance variables. - Use the `os << indent << "{ivarName}: " << m_ivarName << std::endl` recipe: do not print the leading `m_` of the ivar; use a colon after printing its name; leave a whitespace between the colon and the printed value of the ivar. - For boolean ivars print `On`/`Off` according to their values using the ternary operator. - Use `itkPrintSelfObjectMacro` to print objects inheriting from `itk::LightObject` that can be null. - For pointers that do not inherit from `itk::LightObject` check whether they are non-null before attempting to print them and print the `(empty)` string otherwise. - Rely on the self printing ability of the ITK classes to avoid boilerplate code when printing the corresponding ivars in other classes' `PrintSelf` methods. - Take advantage of the output stream `<<` insertion operator overload for `std::vector` types in the `itk::print_helper` namespace defined in `itkPrintHelper.h` to print such types consistently. - Cast custom types to their numerical values using `itk::NumericTraits::PrinType` so that they are printed as expected. - Remove statements printing the hard-coded class name and its own pointer, e.g. ``` os << indent << "ArrowSpatialObject(" << this << ")" << std::endl; ``` `PrintSelf` does this without requiring the removed line. - Save typing `this->` to point to the instance of the current class. Apply the same principles to the `<<` operator overloads. Overload the ostream operator for the `FixedImageSamplePoint` class used by the `itk::ImageToImageMetric` class. Overload the ostream operator for the `ImageVoxel` class used by the `itk::DeformableSimplexMesh3DGradientConstraintForceFilter` class.
- Loading branch information
1 parent
48025bd
commit c47ed1c
Showing
193 changed files
with
2,359 additions
and
1,446 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.