]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
rnc : commit of previous work done before opening of the branch
authorgdd <gdd>
Tue, 13 Sep 2011 12:39:31 +0000 (12:39 +0000)
committergdd <gdd>
Tue, 13 Sep 2011 12:39:31 +0000 (12:39 +0000)
13 files changed:
src/BasicGUI/Makefile.am
src/EntityGUI/EntityGUI.cxx
src/EntityGUI/EntityGUI.h
src/EntityGUI/EntityGUI_SketcherDlg.cxx
src/EntityGUI/Makefile.am
src/GEOMBase/GEOMBase_Helper.cxx
src/GEOMBase/Makefile.am
src/GEOMGUI/GEOM_msg_en.ts
src/GEOMGUI/GEOM_msg_fr.ts
src/GEOMGUI/GeometryGUI.cxx
src/GEOMGUI/GeometryGUI_Operations.h
src/GEOMGUI/Makefile.am
src/OperationGUI/Makefile.am

index 08fde9c7df35d42d5c939a54200769f80102aea8..05ba2d5618686ede49de1da7ed8215daf4f74137 100644 (file)
@@ -101,7 +101,9 @@ libBasicGUI_la_CPPFLAGS =                   \
        -I$(srcdir)/../GEOMImpl                 \
        -I$(srcdir)/../GEOMClient               \
        -I$(top_builddir)/src/DlgRef            \
-       -I$(top_builddir)/idl
+       -I$(top_builddir)/idl                   \
+       -I/home/palmco/OpenCV/OpenCV-2.3.0/install/include/opencv \
+       -I/home/palmco/OpenCV/OpenCV-2.3.0/install/include
 
 
 libBasicGUI_la_LDFLAGS  =                                      \
@@ -109,4 +111,5 @@ libBasicGUI_la_LDFLAGS  =                                   \
        ../GEOMBase/libGEOMBase.la                              \
        ../GEOMGUI/libGEOM.la                                   \
        $(CAS_LDFLAGS) -lTKGeomBase                             \
-       $(GUI_LDFLAGS) -lsuit
+       $(GUI_LDFLAGS) -lsuit                                   \
+       -L/home/palmco/OpenCV/OpenCV-2.3.0/install/lib -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann  
index a6b0bdf23ae7fdbf4a180969f35333c3af684a0d..33dee8d011df156b464c50653e99a114c15e00bb 100644 (file)
 #include <ElSLib.hxx>
 
 #include <QMouseEvent>
+#include <QApplication>
 
-#include "EntityGUI_SketcherDlg.h" // Sketcher
-#include "EntityGUI_3DSketcherDlg.h" // Sketcher
-#include "EntityGUI_SubShapeDlg.h" // Method SUBSHAPE
+#include "EntityGUI_SketcherDlg.h"        // Sketcher
+#include "EntityGUI_3DSketcherDlg.h"      // Sketcher
+#include "EntityGUI_SubShapeDlg.h"        // Method SUBSHAPE
+#include "EntityGUI_FeatureDetectorDlg.h" // Feature Detection
 
 //=======================================================================
 // function : EntityGUI()
@@ -93,6 +95,9 @@ bool EntityGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
   case GEOMOp::OpExplode:    // EXPLODE
     aDlg = new EntityGUI_SubShapeDlg( getGeometryGUI(), parent );
     break;
+  case GEOMOp::OpFeatureDetect:    // CORNER DETECTION
+    aDlg = new EntityGUI_FeatureDetectorDlg( getGeometryGUI(), parent );
+    break;
   default:
     app->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) );
     break;
@@ -113,38 +118,96 @@ bool EntityGUI::OnMousePress( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWi
   QDialog* aDlg = getGeometryGUI()->GetActiveDialogBox();
 
   // Create Point dialog, OCC viewer 
-  if ( aDlg && ( QString( aDlg->metaObject()->className() ).compare( "EntityGUI_SketcherDlg" ) == 0 ) &&
+  if ( aDlg && 
        theViewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() &&
        pe->modifiers() != Qt::ControlModifier ) {
-    MESSAGE("Premier if ok!")
-    EntityGUI_SketcherDlg* aPntDlg = (EntityGUI_SketcherDlg*) aDlg;
-    if ( aPntDlg->acceptMouseEvent() ) {
-      OCCViewer_Viewer* anOCCViewer =
-        ( (OCCViewer_ViewManager*)( theViewWindow->getViewManager() ) )->getOCCViewer();
-      Handle(AIS_InteractiveContext) ic = anOCCViewer->getAISContext();
-
-      gp_Pnt aPnt;    
-
-      ic->InitSelected();
-      if ( pe->modifiers() == Qt::ShiftModifier )
-        ic->ShiftSelect();  // Append selection
-      else
+    
+    gp_Pnt aPnt;
+  
+    if ( QString( aDlg->metaObject()->className() ).compare( "EntityGUI_SketcherDlg" ) == 0 ) 
+    { 
+      EntityGUI_SketcherDlg* aSketcherDlg = (EntityGUI_SketcherDlg*) aDlg;
+      if ( aSketcherDlg->acceptMouseEvent() ) {
+        OCCViewer_Viewer* anOCCViewer =
+          ( (OCCViewer_ViewManager*)( theViewWindow->getViewManager() ) )->getOCCViewer();
+        Handle(AIS_InteractiveContext) ic = anOCCViewer->getAISContext();
+    
+        ic->InitSelected();
+        if ( pe->modifiers() == Qt::ShiftModifier )
+          ic->ShiftSelect();  // Append selection
+        else
+          ic->Select();       // New selection
+
+        ic->InitSelected();
+        if ( ic->MoreSelected() ) {
+          TopoDS_Shape aShape = ic->SelectedShape();
+          if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX )
+            aPnt = BRep_Tool::Pnt( TopoDS::Vertex( ic->SelectedShape() ) );
+        }
+        else {
+          OCCViewer_ViewPort3d* vp =  ((OCCViewer_ViewWindow*)theViewWindow)->getViewPort();
+          aPnt = ConvertClickToPoint( pe->x(), pe->y(), vp->getView() );
+        }
+        
+        Qt::KeyboardModifiers modifiers = pe->modifiers();
+        aSketcherDlg->OnPointSelected( modifiers, aPnt );  // "feed" the point to point construction dialog
+      } // acceptMouseEvent()
+    }
+    if (  QString( aDlg->metaObject()->className() ).compare( "EntityGUI_FeatureDetectorDlg" ) == 0 ) 
+    {
+      EntityGUI_FeatureDetectorDlg* aCornerDlg = (EntityGUI_FeatureDetectorDlg*) aDlg;
+      if ( aCornerDlg->acceptMouseEvent() ) {
+        OCCViewer_Viewer* anOCCViewer =
+          ( (OCCViewer_ViewManager*)( theViewWindow->getViewManager() ) )->getOCCViewer();
+        Handle(AIS_InteractiveContext) ic = anOCCViewer->getAISContext();   
+
+        ic->InitSelected();
         ic->Select();       // New selection
 
-      ic->InitSelected();
-      if ( ic->MoreSelected() ) {
-        TopoDS_Shape aShape = ic->SelectedShape();
-        if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX )
-          aPnt = BRep_Tool::Pnt( TopoDS::Vertex( ic->SelectedShape() ) );
-      }
-      else {
-        OCCViewer_ViewPort3d* vp =  ((OCCViewer_ViewWindow*)theViewWindow)->getViewPort();
-        aPnt = ConvertClickToPoint( pe->x(), pe->y(), vp->getView() );
-      }
+        ic->InitSelected();
+        if ( ic->MoreSelected() ) {
+          TopoDS_Shape aShape = ic->SelectedShape();
+          if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX )
+            aPnt = BRep_Tool::Pnt( TopoDS::Vertex( ic->SelectedShape() ) );
+        }
+        else {
+          OCCViewer_ViewPort3d* vp =  ((OCCViewer_ViewWindow*)theViewWindow)->getViewPort();
+          aPnt = ConvertClickToPoint( pe->x(), pe->y(), vp->getView() );
+        }
+        
+        aCornerDlg->OnPointSelected( aPnt );  // "feed" the point to corner detection dialog
+        
+        QPoint start = QPoint(pe->x(),pe->y());
+        aCornerDlg->setStartPnt( start );
+      } // acceptMouseEvent()
+      
+    }
+  }
+  return false;
+}
+
+//=================================================================================
+// function : 0nMouseMove()
+// purpose  : [static] manage mouse events
+//=================================================================================
+bool EntityGUI::OnMouseMove( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWindow* theViewWindow )
+{
+//   MESSAGE("EntityGUI::OnMouseMove")
+  QDialog* aDlg = getGeometryGUI()->GetActiveDialogBox();
+  if ( aDlg && ( QString( aDlg->metaObject()->className() ).compare( "EntityGUI_FeatureDetectorDlg" ) == 0 ) &&
+       theViewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() &&
+       pe->modifiers() != Qt::ControlModifier ) {
+    
+    EntityGUI_FeatureDetectorDlg* aCornerDlg = (EntityGUI_FeatureDetectorDlg*) aDlg;
+   
+    gp_Pnt aPnt; 
       
-      Qt::KeyboardModifiers modifiers = pe->modifiers();
-      aPntDlg->OnPointSelected( modifiers, aPnt );  // "feed" the point to point construction dialog
-    } // acceptMouseEvent()
+    if ( QApplication::mouseButtons() == Qt::LeftButton && 
+         aCornerDlg->acceptMouseEvent() )
+    {
+      QPoint end = QPoint(pe->x(),pe->y());
+      aCornerDlg->setEndPnt( end );
+    }    
   }
   return false;
 }
index cfc0addefbb859ea5c847414e2abdbf1a13b3266..d6a557ef63291bc437b88c8f5d487fbc34ab4de1 100644 (file)
@@ -49,8 +49,9 @@ public :
 
   bool              OnGUIEvent( int, SUIT_Desktop* );
   bool              OnMousePress( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWindow* theViewWindow );
+  bool              OnMouseMove( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWindow* theViewWindow );
   
-  gp_Pnt            ConvertClickToPoint( int x, int y, Handle(V3d_View) aView );
+  static gp_Pnt     ConvertClickToPoint( int x, int y, Handle(V3d_View) aView );
 
   void              DisplaySimulationShape( const TopoDS_Shape&, const TopoDS_Shape& ); 
   void              EraseSimulationShape();
index 711da593cedee950d6cca13c6569ae9081e52fdc..f3fa98bf22842786e3a6822afaf6657e7f039860 100644 (file)
@@ -28,6 +28,9 @@
 #include "EntityGUI_Widgets.h"
 #include <SalomeApp_DoubleSpinBox.h>
 
+#include <OCCViewer_ViewPort3d.h>
+#include <OCCViewer_ViewWindow.h>
+
 #include <GEOMBase.h>
 #include <GeometryGUI.h>
 #include <GEOMImpl_Types.hxx>
@@ -1525,6 +1528,10 @@ void EntityGUI_SketcherDlg::OnPointSelected(Qt::KeyboardModifiers modifiers, con
 {
   MESSAGE("EntityGUI_SketcherDlg::OnPointSelected")
   
+  SUIT_ViewWindow*       theViewWindow  = getDesktop()->activeWindow();
+  OCCViewer_ViewPort3d*  vp             = ((OCCViewer_ViewWindow*)theViewWindow)->getViewPort();
+  QString                theImgFileName = vp->backgroundImageFilename();
+  
   double x, y;
   x = y = 0;
   
@@ -1542,8 +1549,8 @@ void EntityGUI_SketcherDlg::OnPointSelected(Qt::KeyboardModifiers modifiers, con
   gp_Pnt aTrsfPnt; 
   GEOMBase::VertexToPoint( aShape, aTrsfPnt );
   
-  autoApply = ( getPnt2ConstructorId() == 1 && false );  // If no additional argument needed after selection
-                                                         // -> apply automatically --> disabled for now
+  autoApply = ( (getPnt2ConstructorId() == 1) && (!theImgFileName.isEmpty()) );  // If no additional argument needed after selection and there is a backgroundimage
+                                                                                 // -> apply automatically 
   
   if ( getPnt1ConstructorId() == 0 ){                    // Relative selection mode
     x = aTrsfPnt.X() - myLastX1;
index e8331a45457d5924431c141f8a3d008c147fab85..694c1acaab6587d849d52599f5cf173dd5e5c614 100644 (file)
@@ -33,20 +33,23 @@ salomeinclude_HEADERS =                     \
        EntityGUI_Widgets.h             \
        EntityGUI_SketcherDlg.h         \
        EntityGUI_3DSketcherDlg.h       \
-       EntityGUI_SubShapeDlg.h 
+       EntityGUI_SubShapeDlg.h         \
+       EntityGUI_FeatureDetectorDlg.h  
 
 dist_libEntityGUI_la_SOURCES =                 \
        EntityGUI.cxx                   \
        EntityGUI_Widgets.cxx           \
        EntityGUI_SketcherDlg.cxx       \
        EntityGUI_3DSketcherDlg.cxx     \
-       EntityGUI_SubShapeDlg.cxx
+       EntityGUI_SubShapeDlg.cxx       \
+       EntityGUI_FeatureDetectorDlg.cxx        
 
 MOC_FILES =                            \
        EntityGUI_Widgets_moc.cxx       \
        EntityGUI_SketcherDlg_moc.cxx   \
        EntityGUI_3DSketcherDlg_moc.cxx \
-       EntityGUI_SubShapeDlg_moc.cxx
+       EntityGUI_SubShapeDlg_moc.cxx   \
+       EntityGUI_FeatureDetectorDlg_moc.cxx    
 
 nodist_libEntityGUI_la_SOURCES =       \
         $(MOC_FILES)
@@ -88,8 +91,11 @@ libEntityGUI_la_CPPFLAGS =                   \
        -I$(srcdir)/../GEOMImpl                 \
        -I$(srcdir)/../GEOMFiltersSelection     \
        -I$(srcdir)/../SKETCHER                 \
+       -I$(srcdir)/../GEOM                     \
        -I$(top_builddir)/src/DlgRef            \
-       -I$(top_builddir)/idl
+       -I$(top_builddir)/idl                   \
+       -I/home/palmco/OpenCV/OpenCV-2.3.0/install/include/opencv \
+       -I/home/palmco/OpenCV/OpenCV-2.3.0/install/include
 
 libEntityGUI_la_LDFLAGS  =                                     \
        ../GEOMFiltersSelection/libGEOMFiltersSelection.la      \
@@ -97,5 +103,6 @@ libEntityGUI_la_LDFLAGS  =                                   \
        ../SKETCHER/libGEOMSketcher.la                          \
        ../GEOMGUI/libGEOM.la                                   \
        $(QT_MT_LIBS)                                           \
-       $(CAS_TKTopAlgo) -lTKernel
+       $(CAS_TKTopAlgo) -lTKernel                              \
+       -L/home/palmco/OpenCV/OpenCV-2.3.0/install/lib -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann  
 
index d62615d87fb9a8223118230ecbfe68a4fe5d4439..313854e0d6c24825f955d673bca5b1f3eb0775b7 100755 (executable)
@@ -359,7 +359,7 @@ void GEOMBase_Helper::displayPreview( const SALOME_Prs* prs,
 
   if ( myViewWindow == 0 )
     return;
-
+  
   // Display prs
   SUIT_ViewManager* aViewManager = myViewWindow->getViewManager();
   if ( aViewManager->getType() == OCCViewer_Viewer::Type() ||
@@ -700,7 +700,10 @@ bool GEOMBase_Helper::openCommand()
 {
   bool res = false;
   if ( !getStudy() || hasCommand() )
+  {
+    MESSAGE("Getting out from openCommand()")
     return res;
+  }
 
   GEOM::GEOM_IOperations_var anOp = GEOM::GEOM_IOperations::_narrow( getOperation() );
   if ( !anOp->_is_nil() ) {
@@ -708,6 +711,10 @@ bool GEOMBase_Helper::openCommand()
     myCommand->start();
     res = true;
   }
+  else
+  {
+    MESSAGE("anOp->_is_nil() = true")
+  }
 
   return res;
 }
@@ -750,6 +757,8 @@ bool GEOMBase_Helper::commitCommand( const char* )
 //================================================================
 bool GEOMBase_Helper::hasCommand() const
 {
+  bool res = (bool) myCommand;
+  MESSAGE("hasCommand = "<<res)
   return (bool)myCommand;
 }
 
@@ -795,7 +804,11 @@ bool GEOMBase_Helper::checkViewWindow()
 bool GEOMBase_Helper::onAccept( const bool publish, const bool useTransaction )
 {
   SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
-  if ( !appStudy ) return false;
+  if ( !appStudy ) 
+  {
+    MESSAGE("appStudy is empty")
+    return false;
+  }
   _PTR(Study) aStudy = appStudy->studyDS();
 
   bool aLocked = (_PTR(AttributeStudyProperties) (aStudy->GetProperties()))->IsLocked();
@@ -819,7 +832,9 @@ bool GEOMBase_Helper::onAccept( const bool publish, const bool useTransaction )
   bool result = false;
 
   try {
+    MESSAGE("publish ="<<publish<<"useTransaction ="<<useTransaction)
     if ( ( !publish && !useTransaction ) || openCommand() ) {
+      MESSAGE("Entered the if")
       SUIT_OverrideCursor wc;
       SUIT_Session::session()->activeApplication()->putInfo( "" );
       ObjectList objects;
@@ -889,10 +904,12 @@ bool GEOMBase_Helper::onAccept( const bool publish, const bool useTransaction )
   catch( const SALOME::SALOME_Exception& e ) {
     SalomeApp_Tools::QtCatchCorbaException( e );
     abortCommand();
+    MESSAGE("Exception catched")
   }
 
   updateViewer();
 
+  MESSAGE("result ="<<result)
   return result;
 }
 
index 3360c44c31b5b41180e22aa1921f30ed952a4351..70ead1485b5a5a199ac266ce50264717229f5968 100644 (file)
@@ -67,7 +67,9 @@ libGEOMBase_la_CPPFLAGS =             \
        -I$(srcdir)/../GEOMGUI          \
        -I$(srcdir)/../DlgRef           \
        -I$(top_builddir)/src/DlgRef    \
-       -I$(top_builddir)/idl
+       -I$(top_builddir)/idl           \
+       -I/home/palmco/OpenCV/OpenCV-2.3.0/install/include/opencv \
+       -I/home/palmco/OpenCV/OpenCV-2.3.0/install/include
 
 libGEOMBase_la_LDFLAGS  =              \
        ../../idl/libSalomeIDLGEOM.la   \
@@ -75,4 +77,6 @@ libGEOMBase_la_LDFLAGS  =             \
        ../DlgRef/libDlgRef.la          \
        $(KERNEL_LDFLAGS) -lOpUtil      \
        $(GUI_LDFLAGS) -lsuit -lOCCViewer -lVTKViewer -lSVTK -lSalomePrs -lSalomeApp -lCAM \
-       $(CAS_LDPATH) -lTKPrim
+       $(CAS_LDPATH) -lTKPrim          \
+       -L/home/palmco/OpenCV/OpenCV-2.3.0/install/lib -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann  
+
index f3c0edbbb563006c924788a97d01388334a281da..e05b3178b4d13017201d02aac46f0030782efd82 100644 (file)
@@ -2181,6 +2181,10 @@ Please, select face, shell or solid and try again</translation>
         <source>MEN_BUILD</source>
         <translation>Build</translation>
     </message>
+    <message>
+        <source>MEN_FEATURE_DETECTION</source>
+        <translation>Feature detection</translation>
+    </message>
     <message>
         <source>MEN_CHAMFER</source>
         <translation>Chamfer</translation>
@@ -3156,11 +3160,11 @@ Please, select face, shell or solid and try again</translation>
     <message>
         <source>STB_POP_UNPUBLISH_OBJ</source>
         <translation>Unpublish object</translation>
-   </message>
+    </message>
     <message>
         <source>STB_POP_PUBLISH_OBJ</source>
         <translation>Publish object</translation>
-   </message>
+    </message>
     <message>
         <source>STB_POP_HIDE_CHILDREN</source>
         <translation>Hide child objects</translation>
@@ -3704,7 +3708,7 @@ Please, select face, shell or solid and try again</translation>
     <message>
         <source>TOP_POP_PUBLISH_OBJ</source>
         <translation>Publish object</translation>
-   </message>
+    </message>
     <message>
         <source>TOP_POP_HIDE_CHILDREN</source>
         <translation>Hide Children</translation>
@@ -4345,7 +4349,7 @@ Otherwise the dimensions will be kept without modifications.</translation>
     <message>
         <source>GEOM_CURVE_ANALITICAL</source>
         <translation>Analytical</translation>
-    </message>        
+    </message>
 </context>
 <context>
     <name>BasicGUI_ParamCurveWidget</name>
@@ -4372,7 +4376,7 @@ Otherwise the dimensions will be kept without modifications.</translation>
     <message>
         <source>GEOM_PCURVE_MAX</source>
         <translation>Max t</translation>
-    </message>        
+    </message>
     <message>
         <source>GEOM_PCURVE_STEP</source>
         <translation>Step</translation>
@@ -4552,6 +4556,65 @@ Otherwise the dimensions will be kept without modifications.</translation>
 Number of sketch points too small</translation>
     </message>
 </context>
+<context>
+    <name>EntityGUI_FeatureDetectorDlg</name>
+    <message>
+        <source>GEOM_DETECT_TITLE</source>
+        <translation>Feature Detection</translation>
+    </message>
+    <message>
+        <source>GEOM_SCALING</source>
+        <translation>Scaling</translation>
+    </message>
+    <message>
+        <source>GEOM_PNT1</source>
+        <translation>Top left corner</translation>
+    </message>
+    <message>
+        <source>GEOM_PNT2</source>
+        <translation>Top right corner</translation>
+    </message>
+    <message>
+        <source>GEOM_CORNER</source>
+        <translation>Detected_corners</translation>
+    </message>
+    <message>
+        <source>GEOM_CORNERS</source>
+        <translation>Corners</translation>
+    </message>
+    <message>
+        <source>GEOM_CONTOURS</source>
+        <translation>Contours</translation>
+    </message>
+    <message>
+        <source>GEOM_FEATURES</source>
+        <translation>Features</translation>
+    </message>
+    <message>
+        <source>GEOM_DETECT_ZONE</source>
+        <translation>Select a detection zone (default is whole picture)</translation>
+    </message>
+    <message>
+        <source>GEOM_COLOR_FILTER</source>
+        <translation>Select the color of the zone you want to find the frontier of</translation>
+    </message>
+    <message>
+        <source>GEOM_VIEW</source>
+        <translation>View</translation>
+    </message>
+    <message>
+        <source>GEOM_FRONT</source>
+        <translation>Front (Y-Z)</translation>
+    </message>
+    <message>
+        <source>GEOM_TOP</source>
+        <translation>Top (X-Y)</translation>
+    </message>
+    <message>
+        <source>GEOM_LEFT</source>
+        <translation>Left (X-Z)</translation>
+    </message>
+</context>
 <context>
     <name>EntityGUI_SubShapeDlg</name>
     <message>
@@ -4963,12 +5026,12 @@ Would you like to continue?</translation>
         <translation>Publish Objects</translation>
     </message>
     <message>
-      <source>OBJECT_NAME</source>
-      <translation>Name</translation>
+        <source>OBJECT_NAME</source>
+        <translation>Name</translation>
     </message>
     <message>
-      <source>OBJECT_ENTRY</source>
-      <translation>Entry</translation>
+        <source>OBJECT_ENTRY</source>
+        <translation>Entry</translation>
     </message>
     <message>
         <source>UNSELECT_ALL</source>
index 099e90fa3236898aa0d13749a4a5d569dcc38844..5342658ac4f3339a41762b87d690b75074e6d678 100644 (file)
@@ -2181,6 +2181,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>MEN_BUILD</source>
         <translation>Construire</translation>
     </message>
+    <message>
+        <source>MEN_CORNER_DETECTION</source>
+        <translation>Détecter les angles (image ou plan)</translation>
+    </message>
     <message>
         <source>MEN_CHAMFER</source>
         <translation>Chanfrein</translation>
@@ -4552,6 +4556,33 @@ le paramètre &apos;%1&apos; aux préférences du module Géométrie.</translati
 Le nombre de points n&apos;est pas suffisant</translation>
     </message>
 </context>
+<context>
+    <name>EntityGUI_CornerDetectionDlg</name>
+    <message>
+        <source>GEOM_DETECT_TITLE</source>
+        <translation>Détecter les angles</translation>
+    </message>
+    <message>
+        <source>GEOM_SCALING</source>
+        <translation>Mise à l&apos;échelle</translation>
+    </message>
+    <message>
+        <source>GEOM_PNT1</source>
+        <translation>Coin supérieur gauche</translation>
+    </message>
+    <message>
+        <source>GEOM_PNT2</source>
+        <translation>Coin supérieur droit</translation>
+    </message>
+    <message>
+        <source>GEOM_CORNER</source>
+        <translation>Angles_détectés</translation>
+    </message>
+    <message>
+        <source>GEOM_CORNERS</source>
+        <translation>Angles</translation>
+    </message>
+</context>
 <context>
     <name>EntityGUI_SubShapeDlg</name>
     <message>
index 0337045129689a4f10e9f8ef2345810f06754d42..4881c4e10304d5c8c283637ebbaed92481478f32 100644 (file)
@@ -282,7 +282,7 @@ void GeometryGUI::ActiveWorkingPlane()
       view3d->SetProj(DZ.X(), DZ.Y(), DZ.Z());
       view3d->SetUp(DY.X(), DY.Y(), DY.Z());
 
-      vw->onViewFitAll();
+//       vw->onViewFitAll(); TEST (don't forget to remove comments)
     }
   }
   else if( ViewVTK ) {
@@ -460,6 +460,7 @@ void GeometryGUI::OnGUIEvent( int id )
   case GEOMOp::Op2dSketcher:       // MENU ENTITY - SKETCHER
   case GEOMOp::Op3dSketcher:       // MENU ENTITY - 3D SKETCHER
   case GEOMOp::OpExplode:          // MENU ENTITY - EXPLODE
+  case GEOMOp::OpFeatureDetect:    // MENU ENTITY - FEATURE DETECTION
     libName = "EntityGUI";
     break;
   case GEOMOp::OpEdge:             // MENU BUILD - EDGE
@@ -707,6 +708,7 @@ void GeometryGUI::initialize( CAM_Application* app )
   createGeomAction( GEOMOp::Op2dSketcher,  "SKETCH" );
   createGeomAction( GEOMOp::Op3dSketcher,  "3DSKETCH" );
   createGeomAction( GEOMOp::OpExplode,     "EXPLODE" );
+  createGeomAction( GEOMOp::OpFeatureDetect,"FEATURE_DETECTION" );
 
   createGeomAction( GEOMOp::OpEdge,        "EDGE" );
   createGeomAction( GEOMOp::OpWire,        "WIRE" );
@@ -900,6 +902,10 @@ void GeometryGUI::initialize( CAM_Application* app )
   createMenu( GEOMOp::OpShell,    buildId, -1 );
   createMenu( GEOMOp::OpSolid,    buildId, -1 );
   createMenu( GEOMOp::OpCompound, buildId, -1 );
+  
+  createMenu( separator(),          newEntId, -1 );
+  
+  createMenu( GEOMOp::OpFeatureDetect, newEntId, -1 );
 
   int operId = createMenu( tr( "MEN_OPERATIONS" ), -1, -1, 10 );
 
@@ -1065,6 +1071,8 @@ void GeometryGUI::initialize( CAM_Application* app )
   createTool( separator(),               operTbId );
   createTool( GEOMOp::OpExplode,         operTbId );
   createTool( separator(),               operTbId );
+  createTool( GEOMOp::OpFeatureDetect,    operTbId );
+  createTool( separator(),               operTbId );
   createTool( GEOMOp::OpPartition,       operTbId );
   createTool( GEOMOp::OpArchimede,       operTbId );
   createTool( GEOMOp::OpShapesOnShape,   operTbId );
index 73b68f2f2e1384a5422cb35eb093f5802ecf08d8..f891de5a7ba22c943ef4908f5b3bf23ca67a99eb 100644 (file)
@@ -92,6 +92,7 @@ namespace GEOMOp {
     Op2dSketcher        = 3300,   // MENU NEW ENTITY - SKETCHER
     Op3dSketcher        = 3301,   // MENU NEW ENTITY - 3D SKETCHER
     OpExplode           = 3302,   // MENU NEW ENTITY - EXPLODE
+    OpFeatureDetect     = 3303,   // MENU NEW ENTITY - FEATURE DETECTION
     // BuildGUI ------------------//--------------------------------
     OpEdge              = 3400,   // MENU NEW ENTITY - BUILD - EDGE
     OpWire              = 3401,   // MENU NEW ENTITY - BUILD - WIRE
index d65f42496cbf00a80ffd0dcfd3e279a6f9e045e6..5ca89f58f2124c52c6ca017d2aafb3afa62f4e5a 100644 (file)
@@ -76,7 +76,9 @@ libGEOM_la_CPPFLAGS =                         \
        -I$(srcdir)/../GEOMClient               \
        -I$(srcdir)/../GEOMImpl                 \
        -I$(top_builddir)/idl                   \
-       -I$(top_builddir)
+       -I$(top_builddir)                       \   
+       -I/home/palmco/OpenCV/OpenCV-2.3.0/install/include/opencv \
+       -I/home/palmco/OpenCV/OpenCV-2.3.0/install/include
 
 libGEOM_la_LDFLAGS =                                           \
        $(PYTHON_LIBS)                                          \
@@ -84,7 +86,9 @@ libGEOM_la_LDFLAGS =                                          \
        ../GEOMClient/libGEOMClient.la                          \
        ../OBJECT/libGEOMObject.la                              \
        $(KERNEL_LDFLAGS) -lSalomeLifeCycleCORBA -lSalomeNS -lSalomeDSClient            \
-       $(GUI_LDFLAGS) -lOCCViewer -lVTKViewer -lCAM -lSOCC -lSVTK -lEvent -lSalomePrs -lstd
+       $(GUI_LDFLAGS) -lOCCViewer -lVTKViewer -lCAM -lSOCC -lSVTK -lEvent -lSalomePrs -lstd    \
+       -L/home/palmco/OpenCV/OpenCV-2.3.0/install/lib -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann  
+
 # -lSalomeApp 
 # -lToolsGUI
 #      $(CORBA_LIBS) \
index 3246166328c89bc50b68f21a8591324a36d0ee2e..31a5621226d7c06499677ee67081371d5602b3f5 100644 (file)
@@ -81,11 +81,15 @@ libOperationGUI_la_CPPFLAGS =               \
        -I$(srcdir)/../GEOMImpl         \
        -I$(srcdir)/../GEOMAlgo         \
        -I$(top_builddir)/src/DlgRef    \
-       -I$(top_builddir)/idl
+       -I$(top_builddir)/idl           \
+       -I/home/palmco/OpenCV/OpenCV-2.3.0/install/include/opencv \
+       -I/home/palmco/OpenCV/OpenCV-2.3.0/install/include
+
 
 libOperationGUI_la_LDFLAGS =           \
        ../GEOMBase/libGEOMBase.la      \
-       $(CAS_LDPATH) -lTKFillet
+       $(CAS_LDPATH) -lTKFillet        \
+       -L/home/palmco/OpenCV/OpenCV-2.3.0/install/lib -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann  
 
 ###############################
 # Obsolete files ?