From: gdd Date: Thu, 24 Nov 2011 14:37:07 +0000 (+0000) Subject: rnc: made picture import in GEOM independent from OpenCV X-Git-Tag: V6_5_0a1~117 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4afdc688fc0c62ba252e8274a712482558f7ae14;p=modules%2Fgeom.git rnc: made picture import in GEOM independent from OpenCV --- diff --git a/src/EntityGUI/EntityGUI.cxx b/src/EntityGUI/EntityGUI.cxx index 332de5de0..b56ee2599 100644 --- a/src/EntityGUI/EntityGUI.cxx +++ b/src/EntityGUI/EntityGUI.cxx @@ -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; diff --git a/src/EntityGUI/EntityGUI_PictureImportDlg.cxx b/src/EntityGUI/EntityGUI_PictureImportDlg.cxx index d3e63c390..05aa79e18 100644 --- a/src/EntityGUI/EntityGUI_PictureImportDlg.cxx +++ b/src/EntityGUI/EntityGUI_PictureImportDlg.cxx @@ -39,8 +39,7 @@ #include #include - -#include +// #include #include @@ -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 ); diff --git a/src/EntityGUI/Makefile.am b/src/EntityGUI/Makefile.am index e543b2875..6d588edfb 100644 --- a/src/EntityGUI/Makefile.am +++ b/src/EntityGUI/Makefile.am @@ -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 diff --git a/src/GEOMGUI/GEOM_msg_en.ts b/src/GEOMGUI/GEOM_msg_en.ts index 1514f2e9a..c6cf7a861 100644 --- a/src/GEOMGUI/GEOM_msg_en.ts +++ b/src/GEOMGUI/GEOM_msg_en.ts @@ -4596,7 +4596,12 @@ Number of sketch points too small GEOM_DETECT_ZONE - Select a detection zone (default is whole picture) + Select a detection zone +(default is whole picture) + + + GEOM_DETECT_OUTPUT + Output type GEOM_PICTURE @@ -4629,6 +4634,10 @@ Number of sketch points too small GEOM_PICTURE Picture + + GEOM_FILE + File name + GEOM_IMPORT_PICT_TITLE Import picture in viewer diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index 8dc5b71e9..2d352d919 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -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 ); diff --git a/src/GEOMGUI/GeometryGUI_Operations.h b/src/GEOMGUI/GeometryGUI_Operations.h index eb21885c6..cabc0e9f3 100644 --- a/src/GEOMGUI/GeometryGUI_Operations.h +++ b/src/GEOMGUI/GeometryGUI_Operations.h @@ -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