how to return objects when function uses a filter ?
Mantis Issue 400, reported by cmoisy, assigned to ghost, created: 2011-08-16
I want to use several modules, for example one to apply a ROI on an image, another one for images merging and others for image pre-processing (atmospheric correction). I would like to be able to have the function return an object, for example : ROI = extractionROI (fileName, shapefile);
the problem is that with pipelines, as objects are destroyed once the function has returned, the ROI will have a incoherent value outside the function. If we give the pointer value for the ROI region (initialized before the call to the function) extractionROI (fileName, shapefile, ROI);
we have the same problem due to pipeline
how can we manage to sort this issue ? do we have to create all objects as readers in a global way in main function ?
it there something simple I am missing ?
coding in C++ on Linux
1313489325 - C ValladeauHave you try to create one class per module? The idea is that the "main" becomes a method of the class (for example Generate), the internal filters become class attributs with classical accessors. Of course, the Generate method can provide a pointer...