]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
rnc: made picture import in GEOM independent from OpenCV
authorgdd <gdd>
Thu, 24 Nov 2011 14:37:07 +0000 (14:37 +0000)
committergdd <gdd>
Thu, 24 Nov 2011 14:37:07 +0000 (14:37 +0000)
src/EntityGUI/EntityGUI.cxx
src/EntityGUI/EntityGUI_PictureImportDlg.cxx
src/EntityGUI/Makefile.am
src/GEOMGUI/GEOM_msg_en.ts
src/GEOMGUI/GeometryGUI.cxx
src/GEOMGUI/GeometryGUI_Operations.h

index 332de5de074ea63ea3635fba3331f370a243bfc2..b56ee2599198bfbe53c64c10b07893fb6e868faf 100644 (file)
@@ -100,10 +100,10 @@ bool EntityGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
   case GEOMOp::OpFeatureDetect:    // FEATURE DETECTION
     aDlg = new EntityGUI_FeatureDetectorDlg( getGeometryGUI(), parent );
     break;
+#endif
   case GEOMOp::OpPictureImport:    // IMPORT PICTURE IN VIEWER
     aDlg = new EntityGUI_PictureImportDlg( getGeometryGUI(), parent );
     break;
-#endif
   default:
     app->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) );
     break;
index d3e63c390e17b9300cfb309360632ccbacb0366b..05aa79e18156ab1d98232053bb1d4fbeba7e8028 100644 (file)
@@ -39,8 +39,7 @@
 #include <TopoDS.hxx>
 
 #include <GEOMImpl_Types.hxx>
-
-#include <ShapeRec_FeatureDetector.hxx>
+// #include <ShapeRec_FeatureDetector.hxx>
 
 #include <QFileDialog>
 
@@ -55,11 +54,8 @@ EntityGUI_PictureImportDlg::EntityGUI_PictureImportDlg( GeometryGUI* theGeometry
                                     bool modal, Qt::WindowFlags fl )
   : GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
 {
-//   QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_LINE_2P" ) ) );
   setWindowTitle( tr( "GEOM_IMPORT_PICT_TITLE" ) );
   mainFrame()->GroupConstructors->setTitle( tr( "GEOM_PICTURE" ) );
-//   mainFrame()->RadioButton1->setIcon( image0 );
-//   mainFrame()->RadioButton2->setIcon( image2 );
 
   mainFrame()->RadioButton2->setAttribute(Qt::WA_DeleteOnClose);
   mainFrame()->RadioButton2->close();
@@ -182,12 +178,9 @@ bool EntityGUI_PictureImportDlg::execute( ObjectList& objects )
   if ( theImgFileName.isEmpty() )
     return res;
   
-  ShapeRec_FeatureDetector* aDetector = new ShapeRec_FeatureDetector();
-  aDetector->SetPath( theImgFileName.toStdString() );
-    
-  int height            =  aDetector->GetImgHeight();
-  int width             =  aDetector->GetImgWidth();
-  
+  QPixmap* pixmap = new QPixmap(theImgFileName); 
+  int height            =  pixmap->height();
+  int width             =  pixmap->width();
   
   GEOM::GEOM_Object_var P1 = aBasicOperations->MakePointXYZ( -0.5*width, -0.5*height, 0 );
   GEOM::GEOM_Object_var P2 = aBasicOperations->MakePointXYZ( -0.5*width,  0.5*height, 0 );
index e543b2875bf248bc5dbbf6ae1a8f8fb720ca6dc1..6d588edfb903443d52ff8c1ed13ffe7784d286d5 100644 (file)
@@ -28,15 +28,16 @@ if WITH_OPENCV
   FeatureDetectorDlg_Header = EntityGUI_FeatureDetectorDlg.h
   FeatureDetectorDlg_Sources = EntityGUI_FeatureDetectorDlg.cxx
   FeatureDetectorDlg_moc = EntityGUI_FeatureDetectorDlg_moc.cxx
-  PictureImportDlg_Header = EntityGUI_PictureImportDlg.h
-  PictureImportDlg_Sources = EntityGUI_PictureImportDlg.cxx
-  PictureImportDlg_moc = EntityGUI_PictureImportDlg_moc.cxx
   Opencv_libs = $(OPENCV_LIBS)
   Opencv_includes = $(OPENCV_INCLUDES)
   ShapeRec_dir = $(srcdir)/../ShapeRecognition
   ShapeRec_la = ../ShapeRecognition/libGEOMShapeRec.la  
 endif
 
+PictureImportDlg_Header = EntityGUI_PictureImportDlg.h
+PictureImportDlg_Sources = EntityGUI_PictureImportDlg.cxx
+PictureImportDlg_moc = EntityGUI_PictureImportDlg_moc.cxx
+
 # Libraries targets
 lib_LTLIBRARIES = libEntityGUI.la
 
index 1514f2e9ad0b9ae6a39ce4775f952b5650e61383..c6cf7a86119402200887fc61daae91610b24e17c 100644 (file)
@@ -4596,7 +4596,12 @@ Number of sketch points too small</translation>
     </message>
     <message>
         <source>GEOM_DETECT_ZONE</source>
-        <translation>Select a detection zone (default is whole picture)</translation>
+        <translation>Select a detection zone
+(default is whole picture)</translation>
+    </message>
+    <message>
+        <source>GEOM_DETECT_OUTPUT</source>
+        <translation>Output type</translation>
     </message>
     <message>
         <source>GEOM_PICTURE</source>
@@ -4629,6 +4634,10 @@ Number of sketch points too small</translation>
         <source>GEOM_PICTURE</source>
         <translation>Picture</translation>
     </message>
+    <message>
+        <source>GEOM_FILE</source>
+        <translation>File name</translation>
+    </message>
     <message>
         <source>GEOM_IMPORT_PICT_TITLE</source>
         <translation>Import picture in viewer</translation>
index 8dc5b71e9250381b8574840c3d8cd8719088cc16..2d352d9193a94a9a449c6d500bfd97a548a1bcba 100644 (file)
@@ -463,8 +463,8 @@ void GeometryGUI::OnGUIEvent( int id )
   case GEOMOp::OpExplode:          // MENU ENTITY - EXPLODE
 #ifdef WITH_OPENCV
   case GEOMOp::OpFeatureDetect:    // MENU ENTITY - FEATURE DETECTION
-  case GEOMOp::OpPictureImport:    // MENU ENTITY - IMPORT PICTURE IN VIEWER
 #endif
+  case GEOMOp::OpPictureImport:    // MENU ENTITY - IMPORT PICTURE IN VIEWER
     libName = "EntityGUI";
     break;
   case GEOMOp::OpEdge:             // MENU BUILD - EDGE
@@ -726,8 +726,8 @@ void GeometryGUI::initialize( CAM_Application* app )
   createGeomAction( GEOMOp::OpExplode,     "EXPLODE" );
 #ifdef WITH_OPENCV
   createGeomAction( GEOMOp::OpFeatureDetect,"FEATURE_DETECTION" );
-  createGeomAction( GEOMOp::OpPictureImport,"PICTURE_IMPORT" );
 #endif
+  createGeomAction( GEOMOp::OpPictureImport,"PICTURE_IMPORT" );
 
   createGeomAction( GEOMOp::OpEdge,        "EDGE" );
   createGeomAction( GEOMOp::OpWire,        "WIRE" );
@@ -926,8 +926,8 @@ void GeometryGUI::initialize( CAM_Application* app )
   
   createMenu( separator(),          newEntId, -1 );
   
-#ifdef WITH_OPENCV
   createMenu( GEOMOp::OpPictureImport, newEntId, -1 );
+#ifdef WITH_OPENCV
   createMenu( GEOMOp::OpFeatureDetect, newEntId, -1 );
 #endif
 
@@ -1097,9 +1097,10 @@ void GeometryGUI::initialize( CAM_Application* app )
   createTool( separator(),               operTbId );
 #ifdef WITH_OPENCV
   createTool( GEOMOp::OpFeatureDetect,   operTbId );
+#endif
   createTool( GEOMOp::OpPictureImport,   operTbId );
   createTool( separator(),               operTbId );
-#endif
+
   createTool( GEOMOp::OpPartition,       operTbId );
   createTool( GEOMOp::OpArchimede,       operTbId );
   createTool( GEOMOp::OpShapesOnShape,   operTbId );
index eb21885c6d1cf5b62b75dd48260249957ef353c1..cabc0e9f31073317c3ee4fac8af3a4ef8c6cc0f7 100644 (file)
@@ -96,8 +96,9 @@ namespace GEOMOp {
     OpExplode           = 3302,   // MENU NEW ENTITY - EXPLODE
 #ifdef WITH_OPENCV
     OpFeatureDetect     = 3303,   // MENU NEW ENTITY - FEATURE DETECTION
-    OpPictureImport     = 3304,   // MENU NEW ENTITY - IMPORT PICTURE IN VIEWER
 #endif
+    OpPictureImport     = 3304,   // MENU NEW ENTITY - IMPORT PICTURE IN VIEWER
+
     // BuildGUI ------------------//--------------------------------
     OpEdge              = 3400,   // MENU NEW ENTITY - BUILD - EDGE
     OpWire              = 3401,   // MENU NEW ENTITY - BUILD - WIRE