]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
rnc: made OpenCV an optional prerequisite
authorgdd <gdd>
Mon, 7 Nov 2011 15:11:09 +0000 (15:11 +0000)
committergdd <gdd>
Mon, 7 Nov 2011 15:11:09 +0000 (15:11 +0000)
src/EntityGUI/EntityGUI.cxx
src/EntityGUI/Makefile.am
src/GEOMGUI/GeometryGUI.cxx
src/GEOMGUI/GeometryGUI_Operations.h

index c1d160314699441201f792f448382ded71150b16..02985b32876c5e0c7df2d026129c5ec0098013ce 100644 (file)
@@ -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;
index a9134497d51be16983c8eb43b82a06b9f051338f..40fd1b654772382bb60d04e5ddabc094e7bff1e8 100644 (file)
 #
 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)
index e49dc8e2d2eef94fef4a5906940ec8bf98e63052..0cb7c95c21d3b65515148a7c003fbd569e96e895 100644 (file)
@@ -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 );
index 59498a5e6baea722d5806f9d52c2eae66ccb1de8..eb21885c6d1cf5b62b75dd48260249957ef353c1 100644 (file)
@@ -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