]> Creatis software - creaImageIO.git/commitdiff
QT interface
authorFrederic Cervenansky <Frederic.Cervenansky@creatis.insa-lyon.fr>
Mon, 18 Oct 2010 15:28:56 +0000 (15:28 +0000)
committerFrederic Cervenansky <Frederic.Cervenansky@creatis.insa-lyon.fr>
Mon, 18 Oct 2010 15:28:56 +0000 (15:28 +0000)
CMakeLists.txt
src/CMakeLists.txt
src/creaImageIOGimmick.cpp
src/creaImageIOGimmick.h
src/creaImageIOSimpleView.cpp
src/creaImageIOWxGimmickView.cpp

index b0ead9604ff17b3061ce006b9aaa24e001740526..b23075b74488969ee1854b60b3aceaec2919351f 100644 (file)
@@ -35,15 +35,22 @@ SET(USE_VTK ON)
 SET(USE_ITK OFF)
 SET(USE_BOOST ON)
 OPTION(USE_WXWIDGETS "Use WxWidgets GUI" ON)
-OPTION(USE_QT4 "USE WxWidgets GUI"       OFF)
+OPTION(USE_QT4 "USE QT4GUI"       OFF)
 OPTION(USE_XERCES "USE Xerces if you want to use an beta version of outputModel" OFF)
 
 IF(USE_QT4)
        IF(USE_WXWIDGETS)
-                MESSAGE(STATUS "CANNOT USE QT WXWIDGETS IN SAME TIME")
+                MESSAGE(ERROR "CANNOT USE QT WXWIDGETS IN SAME TIME")
        ENDIF(USE_WXWIDGETS)
 ENDIF(USE_QT4)
                 
+IF(QT4_FOUND)
+ IF (WIN32)
+ MESSAGE("So ... ${QT_DIR}")
+               INCLUDE_DIRECTORIES(${QT_DIR}/../include)               
+               LINK_DIRECTORIES(${QT_DIR}/../lib)
+ ENDIF(WIN32)
+ENDIF(QT4_FOUND)
                 
 OPTION(USE_GDCM "Use gdcm 1.3" ON)
 OPTION(USE_GDCM2 "Use gdcm 2.0.14 at least" OFF)
index 2b584ccb81414eb13f0491d100ca87705e4b2755..618ca30d54abd6e92d133cb803443278e2f1bfbb 100644 (file)
@@ -79,8 +79,34 @@ FILE(GLOB SOURCES_CREAIMAGEIO_WX
          creaImageIOWxTreeView.cpp
          creaImageIOWxOutputDlg.cpp
          )
+         SOURCE_GROUP("Source Files\\GUI" FILES ${SOURCES_CREAIMAGEIO_WX})
 endif()
 
+# USE QT, need to transform files (moc mechanism)
+IF (USE_QT4)
+       #cpp
+       FILE(GLOB QT_CPP 
+               QtGUI/*.cpp QtGUI/*.cxx
+               )
+       
+       # headers
+       SET(QT4_HEADERS_TO_WRAP
+               QtGUI/creaimageioqtreeview.h
+               QtGUI/mainwindow.h
+               )
+       
+
+  QT4_WRAP_CPP(MOC_SOURCES ${QT4_HEADERS_TO_WRAP})
+  SOURCE_GROUP("Source Files\\GUI" FILES ${MOC_SOURCES})
+  
+  
+  # UI
+  FILE(GLOB UI_FILES QtGUI/*.ui)
+  QT4_WRAP_UI(UI_SOURCES ${UI_FILES})
+  #SOURCE_GROUP("UI Files" FILES ${UI_FILES})
+  SOURCE_GROUP("Source Files\\GUI" FILES ${UI_SOURCES})
+ENDIF(USE_QT4)
+
 
 IF(USE_XERCES)
 FILE(GLOB SOURCES_CREAIMAGEIO_OUTPUT
@@ -101,7 +127,6 @@ FILE(GLOB HEADER_CREAIMAGEIO_PACS PACS/*.h)
 
 SOURCE_GROUP("Source Files" FILES ${SOURCES_CREAIMAGEIO})
 SOURCE_GROUP("Header Files" FILES ${HEADER_CREAIMAGEIO})
-SOURCE_GROUP("Source Files\\GUI" FILES ${SOURCES_CREAIMAGEIO_WX})
 if(BUILD_CREA_PACS)
        SOURCE_GROUP("Source Files\\PACS" FILES ${SOURCES_CREAIMAGEIO_PACS})
        SOURCE_GROUP("Header Files\\PACS" FILES ${HEADER_CREAIMAGEIO_PACS})
@@ -111,12 +136,25 @@ SOURCE_GROUP("Source Files\\Readers" FILES ${SOURCES_CREAIMAGEIO_IMG_READER}
 SOURCE_GROUP("Source Files\\Tree" FILES ${SOURCES_CREAIMAGEIO_TREE})
 
 
+
+
+IF(USE_WXWIDGETS)
+SET( GUI_SRCS
+        ${SOURCES_CREAIMAGEIO_WX}
+        )
+ELSE(USE_WXWIDGETS)
+SET( GUI_SRCS
+        ${QT_CPP}
+        ${UI_SOURCES}
+        ${MOC_SOURCES}
+        )
+ENDIF(USE_WXWIDGETS)
 SET( PRIMITIVE_SRCS
  ${SOURCES_CREAIMAGEIO}
  ${HEADER_CREAIMAGEIO}
  ${SOURCES_CREAIMAGEIO_IMG_READER}
  ${SOURCES_CREAIMAGEIO_IMG_DICOM_READER}
- ${SOURCES_CREAIMAGEIO_WX}
+ ${GUI_SRCS}
  ${SOURCES_CREAIMAGEIO_TREE}
 )
 
index 5c7b07fd4fb9e36f366c64b8fef7176e69c73b34..06e32ce55a89c81f68f82242ee26e30c1284c97c 100644 (file)
@@ -539,4 +539,15 @@ void Gimmick::fillVectInfos(std::vector<std::string> i_attr, OutputAttr &infos)
        }
 }
 
+const std::stringstream Gimmick::getSummary()
+{
+      const AddProgress& p = GetAddProgress();
+    std::stringstream mess;
+    mess << "Dirs \tscanned\t: " << p.GetNumberScannedDirs()  << "\n";
+    mess << "Files\tscanned\t: " << p.GetNumberScannedFiles() << "\n";
+    mess << "Files\thandled\t: " << p.GetNumberHandledFiles() << "\n\n";
+    mess << "Files\tadded  \t: " << p.GetNumberAddedFiles()   << "\n\n";
+    return mess;
+}
+
 }
\ No newline at end of file
index 49dfae4f871b970e8e476ad2b27c21ea8ee0c286..55b8d14abf1a5c8fcf3b90c019183b751020aea3 100644 (file)
@@ -208,6 +208,9 @@ namespace creaImageIO
        
        /// Decide if attributes are available through database
        void fillVectInfos(std::vector<std::string> i_attr, OutputAttr &infos);
+
+    /// Get Add Opertaion summary
+    const std::stringstream getSummary();
     //=============================================
   private:
        SQLiteTreeHandler* mLocalDatabase;
index 7a7862926c7cac8a45617964aae06dc773604e51..6c640b33f03657b8c9ea192e29bd71a859aa45f9 100644 (file)
@@ -50,6 +50,7 @@ namespace creaImageIO
                                
                                for(int i=0; i<lgr; i++)
                                {
+                    std::cout << names[i] << std::endl;
                                   i_imgs.push_back( mReader->ReadImage(names[i]) );  
                                }                       
                        }
index 3bdc716a035281c5246112fb3053f221db311d09..9c0d327057be53dbebbde686e7a770226129203e 100644 (file)
@@ -1210,13 +1210,8 @@ namespace creaImageIO
   //=================================================
   void WxGimmickView::DisplayAddSummary()
   {
-    const Gimmick::AddProgress& p = mGimmick->GetAddProgress();
-    std::stringstream mess;
-    mess << "Dirs \tscanned\t: " << p.GetNumberScannedDirs()  << "\n";
-    mess << "Files\tscanned\t: " << p.GetNumberScannedFiles() << "\n";
-    mess << "Files\thandled\t: " << p.GetNumberHandledFiles() << "\n\n";
-    mess << "Files\tadded  \t: " << p.GetNumberAddedFiles()   << "\n\n";
-       time_t end;
+      std::stringstream mess(mGimmick->getSummary());
+    time_t end;
        time(&end);
        mess << "time to scan :" << difftime(end,mstart) << "sec";
     wxMessageBox(std2wx(mess.str()),_T("Addition result"),wxOK,this);