-
Notifications
You must be signed in to change notification settings - Fork 73
Module Conversion Steps
Dan White edited this page Sep 24, 2013
·
28 revisions
- Copy module C++ source file into correct path. Look under
src/Modules/Legacyto see if it is already there.
- Example:
src/Modules/Legacy/Fields/AlignMeshBoundingBoxes.ccis already checked in, so nothing to do.
- Make a copy of the file
SCIRunGUIPrototype/src/Modules/Legacy/Fields/CalculateGradients.h(TODO: general header template) and rename it using the same name as the module. It will act as a template for the newly-required module header file.
- Example: Copied
CalculateGradients.htoAlignMeshBoundingBoxes.h.
- Edit the corresponding
CMakeLists.txtfile to both (a) enable/add the module .cc file, and (b) add the newly-created module header file.
- Example:
src/Modules/Legacy/Fields/CMakeLists.txtwas edited to addAlignMeshBoundingBoxes.hto theDataflow_Modules_Legacy_Fields_HEADERSlist; and, the line containingAlignMeshBoundingBoxes.ccwas uncommented to add both files to the project.
- Under
src/Modules/X/Tests, where X is the general category of your module, add a unit test source file both to the filesystem and to the correspondingCMakeLists.txtfile.
- Example: Unit tests for the Legacy modules are separated from the Legacy directories to aid file diffing. Thus, a file
AlignMeshBoundingBoxesTests.ccwas added tosrc/Modules/Fields/Tests, and then added to the project using CMake.GetFieldBoundaryTests.ccwas copied to create the new file; it will be edited in a later step.
- At this point, the CMake project structure should be valid (although the projects won't build), and your git changeset should look like this:
- CHECKPOINT: If there is no corresponding Algorithm class for your module, there is a limit on the size of its execute() method of 5 lines. Otherwise, a separate Algorithm class is required to be extracted from the Module's implementation.