]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
1) Makefile for ImageComposer package
authorouv <ouv@opencascade.com>
Wed, 10 Jul 2013 11:06:29 +0000 (11:06 +0000)
committerouv <ouv@opencascade.com>
Wed, 10 Jul 2013 11:06:29 +0000 (11:06 +0000)
2) Adding LightApp_GVSelector (for GraphicsView viewer)

configure.ac
src/GraphicsView/Makefile.am
src/ImageComposer/Makefile.am [new file with mode: 0644]
src/LightApp/LightApp_Application.cxx
src/LightApp/LightApp_GVSelector.cxx [new file with mode: 0644]
src/LightApp/LightApp_GVSelector.h [new file with mode: 0644]
src/LightApp/Makefile.am
src/Makefile.am

index c502ee202a91c78cf8ca2ae51c0d3535ec98f2fd..ed5d989ed8493f8399759bd2c4ff35b220127da5 100644 (file)
@@ -677,6 +677,7 @@ AC_OUTPUT([ \
   src/TOOLSGUI/Makefile \
   src/Event/Makefile \
   src/OpenGLUtils/Makefile \
+  src/ImageComposer/Makefile \
   src/Session/Makefile \
   src/SalomeApp/Makefile \
   src/SalomeApp/Test/Makefile \
index 688ce1fbee0f6168ece6ff7000d47998b24b7561..6e0b1c31e143d9596c9880638f42090c4579ea1c 100644 (file)
 #
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
-#  File   : Makefile.in
-#  Author : Vladimir Klyachin (OCN)
-#  Module : caf
-#  $Header$
 
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
@@ -81,6 +77,6 @@ nodist_salomeres_DATA =               \
        GraphicsView_msg_en.qm  \
        GraphicsView_msg_fr.qm
 
-libGraphicsView_la_CPPFLAGS = $(QT_INCLUDES) -I$(srcdir)/../SUIT -I$(srcdir)/../Qtx
+libGraphicsView_la_CPPFLAGS = $(QT_INCLUDES) -I$(srcdir)/../SUIT -I$(srcdir)/../Qtx -I$(srcdir)/../ImageComposer
 libGraphicsView_la_LDFLAGS  = $(QT_MT_LIBS)
-libGraphicsView_la_LIBADD   = ../SUIT/libsuit.la
+libGraphicsView_la_LIBADD   = ../SUIT/libsuit.la ../ImageComposer/libImageComposer.la
diff --git a/src/ImageComposer/Makefile.am b/src/ImageComposer/Makefile.am
new file mode 100644 (file)
index 0000000..cbae5a4
--- /dev/null
@@ -0,0 +1,44 @@
+#  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  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 $(top_srcdir)/adm_local/unix/make_common_starter.am
+
+lib_LTLIBRARIES = libImageComposer.la
+
+salomeinclude_HEADERS =                        \
+ImageComposer.h                                \
+ImageComposer_ColorMaskOperator.h      \
+ImageComposer_CropOperator.h           \
+ImageComposer_CutOperator.h            \
+ImageComposer_FuseOperator.h           \
+ImageComposer_Image.h                  \
+ImageComposer_Operator.h               \
+ImageComposer_Tools.h
+
+dist_libImageComposer_la_SOURCES =     \
+ImageComposer_ColorMaskOperator.cxx    \
+ImageComposer_CropOperator.cxx         \
+ImageComposer_CutOperator.cxx          \
+ImageComposer_FuseOperator.cxx         \
+ImageComposer_Image.cxx                        \
+ImageComposer_Operator.cxx             \
+ImageComposer_Tools.cxx
+
+libImageComposer_la_CPPFLAGS = $(QT_INCLUDES)
+libImageComposer_la_LDFLAGS  = $(QT_MT_LIBS)
index 0fb976ed11a8d8708e857ae8af9d87691876e0bc..3d1e6339afd6cdfe008923e2c88e0569b01e939b 100644 (file)
   #include <QxScene_ViewWindow.h>
 #endif
 
-#ifndef DISABLE_GRAPHICSVIEWER
+#ifndef DISABLE_GRAPHICSVIEW
   #include <GraphicsView_Viewer.h>
   #include <GraphicsView_ViewManager.h>
+  #include "LightApp_GVSelector.h"
 #endif
 
 
@@ -674,7 +675,7 @@ void LightApp_Application::createActions()
 //  createActionForViewer( NewQxGraphViewId, newWinMenu, QString::number( 4 ), Qt::ALT+Qt::Key_C );
   createActionForViewer( NewQxSceneViewId, newWinMenu, QString::number( 4 ), Qt::ALT+Qt::Key_S );
 #endif
-#ifndef DISABLE_GRAPHICSVIEWER
+#ifndef DISABLE_GRAPHICSVIEW
   createActionForViewer( NewGraphicsViewId, newWinMenu, QString::number( 5 ), Qt::ALT+Qt::Key_R );
 #endif
 
@@ -795,7 +796,7 @@ void LightApp_Application::onNewWindow()
     type = QxScene_Viewer::Type();
     break;
 #endif
-#ifndef DISABLE_GRAPHICSVIEWER
+#ifndef DISABLE_GRAPHICSVIEW
   case NewGraphicsViewId:
     type = GraphicsView_Viewer::Type();
     break;
@@ -926,7 +927,7 @@ void LightApp_Application::updateCommandsStatus()
     a->setEnabled( activeStudy() );
 #endif
 
-#ifndef DISABLE_GRAPHICSVIEWER
+#ifndef DISABLE_GRAPHICSVIEW
   a = action( NewGraphicsViewId );
   if( a )
     a->setEnabled( activeStudy() );
@@ -1505,10 +1506,11 @@ SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType
 #endif
   }
 #endif
-#ifndef DISABLE_GRAPHICSVIEWER
+#ifndef DISABLE_GRAPHICSVIEW
   if( vmType == GraphicsView_Viewer::Type() )
   {
     viewMgr = new GraphicsView_ViewManager( activeStudy(), desktop() );
+    new LightApp_GVSelector( (GraphicsView_Viewer*)viewMgr->getViewModel(), mySelMgr );
   }
 #endif
 
diff --git a/src/LightApp/LightApp_GVSelector.cxx b/src/LightApp/LightApp_GVSelector.cxx
new file mode 100644 (file)
index 0000000..75ed0d1
--- /dev/null
@@ -0,0 +1,80 @@
+// Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// 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 <LightApp_GVSelector.h>
+
+#include <GraphicsView_Object.h>
+#include <GraphicsView_Selector.h>
+#include <GraphicsView_ViewPort.h>
+#include <GraphicsView_Viewer.h>
+
+LightApp_GVDataOwner::LightApp_GVDataOwner( GraphicsView_Object* theObject )
+: myObject( theObject )
+{
+}
+
+LightApp_GVDataOwner::~LightApp_GVDataOwner()
+{
+}
+
+QString LightApp_GVDataOwner::keyString() const
+{
+  return myObject->getName();
+}
+
+GraphicsView_Object* LightApp_GVDataOwner::object() const
+{
+  return myObject;
+}
+
+LightApp_GVSelector::LightApp_GVSelector( GraphicsView_Viewer* theViewer,
+                                          SUIT_SelectionMgr* theSelMgr )
+: SUIT_Selector( theSelMgr ), myViewer( theViewer )
+{
+  connect( theViewer->getSelector(), SIGNAL( selSelectionDone( GV_SelectionChangeStatus ) ),
+           this, SLOT( OnSelectionDone( GV_SelectionChangeStatus ) ) );
+}
+
+LightApp_GVSelector::~LightApp_GVSelector()
+{
+}
+
+QString LightApp_GVSelector::type() const
+{
+  return GraphicsView_Viewer::Type();
+}
+
+void LightApp_GVSelector::getSelection( SUIT_DataOwnerPtrList& theList ) const
+{
+  GraphicsView_ViewPort* aViewport = myViewer->getActiveViewPort();
+  for( aViewport->initSelected(); aViewport->moreSelected(); aViewport->nextSelected() )
+    theList.append( new LightApp_GVDataOwner( aViewport->selectedObject() ) );
+}
+
+void LightApp_GVSelector::setSelection( const SUIT_DataOwnerPtrList& )
+{
+}
+
+void LightApp_GVSelector::OnSelectionDone( GV_SelectionChangeStatus )
+{
+  selectionChanged();
+}
diff --git a/src/LightApp/LightApp_GVSelector.h b/src/LightApp/LightApp_GVSelector.h
new file mode 100644 (file)
index 0000000..e977d0a
--- /dev/null
@@ -0,0 +1,70 @@
+// Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef LIGHTAPP_GVSELECTOR_H
+#define LIGHTAPP_GVSELECTOR_H
+
+#include "LightApp.h"
+
+#include <QObject>
+#include <SUIT_Selector.h>
+#include <SUIT_DataOwner.h>
+#include <GraphicsView_Defs.h>
+
+class GraphicsView_Object;
+class GraphicsView_Viewer;
+
+class LIGHTAPP_EXPORT LightApp_GVDataOwner : public SUIT_DataOwner
+{
+public:
+  LightApp_GVDataOwner( GraphicsView_Object* );
+  virtual ~LightApp_GVDataOwner();
+
+  virtual QString keyString() const;
+  GraphicsView_Object* object() const;
+
+private:
+  GraphicsView_Object* myObject;
+};
+
+class LIGHTAPP_EXPORT LightApp_GVSelector : public QObject, public SUIT_Selector
+{
+  Q_OBJECT
+
+public:
+  LightApp_GVSelector( GraphicsView_Viewer*, SUIT_SelectionMgr* );
+  virtual ~LightApp_GVSelector();
+
+  virtual QString type() const;
+
+protected:
+  virtual void getSelection( SUIT_DataOwnerPtrList& ) const;
+  virtual void setSelection( const SUIT_DataOwnerPtrList& );
+
+protected slots:
+  void OnSelectionDone( GV_SelectionChangeStatus );
+
+private:
+  GraphicsView_Viewer* myViewer;
+};
+
+#endif
index 146825ad3e305d0bdba4bbdba0db070c09b967bc..e82031f1fc0ddc6723840b94aa5f7d33e6a476f9 100755 (executable)
@@ -79,6 +79,9 @@ endif
 if ENABLE_GLVIEWER
   salomeinclude_HEADERS += LightApp_GLSelector.h
 endif
+if ENABLE_GRAPHICSVIEW
+  salomeinclude_HEADERS += LightApp_GVSelector.h
+endif
 if ENABLE_PLOT2DVIEWER
   salomeinclude_HEADERS += LightApp_Plot2dSelector.h
 endif
@@ -128,6 +131,9 @@ endif
 if ENABLE_GLVIEWER
   dist_libLightApp_la_SOURCES += LightApp_GLSelector.cxx
 endif
+if ENABLE_GRAPHICSVIEW
+  dist_libLightApp_la_SOURCES += LightApp_GVSelector.cxx
+endif
 if ENABLE_PLOT2DVIEWER
   dist_libLightApp_la_SOURCES += LightApp_Plot2dSelector.cxx
 endif
@@ -162,6 +168,9 @@ endif
 if ENABLE_GLVIEWER
   MOC_FILES += LightApp_GLSelector_moc.cxx
 endif
+if ENABLE_GRAPHICSVIEW
+  MOC_FILES += LightApp_GVSelector_moc.cxx
+endif
 if ENABLE_PLOT2DVIEWER
   MOC_FILES += LightApp_Plot2dSelector_moc.cxx
 endif
@@ -219,7 +228,7 @@ endif
 if ENABLE_GRAPHICSVIEW
   libLightApp_la_CPPFLAGS += -I$(srcdir)/../GraphicsView
 else !ENABLE_GRAPHICSVIEW
-  libLightApp_la_CPPFLAGS += -DDISABLE_GRAPHICSVIEWER
+  libLightApp_la_CPPFLAGS += -DDISABLE_GRAPHICSVIEW
 endif
 if ENABLE_SUPERVGRAPHVIEWER
   libLightApp_la_CPPFLAGS += -I$(srcdir)/../SUPERVGraph
index b419ac73c9935d4d758d6b69eedd4b896c6f0884..9907e6de859ebba73779c67693ebf8f2923962b0 100755 (executable)
@@ -29,7 +29,7 @@ include $(top_srcdir)/adm_local/unix/make_common_starter.am
 # Common packages
 ##
 
-SUBDIRS_COMMON = CASCatch Qtx Style DDS QDS ObjBrowser SUIT SUITApp STD CAF CAM LogWindow Prs Event OpenGLUtils GUI_PY
+SUBDIRS_COMMON = CASCatch Qtx Style DDS QDS ObjBrowser SUIT SUITApp STD CAF CAM LogWindow Prs Event OpenGLUtils ImageComposer GUI_PY
 
 ##
 # SALOME object
@@ -131,7 +131,7 @@ SUBDIRS = $(SUBDIRS_COMMON) $(SUBDIRS_OBJECT) $(SUBDIRS_VIEWERTOOLS) $(SUBDIRS_G
           $(SUBDIRS_OCCVIEWER) $(SUBDIRS_PLOT2DVIEWER) $(SUBDIRS_SUPERVGRAPHVIEWER) $(SUBDIRS_QXGRAPHVIEWER) \
           $(SUBDIRS_PYCONSOLE) $(SUBDIRS_LIGHT) $(SUBDIRS_CORBA) $(SUBDIRS_PY_LIGHT)
 
-DIST_SUBDIRS = CASCatch Qtx Style DDS QDS ObjBrowser SUIT SUITApp STD CAF CAM LogWindow Prs Event OpenGLUtils \
+DIST_SUBDIRS = CASCatch Qtx Style DDS QDS ObjBrowser SUIT SUITApp STD CAF CAM LogWindow Prs Event OpenGLUtils ImageComposer \
                OBJECT ViewerTools GLViewer GraphicsView VTKViewer SVTK OCCViewer SOCC Plot2d SPlot2d SUPERVGraph QxGraph QxScene \
                PyInterp PyConsole LightApp ResExporter TOOLSGUI Session SalomeApp GuiHelpers TreeData \
                SALOME_SWIG SALOME_PY SALOME_PYQT GUI_PY