]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Create polyline operation was added
authormtn <mtn@opencascade.com>
Thu, 8 Aug 2013 11:23:24 +0000 (11:23 +0000)
committermtn <mtn@opencascade.com>
Thu, 8 Aug 2013 11:23:24 +0000 (11:23 +0000)
src/HYDROGUI/CMakeLists.txt
src/HYDROGUI/HYDROGUI_DataModel.cxx
src/HYDROGUI/HYDROGUI_Operations.cxx
src/HYDROGUI/HYDROGUI_Operations.h
src/HYDROGUI/HYDROGUI_PolylineDlg.cxx [new file with mode: 0755]
src/HYDROGUI/HYDROGUI_PolylineDlg.h [new file with mode: 0755]
src/HYDROGUI/HYDROGUI_PolylineOp.cxx [new file with mode: 0755]
src/HYDROGUI/HYDROGUI_PolylineOp.h [new file with mode: 0755]
src/HYDROGUI/resources/HYDROGUI_msg_en.ts
src/HYDROGUI/resources/LightApp.xml

index 2698378506112a4de00cac5e9835a80601c580d9..f5cc14cf815a4d3683916906b9cafd3bbea378fe 100644 (file)
@@ -10,6 +10,8 @@ set(PROJECT_HEADERS
     HYDROGUI_GVSelector.h
     HYDROGUI_ImportImageDlg.h
     HYDROGUI_ImportImageOp.h
+    HYDROGUI_PolylineOp.h
+    HYDROGUI_PolylineDlg.h
     HYDROGUI_InputPanel.h
     HYDROGUI_Module.h
     HYDROGUI_ObjSelector.h
@@ -36,6 +38,8 @@ set(PROJECT_SOURCES
     HYDROGUI_GVSelector.cxx
     HYDROGUI_ImportImageDlg.cxx
     HYDROGUI_ImportImageOp.cxx
+    HYDROGUI_PolylineDlg.cxx
+    HYDROGUI_PolylineOp.cxx
     HYDROGUI_InputPanel.cxx
     HYDROGUI_Module.cxx
     HYDROGUI_ObjSelector.cxx
@@ -56,19 +60,21 @@ add_definitions(
   ${CAS_DEFINITIONS}
   ${QT_DEFINITIONS}
   $(GUI_CXXFLAGS)
+  $(GEOM_CXXFLAGS)
 )
 
 include_directories(
   ${CAS_INCLUDE_DIRS}
   ${QT_INCLUDES}
   ${GUI_ROOT_DIR}/include/salome
+  ${GEOM_ROOT_DIR}/include/salome
   ${CMAKE_CURRENT_SOURCE_DIR}
   ${CMAKE_CURRENT_SOURCE_DIR}/../HYDROData
   ${CMAKE_CURRENT_SOURCE_DIR}/../HYDROOperations
 )
 
 add_library(HYDROGUI SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${PROJECT_HEADERS_MOC})
-target_link_libraries(HYDROGUI ${CAS_OCAF} HYDROData HYDROOperations)
+target_link_libraries(HYDROGUI ${CAS_OCAF} HYDROData HYDROOperations -L${GEOM_ROOT_DIR}/lib/salome/ -lCurveCreator)
 
 set(PROJECT_LIBRARIES HYDROGUI)
 
index 60952405b862b42cee49366beede115457ae9edc..4108df409fe06fa37bd36136b5745bd72118b5dc 100644 (file)
@@ -195,6 +195,17 @@ void HYDROGUI_DataModel::update( const int theStudyId )
       createObject( anImageRootObj, anImageObj );
   }
 
+  LightApp_DataObject* aPolylineRootObj = createObject( aRootObj, "POLYLINES" );
+
+  HYDROData_Iterator aPolyIterator( aDocument, KIND_IMAGE );
+  for( ; aPolyIterator.More(); aPolyIterator.Next() )
+  {
+    Handle(HYDROData_Image) aPolylineObj =
+      Handle(HYDROData_Image)::DownCast( anIterator.Current() );
+    if( !aPolylineObj.IsNull() )
+      createObject( aPolylineRootObj, aPolylineObj );
+  }
+
   if( SUIT_DataBrowser* anObjectBrowser = anApp->objectBrowser() )
   {
     anObjectBrowser->setAutoOpenLevel( 3 );
index b0714ecc3300a1dfa9edc5e272aefe696b53d61b..767244045d5540627954f45bd17a38363c5c0539 100644 (file)
@@ -28,6 +28,7 @@
 #include "HYDROGUI_Module.h"
 #include "HYDROGUI_ShowHideOp.h"
 #include "HYDROGUI_TwoImagesOp.h"
+#include "HYDROGUI_PolylineOp.h"
 #include "HYDROGUI_UpdateFlags.h"
 
 #include <CAM_Application.h>
@@ -65,6 +66,9 @@ void HYDROGUI_Module::createActions()
   createAction( FuseId, "FUSE_IMAGES" );
   createAction( CutId, "CUT_IMAGES" );
 
+  createAction( PolylineId, "POLYLINE" );
+
+
   createAction( DeleteId, "DELETE", "", Qt::Key_Delete );
 
   createAction( ShowId, "SHOW" );
@@ -85,6 +89,7 @@ void HYDROGUI_Module::createMenus()
   createMenu( ImportImageId, aHydroId, -1, -1 );
   createMenu( FuseId, aHydroId, -1, -1 );
   createMenu( CutId, aHydroId, -1, -1 );
+  createMenu( PolylineId, aHydroId, -1, -1 );
 }
 
 void HYDROGUI_Module::createPopups()
@@ -216,6 +221,8 @@ LightApp_Operation* HYDROGUI_Module::createOperation( const int theId ) const
   case HideAllId:
     anOp = new HYDROGUI_ShowHideOp( aModule, theId );
     break;
+  case PolylineId:
+    anOp = new HYDROGUI_PolylineOp( aModule );
   }
 
   if( !anOp )
index 972bcfb5e9b1cfec5689bb17f4c204ac700007bb..632b026144134859804ae3c0aaa489d7f57f3a08 100644 (file)
@@ -41,6 +41,7 @@ enum OperationId
   ShowAllId,
   HideId,
   HideAllId,
+  PolylineId,
 };
 
 #endif
diff --git a/src/HYDROGUI/HYDROGUI_PolylineDlg.cxx b/src/HYDROGUI/HYDROGUI_PolylineDlg.cxx
new file mode 100755 (executable)
index 0000000..894bc23
--- /dev/null
@@ -0,0 +1,44 @@
+// 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 "HYDROGUI_PolylineDlg.h"
+#include <CurveCreator_Widget.h>
+#include <CurveCreator_Curve.hxx>
+
+
+HYDROGUI_PolylineDlg::HYDROGUI_PolylineDlg( HYDROGUI_Module* theModule, const QString& theTitle )
+: HYDROGUI_InputPanel( theModule, theTitle )
+{
+   CurveCreator_Curve *aStaticCurve = NULL;
+
+   aStaticCurve = new CurveCreator_Curve(CurveCreator::Dim3d);
+
+   CurveCreator_Widget *aWidget =
+       new CurveCreator_Widget( this, aStaticCurve);
+
+   addWidget( aWidget, 0, 0 );
+   setRowStretch();
+}
+
+HYDROGUI_PolylineDlg::~HYDROGUI_PolylineDlg()
+{
+}
diff --git a/src/HYDROGUI/HYDROGUI_PolylineDlg.h b/src/HYDROGUI/HYDROGUI_PolylineDlg.h
new file mode 100755 (executable)
index 0000000..54c4ae2
--- /dev/null
@@ -0,0 +1,44 @@
+// 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 HYDROGUI_POLYLINEDLG_H
+#define HYDROGUI_POLYLINEDLG_H
+
+#include "HYDROGUI_InputPanel.h"
+
+
+class HYDROGUI_PolylineDlg : public HYDROGUI_InputPanel
+{
+  Q_OBJECT
+
+public:
+  HYDROGUI_PolylineDlg( HYDROGUI_Module* theModule, const QString& theTitle );
+  virtual ~HYDROGUI_PolylineDlg();
+
+protected slots:
+
+signals:
+  void                       createPreview( QString );
+
+};
+
+#endif
diff --git a/src/HYDROGUI/HYDROGUI_PolylineOp.cxx b/src/HYDROGUI/HYDROGUI_PolylineOp.cxx
new file mode 100755 (executable)
index 0000000..cfe2c92
--- /dev/null
@@ -0,0 +1,47 @@
+// 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 "HYDROGUI_PolylineOp.h"
+#include "HYDROGUI_PolylineDlg.h"
+
+#include "HYDROGUI_Module.h"
+
+
+HYDROGUI_PolylineOp::HYDROGUI_PolylineOp( HYDROGUI_Module* theModule )
+: HYDROGUI_Operation( theModule )
+{
+  setName( tr("POLYLINE") );
+}
+
+HYDROGUI_PolylineOp::~HYDROGUI_PolylineOp()
+{
+}
+
+HYDROGUI_InputPanel* HYDROGUI_PolylineOp::createInputPanel() const
+{
+  return new HYDROGUI_PolylineDlg( module(), getName() );
+}
+
+bool HYDROGUI_PolylineOp::processApply( int& theUpdateFlags )
+{
+  return true;
+}
diff --git a/src/HYDROGUI/HYDROGUI_PolylineOp.h b/src/HYDROGUI/HYDROGUI_PolylineOp.h
new file mode 100755 (executable)
index 0000000..be473d9
--- /dev/null
@@ -0,0 +1,43 @@
+// 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 HYDROGUI_POLYLINEOP_H
+#define HYDROGUI_POLYLINEOP_H
+
+#include "HYDROGUI_Operation.h"
+
+class HYDROGUI_PolylineOp : public HYDROGUI_Operation
+{
+  Q_OBJECT
+
+public:
+  HYDROGUI_PolylineOp( HYDROGUI_Module* theModule );
+  virtual ~HYDROGUI_PolylineOp();
+
+protected:
+  virtual HYDROGUI_InputPanel* createInputPanel() const;
+
+  virtual bool processApply( int& theUpdateFlags );
+
+};
+
+#endif
index b9ee02a2e6f3ef8579061a11877269b3c7929b17..46403e91845158bc7b013585e997bf9e22a1fa90 100644 (file)
       <source>DSK_IMPORT_IMAGE</source>
       <translation>Import image</translation>
     </message>
+    <message>
+      <source>DSK_POLYLINE</source>
+      <translation>Create polyline</translation>
+    </message>
     <message>
       <source>DSK_REDO</source>
       <translation>Redo</translation>
       <source>MEN_IMPORT_IMAGE</source>
       <translation>Import image</translation>
     </message>
+    <message>
+      <source>MEN_POLYLINE</source>
+      <translation>Create polyline</translation>
+    </message>
     <message>
       <source>MEN_REDO</source>
       <translation>Redo</translation>
       <source>STB_IMPORT_IMAGE</source>
       <translation>Import image</translation>
     </message>
+    <message>
+      <source>STB_IMPORT_IMAGE</source>
+      <translation>Create polyline</translation>
+    </message>
     <message>
       <source>STB_REDO</source>
       <translation>Redo</translation>
index 5ae92965355780072d258301da986556acf8bed7..1e8658d7355c8e17f4e6eba1bf5bc9a04780cb18 100644 (file)
@@ -38,5 +38,6 @@
   <section name="resources" >
     <parameter value="${HYDRORes}" name="HYDRO" />
     <parameter value="${HYDRORes}" name="HYDROGUI" />
+    <parameter value="${GEOM_ROOT_DIR}/share/salome/resources/geom" name="GEOM"/>
   </section>
 </document>