Breakup ImageWidget into two Objects
Closed this issue · 5 comments
ImageWidget needs to be broken up into multiple cpp files. Too large
objects should be broken up so that it contains sub objects and these sub objects contain the functionality that pertains only to those objects. (e.g. mousemoveevent should be specific to widget, not if(within roi) - e.g. overload QLabel to add mouse operations shared for all image displays which would help break up ImageWidget into smaller parts)
Potentially tie each section in worker thread to smaller workers that are created and destroyed when menus are switched? e.g. all transform operations in transformWorker? Easier to handle data back and forth between objects that need to. - see Wiki for notes.
imagewidget should have a base class that overrides QLabel for the necessary paint events (drawing ROI select and Brush) which would be MUCH faster than its current implementation. - Later break this up into individual projects.
ImageWorker is being broken up accordingly. This functionality solves several problems with the application both in performance and backend organization. ImageWidget should be broken up so that he QLabel contains all drawing and mouse tracking functionality to both speed up painting by painting directly on the widget (usually not a great practice unless justified). This can be broken up even further so that there is an intermediate QLabel that handles mouse tracking which can also be used in the QColorSelector.
Maybe the QLabels could be modular like the imageWorkers, and attached in the widget accordingly, containing the proper drawing functionality specific to the selected menu.
This should be in the second release of the application. For now get the first version done.
Maybe this can be more simply achieved through event filters! If not perhaps, streamline the function calls and paint on the pixmap before attaching it to the QLabel.
(try the event filters at least to simplify mouse operations)