diff --git a/Core/Documentation/Doxygen/Concepts/CodingGeneral.dox b/Core/Documentation/Doxygen/Concepts/CodingGeneral.dox index 13a887fda6..e52f8b38fd 100644 --- a/Core/Documentation/Doxygen/Concepts/CodingGeneral.dox +++ b/Core/Documentation/Doxygen/Concepts/CodingGeneral.dox @@ -1,17 +1,54 @@ /** -\page CodingGeneral General Coding +\page CodingPage Coding -Conceptual MITK is mainly oriented on ITK (The Insight Toolkit). Thus, most of the ITK coding concepts can be transfered to MITK. It is worth mentioning that there is a clearly written ITK Software Guide available for download on the ITK homepage. One basic concept, which MITK inherits from ITK, is the concept of smart pointers. This concepts makes memory management much easier because you don't have to call "delete" on your pointers in contrast to conventional C++. You will see these smart pointers all over MITK, an example is shown next. +\section CodingPageGeneral General Information +Conceptually MITK is mainly geared to ITK (The Insight Toolkit). +Thus, most of the ITK coding concepts can be transferred to MITK. + +The ITK coding concepts can be found in the free ITK software guide, downloadable at ITKs homepage. + +The main ITK concepts which one should look into before using MITK are: + + +\section CodingPageStyle Coding Style +MITK provides coding style guidelines. When implementing code which should be added to the project, +these guidelines should be followed in order to keep an unified coding style all over MITK. The style +is oriented on normal c++ coding style combined with some extension of used libraries, e.g. the use of +itk smart pointers. The MITK style guide is provided on the following page: \ref StyleGuideAndNotesPage. +If you are new to MITK coding style please also consider that MITK is using different pre defined macros, +which might look confusing for people who are new to MITK. An overview on these macros is given in +section \ref CodingPageMITKMacros. + +\section CodingPageMITKMacros Macros in MITK +MITK uses different macros to simplify implementation, but this macros might look confusing at first. Some +of these macros are used from ITK, others are defined in MITK itself. The most important macros are defined +in the file mitkCommon.h, but there are some other headers which also define macros, e.g. mitkTestingMacros.h +and mitkExceptionMacros.h. + +In the following the most important macros are shown for overview, more details are available in the corresponding header files. \code -mitk::Image::Pointer myImage; //declaration -myImage = mitk::Image::New(); //instantiation -myImage->GetData(); //call of a method - -//in conventional C++ the same would look like this: -//(Attention: this is NO valid code in MITK!) -mitk::Image* myImage; //declaration -myImage = new mitk::Image(); //instantiation -myImage->GetData(); //call of a method -delete myImage; //delete object, you don't need this in case of ITK smart pointers +//These macros come from ITK: + +itkNewMacro(Self); //this macro creates the constructor for smart pointers + //it calls the normal c++ constructor of the class + //the normal constructor should be declared protected + +itkGetMacro(Name,Class); //these macros create getters and setters +itkSetMacro(Name,Class); //automatically, but you need the corresponding +itkGetConstMacro(Name,Class); //member variable m_Name in your class +itkSetConstMacro(Name,Class); + +//The following macros are defined in MITK itself: + +mitkClassMacro(Class,Superclass); //macro is needed in every header of a MITK class + +mitkNewMacro1Param(Class,ParamType); //like the ITK new macro, but with one parameter + //you need a constructor with one parameter as well + //the same macro exists for 2,3 and 4 parameters + +mitkExceptionClassMacro(Class,Superclass); //special macro for MITK exception classes \endcode */ diff --git a/Core/Documentation/Doxygen/Concepts/CodingStyle.dox b/Core/Documentation/Doxygen/Concepts/CodingStyle.dox deleted file mode 100644 index 799fee7c26..0000000000 --- a/Core/Documentation/Doxygen/Concepts/CodingStyle.dox +++ /dev/null @@ -1,4 +0,0 @@ -/** -\page CodingStyle Coding Style -MITK provides coding style guidelines. When implementing code which should be added to the project, these guidelines should be followed in order to keep an unified coding style all over MITK. The style is oriented on normal c++ coding style combined with some extension of used libraries, e.g. the use of itk smart pointers. The MITK style guide is provided on the following page: \ref StyleGuideAndNotesPage. If you are new to MITK coding style please also consider that MITK is using different pre defined macros, which might look confusing for people who are new to MITK. An overview on these macros is given on page \ref MITKMacros. -*/ diff --git a/Core/Documentation/Doxygen/Concepts/Concepts.dox b/Core/Documentation/Doxygen/Concepts/Concepts.dox index 3aeda4b31e..7c80f3f2c8 100644 --- a/Core/Documentation/Doxygen/Concepts/Concepts.dox +++ b/Core/Documentation/Doxygen/Concepts/Concepts.dox @@ -1,29 +1,29 @@ /** \page Concepts MITK concepts The following items describe some issues about MITK on a more abstract level. -# \subpage OverviewPage --# Coding Concepts - -# \subpage CodingGeneral - -# \subpage CodingStyle - -# \subpage MITKMacros +-# \subpage CodingPage "Coding Concepts" + -# \ref CodingPageGeneral + -# \ref CodingPageStyle + -# \ref CodingPageMITKMacros -# \subpage MicroServices_Overview -# Data Concepts -# \subpage MitkImagePage -# \subpage DataManagementPage -# \subpage PropertiesPage -# \subpage GeometryOverviewPage -# \subpage QVTKRendering -# \subpage InteractionPage -# \subpage LoggingPage -# \subpage ExceptionPage -# Testing Concept -# \subpage GeneralTests -# \subpage RenderingTests -# \subpage ModularizationPage "Modularization Concept" - -# \subpage ModularizationPageOverview - -# \subpage ModularizationPageHowTo + -# \ref ModularizationPageOverview + -# \ref ModularizationPageHowTo If you want to start using MITK, you also want to see the chapter \ref Development. */ diff --git a/Core/Documentation/Doxygen/Concepts/MITKMacros.dox b/Core/Documentation/Doxygen/Concepts/MITKMacros.dox deleted file mode 100644 index 6b665f3ba7..0000000000 --- a/Core/Documentation/Doxygen/Concepts/MITKMacros.dox +++ /dev/null @@ -1,28 +0,0 @@ -/** -\page MITKMacros Macros in MITK -MITK uses different macros to simplify implementation, but this macros might look confusing at first. Some of these macros are used from ITK, others are defined in MITK itself. The most important macros are defined in the file mitkCommon.h, but there are some other headers which also define macros, e.g. mitkTestingMacros.h and mitkExceptionMacros.h. - -In the following the most important macros are shown for overview, more details are available in the corresponding header files. -\code -//These macros come from ITK: - -itkNewMacro(Self); //this macro creates the constructor for smart pointers - //it calls the normal c++ constructor of the class - //the normal constructor should be declared protected - -itkGetMacro(Name,Class); //these macros create getters and setters -itkSetMacro(Name,Class); //automatically, but you need the corresponding -itkGetConstMacro(Name,Class); //member variable m_Name in your class -itkSetConstMacro(Name,Class); - -//The following macros are defined in MITK itself: - -mitkClassMacro(Class,Superclass); //macro is needed in every header of a MITK class - -mitkNewMacro1Param(Class,ParamType); //like the ITK new macro, but with one parameter - //you need a constructor with one parameter as well - //the same macro exists for 2,3 and 4 parameters - -mitkExceptionClassMacro(Class,Superclass); //special macro for MITK exception classes -\endcode -*/