diff --git a/Plugins/PluginList.cmake b/Plugins/PluginList.cmake index 72ef51dafe..1a6e6ada9d 100644 --- a/Plugins/PluginList.cmake +++ b/Plugins/PluginList.cmake @@ -1,59 +1,58 @@ # Plug-ins must be ordered according to their dependencies if (MITK_USE_Qt4) set(MITK_EXT_PLUGINS org.mitk.core.services:ON org.mitk.gui.common:ON org.mitk.planarfigure:ON org.mitk.core.ext:OFF org.mitk.core.jobs:OFF org.mitk.diffusionimaging:OFF org.mitk.simulation:OFF org.mitk.gui.qt.application:ON org.mitk.gui.qt.coreapplication:OFF org.mitk.gui.qt.ext:OFF org.mitk.gui.qt.extapplication:OFF org.mitk.gui.qt.common:ON org.mitk.gui.qt.stdmultiwidgeteditor:ON org.mitk.gui.qt.common.legacy:OFF org.mitk.gui.qt.cmdlinemodules:OFF org.mitk.gui.qt.diffusionimagingapp:OFF org.mitk.gui.qt.datamanager:ON org.mitk.gui.qt.datamanagerlight:OFF org.mitk.gui.qt.properties:ON org.mitk.gui.qt.basicimageprocessing:OFF org.mitk.gui.qt.dicom:OFF org.mitk.gui.qt.diffusionimaging:OFF org.mitk.gui.qt.dtiatlasapp:OFF org.mitk.gui.qt.igtexamples:OFF org.mitk.gui.qt.igttracking:OFF org.mitk.gui.qt.imagecropper:OFF org.mitk.gui.qt.imagenavigator:ON org.mitk.gui.qt.viewnavigator:OFF org.mitk.gui.qt.materialeditor:OFF org.mitk.gui.qt.measurementtoolbox:OFF org.mitk.gui.qt.moviemaker:OFF - org.mitk.gui.qt.moviemaker2:OFF org.mitk.gui.qt.pointsetinteraction:OFF org.mitk.gui.qt.python:OFF org.mitk.gui.qt.registration:OFF org.mitk.gui.qt.remeshing:OFF org.mitk.gui.qt.segmentation:OFF org.mitk.gui.qt.simulation:OFF org.mitk.gui.qt.toftutorial:OFF org.mitk.gui.qt.tofutil:OFF org.mitk.gui.qt.ugvisualization:OFF org.mitk.gui.qt.ultrasound:OFF org.mitk.gui.qt.volumevisualization:OFF org.mitk.gui.qt.eventrecorder:OFF org.mitk.gui.qt.xnat:OFF ) else() set(MITK_EXT_PLUGINS # empty so far ) endif() diff --git a/Plugins/org.mitk.gui.qt.moviemaker/documentation/UserManual/QmitkMovieMaker.dox b/Plugins/org.mitk.gui.qt.moviemaker/documentation/UserManual/QmitkMovieMaker.dox deleted file mode 100644 index 878627bddb..0000000000 --- a/Plugins/org.mitk.gui.qt.moviemaker/documentation/UserManual/QmitkMovieMaker.dox +++ /dev/null @@ -1,44 +0,0 @@ -/** - -\page org_mitk_views_moviemaker The Movie Maker View - -\imageMacro{QmitkMovieMaker_Icon.png,"Icon of the Movie Maker View",2.00} - -Available sections: - - \ref QmitkMovieMakerUserManualOverview - - \ref QmitkMovieMakerUserManualFeatures - - \ref QmitkMovieMakerUserManualUsage - -\section QmitkMovieMakerUserManualOverview Overview - -MovieMaker is a functionality for easily creating fancy movies from scenes displayed in MITK widgets. -It is also possible to slide through your data, automatically rotate 3D scenes and take screenshots of widgets. - -\section QmitkMovieMakerUserManualFeatures Features - - The Movie Maker allows you to create movies and screenshots from within MITK. It can automatically scroll thorugh timesteps and slices while recording a movie. This way, you can record visualizations like a beating heart or a rotating skull. - -\section QmitkMovieMakerUserManualUsage Usage - -\imageMacro{QmitkMovieMaker_ControlArea.png,"A view of the command area of QmitkMovieMaker",9.84} - -\subsection QmitkMovieMakerUserManualWindowSelection Window selection -With the first two drop down boxes, you can choose which window you want to step through and which window you want to record in. Left clicking inside a window will set both drop down boxes to that window, but you can choose different windows for stepping and recording. - -The first drop down box defines the window along which slices will be stepped through if stepping is set to spatial (see below). The second denotes the window from which the content will be recorded. - -\subsection QmitkMovieMakerUserManualRecordingOptions Recording Options - -The slider can be used to step through the slices manually while not recording. Start and stop control a preview of what a video would look like. - -The buttons in the bottom part of this section can be used to create movies (windows only) or screenshots. Clicking opens a file %dialog where a name can be selected. After confirmation, a screenshot or movie is created according to the playing options. - -\subsection QmitkMovieMakerUserManualPlayingOptions Playing Options - -The first section controls whether the movie steps through slices (if a 2D view is selected), rotate the shown scene (if a 3D view is selected), or step through time steps (if set to temporal and a time resolved dataset is selected). If set to combined, a combination of both above options is used, with their speed relation set via the S/T Relation Spinbox. - -In the second section the direction of stepping can be set. Options are: Forward, backward and Ping-Pong, which is back-and-forth.The stepping speed can be set via the spinbox(total time in seconds). - -Although stepping speed is a total time in sec., this can not always be achieved. As a minimal frame rate of 25 fps is assumed to provide smooth movies, a dataset with only 25 slices will always be stepped through in 1 sec or faster. - -*/ diff --git a/Plugins/org.mitk.gui.qt.moviemaker/documentation/UserManual/QmitkMovieMaker_ControlArea.png b/Plugins/org.mitk.gui.qt.moviemaker/documentation/UserManual/QmitkMovieMaker_ControlArea.png deleted file mode 100644 index ec8c0b8dca..0000000000 Binary files a/Plugins/org.mitk.gui.qt.moviemaker/documentation/UserManual/QmitkMovieMaker_ControlArea.png and /dev/null differ diff --git a/Plugins/org.mitk.gui.qt.moviemaker/documentation/UserManual/QmitkMovieMaker_Icon.png b/Plugins/org.mitk.gui.qt.moviemaker/documentation/UserManual/QmitkMovieMaker_Icon.png deleted file mode 100644 index 92c8276a2a..0000000000 Binary files a/Plugins/org.mitk.gui.qt.moviemaker/documentation/UserManual/QmitkMovieMaker_Icon.png and /dev/null differ diff --git a/Plugins/org.mitk.gui.qt.moviemaker/documentation/UserManual/QmitkMovieMaker_ScreenshotMakerInterface.png b/Plugins/org.mitk.gui.qt.moviemaker/documentation/UserManual/QmitkMovieMaker_ScreenshotMakerInterface.png deleted file mode 100644 index 085dcbdea6..0000000000 Binary files a/Plugins/org.mitk.gui.qt.moviemaker/documentation/UserManual/QmitkMovieMaker_ScreenshotMakerInterface.png and /dev/null differ diff --git a/Plugins/org.mitk.gui.qt.moviemaker/documentation/UserManual/QmitkScreenshotMaker.dox b/Plugins/org.mitk.gui.qt.moviemaker/documentation/UserManual/QmitkScreenshotMaker.dox deleted file mode 100644 index 05b657bdeb..0000000000 --- a/Plugins/org.mitk.gui.qt.moviemaker/documentation/UserManual/QmitkScreenshotMaker.dox +++ /dev/null @@ -1,19 +0,0 @@ -/** -\page org_mitk_views_screenshotmaker The Screenshot Maker - -This view provides the functionality to create and save screenshots of the data. - -Available sections: - - \ref QmitkScreenshotMakerUserManualUse - -\imageMacro{QmitkMovieMaker_ScreenshotMakerInterface.png,"The Screenshot Maker User Interface",7.09} - -\section QmitkScreenshotMakerUserManualUse Usage - -The first section offers the option of creating a screenshot of the last activated render window (thus the one, which was last clicked into). Upon clicking the button, the Screenshot Maker asks for a filename in which the screenshot is to be stored. The multiplanar Screenshot button asks for a folder, where screenshots of the three 2D views will be stored with default names. - -The high resolution screenshot section works the same as the simple screenshot section, aside from the fact, that the user can choose a magnification factor. - -In the option section one can rotate the camera in the 3D view by using the buttons. Furthermore one can choose the background colour for the screenshots, default is black. - -*/ diff --git a/Plugins/org.mitk.gui.qt.moviemaker/documentation/doxygen/modules.dox b/Plugins/org.mitk.gui.qt.moviemaker/documentation/doxygen/modules.dox deleted file mode 100644 index 07f1421b2a..0000000000 --- a/Plugins/org.mitk.gui.qt.moviemaker/documentation/doxygen/modules.dox +++ /dev/null @@ -1,16 +0,0 @@ -/** - \defgroup org_mitk_gui_qt_moviemaker org.mitk.gui.qt.moviemaker - \ingroup MITKPlugins - - \brief Describe your plugin here. - -*/ - -/** - \defgroup org_mitk_gui_qt_moviemaker_internal Internal - \ingroup org_mitk_gui_qt_moviemaker - - \brief This subcategory includes the internal classes of the org.mitk.gui.qt.moviemaker plugin. Other - plugins must not rely on these classes. They contain implementation details and their interface - may change at any time. We mean it. -*/ diff --git a/Plugins/org.mitk.gui.qt.moviemaker/files.cmake b/Plugins/org.mitk.gui.qt.moviemaker/files.cmake index c4e28db992..11d7677e23 100644 --- a/Plugins/org.mitk.gui.qt.moviemaker/files.cmake +++ b/Plugins/org.mitk.gui.qt.moviemaker/files.cmake @@ -1,46 +1,53 @@ set(SRC_CPP_FILES - ) set(INTERNAL_CPP_FILES - QmitkMovieMaker.cpp + QmitkAnimationItem.cpp + QmitkAnimationItemDelegate.cpp + QmitkAnimationWidget.cpp + QmitkFFmpegWriter.cpp + QmitkMovieMakerView.cpp + QmitkOrbitAnimationItem.cpp + QmitkOrbitAnimationWidget.cpp + QmitkSliceAnimationItem.cpp + QmitkSliceAnimationWidget.cpp mitkMovieMakerPluginActivator.cpp QmitkScreenshotMaker.cpp - ) set(UI_FILES - src/internal/QmitkMovieMakerControls.ui + src/internal/QmitkMovieMakerView.ui + src/internal/QmitkOrbitAnimationWidget.ui + src/internal/QmitkSliceAnimationWidget.ui src/internal/QmitkScreenshotMakerControls.ui ) set(MOC_H_FILES src/internal/mitkMovieMakerPluginActivator.h - src/internal/QmitkMovieMaker.h + src/internal/QmitkAnimationItemDelegate.h + src/internal/QmitkAnimationWidget.h + src/internal/QmitkFFmpegWriter.h + src/internal/QmitkMovieMakerView.h + src/internal/QmitkOrbitAnimationWidget.h + src/internal/QmitkSliceAnimationWidget.h src/internal/QmitkScreenshotMaker.h ) set(CACHED_RESOURCE_FILES - resources/icon.xpm - plugin.xml - resources/play.xpm - resources/stop.xpm - resources/pause.xpm + resources/camera-video.png resources/screenshot_maker.png + plugin.xml ) -set(RES_FILES +set(QRC_FILES resources/QmitkMovieMaker.qrc - resources/play.xpm - resources/stop.xpm - resources/pause.xpm ) foreach(file ${SRC_CPP_FILES}) set(CPP_FILES ${CPP_FILES} src/${file}) endforeach(file ${SRC_CPP_FILES}) foreach(file ${INTERNAL_CPP_FILES}) set(CPP_FILES ${CPP_FILES} src/internal/${file}) endforeach(file ${INTERNAL_CPP_FILES}) diff --git a/Plugins/org.mitk.gui.qt.moviemaker/manifest_headers.cmake b/Plugins/org.mitk.gui.qt.moviemaker/manifest_headers.cmake index 33c96b326e..0273e2802e 100644 --- a/Plugins/org.mitk.gui.qt.moviemaker/manifest_headers.cmake +++ b/Plugins/org.mitk.gui.qt.moviemaker/manifest_headers.cmake @@ -1,5 +1,5 @@ set(Plugin-Name "MITK Movie Maker") set(Plugin-Version "0.9") set(Plugin-Vendor "DKFZ, Medical and Biological Informatics") set(Plugin-ContactAddress "http://www.mitk.org") -set(Require-Plugin org.mitk.gui.qt.common.legacy) \ No newline at end of file +set(Require-Plugin org.mitk.gui.qt.common org.mitk.gui.qt.common.legacy org.mitk.gui.qt.ext) \ No newline at end of file diff --git a/Plugins/org.mitk.gui.qt.moviemaker/plugin.xml b/Plugins/org.mitk.gui.qt.moviemaker/plugin.xml index 32c792be7d..d3fe235aa5 100644 --- a/Plugins/org.mitk.gui.qt.moviemaker/plugin.xml +++ b/Plugins/org.mitk.gui.qt.moviemaker/plugin.xml @@ -1,35 +1,35 @@ + class="QmitkMovieMakerView" + icon="resources/camera-video.png" > Take movies of your data Take screenshots of your data diff --git a/Plugins/org.mitk.gui.qt.moviemaker/resources/QmitkMovieMaker.qrc b/Plugins/org.mitk.gui.qt.moviemaker/resources/QmitkMovieMaker.qrc index 8bdb515e34..61ad433b67 100644 --- a/Plugins/org.mitk.gui.qt.moviemaker/resources/QmitkMovieMaker.qrc +++ b/Plugins/org.mitk.gui.qt.moviemaker/resources/QmitkMovieMaker.qrc @@ -1,10 +1,6 @@ - QmitkMovieMakerClasses.png - QmitkMovieMakerGUI.png - icon.xpm - pause.xpm - play.xpm - stop.xpm + delay.svg + duration.svg diff --git a/Plugins/org.mitk.gui.qt.moviemaker/resources/QmitkMovieMakerClasses.png b/Plugins/org.mitk.gui.qt.moviemaker/resources/QmitkMovieMakerClasses.png deleted file mode 100644 index 9c26381a09..0000000000 Binary files a/Plugins/org.mitk.gui.qt.moviemaker/resources/QmitkMovieMakerClasses.png and /dev/null differ diff --git a/Plugins/org.mitk.gui.qt.moviemaker/resources/QmitkMovieMakerGUI.png b/Plugins/org.mitk.gui.qt.moviemaker/resources/QmitkMovieMakerGUI.png deleted file mode 100644 index 02af724a9e..0000000000 Binary files a/Plugins/org.mitk.gui.qt.moviemaker/resources/QmitkMovieMakerGUI.png and /dev/null differ diff --git a/Plugins/org.mitk.gui.qt.moviemaker2/resources/camera-video.png b/Plugins/org.mitk.gui.qt.moviemaker/resources/camera-video.png similarity index 100% rename from Plugins/org.mitk.gui.qt.moviemaker2/resources/camera-video.png rename to Plugins/org.mitk.gui.qt.moviemaker/resources/camera-video.png diff --git a/Plugins/org.mitk.gui.qt.moviemaker2/resources/delay.svg b/Plugins/org.mitk.gui.qt.moviemaker/resources/delay.svg similarity index 100% rename from Plugins/org.mitk.gui.qt.moviemaker2/resources/delay.svg rename to Plugins/org.mitk.gui.qt.moviemaker/resources/delay.svg diff --git a/Plugins/org.mitk.gui.qt.moviemaker2/resources/duration.svg b/Plugins/org.mitk.gui.qt.moviemaker/resources/duration.svg similarity index 100% rename from Plugins/org.mitk.gui.qt.moviemaker2/resources/duration.svg rename to Plugins/org.mitk.gui.qt.moviemaker/resources/duration.svg diff --git a/Plugins/org.mitk.gui.qt.moviemaker/resources/icon.png b/Plugins/org.mitk.gui.qt.moviemaker/resources/icon.png deleted file mode 100644 index 6ad519ea65..0000000000 Binary files a/Plugins/org.mitk.gui.qt.moviemaker/resources/icon.png and /dev/null differ diff --git a/Plugins/org.mitk.gui.qt.moviemaker/resources/icon.xpm b/Plugins/org.mitk.gui.qt.moviemaker/resources/icon.xpm deleted file mode 100644 index 103ebf4b01..0000000000 --- a/Plugins/org.mitk.gui.qt.moviemaker/resources/icon.xpm +++ /dev/null @@ -1,47 +0,0 @@ -/* XPM */ -static const char * icon_xpm[] = { -"28 28 16 1", -" c None", -". c #000000", -"+ c #555555", -"@ c #222222", -"# c #777777", -"$ c #444444", -"% c #BBBBBB", -"& c #DDDDDD", -"* c #AAAAAA", -"= c #FFFFFF", -"- c #888888", -"; c #993366", -"> c #CC6666", -", c #663300", -"' c #440000", -") c #FFFF00", -" ... ", -" ..+@@. ", -" ..++@+@.. ", -" ..+++##@@.. ", -" ..+++##@@@@.. ", -" ..+++##@@@$$.. ", -" ..#++##@@@$...$ ", -" ..##++#@@@%&&.$ ", -" ...*@@+#@@%&&==&. ", -" ...*++++@@%&&==&&@@. ", -" ..$$==+#-%&&==&&@@$$@. ", -" .+##..=-&&==&&@@@$$+@. ", -" .##---*.=%=&&@@@@$$++@. ", -" .===%**%%$=*@@@@@$$+++@. ", -".=-@+=&%&&.&-@@@@$$++++@. ", -".&.;.+=&%%.%#@@@$$+++++@. ", -".&.>,.=&**.*+@$$====++@. ", -".&.,,.&&--.*+=$$&&&&====... ", -".&+.'.&%##.-=&$+%%%%&&&&===.", -".&%+.*&*++$=&$======%%%%&&&.", -" .&&&&&-++&**$&&&+++%===%%%.", -" .&==&*+++&*--.%%@))++++===.", -" .&**&*+++&-+@@@*+@@)))@&&&.", -" .@&&&*+++@@@@..----@@@+%%%.", -" .+@@$*+@@@@.. .....----***.", -" .+++$@@@.. ....---.", -" ..@+$@.. ... ", -" .... "}; diff --git a/Plugins/org.mitk.gui.qt.moviemaker/resources/pause.xpm b/Plugins/org.mitk.gui.qt.moviemaker/resources/pause.xpm deleted file mode 100644 index 0ad2e7421c..0000000000 --- a/Plugins/org.mitk.gui.qt.moviemaker/resources/pause.xpm +++ /dev/null @@ -1,57 +0,0 @@ -/* XPM */ -static const char * pause_xpm[] = { -"24 24 30 1", -" c None", -". c #000000", -"+ c #FFFFFF", -"@ c #737372", -"# c #848483", -"$ c #888887", -"% c #7E7E7D", -"& c #A8A7A6", -"* c #A4A4A3", -"= c #A6A5A4", -"- c #B5B4B3", -"; c #858483", -"> c #AAA9A7", -", c #C0BFBE", -"' c #91908E", -") c #AFAEAC", -"! c #CACAC8", -"~ c #A6A5A2", -"{ c #BBBAB7", -"] c #D4D3D2", -"^ c #AEADA9", -"/ c #BFBDBA", -"( c #D7D5D3", -"_ c #B2B0AD", -": c #C3C1BE", -"< c #D9D8D6", -"[ c #B5B3B0", -"} c #D1CFCC", -"| c #DEDDDB", -"1 c #F3F3F3", -" ", -" ", -" ", -" ", -" ", -" .....+.....+ ", -" .@#$.+.@#$.+ ", -" .%&*.+.%&*.+ ", -" .%=-.+.%=-.+ ", -" .;>,.+.;>,.+ ", -" .')!.+.')!.+ ", -" .')!.+.')!.+ ", -" .')!.+.')!.+ ", -" .~{].+.~{].+ ", -" .~{].+.~{].+ ", -" .^/(.+.^/(.+ ", -" ._:<.+._:<.+ ", -" .[}|.+.[}|.+ ", -" .....+.....+ ", -" +++++1++++++ ", -" ", -" ", -" ", -" "}; diff --git a/Plugins/org.mitk.gui.qt.moviemaker/resources/play.xpm b/Plugins/org.mitk.gui.qt.moviemaker/resources/play.xpm deleted file mode 100644 index 0bcda4f454..0000000000 --- a/Plugins/org.mitk.gui.qt.moviemaker/resources/play.xpm +++ /dev/null @@ -1,64 +0,0 @@ -/* XPM */ -static const char * play_xpm[] = { -"24 24 37 1", -" c None", -". c #000000", -"+ c #727170", -"@ c #7B7B7A", -"# c #6C6B6A", -"$ c #7F7E7D", -"% c #999996", -"& c #7D7C7B", -"* c #828180", -"= c #9D9C9A", -"- c #B0AFAC", -"; c #908F8D", -"> c #868583", -", c #A1A09E", -"' c #B4B3B1", -") c #B6B4B2", -"! c #A5A4A1", -"~ c #898886", -"{ c #B9B7B4", -"] c #BAB9B6", -"^ c #BCBAB7", -"/ c #C3C2BF", -"( c #FFFFFF", -"_ c #8C8B89", -": c #A9A8A5", -"< c #BDBCB9", -"[ c #C5C3C0", -"} c #D0CECC", -"| c #8F8E8C", -"1 c #B5B3B1", -"2 c #C7C6C3", -"3 c #D2D1CE", -"4 c #B9B6B4", -"5 c #D8D7D5", -"6 c #A19F9D", -"7 c #C7C6C4", -"8 c #A7A6A3", -" ", -" ", -" ", -" ", -" . ", -" .. ", -" .+. ", -" .@#. ", -" .$%&. ", -" .*=-;. ", -" .>,')!. ", -" .~!{]^/.( ", -" ._:<[}.( ", -" .|123.( ", -" .=45.( ", -" .67.( ", -" .8.( ", -" ..( ", -" .( ", -" ( ", -" ", -" ", -" ", -" "}; diff --git a/Plugins/org.mitk.gui.qt.moviemaker/resources/stop.xpm b/Plugins/org.mitk.gui.qt.moviemaker/resources/stop.xpm deleted file mode 100644 index 3b76b26157..0000000000 --- a/Plugins/org.mitk.gui.qt.moviemaker/resources/stop.xpm +++ /dev/null @@ -1,56 +0,0 @@ -/* XPM */ -static const char * stop_xpm[] = { -"24 24 29 1", -" c None", -". c #000000", -"+ c #FFFFFF", -"@ c #737372", -"# c #848483", -"$ c #888887", -"% c #7E7E7D", -"& c #A8A7A6", -"* c #A4A4A3", -"= c #A6A5A4", -"- c #B5B4B3", -"; c #858483", -"> c #AAA9A7", -", c #C0BFBE", -"' c #91908E", -") c #AFAEAC", -"! c #CACAC8", -"~ c #A6A5A2", -"{ c #BBBAB7", -"] c #D4D3D2", -"^ c #AEADA9", -"/ c #BFBDBA", -"( c #D7D5D3", -"_ c #B2B0AD", -": c #C3C1BE", -"< c #D9D8D6", -"[ c #B5B3B0", -"} c #D1CFCC", -"| c #DEDDDB", -" ", -" ", -" ", -" ", -" ", -" .............+ ", -" .@#$$$$$$$$$.+ ", -" .%&*********.+ ", -" .%=---------.+ ", -" .;>,,,,,,,,,.+ ", -" .')!!!!!!!!!.+ ", -" .')!!!!!!!!!.+ ", -" .~{]]]]]]]]].+ ", -" .~{]]]]]]]]].+ ", -" .^/(((((((((.+ ", -" ._:<<<<<<<<<.+ ", -" .[}|||||||||.+ ", -" .............+ ", -" ++++++++++++++ ", -" ", -" ", -" ", -" ", -" "}; diff --git a/Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkAnimationItem.cpp b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkAnimationItem.cpp similarity index 100% rename from Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkAnimationItem.cpp rename to Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkAnimationItem.cpp diff --git a/Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkAnimationItem.h b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkAnimationItem.h similarity index 100% rename from Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkAnimationItem.h rename to Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkAnimationItem.h diff --git a/Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkAnimationItemDelegate.cpp b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkAnimationItemDelegate.cpp similarity index 100% rename from Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkAnimationItemDelegate.cpp rename to Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkAnimationItemDelegate.cpp diff --git a/Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkAnimationItemDelegate.h b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkAnimationItemDelegate.h similarity index 100% rename from Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkAnimationItemDelegate.h rename to Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkAnimationItemDelegate.h diff --git a/Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkAnimationWidget.cpp b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkAnimationWidget.cpp similarity index 100% rename from Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkAnimationWidget.cpp rename to Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkAnimationWidget.cpp diff --git a/Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkAnimationWidget.h b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkAnimationWidget.h similarity index 100% rename from Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkAnimationWidget.h rename to Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkAnimationWidget.h diff --git a/Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkFFmpegWriter.cpp b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkFFmpegWriter.cpp similarity index 100% rename from Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkFFmpegWriter.cpp rename to Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkFFmpegWriter.cpp diff --git a/Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkFFmpegWriter.h b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkFFmpegWriter.h similarity index 100% rename from Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkFFmpegWriter.h rename to Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkFFmpegWriter.h diff --git a/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkMovieMaker.cpp b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkMovieMaker.cpp deleted file mode 100644 index 0d78c15e3c..0000000000 --- a/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkMovieMaker.cpp +++ /dev/null @@ -1,769 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - - -#include "QmitkMovieMaker.h" -//#include "QmitkMovieMakerControls.h" -#include "QmitkStepperAdapter.h" -#include "QmitkStdMultiWidget.h" -#include "QmitkMovieMaker.h" -//#include "QmitkMovieMakerControls.h" -#include "QmitkStepperAdapter.h" -#include "QmitkStdMultiWidget.h" - -#include "mitkVtkPropRenderer.h" -#include "mitkGlobalInteraction.h" - -#include - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "qapplication.h" - -#include "vtkImageWriter.h" -#include "vtkJPEGWriter.h" -#include "vtkPNGWriter.h" -#include "vtkRenderLargeImage.h" -#include "vtkRenderWindowInteractor.h" -#include "vtkRenderer.h" -#include "vtkTestUtilities.h" - -#include -#include "vtkMitkRenderProp.h" - -#include -#include -#include "vtkRenderWindowInteractor.h" -#include - -QmitkMovieMaker::QmitkMovieMaker(QObject *parent, const char * /*name*/) - -: - QmitkFunctionality(), m_Controls(NULL), - m_StepperAdapter(NULL), - m_FocusManagerCallback(0), m_Looping(true), m_Direction(0), m_Aspect(0) -{ - - parentWidget = parent; - - m_Timer = new QTimer(this); - m_Time = new QTime(); - - m_FocusManagerCallback = MemberCommand::New(); - m_FocusManagerCallback->SetCallbackFunction(this, &QmitkMovieMaker::FocusChange); - - m_movieGenerator = mitk::MovieGenerator::New(); - - if (m_movieGenerator.IsNull()) - { - MITK_ERROR << "Either mitk::MovieGenerator is not implemented for your"; - MITK_ERROR << " platform or an error occurred during"; - MITK_ERROR << " mitk::MovieGenerator::New()" ; - } - -} - -QmitkMovieMaker::~QmitkMovieMaker() -{ - delete m_StepperAdapter; - delete m_Timer; - delete m_Time; - //delete m_RecordingRenderer; - -} - -mitk::BaseController* QmitkMovieMaker::GetSpatialController() -{ - mitk::BaseRenderer* focusedRenderer = mitk::GlobalInteraction::GetInstance()->GetFocus(); - - if (mitk::BaseRenderer::GetInstance(GetActiveStdMultiWidget()->mitkWidget1->GetRenderWindow()) - == focusedRenderer) - { - return GetActiveStdMultiWidget()->mitkWidget1->GetController(); - } - else if (mitk::BaseRenderer::GetInstance( - GetActiveStdMultiWidget()->mitkWidget2->GetRenderWindow()) == focusedRenderer) - { - return GetActiveStdMultiWidget()->mitkWidget2->GetController(); - } - else if (mitk::BaseRenderer::GetInstance( - GetActiveStdMultiWidget()->mitkWidget3->GetRenderWindow()) == focusedRenderer) - { - return GetActiveStdMultiWidget()->mitkWidget3->GetController(); - } - else if (mitk::BaseRenderer::GetInstance( - GetActiveStdMultiWidget()->mitkWidget4->GetRenderWindow()) == focusedRenderer) - { - return GetActiveStdMultiWidget()->mitkWidget4->GetController(); - } - - return GetActiveStdMultiWidget()->mitkWidget4->GetController(); -} - -mitk::BaseController* QmitkMovieMaker::GetTemporalController() -{ - return GetActiveStdMultiWidget()->GetTimeNavigationController(); -} - -void QmitkMovieMaker::CreateConnections() -{ - if (m_Controls) - { - // start / pause / stop playing - connect((QObject*) m_Controls->btnPlay, SIGNAL(clicked()), (QObject*) this, - SLOT(StartPlaying())); - connect((QObject*) m_Controls->btnPause, SIGNAL(clicked()), this, SLOT(PausePlaying())); - connect((QObject*) m_Controls->btnStop, SIGNAL(clicked()), this, SLOT(StopPlaying())); - - connect((QObject*) m_Controls->rbtnForward, SIGNAL(clicked()), this, SLOT(RBTNForward())); - connect((QObject*) m_Controls->rbtnBackward, SIGNAL(clicked()), this, SLOT(RBTNBackward())); - connect((QObject*) m_Controls->rbtnPingPong, SIGNAL(clicked()), this, SLOT(RBTNPingPong())); - - // radio button group: forward, backward, ping-pong - connect( this, SIGNAL(SwitchDirection(int)), this, SLOT(SetDirection(int)) ); - - // radio button group: spatial, temporal - connect((QObject*) m_Controls->rbtnSpatial, SIGNAL(clicked()), this, SLOT(RBTNSpatial())); - connect((QObject*) m_Controls->rbtnTemporal, SIGNAL(clicked()), this, SLOT(RBTNTemporal())); - connect((QObject*) m_Controls->rbtnCombined, SIGNAL(clicked()), this, SLOT(RBTNCombined())); - connect( this, SIGNAL(SwitchAspect(int)), this, SLOT(SetAspect(int)) ); - - // stepper window selection - connect((QObject*) (m_Controls->cmbSelectedStepperWindow), SIGNAL ( activated ( int) ), (QObject*) this, SLOT ( SetStepperWindow (int) ) ); - - // recording window selection - connect((QObject*) (m_Controls->cmbSelectedRecordingWindow), SIGNAL ( activated ( int) ), (QObject*) this, SLOT ( SetRecordingWindow (int) ) ); - - // advance the animation - // every timer tick - connect((QObject*) m_Timer, SIGNAL(timeout()), this, SLOT(AdvanceAnimation())); - - // movie generation - // when the movie button is clicked - connect((QObject*) m_Controls->btnMovie, SIGNAL(clicked()), this, SLOT(GenerateMovie())); - - connect((QObject*) m_Controls->btnScreenshot, SIGNAL(clicked()), this, SLOT( - GenerateScreenshot())); - connect((QObject*) m_Controls->m_HRScreenshot, SIGNAL(clicked()), this, SLOT( - GenerateHR3DScreenshot())); - - // blocking of ui elements during movie generation - connect((QObject*) this, SIGNAL(StartBlockControls()), (QObject*) this, SLOT(BlockControls())); - - connect((QObject*) this, SIGNAL(EndBlockControls()), (QObject*) this, SLOT(UnBlockControls())); - - connect((QObject*) this, SIGNAL(EndBlockControlsMovieDeactive()), (QObject*) this, SLOT( - UnBlockControlsMovieDeactive())); - - // allow for change of spatialtime relation - connect((QObject*) m_Controls->spatialTimeRelation, SIGNAL(valueChanged ( int ) ), this, SLOT( DeleteMStepper() ) ); - - - m_Controls->btnScreenshot->setVisible(false); - m_Controls->m_HRScreenshot->setVisible(false); - } -} - -void QmitkMovieMaker::Activated() -{ - QmitkFunctionality::Activated(); - - // create a member command that will be executed from the observer - itk::SimpleMemberCommand::Pointer stepperChangedCommand; - stepperChangedCommand = itk::SimpleMemberCommand::New(); - // set the callback function of the member command - stepperChangedCommand->SetCallbackFunction(this, &QmitkMovieMaker::UpdateGUI); - // add an observer to the data tree node pointer connected to the above member command - MITK_INFO << "Add observer on insertion point node in NavigationPathController::AddObservers"; - m_StepperObserverTag = this->GetTemporalController()->GetTime()->AddObserver( - itk::ModifiedEvent(), stepperChangedCommand); - - m_FocusManagerObserverTag - = mitk::GlobalInteraction::GetInstance()->GetFocusManager()->AddObserver(mitk::FocusEvent(), - m_FocusManagerCallback); - this->UpdateGUI(); - // Initialize steppers etc. - this->FocusChange(); -} - -void QmitkMovieMaker::Deactivated() -{ - QmitkFunctionality::Deactivated(); - this->GetTemporalController()->GetTime()->RemoveObserver(m_StepperObserverTag); - mitk::GlobalInteraction::GetInstance()->GetFocusManager()->RemoveObserver( - m_FocusManagerObserverTag); // remove (if tag is invalid, nothing is removed) -} - -void QmitkMovieMaker::FocusChange() -{ - mitk::Stepper *stepper = this->GetAspectStepper(); - m_StepperAdapter->SetStepper(stepper); - - // Make the stepper movement non-inverted - stepper->InverseDirectionOff(); - - // Set stepping direction and aspect (spatial / temporal) for new stepper - this->UpdateLooping(); - this->UpdateDirection(); - - // Set newly focused window as active in "Selected Window" combo box - const mitk::RenderingManager::RenderWindowVector rwv = - mitk::RenderingManager::GetInstance()->GetAllRegisteredRenderWindows(); - - int i; - mitk::RenderingManager::RenderWindowVector::const_iterator iter; - for (iter = rwv.begin(), i = 0; iter != rwv.end(); ++iter, ++i) - { - mitk::BaseRenderer* focusedRenderer = - mitk::GlobalInteraction::GetInstance()->GetFocusManager()->GetFocused(); - - if (focusedRenderer == mitk::BaseRenderer::GetInstance((*iter))) - { - m_Controls->cmbSelectedStepperWindow->setCurrentIndex(i); - // this->cmbSelectedStepperWindow_activated(i); - this->SetStepperWindow(i); - m_Controls->cmbSelectedRecordingWindow->setCurrentIndex(i); - // this->cmbSelectedRecordWindow_activated(i); - this->SetRecordingWindow(i); - break; - } - } -} - -void QmitkMovieMaker::AdvanceAnimation() -{ - // This method is called when a timer timeout occurs. It increases the - // stepper value according to the elapsed time and the stepper interval. - // Note that a screen refresh is not forced, but merely requested, and may - // occur only after more calls to AdvanceAnimation(). - - mitk::Stepper* stepper = this->GetAspectStepper(); - - m_StepperAdapter->SetStepper(stepper); - - int elapsedTime = m_Time->elapsed(); - m_Time->restart(); - - static double increment = 0.0; - increment = increment - static_cast (increment); - increment += elapsedTime * stepper->GetSteps() / (m_Controls->spnDuration->value() * 1000.0); - - int i, n = static_cast (increment); - for (i = 0; i < n; ++i) - { - stepper->Next(); - } -} - -void QmitkMovieMaker::RenderSlot() -{ - int *i = widget->GetRenderWindow()->GetSize(); - m_PropRenderer->Resize(i[0], i[1]); - - widget->GetRenderWindow()->Render(); -} - -void QmitkMovieMaker::PausePlaying() -{ - - m_Controls->slidAngle->setDisabled(false); - m_Controls->btnMovie->setEnabled(true); - m_Controls->btnPlay->setEnabled(true); - m_Controls->btnScreenshot->setEnabled(true); - - m_Timer->stop(); - - m_Controls->btnPlay->setHidden(false); - m_Controls->btnPause->setHidden(true); - if (m_movieGenerator.IsNull()) - m_Controls->btnMovie->setEnabled(false); -} - -void QmitkMovieMaker::StopPlaying() -{ - m_Controls->slidAngle->setDisabled(false); - m_Controls->btnMovie->setEnabled(true); - m_Controls->btnPlay->setEnabled(true); - m_Controls->btnScreenshot->setEnabled(true); - - m_Controls->btnPlay->setHidden(false); - m_Controls->btnPause->setHidden(true); - - m_Timer->stop(); - switch (m_Direction) - { - case 0: - case 2: - this->GetAspectStepper()->First(); - break; - - case 1: - this->GetAspectStepper()->Last(); - break; - } - - // Reposition slider GUI element - m_StepperAdapter->SetStepper(this->GetAspectStepper()); - - if (m_movieGenerator.IsNull()) - m_Controls->btnMovie->setEnabled(false); - -} - -void QmitkMovieMaker::SetLooping(bool looping) -{ - m_Looping = looping; - this->UpdateLooping(); -} - -void QmitkMovieMaker::SetDirection(int direction) -{ - m_Direction = direction; - this->UpdateDirection(); -} - -void QmitkMovieMaker::SetAspect(int aspect) -{ - m_Aspect = aspect; - - m_StepperAdapter->SetStepper(this->GetAspectStepper()); - this->UpdateLooping(); - this->UpdateDirection(); -} - -void QmitkMovieMaker::SetStepperWindow(int window) -{ - // Set newly selected window / renderer as focused - const mitk::RenderingManager::RenderWindowVector rwv = - mitk::RenderingManager::GetInstance()->GetAllRegisteredRenderWindows(); - - //Delete MultiStepper - DeleteMStepper(); - - int i; - mitk::RenderingManager::RenderWindowVector::const_iterator iter; - for (iter = rwv.begin(), i = 0; iter != rwv.end(); ++iter, ++i) - { - if (i == window) - { - mitk::GlobalInteraction::GetInstance()->GetFocusManager() ->SetFocused( - mitk::BaseRenderer::GetInstance((*iter))); - break; - } - } -} - -void QmitkMovieMaker::SetRecordingWindow(int window) -{ - // Set newly selected window for recording - const mitk::RenderingManager::RenderWindowVector rwv = - mitk::RenderingManager::GetInstance()->GetAllRegisteredRenderWindows(); - - //Delete MultiStepper - DeleteMStepper(); - - int i; - mitk::RenderingManager::RenderWindowVector::const_iterator iter; - for (iter = rwv.begin(), i = 0; iter != rwv.end(); ++iter, ++i) - { - if (i == window) - { - m_RecordingRenderer = mitk::BaseRenderer::GetInstance((*iter)); - break; - } - } -} - -void QmitkMovieMaker::UpdateLooping() -{ - this->GetAspectStepper()->SetAutoRepeat(m_Looping); -} - -void QmitkMovieMaker::UpdateDirection() -{ - mitk::Stepper* stepper = this->GetAspectStepper(); - - switch (m_Direction) - { - case 0: - stepper->InverseDirectionOff(); - stepper->PingPongOff(); - break; - - case 1: - stepper->InverseDirectionOn(); - stepper->PingPongOff(); - break; - - case 2: - stepper->PingPongOn(); - break; - } -} - -mitk::Stepper* QmitkMovieMaker::GetAspectStepper() -{ - if (m_Aspect == 0) - { - m_Stepper = NULL; - return this->GetSpatialController()->GetSlice(); - } - else if (m_Aspect == 1) - { - m_Stepper = NULL; - return this->GetTemporalController()->GetTime(); - } - else if (m_Aspect == 2) - { - if (m_Stepper.IsNull()) - { - int rel = m_Controls->spatialTimeRelation->value(); - int timeRepeat = 1; - int sliceRepeat = 1; - if (rel < 0) - { - sliceRepeat = -rel; - } - else if (rel > 0) - { - timeRepeat = rel; - } - m_Stepper = mitk::MultiStepper::New(); - m_Stepper->AddStepper(this->GetSpatialController()->GetSlice(), sliceRepeat); - m_Stepper->AddStepper(this->GetTemporalController()->GetTime(), timeRepeat); - } - - return m_Stepper.GetPointer(); - } - else - { - // should never get here - return 0; - } -} - -void QmitkMovieMaker::GenerateMovie() -{ - emit StartBlockControls(); - - // provide the movie generator with the stepper and rotate the camera each step - if (m_movieGenerator.IsNotNull()) - { - m_movieGenerator->SetStepper(this->GetAspectStepper()); - m_movieGenerator->SetRenderer(m_RecordingRenderer); - m_movieGenerator->SetFrameRate(static_cast (360 - / (m_Controls->spnDuration->value()))); - - // QString movieFileName = QFileDialog::getSaveFileName( QString::null, "Movie (*.avi)", 0, "movie file dialog", "Choose a file name" ); - - QString movieFileName = QFileDialog::getSaveFileName(0, "Choose a file name", QString::null, - "Movie (*.avi)", 0, 0); - - if (movieFileName.isEmpty() == false) - { - mitk::RenderingManager::GetInstance()->RequestUpdateAll(); - m_movieGenerator->SetFileName(movieFileName.toAscii()); - m_movieGenerator->WriteMovie(); - } - - emit EndBlockControls(); - } - else - { - MITK_ERROR << "Either mitk::MovieGenerator is not implemented for your"; - MITK_ERROR << " platform or an error occurred during"; - MITK_ERROR << " mitk::MovieGenerator::New()"; - - emit EndBlockControlsMovieDeactive(); - } -} - -void QmitkMovieMaker::GenerateScreenshot() -{ - emit StartBlockControls(); - - QString fileName = QFileDialog::getSaveFileName(NULL, "Save screenshot to...", QDir::currentPath(), "JPEG file (*.jpg);;PNG file (*.png)"); - - vtkRenderer* renderer = mitk::GlobalInteraction::GetInstance()->GetFocus()->GetVtkRenderer(); - if (renderer == NULL) - return; - this->TakeScreenshot(renderer, 1, fileName); - - if (m_movieGenerator.IsNotNull()) - emit EndBlockControls(); - else - emit EndBlockControlsMovieDeactive(); -} - -void QmitkMovieMaker::GenerateHR3DScreenshot() -{ - emit StartBlockControls(); - - QString fileName = QFileDialog::getSaveFileName(NULL, "Save screenshot to...", QDir::currentPath(), "JPEG file (*.jpg);;PNG file (*.png)"); - - // only works correctly for 3D RenderWindow - vtkRenderer* renderer = m_MultiWidget->mitkWidget4->GetRenderer()->GetVtkRenderer(); - if (renderer == NULL) - return; - this->TakeScreenshot(renderer, 4, fileName); - - if (m_movieGenerator.IsNotNull()) - emit EndBlockControls(); - else - emit EndBlockControlsMovieDeactive(); -} - -void QmitkMovieMaker::UpdateGUI() -{ - int bla = this->GetTemporalController()->GetTime()->GetSteps(); - if (bla < 2) - { - m_Controls->rbtnTemporal->setEnabled(false); - m_Controls->rbtnCombined->setEnabled(false); - m_Controls->spatialTimeRelation->setEnabled(false); - } - else - { - m_Controls->rbtnTemporal->setEnabled(true); - m_Controls->rbtnCombined->setEnabled(true); - m_Controls->spatialTimeRelation->setEnabled(true); - } - -} - -void QmitkMovieMaker::DataStorageChanged() -{ - // UpdateGUI(); -} - -void QmitkMovieMaker::CreateQtPartControl(QWidget *parent) -{ - if (!m_Controls) - { - m_Controls = new Ui::QmitkMovieMakerControls; - m_Controls->setupUi(parent); - - m_StepperAdapter = new QmitkStepperAdapter((QObject*) m_Controls->slidAngle, - this->GetSpatialController()->GetSlice(), "AngleStepperToMovieMakerFunctionality"); - - // Initialize "Selected Window" combo box - const mitk::RenderingManager::RenderWindowVector rwv = - mitk::RenderingManager::GetInstance()->GetAllRegisteredRenderWindows(); - - mitk::RenderingManager::RenderWindowVector::const_iterator iter; - unsigned int i = 0; - for (iter = rwv.begin(); iter != rwv.end(); ++iter) - { - QString name(mitk::BaseRenderer::GetInstance((*iter))->GetName()); - if (name=="stdmulti.widget1") - { - m_Controls->cmbSelectedStepperWindow->insertItem(i, "Axial"); - m_Controls->cmbSelectedRecordingWindow->insertItem(i++, "Axial"); - } - else if (name=="stdmulti.widget2") - { - m_Controls->cmbSelectedStepperWindow->insertItem(i, "Sagittal"); - m_Controls->cmbSelectedRecordingWindow->insertItem(i++, "Sagittal"); - } - else if (name=="stdmulti.widget3") - { - m_Controls->cmbSelectedStepperWindow->insertItem(i, "Coronal"); - m_Controls->cmbSelectedRecordingWindow->insertItem(i++, "Coronal"); - } - else if (name=="stdmulti.widget4") - { - m_Controls->cmbSelectedStepperWindow->insertItem(i, "3D Window"); - m_Controls->cmbSelectedRecordingWindow->insertItem(i++, "3D Window"); - } - else - { - m_Controls->cmbSelectedStepperWindow->insertItem(i, name); - m_Controls->cmbSelectedRecordingWindow->insertItem(i++, name); - } - } - - m_Controls->btnPause->setHidden(true); - if (m_movieGenerator.IsNull()) - m_Controls->btnMovie->setEnabled(false); - } - - this->CreateConnections(); - -} - -void QmitkMovieMaker::StartPlaying() -{ - m_Controls->slidAngle->setDisabled(true); - m_Controls->btnMovie->setEnabled(false); - m_Controls->btnPlay->setEnabled(false); - m_Controls->btnScreenshot->setEnabled(false); - - // Restart timer with 5 msec interval - this should be fine-grained enough - // even for high display refresh frequencies - m_Timer->start(5); - - m_Time->restart(); - - m_Controls->btnPlay->setHidden(true); - m_Controls->btnPause->setHidden(false); - if (m_movieGenerator.IsNull()) - m_Controls->btnMovie->setEnabled(false); - -} - -void QmitkMovieMaker::RBTNForward() -{ - emit SwitchDirection(0); -} - -void QmitkMovieMaker::RBTNBackward() -{ - emit SwitchDirection(1); -} - -void QmitkMovieMaker::RBTNPingPong() -{ - emit SwitchDirection(2); -} - -void QmitkMovieMaker::RBTNSpatial() -{ - emit SwitchAspect(0); -} - -void QmitkMovieMaker::RBTNTemporal() -{ - emit SwitchAspect(1); -} - -void QmitkMovieMaker::RBTNCombined() -{ - emit SwitchAspect(2); -} - -void QmitkMovieMaker::BlockControls() -{ - BlockControls(true); -} - -void QmitkMovieMaker::UnBlockControls() -{ - BlockControls(false); -} - -void QmitkMovieMaker::UnBlockControlsMovieDeactive() -{ - BlockControls(false); - - m_Controls->btnMovie->setEnabled(false); -} - -void QmitkMovieMaker::BlockControls(bool blocked) -{ - m_Controls->slidAngle->setDisabled(blocked); - m_Controls->spnDuration->setEnabled(!blocked); - m_Controls->btnPlay->setEnabled(!blocked); - m_Controls->btnMovie->setEnabled(!blocked); - m_Controls->btnScreenshot->setEnabled(!blocked); -} - -void QmitkMovieMaker::StdMultiWidgetAvailable(QmitkStdMultiWidget& stdMultiWidget) -{ - m_MultiWidget = &stdMultiWidget; - m_Parent->setEnabled(true); -} - -void QmitkMovieMaker::StdMultiWidgetNotAvailable() -{ - m_MultiWidget = NULL; - m_Parent->setEnabled(false); -} - -void QmitkMovieMaker::TakeScreenshot(vtkRenderer* renderer, unsigned int magnificationFactor, QString fileName) -{ - if ((renderer == NULL) ||(magnificationFactor < 1) || fileName.isEmpty()) - return; - - bool doubleBuffering( renderer->GetRenderWindow()->GetDoubleBuffer() ); - renderer->GetRenderWindow()->DoubleBufferOff(); - - vtkImageWriter* fileWriter; - - QFileInfo fi(fileName); - QString suffix = fi.suffix(); - if (suffix.compare("png", Qt::CaseInsensitive) == 0) - { - fileWriter = vtkPNGWriter::New(); - } - else // default is jpeg - { - vtkJPEGWriter* w = vtkJPEGWriter::New(); - w->SetQuality(100); - w->ProgressiveOff(); - fileWriter = w; - } - vtkRenderLargeImage* magnifier = vtkRenderLargeImage::New(); - magnifier->SetInput(renderer); - magnifier->SetMagnification(magnificationFactor); - //magnifier->Update(); - fileWriter->SetInputConnection(magnifier->GetOutputPort()); - fileWriter->SetFileName(fileName.toLatin1()); - - // vtkRenderLargeImage has problems with different layers, therefore we have to - // temporarily deactivate all other layers. - // we set the background to white, because it is nicer than black... - double oldBackground[3]; - renderer->GetBackground(oldBackground); - double white[] = {1.0, 1.0, 1.0}; - renderer->SetBackground(white); - m_MultiWidget->DisableColoredRectangles(); - m_MultiWidget->DisableDepartmentLogo(); - m_MultiWidget->DisableGradientBackground(); - - m_MultiWidget->mitkWidget1->ActivateMenuWidget( false ); - m_MultiWidget->mitkWidget2->ActivateMenuWidget( false ); - m_MultiWidget->mitkWidget3->ActivateMenuWidget( false ); - m_MultiWidget->mitkWidget4->ActivateMenuWidget( false ); - - fileWriter->Write(); - fileWriter->Delete(); - - m_MultiWidget->mitkWidget1->ActivateMenuWidget( true ); - m_MultiWidget->mitkWidget2->ActivateMenuWidget( true ); - m_MultiWidget->mitkWidget3->ActivateMenuWidget( true ); - m_MultiWidget->mitkWidget4->ActivateMenuWidget( true ); - - m_MultiWidget->EnableColoredRectangles(); - m_MultiWidget->EnableDepartmentLogo(); - m_MultiWidget->EnableGradientBackground(); - renderer->SetBackground(oldBackground); - - renderer->GetRenderWindow()->SetDoubleBuffer(doubleBuffering); -} - -void QmitkMovieMaker::DeleteMStepper() -{ - m_Stepper = NULL; - UpdateLooping(); -} diff --git a/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkMovieMaker.h b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkMovieMaker.h deleted file mode 100644 index ea91684197..0000000000 --- a/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkMovieMaker.h +++ /dev/null @@ -1,300 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - -#if !defined(QMITK_MOVIEMAKER_H__INCLUDED) -#define QMITK_MOVIEMAKER_H__INCLUDED - -#include "QmitkFunctionality.h" -#include "mitkCameraRotationController.h" -#include "mitkStepper.h" -#include "mitkMultiStepper.h" -#include "mitkMovieGenerator.h" -#include "itkCommand.h" - -#include "QVTKWidget.h" -#include "vtkEventQtSlotConnect.h" -#include "vtkRenderWindow.h" -#include "mitkVtkPropRenderer.h" - -#include "ui_QmitkMovieMakerControls.h" -//#include "../MovieMakerDll.h" - -//class QmitkStdMultiWidget; -//class QmitkMovieMakerControls; -class QmitkStepperAdapter; -class vtkCamera; -class QTimer; -class QTime; - -/** - * \brief Functionality for creating movies (AVIs) - * \ingroup Functionalities - * - * - * - \ref QmitkMovieMakerOverview - * - \ref QmitkMovieMakerImplementation - * - \ref QmitkMovieMakerTodo - * - * \section QmitkMovieMakerOverview Overview - * - * The MovieMaker functionality extends existing modes of data visualization - * with animation capabilities. The animation aspect determines which - * aspect of a visualization gets animated. This aspect can be spatial - * (i.e. the camera position and orientation in a 3D view, or the selected - * slice in a 2D view), temporal (the time step in a time-based dataset), or - * something more sophisticated (for example, volume rendering transfer - * functions might be changed dynamically as part of an animation to produce - * interesting effects). Currently, the following animation modes are - * supported: - * - * - Rotation of the camera around the dataset (3D views) - * - Stepping through the dataset slice by slice (2D views) - * - Stepping through a time-based dataset (2D and 3D views) - * - * As can be seen in the screenshot below, the functionality provides cine - * controls to start, pause and stop the animation. The direction of the - * animation can be selected (forward, backward or ping-pong). The animation - * can be set to either the spatial or the temporal aspect, or to both - * aspects combined. The cycle time determines the duration of one animation - * loop. - * - * In a multi-view scenario, the animation is applied to the currently - * focussed view. Other views which display the same data may be affected as - * well. - * - * Animations can be written on disk; the corresponding button creates an - * animation consisting of one single loop and writes every animation frame - * into an AVI file. - * - * \image html QmitkMovieMakerGUI.png - * - * \section QmitkMovieMakerImplementation Implementation - * - * The following diagram provides an overview over the classes collaborating - * with QmitkMovieMaker. - * - * \image html QmitkMovieMakerClasses.png - * - * The respective roles of these classes are: - * - QmitkMovieMaker - * - Provides a class interface for configuring and controlling the - * animation - * - Is associated with the user interface - * - As a Functionality, controls initialization and maintainance of the - * involved components - * - mitk::BaseController - * - Controls an animation aspect (slice selection, camera angle, ...) - * - Subclass mitk::SliceNavigationController: Transfers the animation - * requests to the associated Renderer for selecting a slice in a 3D - * dataset - * - Subclass mitk::CameraRotationController: Modifies the camera angle - * - mitk::Stepper - * - Link between MovieMaker and Controller - * - Holds the current step position of the associated animation aspect - * (e.g. the camera rotation angle, or the slice number) - * - mitk::FocusManager - * - Determines which of the available RenderWindows (and thereby which - * Renderers) the animation shall be applied to - * - mitk::BaseRenderer - * - Controls the rendering of a dataset - * - Target class of the animation - * - mitk::MovieGenerator - * - Writes an AVI file - * - * - * \section QmitkMovieMakerTodo Future plans - * - * The basic animation capabilities of this functionality could be extended - * to allow the creation of more sophisticated animations. Potentially useful - * features include: - * - * - Camera paths: Allow the definition of complex camera paths along - * which the camera can then be moved during an animation. This might be - * done by defining camera keyframes between which camera movements are - * interpolated (as in standard 3D animation applications). Paths derived - * from anatomical features (e.g. vessel graphs) could also serve as a - * basis for camera movements. - * - Color / transfer function animation: Choosing suitable color - * and transfer functions is critical to the quality and benefit of volume - * rendering. Dynamically changing transfer functions could visually enrich - * an animation. One way of achieving this could be to define transfer - * function keyframes between which an animation interpolates. - * - */ -class QmitkMovieMaker: public QmitkFunctionality -{ - Q_OBJECT - -public: - /** \brief Constructor. */ - QmitkMovieMaker(QObject *parent=0, const char *name=0); - - /** \brief Destructor. */ - virtual ~QmitkMovieMaker(); - - /** \brief Method for creating the widget containing the application - * controls, like sliders, buttons etc. - */ - void CreateQtPartControl(QWidget *parent); - // virtual QWidget * CreateControlWidget(QWidget *parent); - - /** \brief Method for creating the connections of main and control widget. - */ - virtual void CreateConnections(); - - /** \brief Method for creating an QAction object, i.e. button & menu entry. - * @param parent the parent QWidget - */ - // virtual QAction * CreateAction(QActionGroup *parent); - - virtual void Activated(); - - virtual void Deactivated(); - - /** \brief Called when another window receives the focus. */ - void FocusChange(); - - virtual void DataStorageChanged(); - - /// - /// Called when a StdMultiWidget is available. - /// - virtual void StdMultiWidgetAvailable(QmitkStdMultiWidget& stdMultiWidget); - /// - /// Called when no StdMultiWidget is available. - /// - virtual void StdMultiWidgetNotAvailable(); - - signals: - void StartBlockControls(); - void EndBlockControls(); - void EndBlockControlsMovieDeactive(); - -public slots: - - /** \brief Start playing the animation by restarting the timer. */ - void StartPlaying(); - - /** \brief Pauses playing the animation by stopping the timer. */ - void PausePlaying(); - - /** \brief Stops playing the animation and resets the stepper. */ - void StopPlaying(); - - /** \brief Sets animation looping ON/OFF. */ - void SetLooping(bool looping); - - /** \brief Sets the direction: 0 = forward, 1 = backward, 2 = pingpong. */ - void SetDirection(int direction); - - /** \brief Sets the animation aspect: - * 0 = spatial, 1 = temporal, 2 = combined. - */ - void SetAspect(int aspect); - - /** \brief Sets a specified stepper window, which is moving. */ - void SetStepperWindow(int window); - - /** \brief Sets a specified recording window, from which the movie is generated. */ - void SetRecordingWindow(int window); - - /** \brief Advances the animation by one frame. - * Exactly how much the stepper advances depends on the time elapsed since - * the last call to this function. - */ - void AdvanceAnimation(); - -protected slots: - - void RenderSlot(); - void GenerateMovie(); - - void GenerateScreenshot(); - void GenerateHR3DScreenshot(); - void RBTNForward(); - void RBTNBackward(); - void RBTNPingPong(); - void RBTNSpatial(); - void RBTNTemporal(); - void RBTNCombined(); - void BlockControls(); - void UnBlockControls(); - void UnBlockControlsMovieDeactive(); - void BlockControls(bool blocked); - - void DeleteMStepper(); - - signals: - - void SwitchDirection(int); - void SwitchAspect(int); - void SwitchSelectedStepperWindow(int); - void SwitchSelectedRecordingWindow(int); - -protected: - - QObject *parentWidget; - QVTKWidget * widget; - QmitkStdMultiWidget* m_MultiWidget; - vtkEventQtSlotConnect * connections; - vtkRenderWindow * renderWindow; - mitk::VtkPropRenderer::Pointer m_PropRenderer; - - Ui::QmitkMovieMakerControls* m_Controls; - -private: - mitk::BaseController* GetSpatialController(); - - mitk::BaseController* GetTemporalController(); - - void UpdateLooping(); - - void UpdateDirection(); - - void UpdateGUI(); - - mitk::Stepper* GetAspectStepper(); - - /*! - \brief taking a screenshot "from" the specified renderer - \param magnificationFactor specifying the quality of the screenshot (the magnification of the actual RenderWindow size) - \param fileName file location and name where the screenshot should be saved - */ - void TakeScreenshot(vtkRenderer* renderer, unsigned int magnificationFactor, QString fileName); - - QmitkStepperAdapter* m_StepperAdapter; - - typedef itk::SimpleMemberCommand MemberCommand; - MemberCommand::Pointer m_FocusManagerCallback; - - QTimer* m_Timer; - - QTime* m_Time; - - bool m_Looping; - int m_Direction; - - int m_Aspect; - mitk::MultiStepper::Pointer m_Stepper; - mitk::BaseRenderer * m_RecordingRenderer; - - mitk::MovieGenerator::Pointer m_movieGenerator; - - unsigned long m_FocusManagerObserverTag; - unsigned long m_StepperObserverTag; - -}; -#endif // !defined(QMITK_MOVIEMAKER_H__INCLUDED) diff --git a/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkMovieMakerControls.ui b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkMovieMakerControls.ui deleted file mode 100644 index 68dd4a6fa2..0000000000 --- a/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkMovieMakerControls.ui +++ /dev/null @@ -1,454 +0,0 @@ - - - QmitkMovieMakerControls - - - - 0 - 0 - 423 - 665 - - - - MovieMaker - - - - - - - 0 - 0 - - - - - 75 - true - - - - Window for stepping - - - false - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 75 - true - - - - Window for recording - - - false - - - - - - - - 0 - 0 - - - - - - - - - 75 - true - - - - Recording options - - - - - - - - - 0 - 0 - - - - - - - Step - - - false - - - - - - - - - - - - - - - 0 - 0 - - - - - - - Start stepper - - - - - - - :/org.mitk.gui.qt.moviemaker/resources/play.xpm:/org.mitk.gui.qt.moviemaker/resources/play.xpm - - - - - - - - 0 - 0 - - - - - - - Pause stepper - - - - - - - :/org.mitk.gui.qt.moviemaker/resources/pause.xpm:/org.mitk.gui.qt.moviemaker/resources/pause.xpm - - - - - - - - 0 - 0 - - - - - - - Stop stepper - - - - - - - :/org.mitk.gui.qt.moviemaker/resources/stop.xpm:/org.mitk.gui.qt.moviemaker/resources/stop.xpm - - - - - - - - - - 0 - 0 - - - - - - - Write Movie (MS Windows only) ... - - - - - - - - 0 - 0 - - - - - - - Writes a screenshot of the selected window. - - - Write Screenshot - - - - - - - - 0 - 0 - - - - - - - Writes a screenshot of the selected window. - - - Write high resolution 3D Screenshot - - - - - - - - - - - 75 - true - - - - Playing options - - - - - - - - - - - - Spatial - - - true - - - - - - - - - - Temporal - - - - - - - - - - Combined - - - - - - - - - - - - S/T Relation - - - false - - - - - - - - - - -10 - - - 10 - - - 0 - - - - - - - - - - - - QFrame::HLine - - - QFrame::Sunken - - - - - - - - - - - - - Forward - - - true - - - - - - - - - - Backward - - - - - - - - - - Ping-Pong - - - - - - - - - - - - Cycle (sec) - - - false - - - - - - - - - - 1 - - - 200 - - - 5 - - - - - - - - - - - - - - - Qt::Vertical - - - - 20 - 31 - - - - - - - - - - QmitkSliderNavigatorWidget - QWidget -
QmitkSliderNavigatorWidget.h
- 1 -
-
- - rbtnForward - rbtnBackward - rbtnPingPong - rbtnSpatial - rbtnTemporal - cmbSelectedStepperWindow - - - - - -
diff --git a/Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkMovieMaker2View.cpp b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkMovieMakerView.cpp similarity index 84% rename from Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkMovieMaker2View.cpp rename to Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkMovieMakerView.cpp index 2977e4a432..5948b720bc 100644 --- a/Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkMovieMaker2View.cpp +++ b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkMovieMakerView.cpp @@ -1,664 +1,666 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "QmitkAnimationItemDelegate.h" #include "QmitkFFmpegWriter.h" -#include "QmitkMovieMaker2View.h" +#include "QmitkMovieMakerView.h" #include "QmitkOrbitAnimationItem.h" #include "QmitkOrbitAnimationWidget.h" #include "QmitkSliceAnimationItem.h" #include "QmitkSliceAnimationWidget.h" -#include +#include #include #include #include #include #include #include #include static QmitkAnimationItem* CreateDefaultAnimation(const QString& widgetKey) { if (widgetKey == "Orbit") return new QmitkOrbitAnimationItem; if (widgetKey == "Slice") return new QmitkSliceAnimationItem; return NULL; } static QString GetFFmpegPath() { berry::IPreferencesService::Pointer preferencesService = berry::Platform::GetServiceRegistry().GetServiceById(berry::IPreferencesService::ID); berry::IPreferences::Pointer preferences = preferencesService->GetSystemPreferences()->Node("/org.mitk.gui.qt.ext.externalprograms"); return QString::fromStdString(preferences->Get("ffmpeg", "")); } static unsigned char* ReadPixels(vtkRenderWindow* renderWindow, int x, int y, int width, int height) { if (renderWindow == NULL) return NULL; unsigned char* frame = new unsigned char[width * height * 3]; renderWindow->MakeCurrent(); glReadPixels(x, y, width, height, GL_RGB, GL_UNSIGNED_BYTE, frame); return frame; } -const std::string QmitkMovieMaker2View::VIEW_ID = "org.mitk.views.moviemaker2"; +const std::string QmitkMovieMakerView::VIEW_ID = "org.mitk.views.moviemaker"; -QmitkMovieMaker2View::QmitkMovieMaker2View() +QmitkMovieMakerView::QmitkMovieMakerView() : m_FFmpegWriter(NULL), - m_Ui(new Ui::QmitkMovieMaker2View), + m_Ui(new Ui::QmitkMovieMakerView), m_AnimationModel(NULL), m_AddAnimationMenu(NULL), m_RecordMenu(NULL), m_Timer(NULL), m_TotalDuration(0.0), m_NumFrames(0), m_CurrentFrame(0) { } -QmitkMovieMaker2View::~QmitkMovieMaker2View() +QmitkMovieMakerView::~QmitkMovieMakerView() { } -void QmitkMovieMaker2View::CreateQtPartControl(QWidget* parent) +void QmitkMovieMakerView::CreateQtPartControl(QWidget* parent) { m_FFmpegWriter = new QmitkFFmpegWriter(parent); m_Ui->setupUi(parent); this->InitializeAnimationWidgets(); this->InitializeAnimationTreeViewWidgets(); this->InitializePlaybackAndRecordWidgets(); this->InitializeTimer(parent); m_Ui->animationWidgetGroupBox->setVisible(false); } -void QmitkMovieMaker2View::InitializeAnimationWidgets() +void QmitkMovieMakerView::InitializeAnimationWidgets() { m_AnimationWidgets["Orbit"] = new QmitkOrbitAnimationWidget; m_AnimationWidgets["Slice"] = new QmitkSliceAnimationWidget; Q_FOREACH(QWidget* widget, m_AnimationWidgets.values()) { if (widget != NULL) { widget->setVisible(false); m_Ui->animationWidgetGroupBoxLayout->addWidget(widget); } } this->ConnectAnimationWidgets(); } -void QmitkMovieMaker2View::InitializeAnimationTreeViewWidgets() +void QmitkMovieMakerView::InitializeAnimationTreeViewWidgets() { this->InitializeAnimationModel(); this->InitializeAddAnimationMenu(); this->ConnectAnimationTreeViewWidgets(); } -void QmitkMovieMaker2View::InitializePlaybackAndRecordWidgets() +void QmitkMovieMakerView::InitializePlaybackAndRecordWidgets() { this->InitializeRecordMenu(); this->ConnectPlaybackAndRecordWidgets(); } -void QmitkMovieMaker2View::InitializeAnimationModel() +void QmitkMovieMakerView::InitializeAnimationModel() { m_AnimationModel = new QStandardItemModel(m_Ui->animationTreeView); m_AnimationModel->setHorizontalHeaderLabels(QStringList() << "Animation" << "Timeline"); m_Ui->animationTreeView->setModel(m_AnimationModel); m_Ui->animationTreeView->setItemDelegate(new QmitkAnimationItemDelegate(m_Ui->animationTreeView)); } -void QmitkMovieMaker2View::InitializeAddAnimationMenu() +void QmitkMovieMakerView::InitializeAddAnimationMenu() { m_AddAnimationMenu = new QMenu(m_Ui->addAnimationButton); Q_FOREACH(const QString& key, m_AnimationWidgets.keys()) { m_AddAnimationMenu->addAction(key); } } -void QmitkMovieMaker2View::InitializeRecordMenu() +void QmitkMovieMakerView::InitializeRecordMenu() { typedef QPair PairOfStrings; m_RecordMenu = new QMenu(m_Ui->recordButton); QVector renderWindows; renderWindows.push_back(qMakePair(QString("Axial"), QString("stdmulti.widget1"))); renderWindows.push_back(qMakePair(QString("Sagittal"), QString("stdmulti.widget2"))); renderWindows.push_back(qMakePair(QString("Coronal"), QString("stdmulti.widget3"))); renderWindows.push_back(qMakePair(QString("3D"), QString("stdmulti.widget4"))); Q_FOREACH(const PairOfStrings& renderWindow, renderWindows) { QAction* action = new QAction(m_RecordMenu); action->setText(renderWindow.first); action->setData(renderWindow.second); m_RecordMenu->addAction(action); } } -void QmitkMovieMaker2View::InitializeTimer(QWidget* parent) +void QmitkMovieMakerView::InitializeTimer(QWidget* parent) { m_Timer = new QTimer(parent); this->OnFPSSpinBoxValueChanged(m_Ui->fpsSpinBox->value()); this->ConnectTimer(); } -void QmitkMovieMaker2View::ConnectAnimationTreeViewWidgets() +void QmitkMovieMakerView::ConnectAnimationTreeViewWidgets() { this->connect(m_AnimationModel, SIGNAL(rowsInserted(const QModelIndex&, int, int)), this, SLOT(OnAnimationTreeViewRowsInserted(const QModelIndex&, int, int))); this->connect(m_AnimationModel, SIGNAL(rowsRemoved(const QModelIndex&, int, int)), this, SLOT(OnAnimationTreeViewRowsRemoved(const QModelIndex&, int, int))); this->connect(m_Ui->animationTreeView->selectionModel(), SIGNAL(selectionChanged(const QItemSelection&, const QItemSelection&)), this, SLOT(OnAnimationTreeViewSelectionChanged(const QItemSelection&, const QItemSelection&))); this->connect(m_Ui->moveAnimationUpButton, SIGNAL(clicked()), this, SLOT(OnMoveAnimationUpButtonClicked())); this->connect(m_Ui->moveAnimationDownButton, SIGNAL(clicked()), this, SLOT(OnMoveAnimationDownButtonClicked())); this->connect(m_Ui->addAnimationButton, SIGNAL(clicked()), this, SLOT(OnAddAnimationButtonClicked())); this->connect(m_Ui->removeAnimationButton, SIGNAL(clicked()), this, SLOT(OnRemoveAnimationButtonClicked())); } -void QmitkMovieMaker2View::ConnectAnimationWidgets() +void QmitkMovieMakerView::ConnectAnimationWidgets() { this->connect(m_Ui->startComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(OnStartComboBoxCurrentIndexChanged(int))); this->connect(m_Ui->durationSpinBox, SIGNAL(valueChanged(double)), this, SLOT(OnDurationSpinBoxValueChanged(double))); this->connect(m_Ui->delaySpinBox, SIGNAL(valueChanged(double)), this, SLOT(OnDelaySpinBoxValueChanged(double))); } -void QmitkMovieMaker2View::ConnectPlaybackAndRecordWidgets() +void QmitkMovieMakerView::ConnectPlaybackAndRecordWidgets() { this->connect(m_Ui->playButton, SIGNAL(toggled(bool)), this, SLOT(OnPlayButtonToggled(bool))); this->connect(m_Ui->stopButton, SIGNAL(clicked()), this, SLOT(OnStopButtonClicked())); this->connect(m_Ui->recordButton, SIGNAL(clicked()), this, SLOT(OnRecordButtonClicked())); this->connect(m_Ui->fpsSpinBox, SIGNAL(valueChanged(int)), this, SLOT(OnFPSSpinBoxValueChanged(int))); } -void QmitkMovieMaker2View::ConnectTimer() +void QmitkMovieMakerView::ConnectTimer() { this->connect(m_Timer, SIGNAL(timeout()), this, SLOT(OnTimerTimeout())); } -void QmitkMovieMaker2View::SetFocus() +void QmitkMovieMakerView::SetFocus() { m_Ui->addAnimationButton->setFocus(); } -void QmitkMovieMaker2View::OnMoveAnimationUpButtonClicked() +void QmitkMovieMakerView::OnMoveAnimationUpButtonClicked() { const QItemSelection selection = m_Ui->animationTreeView->selectionModel()->selection(); if (!selection.isEmpty()) { const int selectedRow = selection[0].top(); if (selectedRow > 0) m_AnimationModel->insertRow(selectedRow - 1, m_AnimationModel->takeRow(selectedRow)); } this->CalculateTotalDuration(); } -void QmitkMovieMaker2View::OnMoveAnimationDownButtonClicked() +void QmitkMovieMakerView::OnMoveAnimationDownButtonClicked() { const QItemSelection selection = m_Ui->animationTreeView->selectionModel()->selection(); if (!selection.isEmpty()) { const int rowCount = m_AnimationModel->rowCount(); const int selectedRow = selection[0].top(); if (selectedRow < rowCount - 1) m_AnimationModel->insertRow(selectedRow + 1, m_AnimationModel->takeRow(selectedRow)); } this->CalculateTotalDuration(); } -void QmitkMovieMaker2View::OnAddAnimationButtonClicked() +void QmitkMovieMakerView::OnAddAnimationButtonClicked() { QAction* action = m_AddAnimationMenu->exec(QCursor::pos()); if (action != NULL) { const QString widgetKey = action->text(); m_AnimationModel->appendRow(QList() << new QStandardItem(widgetKey) << CreateDefaultAnimation(widgetKey)); m_Ui->playbackAndRecordingGroupBox->setEnabled(true); } } -void QmitkMovieMaker2View::OnPlayButtonToggled(bool checked) +void QmitkMovieMakerView::OnPlayButtonToggled(bool checked) { if (checked) { m_Ui->playButton->setIcon(QIcon(":/org_mitk_icons/icons/tango/scalable/actions/media-playback-pause.svg")); m_Ui->playButton->repaint(); m_Timer->start(static_cast(1000.0 / m_Ui->fpsSpinBox->value())); } else { m_Timer->stop(); m_Ui->playButton->setIcon(QIcon(":/org_mitk_icons/icons/tango/scalable/actions/media-playback-start.svg")); m_Ui->playButton->repaint(); } } -void QmitkMovieMaker2View::OnStopButtonClicked() +void QmitkMovieMakerView::OnStopButtonClicked() { m_Ui->playButton->setChecked(false); m_Ui->stopButton->setEnabled(false); m_CurrentFrame = 0; this->RenderCurrentFrame(); } -void QmitkMovieMaker2View::OnRecordButtonClicked() // TODO: Refactor +void QmitkMovieMakerView::OnRecordButtonClicked() // TODO: Refactor { - m_FFmpegWriter->SetFFmpegPath(GetFFmpegPath()); + const QString ffmpegPath = GetFFmpegPath(); - if (m_FFmpegWriter->GetFFmpegPath().isEmpty()) + if (ffmpegPath.isEmpty()) { - QMessageBox::critical(NULL, "Movie Maker 2", "Path to FFmpeg executable is not set in preferences!"); + QMessageBox::information(NULL, "Movie Maker", "Set path to FFmpeg or Libav (avconv) in preferences (Window -> Preferences... (Ctrl+P) -> External Programs) to be able to record your movies to video files."); return; } + m_FFmpegWriter->SetFFmpegPath(GetFFmpegPath()); + QAction* action = m_RecordMenu->exec(QCursor::pos()); if (action == NULL) return; vtkRenderWindow* renderWindow = mitk::BaseRenderer::GetRenderWindowByName(action->data().toString().toStdString()); if (renderWindow == NULL) return; const int border = 3; const int x = border; const int y = border; int width = renderWindow->GetSize()[0] - border * 2; int height = renderWindow->GetSize()[1] - border * 2; if (width & 1) --width; if (height & 1) --height; if (width < 16 || height < 16) return; m_FFmpegWriter->SetSize(width, height); m_FFmpegWriter->SetFramerate(m_Ui->fpsSpinBox->value()); QString saveFileName = QFileDialog::getSaveFileName(NULL, "Specify a filename", "", "Movie (*.mp4)"); if (saveFileName.isEmpty()) return; if(!saveFileName.endsWith(".mp4")) saveFileName += ".mp4"; m_FFmpegWriter->SetOutputPath(saveFileName); try { m_FFmpegWriter->Start(); for (m_CurrentFrame = 0; m_CurrentFrame < m_NumFrames; ++m_CurrentFrame) { this->RenderCurrentFrame(); renderWindow->MakeCurrent(); unsigned char* frame = ReadPixels(renderWindow, x, y, width, height); m_FFmpegWriter->WriteFrame(frame); delete[] frame; } m_FFmpegWriter->Stop(); m_CurrentFrame = 0; this->RenderCurrentFrame(); } catch (const mitk::Exception& exception) { m_CurrentFrame = 0; this->RenderCurrentFrame(); - QMessageBox::critical(NULL, "Movie Maker 2", exception.GetDescription()); + QMessageBox::critical(NULL, "Movie Maker", exception.GetDescription()); } } -void QmitkMovieMaker2View::OnRemoveAnimationButtonClicked() +void QmitkMovieMakerView::OnRemoveAnimationButtonClicked() { const QItemSelection selection = m_Ui->animationTreeView->selectionModel()->selection(); if (!selection.isEmpty()) m_AnimationModel->removeRow(selection[0].top()); } -void QmitkMovieMaker2View::OnAnimationTreeViewRowsInserted(const QModelIndex& parent, int start, int) +void QmitkMovieMakerView::OnAnimationTreeViewRowsInserted(const QModelIndex& parent, int start, int) { this->CalculateTotalDuration(); m_Ui->animationTreeView->selectionModel()->select( m_AnimationModel->index(start, 0, parent), QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows); } -void QmitkMovieMaker2View::OnAnimationTreeViewRowsRemoved(const QModelIndex&, int, int) +void QmitkMovieMakerView::OnAnimationTreeViewRowsRemoved(const QModelIndex&, int, int) { this->CalculateTotalDuration(); this->UpdateWidgets(); } -void QmitkMovieMaker2View::OnAnimationTreeViewSelectionChanged(const QItemSelection&, const QItemSelection&) +void QmitkMovieMakerView::OnAnimationTreeViewSelectionChanged(const QItemSelection&, const QItemSelection&) { this->UpdateWidgets(); } -void QmitkMovieMaker2View::OnStartComboBoxCurrentIndexChanged(int index) +void QmitkMovieMakerView::OnStartComboBoxCurrentIndexChanged(int index) { QmitkAnimationItem* item = this->GetSelectedAnimationItem(); if (item != NULL) { item->SetStartWithPrevious(index); this->RedrawTimeline(); this->CalculateTotalDuration(); } } -void QmitkMovieMaker2View::OnDurationSpinBoxValueChanged(double value) +void QmitkMovieMakerView::OnDurationSpinBoxValueChanged(double value) { QmitkAnimationItem* item = this->GetSelectedAnimationItem(); if (item != NULL) { item->SetDuration(value); this->RedrawTimeline(); } } -void QmitkMovieMaker2View::OnDelaySpinBoxValueChanged(double value) +void QmitkMovieMakerView::OnDelaySpinBoxValueChanged(double value) { QmitkAnimationItem* item = this->GetSelectedAnimationItem(); if (item != NULL) { item->SetDelay(value); this->RedrawTimeline(); this->CalculateTotalDuration(); } } -void QmitkMovieMaker2View::OnFPSSpinBoxValueChanged(int value) +void QmitkMovieMakerView::OnFPSSpinBoxValueChanged(int value) { this->CalculateTotalDuration(); m_Timer->setInterval(static_cast(1000.0 / value)); } -void QmitkMovieMaker2View::OnTimerTimeout() +void QmitkMovieMakerView::OnTimerTimeout() { this->RenderCurrentFrame(); m_CurrentFrame = std::min(m_NumFrames, m_CurrentFrame + 1); if (m_CurrentFrame >= m_NumFrames) { m_Ui->playButton->setChecked(false); m_CurrentFrame = 0; this->RenderCurrentFrame(); } m_Ui->stopButton->setEnabled(m_CurrentFrame != 0); } -void QmitkMovieMaker2View::RenderCurrentFrame() +void QmitkMovieMakerView::RenderCurrentFrame() { typedef QPair AnimationIterpolationFactorPair; const double deltaT = m_TotalDuration / (m_NumFrames - 1); const QVector activeAnimations = this->GetActiveAnimations(m_CurrentFrame * deltaT); Q_FOREACH(const AnimationIterpolationFactorPair& animation, activeAnimations) { animation.first->Animate(animation.second); } mitk::RenderingManager::GetInstance()->ForceImmediateUpdateAll(); } -void QmitkMovieMaker2View::UpdateWidgets() +void QmitkMovieMakerView::UpdateWidgets() { const QItemSelection selection = m_Ui->animationTreeView->selectionModel()->selection(); if (selection.isEmpty()) { m_Ui->moveAnimationUpButton->setEnabled(false); m_Ui->moveAnimationDownButton->setEnabled(false); m_Ui->removeAnimationButton->setEnabled(false); m_Ui->playbackAndRecordingGroupBox->setEnabled(false); this->HideCurrentAnimationWidget(); } else { const int rowCount = m_AnimationModel->rowCount(); const int selectedRow = selection[0].top(); m_Ui->moveAnimationUpButton->setEnabled(rowCount > 1 && selectedRow != 0); m_Ui->moveAnimationDownButton->setEnabled(rowCount > 1 && selectedRow < rowCount - 1); m_Ui->removeAnimationButton->setEnabled(true); m_Ui->playbackAndRecordingGroupBox->setEnabled(true); this->ShowAnimationWidget(dynamic_cast(m_AnimationModel->item(selectedRow, 1))); } this->UpdateAnimationWidgets(); } -void QmitkMovieMaker2View::UpdateAnimationWidgets() +void QmitkMovieMakerView::UpdateAnimationWidgets() { QmitkAnimationItem* item = this->GetSelectedAnimationItem(); if (item != NULL) { m_Ui->startComboBox->setCurrentIndex(item->GetStartWithPrevious()); m_Ui->durationSpinBox->setValue(item->GetDuration()); m_Ui->delaySpinBox->setValue(item->GetDelay()); m_Ui->animationGroupBox->setEnabled(true); } else { m_Ui->animationGroupBox->setEnabled(false); } } -void QmitkMovieMaker2View::HideCurrentAnimationWidget() +void QmitkMovieMakerView::HideCurrentAnimationWidget() { if (m_Ui->animationWidgetGroupBox->isVisible()) { m_Ui->animationWidgetGroupBox->setVisible(false); int numWidgets = m_Ui->animationWidgetGroupBoxLayout->count(); for (int i = 0; i < numWidgets; ++i) m_Ui->animationWidgetGroupBoxLayout->itemAt(i)->widget()->setVisible(false); } } -void QmitkMovieMaker2View::ShowAnimationWidget(QmitkAnimationItem* animationItem) +void QmitkMovieMakerView::ShowAnimationWidget(QmitkAnimationItem* animationItem) { this->HideCurrentAnimationWidget(); if (animationItem == NULL) return; const QString widgetKey = animationItem->GetWidgetKey(); QmitkAnimationWidget* animationWidget = NULL; if (m_AnimationWidgets.contains(widgetKey)) { animationWidget = m_AnimationWidgets[widgetKey]; if (animationWidget != NULL) { m_Ui->animationWidgetGroupBox->setTitle(widgetKey); animationWidget->SetAnimationItem(animationItem); animationWidget->setVisible(true); } } m_Ui->animationWidgetGroupBox->setVisible(animationWidget != NULL); } -void QmitkMovieMaker2View::RedrawTimeline() +void QmitkMovieMakerView::RedrawTimeline() { if (m_AnimationModel->rowCount() > 1) { m_Ui->animationTreeView->dataChanged( m_AnimationModel->index(0, 1), m_AnimationModel->index(m_AnimationModel->rowCount() - 1, 1)); } } -QmitkAnimationItem* QmitkMovieMaker2View::GetSelectedAnimationItem() const +QmitkAnimationItem* QmitkMovieMakerView::GetSelectedAnimationItem() const { const QItemSelection selection = m_Ui->animationTreeView->selectionModel()->selection(); return !selection.isEmpty() ? dynamic_cast(m_AnimationModel->item(selection[0].top(), 1)) : NULL; } -void QmitkMovieMaker2View::CalculateTotalDuration() +void QmitkMovieMakerView::CalculateTotalDuration() { const int rowCount = m_AnimationModel->rowCount(); double totalDuration = 0.0; double previousStart = 0.0; for (int i = 0; i < rowCount; ++i) { QmitkAnimationItem* item = dynamic_cast(m_AnimationModel->item(i, 1)); if (item == NULL) continue; if (item->GetStartWithPrevious()) { totalDuration = std::max(totalDuration, previousStart + item->GetDelay() + item->GetDuration()); } else { previousStart = totalDuration; totalDuration += item->GetDelay() + item->GetDuration(); } } m_TotalDuration = totalDuration; // TODO totalDuration == 0 m_NumFrames = static_cast(totalDuration * m_Ui->fpsSpinBox->value()); // TODO numFrames < 2 } -QVector > QmitkMovieMaker2View::GetActiveAnimations(double t) const +QVector > QmitkMovieMakerView::GetActiveAnimations(double t) const { const int rowCount = m_AnimationModel->rowCount(); QVector > activeAnimations; double totalDuration = 0.0; double previousStart = 0.0; for (int i = 0; i < rowCount; ++i) { QmitkAnimationItem* item = dynamic_cast(m_AnimationModel->item(i, 1)); if (item == NULL) continue; if (item->GetDuration() > 0.0) { double start = item->GetStartWithPrevious() ? previousStart + item->GetDelay() : totalDuration + item->GetDelay(); if (start <= t && t <= start + item->GetDuration()) activeAnimations.push_back(qMakePair(item, (t - start) / item->GetDuration())); } if (item->GetStartWithPrevious()) { totalDuration = std::max(totalDuration, previousStart + item->GetDelay() + item->GetDuration()); } else { previousStart = totalDuration; totalDuration += item->GetDelay() + item->GetDuration(); } } return activeAnimations; } diff --git a/Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkMovieMaker2View.h b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkMovieMakerView.h similarity index 88% rename from Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkMovieMaker2View.h rename to Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkMovieMakerView.h index 50a94a2f9d..f65344a0b7 100644 --- a/Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkMovieMaker2View.h +++ b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkMovieMakerView.h @@ -1,98 +1,98 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ -#ifndef QmitkMovieMaker2View_h -#define QmitkMovieMaker2View_h +#ifndef QmitkMovieMakerView_h +#define QmitkMovieMakerView_h #include class QmitkAnimationItem; class QmitkAnimationWidget; class QmitkFFmpegWriter; class QMenu; class QStandardItemModel; class QTimer; namespace Ui { - class QmitkMovieMaker2View; + class QmitkMovieMakerView; } -class QmitkMovieMaker2View : public QmitkAbstractView +class QmitkMovieMakerView : public QmitkAbstractView { Q_OBJECT public: static const std::string VIEW_ID; - QmitkMovieMaker2View(); - ~QmitkMovieMaker2View(); + QmitkMovieMakerView(); + ~QmitkMovieMakerView(); void CreateQtPartControl(QWidget* parent); void SetFocus(); private slots: void OnMoveAnimationUpButtonClicked(); void OnMoveAnimationDownButtonClicked(); void OnAddAnimationButtonClicked(); void OnRemoveAnimationButtonClicked(); void OnAnimationTreeViewRowsInserted(const QModelIndex& parent, int start, int end); void OnAnimationTreeViewRowsRemoved(const QModelIndex& parent, int start, int end); void OnAnimationTreeViewSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected); void OnStartComboBoxCurrentIndexChanged(int index); void OnDurationSpinBoxValueChanged(double value); void OnDelaySpinBoxValueChanged(double value); void OnPlayButtonToggled(bool checked); void OnStopButtonClicked(); void OnRecordButtonClicked(); void OnFPSSpinBoxValueChanged(int value); void OnTimerTimeout(); private: void InitializeAnimationWidgets(); void InitializeAnimationTreeViewWidgets(); void InitializeAnimationModel(); void InitializeAddAnimationMenu(); void InitializePlaybackAndRecordWidgets(); void InitializeRecordMenu(); void InitializeTimer(QWidget* parent); void ConnectAnimationTreeViewWidgets(); void ConnectAnimationWidgets(); void ConnectPlaybackAndRecordWidgets(); void ConnectTimer(); void RenderCurrentFrame(); void UpdateWidgets(); void UpdateAnimationWidgets(); void HideCurrentAnimationWidget(); void ShowAnimationWidget(QmitkAnimationItem* animationItem); void RedrawTimeline(); void CalculateTotalDuration(); QmitkAnimationItem* GetSelectedAnimationItem() const; - QVector > QmitkMovieMaker2View::GetActiveAnimations(double t) const; + QVector > QmitkMovieMakerView::GetActiveAnimations(double t) const; QmitkFFmpegWriter* m_FFmpegWriter; - Ui::QmitkMovieMaker2View* m_Ui; + Ui::QmitkMovieMakerView* m_Ui; QStandardItemModel* m_AnimationModel; QMap m_AnimationWidgets; QMenu* m_AddAnimationMenu; QMenu* m_RecordMenu; QTimer* m_Timer; double m_TotalDuration; int m_NumFrames; int m_CurrentFrame; }; #endif diff --git a/Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkMovieMaker2View.ui b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkMovieMakerView.ui similarity index 97% rename from Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkMovieMaker2View.ui rename to Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkMovieMakerView.ui index 34e0eb573c..ccbd70bb83 100644 --- a/Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkMovieMaker2View.ui +++ b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkMovieMakerView.ui @@ -1,507 +1,507 @@ - QmitkMovieMaker2View - + QmitkMovieMakerView + true 0 0 320 640 - Movie Maker 2 + Movie Maker false Move animation up :/org_mitk_icons/icons/tango/scalable/actions/go-up.svg:/org_mitk_icons/icons/tango/scalable/actions/go-up.svg 24 24 true false Move animation down :/org_mitk_icons/icons/tango/scalable/actions/go-down.svg:/org_mitk_icons/icons/tango/scalable/actions/go-down.svg 24 24 true Add animation :/org_mitk_icons/icons/tango/scalable/actions/list-add.svg:/org_mitk_icons/icons/tango/scalable/actions/list-add.svg 24 24 true false Remove animation :/org_mitk_icons/icons/tango/scalable/actions/list-remove.svg:/org_mitk_icons/icons/tango/scalable/actions/list-remove.svg 24 24 true 0 0 0 100 16777215 100 false true 80 false Animation 0 0 24 24 24 24 :/org_mitk_icons/icons/tango/scalable/actions/media-playback-start.svg true 0 0 Start: startComboBox 0 0 After previous With previous 0 0 24 24 24 24 - :/org_gui_qt_moviemaker2/duration.svg + :/QmitkMovieMakerView/duration.svg true 0 0 Duration: durationSpinBox 0 0 s 100.000000000000000 0.500000000000000 2.000000000000000 0 0 24 24 24 24 - :/org_gui_qt_moviemaker2/delay.svg + :/QmitkMovieMakerView/delay.svg true 0 0 Delay: delaySpinBox 0 0 s 100.000000000000000 0.500000000000000 false Playback && Recording Play :/org_mitk_icons/icons/tango/scalable/actions/media-playback-start.svg:/org_mitk_icons/icons/tango/scalable/actions/media-playback-start.svg 24 24 true true false Stop :/org_mitk_icons/icons/tango/scalable/actions/media-playback-stop.svg:/org_mitk_icons/icons/tango/scalable/actions/media-playback-stop.svg 24 24 true Qt::Horizontal 40 20 Record :/org_mitk_icons/icons/tango/scalable/actions/media-record.svg:/org_mitk_icons/icons/tango/scalable/actions/media-record.svg 24 24 true Frames per second FPS 1 120 30 Qt::Vertical 20 227 animationTreeView moveAnimationUpButton moveAnimationDownButton addAnimationButton removeAnimationButton startComboBox durationSpinBox delaySpinBox playButton stopButton recordButton fpsSpinBox - + diff --git a/Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkOrbitAnimationItem.cpp b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkOrbitAnimationItem.cpp similarity index 100% rename from Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkOrbitAnimationItem.cpp rename to Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkOrbitAnimationItem.cpp diff --git a/Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkOrbitAnimationItem.h b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkOrbitAnimationItem.h similarity index 100% rename from Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkOrbitAnimationItem.h rename to Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkOrbitAnimationItem.h diff --git a/Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkOrbitAnimationWidget.cpp b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkOrbitAnimationWidget.cpp similarity index 100% rename from Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkOrbitAnimationWidget.cpp rename to Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkOrbitAnimationWidget.cpp diff --git a/Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkOrbitAnimationWidget.h b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkOrbitAnimationWidget.h similarity index 100% rename from Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkOrbitAnimationWidget.h rename to Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkOrbitAnimationWidget.h diff --git a/Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkOrbitAnimationWidget.ui b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkOrbitAnimationWidget.ui similarity index 100% rename from Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkOrbitAnimationWidget.ui rename to Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkOrbitAnimationWidget.ui diff --git a/Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkSliceAnimationItem.cpp b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkSliceAnimationItem.cpp similarity index 100% rename from Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkSliceAnimationItem.cpp rename to Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkSliceAnimationItem.cpp diff --git a/Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkSliceAnimationItem.h b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkSliceAnimationItem.h similarity index 100% rename from Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkSliceAnimationItem.h rename to Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkSliceAnimationItem.h diff --git a/Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkSliceAnimationWidget.cpp b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkSliceAnimationWidget.cpp similarity index 100% rename from Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkSliceAnimationWidget.cpp rename to Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkSliceAnimationWidget.cpp diff --git a/Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkSliceAnimationWidget.h b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkSliceAnimationWidget.h similarity index 100% rename from Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkSliceAnimationWidget.h rename to Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkSliceAnimationWidget.h diff --git a/Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkSliceAnimationWidget.ui b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkSliceAnimationWidget.ui similarity index 100% rename from Plugins/org.mitk.gui.qt.moviemaker2/src/internal/QmitkSliceAnimationWidget.ui rename to Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkSliceAnimationWidget.ui diff --git a/Plugins/org.mitk.gui.qt.moviemaker/src/internal/mitkMovieMakerPluginActivator.cpp b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/mitkMovieMakerPluginActivator.cpp index 6becf27540..0027cf3e38 100644 --- a/Plugins/org.mitk.gui.qt.moviemaker/src/internal/mitkMovieMakerPluginActivator.cpp +++ b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/mitkMovieMakerPluginActivator.cpp @@ -1,38 +1,38 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "mitkMovieMakerPluginActivator.h" -#include "QmitkMovieMaker.h" +#include "QmitkMovieMakerView.h" #include "QmitkScreenshotMaker.h" #include namespace mitk { void MovieMakerPluginActivator::start(ctkPluginContext* context) { - BERRY_REGISTER_EXTENSION_CLASS(QmitkMovieMaker, context) + BERRY_REGISTER_EXTENSION_CLASS(QmitkMovieMakerView, context) BERRY_REGISTER_EXTENSION_CLASS(QmitkScreenshotMaker, context) } void MovieMakerPluginActivator::stop(ctkPluginContext* context) { Q_UNUSED(context) } } Q_EXPORT_PLUGIN2(org_mitk_gui_qt_moviemaker, mitk::MovieMakerPluginActivator) diff --git a/Plugins/org.mitk.gui.qt.moviemaker2/CMakeLists.txt b/Plugins/org.mitk.gui.qt.moviemaker2/CMakeLists.txt deleted file mode 100644 index 0d1d280e42..0000000000 --- a/Plugins/org.mitk.gui.qt.moviemaker2/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -project(org_mitk_gui_qt_moviemaker2) - -MACRO_CREATE_MITK_CTK_PLUGIN( - EXPORT_DIRECTIVE MOVIE_MAKER_2_EXPORT - EXPORTED_INCLUDE_SUFFIXES src -) diff --git a/Plugins/org.mitk.gui.qt.moviemaker2/files.cmake b/Plugins/org.mitk.gui.qt.moviemaker2/files.cmake deleted file mode 100644 index 30ee551c36..0000000000 --- a/Plugins/org.mitk.gui.qt.moviemaker2/files.cmake +++ /dev/null @@ -1,51 +0,0 @@ -set(SRC_CPP_FILES -) - -set(INTERNAL_CPP_FILES - org_mitk_gui_qt_moviemaker2_Activator.cpp - QmitkAnimationItem.cpp - QmitkAnimationItemDelegate.cpp - QmitkAnimationWidget.cpp - QmitkFFmpegWriter.cpp - QmitkMovieMaker2View.cpp - QmitkOrbitAnimationItem.cpp - QmitkOrbitAnimationWidget.cpp - QmitkSliceAnimationItem.cpp - QmitkSliceAnimationWidget.cpp -) - -set(UI_FILES - src/internal/QmitkMovieMaker2View.ui - src/internal/QmitkOrbitAnimationWidget.ui - src/internal/QmitkSliceAnimationWidget.ui -) - -set(MOC_H_FILES - src/internal/org_mitk_gui_qt_moviemaker2_Activator.h - src/internal/QmitkAnimationItemDelegate.h - src/internal/QmitkAnimationWidget.h - src/internal/QmitkFFmpegWriter.h - src/internal/QmitkMovieMaker2View.h - src/internal/QmitkOrbitAnimationWidget.h - src/internal/QmitkSliceAnimationWidget.h -) - -set(CACHED_RESOURCE_FILES - resources/camera-video.png - plugin.xml -) - -set(QRC_FILES - resources/org_mitk_gui_qt_moviemaker2.qrc -) - -set(CPP_FILES -) - -foreach(file ${SRC_CPP_FILES}) - set(CPP_FILES ${CPP_FILES} src/${file}) -endforeach() - -foreach(file ${INTERNAL_CPP_FILES}) - set(CPP_FILES ${CPP_FILES} src/internal/${file}) -endforeach() diff --git a/Plugins/org.mitk.gui.qt.moviemaker2/manifest_headers.cmake b/Plugins/org.mitk.gui.qt.moviemaker2/manifest_headers.cmake deleted file mode 100644 index 0aa325e379..0000000000 --- a/Plugins/org.mitk.gui.qt.moviemaker2/manifest_headers.cmake +++ /dev/null @@ -1,5 +0,0 @@ -set(Plugin-Name "MITK Movie Maker 2") -set(Plugin-Version "0.1") -set(Plugin-Vendor "DKFZ, Medical and Biological Informatics") -set(Plugin-ContactAddress "http://www.mitk.org") -set(Require-Plugin org.mitk.gui.qt.common org.mitk.gui.qt.ext) diff --git a/Plugins/org.mitk.gui.qt.moviemaker2/plugin.xml b/Plugins/org.mitk.gui.qt.moviemaker2/plugin.xml deleted file mode 100644 index 5c0f11d18f..0000000000 --- a/Plugins/org.mitk.gui.qt.moviemaker2/plugin.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - diff --git a/Plugins/org.mitk.gui.qt.moviemaker2/resources/org_mitk_gui_qt_moviemaker2.qrc b/Plugins/org.mitk.gui.qt.moviemaker2/resources/org_mitk_gui_qt_moviemaker2.qrc deleted file mode 100644 index c455c395f4..0000000000 --- a/Plugins/org.mitk.gui.qt.moviemaker2/resources/org_mitk_gui_qt_moviemaker2.qrc +++ /dev/null @@ -1,6 +0,0 @@ - - - delay.svg - duration.svg - - diff --git a/Plugins/org.mitk.gui.qt.moviemaker2/src/internal/org_mitk_gui_qt_moviemaker2_Activator.cpp b/Plugins/org.mitk.gui.qt.moviemaker2/src/internal/org_mitk_gui_qt_moviemaker2_Activator.cpp deleted file mode 100644 index dfe19b2db6..0000000000 --- a/Plugins/org.mitk.gui.qt.moviemaker2/src/internal/org_mitk_gui_qt_moviemaker2_Activator.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - -#include "org_mitk_gui_qt_moviemaker2_Activator.h" -#include "QmitkMovieMaker2View.h" -#include - -void mitk::org_mitk_gui_qt_moviemaker2_Activator::start(ctkPluginContext* context) -{ - BERRY_REGISTER_EXTENSION_CLASS(QmitkMovieMaker2View, context); -} - -void mitk::org_mitk_gui_qt_moviemaker2_Activator::stop(ctkPluginContext*) -{ -} - -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - Q_EXPORT_PLUGIN2(org_mitk_gui_qt_moviemaker2, mitk::org_mitk_gui_qt_moviemaker2_Activator) -#endif diff --git a/Plugins/org.mitk.gui.qt.moviemaker2/src/internal/org_mitk_gui_qt_moviemaker2_Activator.h b/Plugins/org.mitk.gui.qt.moviemaker2/src/internal/org_mitk_gui_qt_moviemaker2_Activator.h deleted file mode 100644 index db43af249e..0000000000 --- a/Plugins/org.mitk.gui.qt.moviemaker2/src/internal/org_mitk_gui_qt_moviemaker2_Activator.h +++ /dev/null @@ -1,38 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - -#ifndef org_mitk_gui_qt_moviemaker2_Activator_h -#define org_mitk_gui_qt_moviemaker2_Activator_h - -#include - -namespace mitk -{ - class org_mitk_gui_qt_moviemaker2_Activator : public QObject, public ctkPluginActivator - { - Q_OBJECT -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) - Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_moviemaker2") -#endif - Q_INTERFACES(ctkPluginActivator) - - public: - void start(ctkPluginContext* context); - void stop(ctkPluginContext*); - }; -} - -#endif