From 498ce1933f5438ba6c4e416ab01e39c0eebca025 Mon Sep 17 00:00:00 2001 From: ngo Date: Mon, 4 Feb 2013 11:11:13 +0000 Subject: [PATCH] Restart from scratch --- adm_local/cmake_files/FindGEOM.cmake | 4 +- configure.ac | 4 +- .../gui/GEOM/input/creating_adv_obj.doc | 1 + .../gui/GEOM/input/creating_exportxao.doc | 29 ++ .../GEOM/input/tui_importexport_geom_objs.doc | 18 ++ idl/GEOM_Gen.idl | 21 ++ idl/GEOM_Superv.idl | 5 + resources/GEOMCatalog.xml.in | 63 ++++ resources/ImportExport | 8 +- resources/Makefile.am | 5 +- src/ImportExportGUI/ImportExportGUI.cxx | 92 ++++++ src/ImportExportGUI/ImportExportGUI.h | 41 +++ ...tExportGUI_1Sel1LineEdit2ListWidget_QTD.ui | 107 +++++++ .../ImportExportGUI_ExportXAODlg.cxx | 268 ++++++++++++++++++ .../ImportExportGUI_ExportXAODlg.h | 69 +++++ .../ImportExportGUI_Widgets.cxx | 37 +++ src/ImportExportGUI/ImportExportGUI_Widgets.h | 42 +++ src/ImportExportGUI/Makefile.am | 88 ++++++ .../MeasureGUI_1Sel3LineEdit_QTD.ui | 109 +++++++ src/Makefile.am | 3 +- 20 files changed, 996 insertions(+), 18 deletions(-) create mode 100644 doc/salome/gui/GEOM/input/creating_adv_obj.doc create mode 100644 doc/salome/gui/GEOM/input/creating_exportxao.doc create mode 100644 doc/salome/gui/GEOM/input/tui_importexport_geom_objs.doc create mode 100644 src/ImportExportGUI/ImportExportGUI.cxx create mode 100644 src/ImportExportGUI/ImportExportGUI.h create mode 100644 src/ImportExportGUI/ImportExportGUI_1Sel1LineEdit2ListWidget_QTD.ui create mode 100644 src/ImportExportGUI/ImportExportGUI_ExportXAODlg.cxx create mode 100644 src/ImportExportGUI/ImportExportGUI_ExportXAODlg.h create mode 100644 src/ImportExportGUI/ImportExportGUI_Widgets.cxx create mode 100644 src/ImportExportGUI/ImportExportGUI_Widgets.h create mode 100644 src/ImportExportGUI/Makefile.am create mode 100644 src/ImportExportGUI/MeasureGUI_1Sel3LineEdit_QTD.ui diff --git a/adm_local/cmake_files/FindGEOM.cmake b/adm_local/cmake_files/FindGEOM.cmake index 6430d3f1f..eb9df0622 100644 --- a/adm_local/cmake_files/FindGEOM.cmake +++ b/adm_local/cmake_files/FindGEOM.cmake @@ -20,6 +20,7 @@ SET(GEOM_CXXFLAGS -I${GEOM_ROOT_DIR}/include/salome) FIND_LIBRARY(AdvancedGUI AdvancedGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(ImportExportGUI ImportExportGUI ${GEOM_ROOT_DIR}/lib/salome) FIND_LIBRARY(BasicGUI BasicGUI ${GEOM_ROOT_DIR}/lib/salome) FIND_LIBRARY(BlocksGUI BlocksGUI ${GEOM_ROOT_DIR}/lib/salome) FIND_LIBRARY(BooleanGUI BooleanGUI ${GEOM_ROOT_DIR}/lib/salome) @@ -60,6 +61,3 @@ FIND_LIBRARY(STEPImport STEPImport ${GEOM_ROOT_DIR}/lib/salome) FIND_LIBRARY(STLExport STLExport ${GEOM_ROOT_DIR}/lib/salome) FIND_LIBRARY(TransformationGUI TransformationGUI ${GEOM_ROOT_DIR}/lib/salome) FIND_LIBRARY(VTKExport VTKExport ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(XAOExport XAOExport ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(XAOImport XAOImport ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(XAO XAO ${GEOM_ROOT_DIR}/lib/salome) diff --git a/configure.ac b/configure.ac index 53a483bb4..0fdd3c51f 100644 --- a/configure.ac +++ b/configure.ac @@ -495,6 +495,7 @@ AC_OUTPUT([ \ doc/salome/tui/static/header.html \ src/Makefile \ src/AdvancedGUI/Makefile \ + src/ImportExportGUI/Makefile \ src/ARCHIMEDE/Makefile \ src/BREPExport/Makefile \ src/BREPImport/Makefile \ @@ -540,9 +541,6 @@ AC_OUTPUT([ \ src/ShapeRecognition/Makefile \ src/TransformationGUI/Makefile \ src/VTKExport/Makefile \ - src/XAO/Makefile \ - src/XAOExport/Makefile \ - src/XAOImport/Makefile \ resources/Makefile \ resources/GEOMCatalog.xml \ resources/SalomeApp.xml \ diff --git a/doc/salome/gui/GEOM/input/creating_adv_obj.doc b/doc/salome/gui/GEOM/input/creating_adv_obj.doc new file mode 100644 index 000000000..dad70dc6d --- /dev/null +++ b/doc/salome/gui/GEOM/input/creating_adv_obj.doc @@ -0,0 +1 @@ +
  • \subpage create_exportxao_page
  • diff --git a/doc/salome/gui/GEOM/input/creating_exportxao.doc b/doc/salome/gui/GEOM/input/creating_exportxao.doc new file mode 100644 index 000000000..07726287a --- /dev/null +++ b/doc/salome/gui/GEOM/input/creating_exportxao.doc @@ -0,0 +1,29 @@ +/*! + +\page create_exportxao_page ExportXAO + +To create a \b ExportXAO in the Main Menu select New Entity - > +ImportExport - > ExportXAO + +Specify the parameters of the ExportXAO object creation in the opened dialog +box and press "Apply" or "Apply & Close" button. +Result of each operation will be a GEOM_Object. + +TUI Command: geompy.MakeExportXAO(ExportingShape, FileName, lGroups, lFields) + +Arguments: +- \b ExportingShape - Shape to export +- \b FileName - The name of the exported file +- \b lGroups - List of groups to export +- \b lFields - List of fields to export + +\image html exportxao_dlg.png + +Example: + +\image html exportxao.png + +Our TUI Scripts provide you with useful examples of creation of +\ref tui_creation_exportxao "ImportExport objects". + +*/ diff --git a/doc/salome/gui/GEOM/input/tui_importexport_geom_objs.doc b/doc/salome/gui/GEOM/input/tui_importexport_geom_objs.doc new file mode 100644 index 000000000..5a02d6460 --- /dev/null +++ b/doc/salome/gui/GEOM/input/tui_importexport_geom_objs.doc @@ -0,0 +1,18 @@ +\anchor tui_creation_exportxao +

    Creation of ExportXAO

    + +\code +import geompy +import salome +gg = salome.ImportComponentGUI("GEOM") + +# create ExportXAO object +exportxao = geompy.MakeExportXAO([value], [value], [value], [value]) + +# add object in the study +id_exportxao = geompy.addToStudy(exportxao,"ExportXAO") + +# display exportxao +gg.createAndDisplayGO(id_exportxao) +\endcode + diff --git a/idl/GEOM_Gen.idl b/idl/GEOM_Gen.idl index f35c7935e..5a21f005d 100644 --- a/idl/GEOM_Gen.idl +++ b/idl/GEOM_Gen.idl @@ -4005,6 +4005,26 @@ module GEOM /*@@ insert new functions before this line @@ do not remove this line @@*/ }; + // # GEOM_IImportExportOperations: + /*! + * \brief Interface for advanced modeling functions. + */ + interface GEOM_IImportExportOperations : GEOM_IOperations + { + /*! + * Export a shape to XAO Format + * \param theExportingShape Shape to export + * \param theFileName The name of the exported file + * \param thelGroups List of groups to export + * \param thelFields List of fields to export + * \return New GEOM_Object, containing the created shape. + */ + + boolean ExportXAO (in GEOM_Object theExportingShape, in string theFileName, in ListOfGO thelGroups, in ListOfGO thelFields); + + /*@@ insert new functions before this line @@ do not remove this line @@*/ + }; + // # GEOM_Gen: /*! * \brief Interface to access other GEOM interfaces. @@ -4141,6 +4161,7 @@ module GEOM GEOM_IBlocksOperations GetIBlocksOperations (in long theStudyID) raises (SALOME::SALOME_Exception); GEOM_IGroupOperations GetIGroupOperations (in long theStudyID) raises (SALOME::SALOME_Exception); GEOM_IAdvancedOperations GetIAdvancedOperations (in long theStudyID) raises (SALOME::SALOME_Exception); + GEOM_IImportExportOperations GetIImportExportOperations (in long theStudyID) raises (SALOME::SALOME_Exception); // # Objects Management diff --git a/idl/GEOM_Superv.idl b/idl/GEOM_Superv.idl index 36c204b1d..1e29b3e6a 100644 --- a/idl/GEOM_Superv.idl +++ b/idl/GEOM_Superv.idl @@ -623,6 +623,11 @@ module GEOM GEOM_Object MakeDividedCylinder (in double theR, in double theH, in pattern thePattern); + //-----------------------------------------------------------// + // ImportExportOperations // + //-----------------------------------------------------------// + boolean ExportXAO (in GEOM_Object theExportingShape, in string theFileName, in GEOM_List thelGroups, in GEOM_List thelFields); + /*@@ insert new functions before this line @@ do not remove this line @@*/ }; }; diff --git a/resources/GEOMCatalog.xml.in b/resources/GEOMCatalog.xml.in index e4c33f0de..36e2b904b 100644 --- a/resources/GEOMCatalog.xml.in +++ b/resources/GEOMCatalog.xml.in @@ -52,8 +52,10 @@ + + @@ -470,6 +472,30 @@ + + + GetIImportExportOperations + + + + 1 + + + + theStudyID + long + + + + + + return + GEOM_IImportExportOperations + + + + + RemoveObject @@ -5279,6 +5305,43 @@ + + MakeExportXAO + + + unknown + 0 + + + theExportingShape + GEOM_Object + Shape to export + + + theFileName + string + The name of the exported file + + + thelGroups + GEOM_List + List of groups to export + + + thelFields + GEOM_List + List of fields to export + + + + + return + bool + Result object + + + + diff --git a/resources/ImportExport b/resources/ImportExport index 09f559732..f338de457 100644 --- a/resources/ImportExport +++ b/resources/ImportExport @@ -1,14 +1,10 @@ -Import: BREP|XAO|IGES|STEP|ACIS -Export: BREP|XAO|IGES|IGES_5_3|STEP|STL_Bin|STL_ASCII|ACIS|VTK +Import: BREP|IGES|STEP|ACIS +Export: BREP|IGES|IGES_5_3|STEP|STL_Bin|STL_ASCII|ACIS|VTK BREP.Import: libBREPImport BREP.Export: libBREPExport BREP.Pattern: BREP Files ( *.brep ) -XAO.Import: libXAOImport -XAO.Export: libXAOExport -XAO.Pattern: XAO Files ( *.xao ) - IGES.Import: libIGESImport IGES.Export: libIGESExport IGES.Pattern: IGES Files ( *.iges *.igs ) diff --git a/resources/Makefile.am b/resources/Makefile.am index 621e9081b..c8090b63d 100644 --- a/resources/Makefile.am +++ b/resources/Makefile.am @@ -182,10 +182,6 @@ tree_group_vertex.png \ tree_group_edge.png \ tree_group_face.png \ tree_group_solid.png \ -tree_field_vertex.png \ -tree_field_edge.png \ -tree_field_face.png \ -tree_field_solid.png \ tree_lcs.png \ vector.png \ vector_mode.png \ @@ -261,6 +257,7 @@ ADVANCED_RESOURCES += dlg_pipetshapefilletrf.png # ADVANCED_RESOURCES += divideddisk.png divideddisk_r_ratio.png tree_divideddisk.png ADVANCED_RESOURCES += dividedcylinder.png dividedcylinder_r_h.png # tree_dividedcylinder.png +#IMPORTEXPORT_RESOURCES += exportxao.png exportxao_exportingshape_filename_lgroups_lfields.png tree_exportxao.png ##@@ insert new functions before this line @@ do not remove this line @@## dist_salomeres_DATA += $(ADVANCED_RESOURCES) diff --git a/src/ImportExportGUI/ImportExportGUI.cxx b/src/ImportExportGUI/ImportExportGUI.cxx new file mode 100644 index 000000000..2d111202e --- /dev/null +++ b/src/ImportExportGUI/ImportExportGUI.cxx @@ -0,0 +1,92 @@ +// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE +// +// 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 +// + +// File : ImportExportGUI.cxx +// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com) +// +#include "ImportExportGUI.h" + +#include "GeometryGUI.h" +#include "GeometryGUI_Operations.h" + +#include +#include + +#include "ImportExportGUI_ExportXAODlg.h" +//@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@// + +#include + +//======================================================================= +// function : ImportExportGUI() +// purpose : Constructor +//======================================================================= +ImportExportGUI::ImportExportGUI( GeometryGUI* parent ) : GEOMGUI( parent ) +{ +} + +//======================================================================= +// function : ~ImportExportGUI +// purpose : Destructor +//======================================================================= +ImportExportGUI::~ImportExportGUI() +{ +} + +//======================================================================= +// function : OnGUIEvent() +// purpose : +//======================================================================= +bool ImportExportGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent ) +{ + SalomeApp_Application* app = getGeometryGUI()->getApp(); + if ( !app ) return false; + + getGeometryGUI()->EmitSignalDeactivateDialog(); + + QDialog* aDlg = NULL; + + switch ( theCommandID ) { case GEOMOp::OpExportXAO: + aDlg = new ImportExportGUI_ExportXAODlg( getGeometryGUI(), parent ); + break; + //@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@// + default: + app->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) ); + break; + } + + if ( aDlg != NULL ) + aDlg->show(); + + return true; +} + +//===================================================================================== +// EXPORTED METHODS +//===================================================================================== +extern "C" +{ +#ifdef WIN32 + __declspec( dllexport ) +#endif + GEOMGUI* GetLibGUI( GeometryGUI* parent ) + { + return new ImportExportGUI( parent ); + } +} diff --git a/src/ImportExportGUI/ImportExportGUI.h b/src/ImportExportGUI/ImportExportGUI.h new file mode 100644 index 000000000..261e1cacd --- /dev/null +++ b/src/ImportExportGUI/ImportExportGUI.h @@ -0,0 +1,41 @@ +// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE +// +// 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 +// + +// File : ImportExportGUI.h +// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com) +// +#ifndef IMPORTEXPORTGUI_H +#define IMPORTEXPORTGUI_H + +#include "GEOMGUI.h" + +//================================================================================= +// class : ImportExportGUI +// purpose : +//================================================================================= +class ImportExportGUI : public GEOMGUI +{ +public: + ImportExportGUI( GeometryGUI* ); + ~ImportExportGUI(); + + bool OnGUIEvent( int, SUIT_Desktop* ); +}; + +#endif // IMPORTEXPORTGUI_H diff --git a/src/ImportExportGUI/ImportExportGUI_1Sel1LineEdit2ListWidget_QTD.ui b/src/ImportExportGUI/ImportExportGUI_1Sel1LineEdit2ListWidget_QTD.ui new file mode 100644 index 000000000..12090f439 --- /dev/null +++ b/src/ImportExportGUI/ImportExportGUI_1Sel1LineEdit2ListWidget_QTD.ui @@ -0,0 +1,107 @@ + + + ImportExportGUI_1Sel1LineEdit2ListWidget_QTD + + + + 0 + 0 + 222 + 178 + + + + + + + + 0 + + + 6 + + + + + + + + + 9 + + + 6 + + + + + + + + TL2 + + + + + + + + 0 + 0 + + + + + + + + + + + TL1 + + + + + + + + 100 + 0 + + + + + + + + TL3 + + + + + + + TL4 + + + + + + + + + + + + + + + + PushButton1 + LineEdit1 + LineEdit2 + + + + diff --git a/src/ImportExportGUI/ImportExportGUI_ExportXAODlg.cxx b/src/ImportExportGUI/ImportExportGUI_ExportXAODlg.cxx new file mode 100644 index 000000000..f7c2940fe --- /dev/null +++ b/src/ImportExportGUI/ImportExportGUI_ExportXAODlg.cxx @@ -0,0 +1,268 @@ +// Copyright (C) 2007-2008 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 "ImportExportGUI_ExportXAODlg.h" +#include "ImportExportGUI_Widgets.h" + +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +//#include + +// OCCT Includes +#include +#include +#include +#include +#include + +#include + +//================================================================================= +// Constructor +//================================================================================= +ImportExportGUI_ExportXAODlg::ImportExportGUI_ExportXAODlg (GeometryGUI* theGeometryGUI, QWidget* parent) + : GEOMBase_Skeleton(theGeometryGUI, parent, false) +{ + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); + QPixmap imageOp (resMgr->loadPixmap("GEOM", tr("ICON_DLG_EXPORTXAO_EXPORTINGSHAPE_FILENAME_LGROUPS_LFIELDS"))); + QPixmap imageSel (resMgr->loadPixmap("GEOM", tr("ICON_SELECT"))); + + setWindowTitle(tr("GEOM_EXPORTXAO_TITLE")); + + /***************************************************************/ + mainFrame()->GroupConstructors->setTitle( tr( "GEOM_EXPORTXAO_TITLE" ) ); + mainFrame()->RadioButton1->setIcon( imageOp ); + mainFrame()->RadioButton2->setAttribute( Qt::WA_DeleteOnClose ); + mainFrame()->RadioButton2->close(); + mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose ); + mainFrame()->RadioButton3->close(); + + myGrp = new ImportExportGUI_1Sel1LineEdit2ListWidget( centralWidget() ); + myGrp->GroupBox1->setTitle( tr( "GEOM_EXPORTXAO" ) ); + myGrp->TextLabel1->setText( tr( "GEOM_EXPORTXAO_EXPORTINGSHAPE" ) ); + myGrp->TextLabel2->setText( tr( "GEOM_EXPORTXAO_FILENAME" ) ); + myGrp->TextLabel3->setText( tr( "GEOM_EXPORTXAO_LGROUPS" ) ); + myGrp->TextLabel4->setText( tr( "GEOM_EXPORTXAO_LFIELDS" ) ); + myGrp->PushButton1->setIcon( imageSel ); + + setHelpFileName("create_exportxao_page.html"); + + Init(); +} + +//================================================================================= +// Destructor +//================================================================================= +ImportExportGUI_ExportXAODlg::~ImportExportGUI_ExportXAODlg() +{ + // no need to delete child widgets, Qt does it all for us +} + +//================================================================================= +// function : Init() +// purpose : +//================================================================================= +void ImportExportGUI_ExportXAODlg::Init() +{ + // Get setting of step value from file configuration + + // Signal/slot connections + connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk())); + connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply())); + + connect( myGrp->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) ); + connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(), + SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); + + initName(tr("GEOM_EXPORTXAO")); + SelectionIntoArgument(); +} + +//================================================================================= +// function : processObject() +// purpose : Fill dialog fields in accordance with myObj +//================================================================================= +void ImportExportGUI_ExportXAODlg::processObject() +{ + if ( myMainObj->_is_nil() ) { + myGrp->LineEdit1->setText( "" ); + myGrp->LineEdit2->setText( "" ); + erasePreview(); + } + else { + myGrp->LineEdit1->setText( GEOMBase::GetName( myMainObj ) ); + + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); + } +} + +//================================================================================= +// function : ClickOnOk() +// purpose : +//================================================================================= +void ImportExportGUI_ExportXAODlg::ClickOnOk() +{ + if (ClickOnApply()) + ClickOnCancel(); +} + +//================================================================================= +// function : ClickOnApply() +// purpose : +//================================================================================= +bool ImportExportGUI_ExportXAODlg::ClickOnApply() +{ + if (!onAccept()) + return false; + + initName(); + + return true; +} + +//================================================================================= +// function : SelectionIntoArgument() +// purpose : Called when selection as changed or other case +//================================================================================= +void ImportExportGUI_ExportXAODlg::SelectionIntoArgument() +{ + erasePreview(); + myMainObj = GEOM::GEOM_Object::_nil(); + + LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr(); + SALOME_ListIO aSelList; + aSelMgr->selectedObjects(aSelList); + + if (aSelList.Extent() != 1) { + processObject(); + return; + } + + GEOM::GEOM_Object_var aSelectedObject = + GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); + + if ( aSelectedObject->_is_nil() ) { + processObject(); + return; + } + + myMainObj = aSelectedObject; + processObject(); +} + +//================================================================================= +// function : SetEditCurrentArgument() +// purpose : +//================================================================================= +void ImportExportGUI_ExportXAODlg::SetEditCurrentArgument() +{ + myGrp->LineEdit1->setFocus(); + myEditCurrentArgument = myGrp->LineEdit1; + SelectionIntoArgument(); +} +//================================================================================= +// function : ActivateThisDialog() +// purpose : +//================================================================================= +void ImportExportGUI_ExportXAODlg::ActivateThisDialog() +{ + GEOMBase_Skeleton::ActivateThisDialog(); +} + +//================================================================================= +// function : enterEvent [REDEFINED] +// purpose : +//================================================================================= +void ImportExportGUI_ExportXAODlg::enterEvent (QEvent*) +{ + if (!mainFrame()->GroupConstructors->isEnabled()) + ActivateThisDialog(); +} + +//================================================================================= +// function : createOperation +// purpose : +//================================================================================= +GEOM::GEOM_IOperations_ptr ImportExportGUI_ExportXAODlg::createOperation() +{ + return getGeomEngine()->GetIImportExportOperations(getStudyId()); +} + +//================================================================================= +// function : isValid +// purpose : +//================================================================================= +bool ImportExportGUI_ExportXAODlg::isValid (QString& msg) +{ + bool ok = true; + + //@@ add custom validation actions here @@// + + return ok; +} + +//================================================================================= +// function : execute +// purpose : +//================================================================================= +bool ImportExportGUI_ExportXAODlg::execute (ObjectList& objects) +{ + bool res = false; + + GEOM::GEOM_Object_var anObj; + + GEOM::GEOM_IImportExportOperations_var anOper = GEOM::GEOM_IImportExportOperations::_narrow(getOperation()); + + /*//@@ retrieve input values from the widgets here @@// + CORBA::Double theExportingShape = @@ init parameter value from dialog box @@; + CORBA::String_var theFileName = @@ init parameter value from dialog box @@; + CORBA::Boolean thelGroups = @@ init parameter value from dialog box @@; + CORBA::Boolean thelFields = @@ init parameter value from dialog box @@; + + // call engine function + anObj = anOper->ExportXAO(theExportingShape, theFileName, thelGroups, thelFields); + res = !anObj->_is_nil(); + if (res && !IsPreview()) + { + QStringList aParameters; + //@@ put stringified input parameters to the string list here to store in the data model for notebook @@// + aParameters << @@ stringified parameter value @@; // ExportingShape parameter + aParameters << @@ stringified parameter value @@; // FileName parameter + aParameters << @@ stringified parameter value @@; // lGroups parameter + aParameters << @@ stringified parameter value @@; // lFields parameter + if ( aParameters.count() > 0 ) anObj->SetParameters(aParameters.join(":").toLatin1().constData()); + } + + if (res) + objects.push_back(anObj._retn());*/ + + return res; +} diff --git a/src/ImportExportGUI/ImportExportGUI_ExportXAODlg.h b/src/ImportExportGUI/ImportExportGUI_ExportXAODlg.h new file mode 100644 index 000000000..3c5fb4243 --- /dev/null +++ b/src/ImportExportGUI/ImportExportGUI_ExportXAODlg.h @@ -0,0 +1,69 @@ +// Copyright (C) 2007-2008 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 IMPORTEXPORTGUI_EXPORTXAODLG_H +#define IMPORTEXPORTGUI_EXPORTXAODLG_H + +#include + +class QGroupBox; +class QLineEdit; +class QButtonGroup; +class ImportExportGUI_1Sel1LineEdit2ListWidget; + +//================================================================================= +// class : ImportExportGUI_ExportXAODlg +// purpose : +//================================================================================= +class ImportExportGUI_ExportXAODlg : public GEOMBase_Skeleton +{ + Q_OBJECT + +public: + ImportExportGUI_ExportXAODlg( GeometryGUI*, QWidget* = 0 ); + ~ImportExportGUI_ExportXAODlg(); + +protected: + // redefined from GEOMBase_Helper + virtual GEOM::GEOM_IOperations_ptr createOperation(); + virtual bool isValid( QString& ); + virtual bool execute( ObjectList& ); + +private: + void Init(); + void enterEvent( QEvent* ); + void processObject(); + +private: + GEOM::GEOM_Object_var myMainObj; + ImportExportGUI_1Sel1LineEdit2ListWidget* myGrp; + +private slots: + void ClickOnOk(); + bool ClickOnApply(); + void ActivateThisDialog(); + void SelectionIntoArgument(); + void SetEditCurrentArgument(); + //void ValueChangedInSpinBox(); + //void SetDoubleSpinBoxStep( double ); +}; + +#endif // IMPORTEXPORTGUI_EXPORTXAODLG_H diff --git a/src/ImportExportGUI/ImportExportGUI_Widgets.cxx b/src/ImportExportGUI/ImportExportGUI_Widgets.cxx new file mode 100644 index 000000000..0324dfb6d --- /dev/null +++ b/src/ImportExportGUI/ImportExportGUI_Widgets.cxx @@ -0,0 +1,37 @@ +// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE +// +// 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 +// + +// File : ImportExportGUI_Widgets.cxx +// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com) +// +#include "ImportExportGUI_Widgets.h" + +////////////////////////////////////////// +// ImportExportGUI_1Sel1LineEdit2ListWidget +////////////////////////////////////////// + +ImportExportGUI_1Sel1LineEdit2ListWidget::ImportExportGUI_1Sel1LineEdit2ListWidget( QWidget* parent, Qt::WindowFlags f ) +: QWidget( parent, f ) +{ + setupUi( this ); +} +ImportExportGUI_1Sel1LineEdit2ListWidget::~ImportExportGUI_1Sel1LineEdit2ListWidget() +{ +} + diff --git a/src/ImportExportGUI/ImportExportGUI_Widgets.h b/src/ImportExportGUI/ImportExportGUI_Widgets.h new file mode 100644 index 000000000..865542805 --- /dev/null +++ b/src/ImportExportGUI/ImportExportGUI_Widgets.h @@ -0,0 +1,42 @@ +// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE +// +// 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 +// + +// File : IMPORTEXPORTGUI_Widgets.h +// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com) +// +#ifndef IMPORTEXPORTGUI_WIDGETS_H +#define IMPORTEXPORTGUI_WIDGETS_H + +////////////////////////////////////////// +// ImportExportGUI_1Sel1LineEdit2ListWidget +////////////////////////////////////////// + +#include "ui_ImportExportGUI_1Sel1LineEdit2ListWidget_QTD.h" + +class ImportExportGUI_1Sel1LineEdit2ListWidget : public QWidget, + public Ui::ImportExportGUI_1Sel1LineEdit2ListWidget_QTD +{ + Q_OBJECT + +public: + ImportExportGUI_1Sel1LineEdit2ListWidget( QWidget* = 0, Qt::WindowFlags = 0 ); + ~ImportExportGUI_1Sel1LineEdit2ListWidget(); +}; + +#endif // MEASUREGUI_WIDGETS_H diff --git a/src/ImportExportGUI/Makefile.am b/src/ImportExportGUI/Makefile.am new file mode 100644 index 000000000..1959304e6 --- /dev/null +++ b/src/ImportExportGUI/Makefile.am @@ -0,0 +1,88 @@ +# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE +# +# 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 +# + +# File : Makefile.am +# Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com) +# +include $(top_srcdir)/adm_local/unix/make_common_starter.am + +# header files +salomeinclude_HEADERS = \ + ImportExportGUI.h \ + ImportExportGUI_Widgets.h + +IMPORTEXPORT_INCLUDES = +IMPORTEXPORT_INCLUDES += ImportExportGUI_ExportXAODlg.h +##@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@ do not remove this line @@## + +salomeinclude_HEADERS += $(IMPORTEXPORT_INCLUDES) + +# Libraries targets +lib_LTLIBRARIES = libImportExportGUI.la + +dist_libImportExportGUI_la_SOURCES = \ + ImportExportGUI.cxx \ + ImportExportGUI_Widgets.cxx + +IMPORTEXPORT_SOURCES = +IMPORTEXPORT_SOURCES += ImportExportGUI_ExportXAODlg.h ImportExportGUI_ExportXAODlg.cxx +##@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@ do not remove this line @@## + +dist_libImportExportGUI_la_SOURCES += $(IMPORTEXPORT_SOURCES) + +MOC_FILES = + +IMPORTEXPORT_MOC_FILES = +IMPORTEXPORT_MOC_FILES += ImportExportGUI_ExportXAODlg_moc.cxx +##@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@ do not remove this line @@## + +MOC_FILES += $(IMPORTEXPORT_MOC_FILES) + +nodist_libImportExportGUI_la_SOURCES = \ + $(MOC_FILES) + +UIC_FILES = \ + ui_ImportExportGUI_1Sel1LineEdit2ListWidget_QTD.h + +BUILT_SOURCES = $(UIC_FILES) +# additional information to compile and link file + +libImportExportGUI_la_CPPFLAGS = \ + $(QT_INCLUDES) \ + $(VTK_INCLUDES) \ + $(CAS_CPPFLAGS) \ + $(PYTHON_INCLUDES) \ + $(BOOST_CPPFLAGS) \ + $(KERNEL_CXXFLAGS) \ + $(GUI_CXXFLAGS) \ + $(CORBA_CXXFLAGS) \ + $(CORBA_INCLUDES) \ + -I$(srcdir)/../GEOMGUI \ + -I$(srcdir)/../DlgRef \ + -I$(srcdir)/../GEOMBase \ + -I$(srcdir)/../OBJECT \ + -I$(srcdir)/../GEOMClient \ + -I$(srcdir)/../GEOMImpl \ + -I$(srcdir)/../GEOMFiltersSelection \ + -I$(top_builddir)/src/DlgRef \ + -I$(top_builddir)/idl + +libImportExportGUI_la_LDFLAGS = \ + ../GEOMFiltersSelection/libGEOMFiltersSelection.la \ + ../GEOMBase/libGEOMBase.la diff --git a/src/ImportExportGUI/MeasureGUI_1Sel3LineEdit_QTD.ui b/src/ImportExportGUI/MeasureGUI_1Sel3LineEdit_QTD.ui new file mode 100644 index 000000000..a08d828ba --- /dev/null +++ b/src/ImportExportGUI/MeasureGUI_1Sel3LineEdit_QTD.ui @@ -0,0 +1,109 @@ + + + MeasureGUI_1Sel3LineEdit_QTD + + + + 0 + 0 + 197 + 137 + + + + + + + + 0 + + + 6 + + + + + + + + + 9 + + + 6 + + + + + + + + + + + + + + TL3 + + + + + + + TL4 + + + + + + + TL2 + + + + + + + + 0 + 0 + + + + + + + + + + + TL1 + + + + + + + + 100 + 0 + + + + + + + + + + + PushButton1 + LineEdit1 + LineEdit2 + LineEdit3 + LineEdit4 + + + + diff --git a/src/Makefile.am b/src/Makefile.am index 9e1f269a5..8646ff650 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -34,7 +34,7 @@ if GEOM_ENABLE_GUI SUBDIRS += OBJECT DlgRef GEOMFiltersSelection Material GEOMGUI GEOMBase GEOMToolsGUI \ DisplayGUI BasicGUI PrimitiveGUI GenerationGUI EntityGUI BuildGUI \ BooleanGUI TransformationGUI OperationGUI RepairGUI MeasureGUI \ - GroupGUI BlocksGUI AdvancedGUI GEOM_SWIG_WITHIHM XAOExport XAO XAOImport + GroupGUI BlocksGUI AdvancedGUI ImportExportGUI GEOM_SWIG_WITHIHM endif DIST_SUBDIRS = ARCHIMEDE NMTDS NMTTools GEOMAlgo \ @@ -45,5 +45,4 @@ DIST_SUBDIRS = ARCHIMEDE NMTDS NMTTools GEOMAlgo \ GEOMToolsGUI DisplayGUI BasicGUI PrimitiveGUI GenerationGUI \ EntityGUI BuildGUI BooleanGUI TransformationGUI OperationGUI \ RepairGUI MeasureGUI GroupGUI BlocksGUI AdvancedGUI \ - XAOExport XAOImport \ GEOM_SWIG_WITHIHM GEOM_PY ShapeRecognition -- 2.39.2