From 63e2f3bf87bbf8a7f76f6971725c8565ff44b14f Mon Sep 17 00:00:00 2001 From: gdd Date: Mon, 7 Nov 2011 15:11:09 +0000 Subject: [PATCH] rnc: made OpenCV an optional prerequisite --- src/EntityGUI/EntityGUI.cxx | 2 ++ src/EntityGUI/Makefile.am | 27 +++++++++++++++++++-------- src/GEOMGUI/GeometryGUI.cxx | 8 ++++++++ src/GEOMGUI/GeometryGUI_Operations.h | 2 ++ 4 files changed, 31 insertions(+), 8 deletions(-) diff --git a/src/EntityGUI/EntityGUI.cxx b/src/EntityGUI/EntityGUI.cxx index c1d160314..02985b328 100644 --- a/src/EntityGUI/EntityGUI.cxx +++ b/src/EntityGUI/EntityGUI.cxx @@ -96,12 +96,14 @@ bool EntityGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent ) case GEOMOp::OpExplode: // EXPLODE aDlg = new EntityGUI_SubShapeDlg( getGeometryGUI(), parent ); break; +#ifdef WITH_OPENCV case GEOMOp::OpFeatureDetect: // FEATURE DETECTION aDlg = new EntityGUI_FeatureDetectorDlg( getGeometryGUI(), parent ); break; 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/Makefile.am b/src/EntityGUI/Makefile.am index a9134497d..40fd1b654 100644 --- a/src/EntityGUI/Makefile.am +++ b/src/EntityGUI/Makefile.am @@ -24,6 +24,17 @@ # include $(top_srcdir)/adm_local/unix/make_common_starter.am +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) +endif + # Libraries targets lib_LTLIBRARIES = libEntityGUI.la @@ -34,8 +45,8 @@ salomeinclude_HEADERS = \ EntityGUI_SketcherDlg.h \ EntityGUI_3DSketcherDlg.h \ EntityGUI_SubShapeDlg.h \ - EntityGUI_FeatureDetectorDlg.h \ - EntityGUI_PictureImportDlg.h + $(FeatureDetectorDlg_Header) \ + $(PictureImportDlg_Header) dist_libEntityGUI_la_SOURCES = \ EntityGUI.cxx \ @@ -43,16 +54,16 @@ dist_libEntityGUI_la_SOURCES = \ EntityGUI_SketcherDlg.cxx \ EntityGUI_3DSketcherDlg.cxx \ EntityGUI_SubShapeDlg.cxx \ - EntityGUI_FeatureDetectorDlg.cxx\ - EntityGUI_PictureImportDlg.cxx + $(FeatureDetectorDlg_Sources) \ + $(PictureImportDlg_Sources) MOC_FILES = \ EntityGUI_Widgets_moc.cxx \ EntityGUI_SketcherDlg_moc.cxx \ EntityGUI_3DSketcherDlg_moc.cxx \ EntityGUI_SubShapeDlg_moc.cxx \ - EntityGUI_FeatureDetectorDlg_moc.cxx \ - EntityGUI_PictureImportDlg_moc.cxx + $(FeatureDetectorDlg_moc) \ + $(PictureImportDlg_moc) nodist_libEntityGUI_la_SOURCES = \ $(MOC_FILES) @@ -86,7 +97,7 @@ libEntityGUI_la_CPPFLAGS = \ $(GUI_CXXFLAGS) \ $(CORBA_CXXFLAGS) \ $(CORBA_INCLUDES) \ - $(OPENCV_INCLUDES) \ + $(Opencv_includes) \ -I$(srcdir)/../GEOMGUI \ -I$(srcdir)/../DlgRef \ -I$(srcdir)/../GEOMBase \ @@ -106,4 +117,4 @@ libEntityGUI_la_LDFLAGS = \ ../GEOMGUI/libGEOM.la \ $(QT_MT_LIBS) \ $(CAS_TKTopAlgo) -lTKernel \ - $(OPENCV_LIBS) + $(Opencv_libs) diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index e49dc8e2d..0cb7c95c2 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -461,8 +461,10 @@ void GeometryGUI::OnGUIEvent( int id ) case GEOMOp::Op2dSketcher: // MENU ENTITY - SKETCHER case GEOMOp::Op3dSketcher: // MENU ENTITY - 3D SKETCHER 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 libName = "EntityGUI"; break; case GEOMOp::OpEdge: // MENU BUILD - EDGE @@ -710,8 +712,10 @@ void GeometryGUI::initialize( CAM_Application* app ) createGeomAction( GEOMOp::Op2dSketcher, "SKETCH" ); createGeomAction( GEOMOp::Op3dSketcher, "3DSKETCH" ); createGeomAction( GEOMOp::OpExplode, "EXPLODE" ); +#ifdef WITH_OPENCV createGeomAction( GEOMOp::OpFeatureDetect,"FEATURE_DETECTION" ); createGeomAction( GEOMOp::OpPictureImport,"PICTURE_IMPORT" ); +#endif createGeomAction( GEOMOp::OpEdge, "EDGE" ); createGeomAction( GEOMOp::OpWire, "WIRE" ); @@ -910,8 +914,10 @@ void GeometryGUI::initialize( CAM_Application* app ) createMenu( separator(), newEntId, -1 ); +#ifdef WITH_OPENCV createMenu( GEOMOp::OpFeatureDetect, newEntId, -1 ); createMenu( GEOMOp::OpPictureImport, newEntId, -1 ); +#endif int operId = createMenu( tr( "MEN_OPERATIONS" ), -1, -1, 10 ); @@ -1077,9 +1083,11 @@ void GeometryGUI::initialize( CAM_Application* app ) createTool( separator(), operTbId ); createTool( GEOMOp::OpExplode, operTbId ); createTool( separator(), operTbId ); +#ifdef WITH_OPENCV createTool( GEOMOp::OpFeatureDetect, operTbId ); 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 59498a5e6..eb21885c6 100644 --- a/src/GEOMGUI/GeometryGUI_Operations.h +++ b/src/GEOMGUI/GeometryGUI_Operations.h @@ -94,8 +94,10 @@ namespace GEOMOp { Op2dSketcher = 3300, // MENU NEW ENTITY - SKETCHER Op3dSketcher = 3301, // MENU NEW ENTITY - 3D SKETCHER 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 // BuildGUI ------------------//-------------------------------- OpEdge = 3400, // MENU NEW ENTITY - BUILD - EDGE OpWire = 3401, // MENU NEW ENTITY - BUILD - WIRE -- 2.39.2