]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Merge from BR_OPENCV
authorgdd <gdd>
Tue, 8 Nov 2011 13:45:21 +0000 (13:45 +0000)
committergdd <gdd>
Tue, 8 Nov 2011 13:45:21 +0000 (13:45 +0000)
12 files changed:
configure.ac
src/LightApp/Makefile.am
src/OBJECT/Handle_SALOME_AISShape.hxx
src/OBJECT/SALOME_AISShape.cxx
src/OBJECT/SALOME_AISShape.hxx
src/OBJECT/SALOME_AISShape.ixx
src/OCCViewer/Makefile.am
src/OCCViewer/OCCViewer_ViewModel.cxx
src/OCCViewer/OCCViewer_ViewPort3d.cxx
src/OCCViewer/OCCViewer_ViewPort3d.h
src/OCCViewer/OCCViewer_ViewWindow.cxx
src/SOCC/Makefile.am

index 7121072858084aac6044dd8839196f5e259dee16..203158ba51c34ac272e423151e8fb9003cb16256 100644 (file)
@@ -526,10 +526,10 @@ fi
 
 if test "$GUI_DISABLE_CORBA" != "yes"; then
 variables="cc_ok lex_yacc_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok
-omniORB_ok boost_ok occ_ok sip_ok pyqt_ok qwt_ok doxygen_ok graphviz_ok libxml_ok Kernel_ok"
+omniORB_ok boost_ok occ_ok sip_ok pyqt_ok qwt_ok doxygen_ok graphviz_ok opencv_ok libxml_ok Kernel_ok"
 else
 variables="cc_ok lex_yacc_ok python_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok boost_ok
-occ_ok sip_ok pyqt_ok qwt_ok doxygen_ok graphviz_ok Kernel_ok"
+occ_ok sip_ok pyqt_ok qwt_ok doxygen_ok graphviz_ok opencv_ok Kernel_ok "
 fi
 
 for var in $variables
index 814e02bb9136f255d37c80a73c629128f8eb1df6..1f032bed8f625070bae5fd32339b391355909955 100755 (executable)
@@ -183,10 +183,13 @@ nodist_salomeres_DATA =           \
 
 libLightApp_la_CPPFLAGS = $(PYTHON_INCLUDES) $(QT_INCLUDES) $(CAS_CPPFLAGS)            \
        $(HDF5_INCLUDES) @KERNEL_CXXFLAGS@ -I$(srcdir)/../SUIT -I$(srcdir)/../STD       \
+       $(OPENCV_INCLUDES)                                                              \
        -I$(srcdir)/../CAM -I$(srcdir)/../ObjBrowser -I$(srcdir)/../LogWindow           \
        -I$(srcdir)/../Prs -I$(srcdir)/../Qtx -I$(srcdir)/../Event -I$(srcdir)/../Style \
        -I$(srcdir)/../CASCatch
-libLightApp_la_LDFLAGS = $(QT_MT_LIBS)
+
+libLightApp_la_LDFLAGS = $(QT_MT_LIBS)                                                 \
+       $(OPENCV_LIBS)
 
 if ENABLE_VTKVIEWER
   libLightApp_la_CPPFLAGS += $(VTK_INCLUDES) -I$(srcdir)/../VTKViewer
index 2c2026d399e5827a6ebaba7b3695980e81f05a7b..b114d0a1de1b5dde0a3b17fcbcf328c1a0bb8e78 100755 (executable)
 #include <Standard.hxx>
 #endif
 
-#ifndef _Handle_AIS_Shape_HeaderFile
-#include <Handle_AIS_Shape.hxx>
+// #ifndef _Handle_AIS_Shape_HeaderFile
+// #include <Handle_AIS_Shape.hxx>
+// #endif
+#ifndef _AIS_TexturedShape_HeaderFile
+#include <AIS_TexturedShape.hxx>
 #endif
 
 class Standard_Transient;
@@ -44,7 +47,8 @@ class Handle_Standard_Type;
   \class Handle(AIS_Shape)
   Smart pointer (handle) to AIS_Shape
 */
-class Handle(AIS_Shape);
+// class Handle(AIS_Shape);
+class Handle(AIS_TexturedShape);
 class SALOME_AISShape;
 Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(SALOME_AISShape);
 
@@ -52,7 +56,7 @@ Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(SALOME_AISShape);
   \class Handle(SALOME_AISShape)
   Smart pointer (handle) to SALOME_AISShape
 */
-class Handle(SALOME_AISShape) : public Handle(AIS_Shape) {
+class Handle(SALOME_AISShape) : public Handle(AIS_TexturedShape) {
   public:
     inline void* operator new(size_t,void* anAddress) 
       {
@@ -70,12 +74,12 @@ class Handle(SALOME_AISShape) : public Handle(AIS_Shape) {
 //      { 
 //        if (anAddress) Standard::Free((Standard_Address&)anAddress,size); 
 //      }
-    Handle(SALOME_AISShape)():Handle(AIS_Shape)() {} 
-    Handle(SALOME_AISShape)(const Handle(SALOME_AISShape)& aHandle) : Handle(AIS_Shape)(aHandle) 
+    Handle(SALOME_AISShape)():Handle(AIS_TexturedShape)() {} 
+    Handle(SALOME_AISShape)(const Handle(SALOME_AISShape)& aHandle) : Handle(AIS_TexturedShape)(aHandle) 
      {
      }
 
-    Handle(SALOME_AISShape)(const SALOME_AISShape* anItem) : Handle(AIS_Shape)((AIS_Shape *)anItem) 
+    Handle(SALOME_AISShape)(const SALOME_AISShape* anItem) : Handle(AIS_TexturedShape)((AIS_TexturedShape *)anItem) 
      {
      }
 
index 0916b3303ecc7bf8e0c73d41aa2211e4262f65c9..2f812e30f20de97dadfa24162bd0867afd4b2539 100755 (executable)
@@ -34,7 +34,7 @@
   \param shape - TopoDS shape 
 */
 SALOME_AISShape::SALOME_AISShape(const TopoDS_Shape& shape)
-: AIS_Shape(shape)
+: AIS_TexturedShape(shape)
 {
 }
 
index eef6f61bd399d0bfde9b33d122e05e79eb6d4a49..cdc8afe2a385023b9bb65b23dfa7e1700c92a396 100755 (executable)
 #ifndef _Handle_SALOME_InteractiveObject_HeaderFile
 #include <Handle_SALOME_InteractiveObject.hxx>
 #endif
-#ifndef _AIS_Shape_HeaderFile
-#include <AIS_Shape.hxx>
+// #ifndef _AIS_Shape_HeaderFile
+// #include <AIS_Shape.hxx>
+// #endif
+#ifndef _AIS_TexturedShape_HeaderFile
+#include <AIS_TexturedShape.hxx>
 #endif
 #ifndef _Standard_Boolean_HeaderFile
 #include <Standard_Boolean.hxx>
 #endif
+
 class SALOME_InteractiveObject;
 class TopoDS_Shape;
 class TColStd_IndexedMapOfInteger;
 
 
-class SALOME_AISShape : public AIS_Shape {
+class SALOME_AISShape : public AIS_TexturedShape {
 
 public:
 
index ef67553bf04009c8ca0d213791703aa6a2ced02b..10aaaf693f57451e2a678cca3980848366dccee8 100755 (executable)
@@ -37,8 +37,8 @@ SALOME_AISShape::~SALOME_AISShape() {}
 Standard_EXPORT Handle_Standard_Type& SALOME_AISShape_Type_()
 {
 
-    static Handle_Standard_Type aType1 = STANDARD_TYPE(AIS_Shape);
-  if ( aType1.IsNull()) aType1 = STANDARD_TYPE(AIS_Shape);
+  static Handle_Standard_Type aType1 = STANDARD_TYPE(AIS_TexturedShape);
+  if ( aType1.IsNull()) aType1 = STANDARD_TYPE(AIS_TexturedShape);
   static Handle_Standard_Type aType2 = STANDARD_TYPE(AIS_InteractiveObject);
   if ( aType2.IsNull()) aType2 = STANDARD_TYPE(AIS_InteractiveObject);
   static Handle_Standard_Type aType3 = STANDARD_TYPE(SelectMgr_SelectableObject);
index f30b953f7a2a06867e0ec7cac34b29aa53e9ad97..993692633de68d377e63aed88f0f024fef8acbd0 100755 (executable)
@@ -23,6 +23,7 @@
 #  Author : Vladimir Klyachin (OCN)
 #  Module : OCCViewer
 #  $Header$
+#
 
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
@@ -129,5 +130,6 @@ libOCCViewer_la_CPPFLAGS = $(QT_INCLUDES) $(OGL_INCLUDES) $(CAS_CPPFLAGS) @KERNE
        -I$(srcdir)/../OpenGLUtils -I$(srcdir)/../CASCatch
 
 libOCCViewer_la_LDFLAGS  = $(OGL_LIBS) $(QT_MT_LIBS) $(CAS_KERNEL) $(CAS_VIEWER)
+
 libOCCViewer_la_LIBADD   = ../Qtx/libqtx.la ../SUIT/libsuit.la \
        ../ViewerTools/libViewerTools.la ../OpenGLUtils/libOpenGLUtils.la
index 25709f0a4fab0245d63bd36d193de35d6dfdd0cd..240277c318254c294a58947442d9748b440ca162 100755 (executable)
@@ -18,6 +18,7 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 
 #include "OCCViewer_ViewModel.h"
 #include "OCCViewer_ViewWindow.h"
@@ -173,7 +174,10 @@ void OCCViewer_Viewer::initView( OCCViewer_ViewWindow* view )
     
     OCCViewer_ViewPort3d* vp3d = view->getViewPort();
     if ( vp3d )
+    {
       vp3d->setBackgroundColor( myColors[0] );
+      vp3d->getView()->SetSurfaceDetail(V3d_TEX_ALL);
+    }
   }
 }
 
@@ -224,6 +228,7 @@ void OCCViewer_Viewer::onMousePress(SUIT_ViewWindow* theWindow, QMouseEvent* the
 */
 void OCCViewer_Viewer::onMouseMove(SUIT_ViewWindow* theWindow, QMouseEvent* theEvent)
 {
+//   MESSAGE("OCCViewer_Viewer::onMouseMove")
   if (!mySelectionEnabled) return;
   if (!theWindow->inherits("OCCViewer_ViewWindow")) return;
 
@@ -249,6 +254,7 @@ void OCCViewer_Viewer::onMouseMove(SUIT_ViewWindow* theWindow, QMouseEvent* theE
 */
 void OCCViewer_Viewer::onMouseRelease(SUIT_ViewWindow* theWindow, QMouseEvent* theEvent)
 {
+  MESSAGE("OCCViewer_Viewer::onMouseRelease")
   if (!mySelectionEnabled) return;
   if (theEvent->button() != Qt::LeftButton) return;
   if (!theWindow->inherits("OCCViewer_ViewWindow")) return;
@@ -470,9 +476,10 @@ void OCCViewer_Viewer::onChangeBgImageCentered()
   if ( !aView )
     return;
   
-  QString selFile = QFileDialog::getOpenFileName(aView,tr( "SELECT_IMAGE"),aView->backgroundImageFilename(), tr("OCC_BG_IMAGE_FILES"));
-  if ( ! selFile.isEmpty() )
+  QString selFile = QFileDialog::getOpenFileName(aView,tr( "SELECT_IMAGE"),aView->backgroundImageFilename(), tr("OCC_IMAGE_FILES"));
+  if ( ! selFile.isEmpty() ){
     aView->setBackgroundImage(selFile,Aspect_FM_CENTERED);
+  }
 }
 
 /*!
@@ -484,7 +491,7 @@ void OCCViewer_Viewer::onChangeBgImageTiled()
   if ( !aView )
     return;
   
-  QString selFile = QFileDialog::getOpenFileName(aView,tr( "SELECT_IMAGE"),aView->backgroundImageFilename(), tr("OCC_BG_IMAGE_FILES"));
+  QString selFile = QFileDialog::getOpenFileName(aView,tr( "SELECT_IMAGE"),aView->backgroundImageFilename(), tr("OCC_IMAGE_FILES"));
   if ( ! selFile.isEmpty() )
     aView->setBackgroundImage(selFile,Aspect_FM_TILED);
 }
@@ -498,9 +505,10 @@ void OCCViewer_Viewer::onChangeBgImageStretched()
   if ( !aView )
     return;
   
-  QString selFile = QFileDialog::getOpenFileName(aView,tr( "SELECT_IMAGE"),aView->backgroundImageFilename(), tr("OCC_BG_IMAGE_FILES"));
+  QString selFile = QFileDialog::getOpenFileName(aView,tr( "SELECT_IMAGE"),aView->backgroundImageFilename(), tr("OCC_IMAGE_FILES"));
   if ( ! selFile.isEmpty() )
     aView->setBackgroundImage(selFile,Aspect_FM_STRETCH);
+//     aView->setBackgroundImage(selFile,Aspect_FM_STRETCH_NODEF);
 }
 /*!
   Updates OCC 3D viewer
index ebaeedcae6e0d3fb2664be36c2a0fa09211d84ca..7419c10a720e86961bb2e1749561becbe4d1115d 100755 (executable)
@@ -28,6 +28,7 @@
 #include <Basics_OCCTVersion.hxx>
 
 #include <SUIT_ViewManager.h>
+#include <SUIT_ViewModel.h>
 
 #include <QColor>
 #include <QString>
 #include <V3d_PerspectiveView.hxx>
 #include <V3d_OrthographicView.hxx>
 
+#include <InterfaceGraphic_Visual3d.hxx>
+#include <OpenGl_cmn_varargs.h>
+#include <OpenGl_tsm_ws.h>
+
+#include "utilities.h"
+
 #if defined WNT
 #include <WNT_Window.hxx>
 #else
@@ -312,9 +319,10 @@ QString OCCViewer_ViewPort3d::backgroundImageFilename() const
 void OCCViewer_ViewPort3d::setBackgroundImage( const QString& fileName,const Aspect_FillMethod& theFillMethod)
 { 
   myBackgroundImageFilename=fileName;
-  if ( !activeView().IsNull() ) {
-    activeView()->SetBackgroundImage( (Standard_CString)fileName.toLatin1().constData(),theFillMethod,true);
-  }
+  //TEST
+//   if ( !activeView().IsNull() ) {
+//     activeView()->SetBackgroundImage( (Standard_CString)fileName.toLatin1().constData(),theFillMethod,true);
+//   }
 }
 
 /*!
index 57ee4950805a526f10c4c12084eb09222d7e463e..985126bb4346af997a81ebe0b2d7c06001b7a9a7 100755 (executable)
@@ -59,6 +59,11 @@ public:
 
   virtual QString       backgroundImageFilename() const;
   virtual void          setBackgroundImage( const QString& fileName , const Aspect_FillMethod& theFillMethod);
+  
+  virtual int           getBgImgHeight(){return myBgImgHeight; };
+  virtual int           getBgImgWidth() {return myBgImgWidth;  };
+
+  virtual void          updateStaticTriedronVisibility();
 
   virtual void          updateStaticTriedronVisibility();
 
@@ -119,6 +124,8 @@ private:
   double                myScale;
   bool                  myIsAdvancedZoomingEnabled;
   QString               myBackgroundImageFilename;
+  int                   myBgImgHeight;
+  int                   myBgImgWidth;
 };
 
 #ifdef WIN32
index 902558586ca68dc5f368f6281a5f5edfb4e22d1f..c6d6ef54e4a64087bb30017753e9b51a146cdfc0 100755 (executable)
 
 #include <Standard_Version.hxx>
 
+#include "utilities.h"
+
+// // OpenCV includes
+// #include <cv.h>
+// #include <highgui.h>
+
 static QEvent* l_mbPressEvent = 0;
 
 #ifdef WIN32
@@ -228,6 +234,7 @@ OCCViewer_ViewWindow::OCCViewer_ViewWindow( SUIT_Desktop*     theDesktop,
   myInteractionStyle = SUIT_ViewModel::STANDARD;
 
   clearViewAspects();
+  
 }
 
 /*!
@@ -827,6 +834,7 @@ void OCCViewer_ViewWindow::vpMouseMoveEvent( QMouseEvent* theEvent )
             myViewPort->setCursor( handCursor );
           }
         }
+        emit mouseMoving( this, theEvent );
       }
       else if ( anInteractionStyle == SUIT_ViewModel::STANDARD && 
                 aButton == Qt::RightButton && ( aState == Qt::NoModifier || Qt::ShiftModifier ) ) {
@@ -2271,6 +2279,7 @@ void OCCViewer_ViewWindow::onSketchingStarted()
 */
 void OCCViewer_ViewWindow::onSketchingFinished()
 {
+  MESSAGE("OCCViewer_ViewWindow::onSketchingFinished()")
   if ( mypSketcher && mypSketcher->result() == OCCViewer_ViewSketcher::Accept )
   {
     Handle(AIS_InteractiveContext) ic = myModel->getAISContext();
@@ -2286,6 +2295,7 @@ void OCCViewer_ViewWindow::onSketchingFinished()
           int aRight = aRect->right();
           int aTop = aRect->top();
           int aBottom = aRect->bottom();
+//           myRect = aRect;
 
           if( append )
             ic->ShiftSelect( aLeft, aBottom, aRight, aTop, getViewPort()->getView(), Standard_False );
@@ -2421,7 +2431,8 @@ QString OCCViewer_ViewWindow::backgroundImageFilename() const
    
 void OCCViewer_ViewWindow::setBackgroundImage( const QString& theFileName,const Aspect_FillMethod& theFillMethod)
 {
-  if ( myViewPort ) myViewPort->setBackgroundImage( theFileName ,theFillMethod);
+  if ( myViewPort ) 
+    myViewPort->setBackgroundImage( theFileName ,theFillMethod);
 }
 
 /*!
index 91ea8e7359973296a3cf44a1c33f7f0f10e6cda0..6f9ba3e5d7061f3a995ec991929469084059346c 100755 (executable)
@@ -46,9 +46,12 @@ MOC_FILES =                  \
 nodist_libSOCC_la_SOURCES = $(MOC_FILES)
 
 libSOCC_la_CPPFLAGS = $(QT_INCLUDES) $(CAS_CPPFLAGS) $(BOOST_CPPFLAGS)                 \
+                     $(OPENCV_INCLUDES)                                                \
                      -I$(srcdir)/../SUIT -I$(srcdir)/../OBJECT -I$(srcdir)/../Prs      \
                      -I$(srcdir)/../OCCViewer -I$(srcdir)/../Qtx
 
-libSOCC_la_LDFLAGS  = $(QT_MT_LIBS)
+libSOCC_la_LDFLAGS  = $(QT_MT_LIBS)    \
+                     $(OPENCV_LIBS)
+
 libSOCC_la_LIBADD   = ../Qtx/libqtx.la ../SUIT/libsuit.la ../OBJECT/libSalomeObject.la \
                      ../Prs/libSalomePrs.la ../OCCViewer/libOCCViewer.la