[slicer-devel] Module replication error

Julien Finet julien.finet at kitware.com
Tue Jun 5 11:17:30 EDT 2012


Hi Erol,

I advice against duplicating the Transforms module, code duplication is
dangerous :-)

Modules are designed in a way that their "logic" is accessible to other
modules [1]. Maybe you just need to write your own custom panel, and use
the Transforms module logic ? See how "Crop Volume" uses the Volumes logic
[2].
Are you sure you need everything from the Transforms module? Maybe there
are few items you don't need or organized differently. If you are
interested in some widgets, maybe you should extract those widgets from the
transform module, and make them accessible for other modules (see [3] for
an example of a re-usable widget).

Please consider those alternative solutions:
 - redirect the user to use the Transforms module and come back to your
module when done
 - help us working on the "cloning" of module panels at run time (right now
qSlicerAbstractCoreModule::createWidgetRepresentation() is only call once,
but if called twice, you will have 2 panels for 1 logic (it's equivalent to
having 2 views/controllers for 1 model in the Model View Controller
paradigm) and you would be able to embed the newly created panel in your
own module). Most of the work has been done, it's just a matter of exposing
it into the API.

Hth,
Julien.
p.s. your error comes from the EXPORT macro name that needs to be changed
as well.
[1]:
http://www.slicer.org/slicerWiki/index.php/Documentation/4.1/Developers/Tutorials/ModuleWriting#Dependency_between_modules

[2]:
http://viewvc.slicer.org/viewvc.cgi/Slicer4/trunk/Modules/Loadable/CropVolume/qSlicerCropVolumeModule.cxx?view=markup

[3]:
http://viewvc.slicer.org/viewvc.cgi/Slicer4/trunk/Modules/Loadable/Data/Widgets/qMRMLNodeAttributeTableView.h?view=markup


On Tue, Jun 5, 2012 at 3:10 AM, erol yeniaras <eyeniaras at gmail.com> wrote:

> Hello all,
>
> I want to use the capabilities of the Transforms module within my module.
> To this end, I created a replica of Transforms module and named it
> as LITTPlanV2.
>
> I did this firstly by creating a new loadable module and copying the
> contents of Transforms module and pasting under new module. Then I have
> changed the names of the files and their contents. (Replaced the word
> `Transforms` with `LITTPlanV2`).
>
> Then used Cmake gui to configure and generate. In the last step, when
> building with visual studio I faced with such errors:
>
> C:/Slicer/Modules/Loadable/LITTPlanV2/qSlicerLITTPlanV2ModuleWidget.h(34)
> : error C2470: 'qSlicerLITTPlanV2ModuleWidget' : looks like a function
> definition, but there is no parameter list; skipping apparent body
>
> I have been trying to solve this problem since yesterday, but the error
> persists. Does anyone have  a suggestion please? Full module and build log
> is attached.
>
> I appreciate any form of help.
>
> Thanks,
> --
>
> Erol
>
>
> PS: If replicating modules is not appropriate then I will add those
> features on my module directly.
>
> _______________________________________________
> slicer-devel mailing list
> slicer-devel at bwh.harvard.edu
> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
> To unsubscribe: send email to
> slicer-devel-request at massmail.spl.harvard.edu with unsubscribe as the
> subject
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://massmail.spl.harvard.edu/public-archives/slicer-devel/attachments/20120605/39294281/attachment.html 


More information about the slicer-devel mailing list