From: mpa Date: Tue, 13 Jan 2015 12:32:33 +0000 (+0300) Subject: Some corrections of import/export operations X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9f3c477e7b207c47addbaacb6c4e481c745fbb1b;p=plugins%2Fdxfplugin.git Some corrections of import/export operations --- diff --git a/idl/CMakeLists.txt b/idl/CMakeLists.txt index 8b33338..6fd41e0 100755 --- a/idl/CMakeLists.txt +++ b/idl/CMakeLists.txt @@ -31,7 +31,7 @@ IF(WIN32) ENDIF(WIN32) SET(SalomeIDLDXFPlugin_IDLSOURCES - DXFPlugin_Gen.idl + DXFPlugin.idl ) SET(IDL_INCLUDE_DIRS diff --git a/idl/DXFPlugin.idl b/idl/DXFPlugin.idl new file mode 100644 index 0000000..935dbf2 --- /dev/null +++ b/idl/DXFPlugin.idl @@ -0,0 +1,52 @@ +// Copyright (C) 2014 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, or (at your option) any later version. +// +// 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 __DXFPlugin_IDL__ +#define __DXFPlugin_IDL__ + +#include "GEOM_Gen.idl" + +module DXFPlugin +{ + /*! + * \brief Interface for DXFPlugin modeling functions. + */ + interface IDXFOperations : GEOM::GEOM_IOperations + { + /*! + * \brief Export the given shape into a file with given name in DXF format. + * + * \param theObject Shape to be stored in the file. + * \param theFileName Name of the file to store the given shape in. + */ + void ExportDXF( in GEOM::GEOM_Object theObject, + in string theFileName ); + + /*! + * \brief Import a shape from the DXF file. + * + * \param theFileName The file, containing the shape. + * \return List of GEOM_Objects, containing the created shape and propagation groups. + */ + GEOM::ListOfGO ImportDXF( in string theFileName ); + }; +}; + +#endif // __DXFPlugin_IDL__ + diff --git a/idl/DXFPlugin_Gen.idl b/idl/DXFPlugin_Gen.idl deleted file mode 100644 index bec926e..0000000 --- a/idl/DXFPlugin_Gen.idl +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (C) 2014 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, or (at your option) any later version. -// -// 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 __DXFPlugin_GEN__ -#define __DXFPlugin_GEN__ - -#include "GEOM_Gen.idl" - -module DXFPlugin { - - /*! - * \brief Interface for DXFPlugin modeling functions. - */ - interface GEOM_IDXFPluginOperations : GEOM::GEOM_IOperations - { - /*! - * \brief Export the given shape into a file with given name in DXF format. - * - * \param theObject Shape to be stored in the file. - * \param theFileName Name of the file to store the given shape in. - */ - void ExportDXF( in GEOM::GEOM_Object theObject, - in string theFileName ); - - /*! - * \brief Import a shape from the DXF file. - * - * \param theFileName The file, containing the shape. - * \return List of GEOM_Objects, containing the created shape and propagation groups. - */ - GEOM::ListOfGO ImportDXF( in string theFileName ); - }; -}; - -#endif diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c6a6cab..14ef965 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -29,7 +29,6 @@ INCLUDE_DIRECTORIES( ${CAS_INCLUDE_DIRS} ${DXF_INCLUDE_DIRS} ${KERNEL_INCLUDE_DIRS} - ${GUI_INCLUDE_DIRS} ${PROJECT_BINARY_DIR} ${PROJECT_BINARY_DIR}/idl ) @@ -37,6 +36,8 @@ INCLUDE_DIRECTORIES( IF(SALOME_BUILD_GUI) INCLUDE_DIRECTORIES( ${QT_INCLUDE_DIRS} + ${GUI_INCLUDE_DIRS} + ${GEOM_INCLUDE_DIRS} ) ENDIF() @@ -52,7 +53,7 @@ ADD_DEFINITIONS( ENDIF() # libraries to link to -SET(_link_LIBRARIES +SET(_link_engine_LIBRARIES ${CAS_TKXSBase} ${DXF_LIBRARIES} ${KERNEL_SALOMEBasics} @@ -66,8 +67,10 @@ SET(_link_LIBRARIES ) IF(SALOME_BUILD_GUI) - SET(_link_LIBRARIES - ${_link_LIBRARIES} + SET(_link_gui_LIBRARIES + SalomeIDLDXFPlugin + ${GEOM_GEOMObject} + ${GEOM_GEOMBase} ${GEOM_GEOMBase} ) ENDIF() @@ -76,9 +79,9 @@ ENDIF() # --- headers --- SET(DXFPluginEngine_HEADERS - DXFPlugin_Operations_i.hh + DXFPlugin_IOperations_i.hh DXFPlugin_Engine.hxx - DXFPlugin_OperationsCreator.hh + DXFPlugin_OperationsCreator.hxx DXFPlugin_IOperations.hxx DXFPlugin_IExport.hxx DXFPlugin_IImport.hxx @@ -90,8 +93,7 @@ SET(DXFPluginEngine_HEADERS IF(SALOME_BUILD_GUI) # header files / to be processed by moc SET(_moc_HEADERS - DXFPlugin_ExportDlg.h - DXFPlugin_ImportDlg.h + DXFPlugin_GUI.h ) ENDIF() @@ -102,17 +104,15 @@ IF(SALOME_BUILD_GUI) QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS}) SET(DXFPluginGUI_SOURCES - DXFPluginGUI.cxx - DXFPlugin_ExportDlg.cxx - DXFPlugin_ImportDlg.cxx + DXFPlugin_GUI.cxx ${_moc_SOURCES} ) ENDIF() SET(DXFPluginEngine_SOURCES - DXFPluginEngine.cxx - DXFPlugin_OperationsCreator.cc - DXFPlugin_Operations_i.cc + DXFPlugin_Engine.cxx + DXFPlugin_OperationsCreator.cxx + DXFPlugin_IOperations_i.cc DXFPlugin_IOperations.cxx DXFPlugin_ExportDriver.cxx DXFPlugin_ImportDriver.cxx @@ -136,13 +136,13 @@ SET(_python_DXF_SCRIPTS # install Engine library ADD_LIBRARY(DXFPluginEngine ${DXFPluginEngine_SOURCES}) -TARGET_LINK_LIBRARIES(DXFPluginEngine ${_link_LIBRARIES}) +TARGET_LINK_LIBRARIES(DXFPluginEngine ${_link_engine_LIBRARIES}) INSTALL(TARGETS DXFPluginEngine EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) # install GUI library IF(SALOME_BUILD_GUI) ADD_LIBRARY(DXFPluginGUI ${DXFPluginGUI_SOURCES}) - TARGET_LINK_LIBRARIES(DXFPluginGUI ${_link_LIBRARIES}) + TARGET_LINK_LIBRARIES(DXFPluginGUI ${_link_gui_LIBRARIES}) INSTALL(TARGETS DXFPluginGUI EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) # install resources QT4_INSTALL_TS_RESOURCES("${DXFPlugin_RESOURCES}" "${SALOME_DXFPLUGIN_INSTALL_RES_DATA}") diff --git a/src/DXFPluginBuilder.py b/src/DXFPluginBuilder.py index 72b5c73..63404d6 100644 --- a/src/DXFPluginBuilder.py +++ b/src/DXFPluginBuilder.py @@ -18,14 +18,14 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -from DXFPlugin import GEOM_IDXFPluginOperations +from DXFPlugin import IDXFOperations # Engine Library Name __libraryName__ = "DXFPluginEngine" def GetDXFPluginOperations(self): anOp = self.GetPluginOperations(self.myStudyId, __libraryName__) - return anOp._narrow(GEOM_IDXFPluginOperations) + return anOp._narrow(IDXFOperations) ## Export the given shape into a file with given name in DXF format. # @param theObject Shape to be stored in the file. diff --git a/src/DXFPluginEngine.cxx b/src/DXFPluginEngine.cxx deleted file mode 100644 index 1c380c2..0000000 --- a/src/DXFPluginEngine.cxx +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (C) 2014 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, or (at your option) any later version. -// -// 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 -// - -// internal includes -#include "DXFPlugin_Engine.hxx" -#include "DXFPlugin_OperationsCreator.hh" - -extern "C" -{ -DXFPLUGINENGINE_EXPORT - GEOM_GenericOperationsCreator* GetOperationsCreator() - { - DXFPlugin_OperationsCreator* aCreator = new DXFPlugin_OperationsCreator(); - return aCreator; - } -} diff --git a/src/DXFPluginGUI.cxx b/src/DXFPluginGUI.cxx deleted file mode 100644 index 21e41f8..0000000 --- a/src/DXFPluginGUI.cxx +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (C) 2014 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, or (at your option) any later version. -// -// 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 -// - -// internal includes -#include "DXFPluginGUI.h" -#include "DXFPlugin_ExportDlg.h" -#include "DXFPlugin_ImportDlg.h" - -// GUI includes -#include -#include -#include -#include -#include - -// GEOM includes -#include - -//======================================================================= -// function : DXFPluginGUI() -// purpose : Constructor -//======================================================================= -DXFPluginGUI::DXFPluginGUI( GeometryGUI* parent ) : GEOMPluginGUI( parent ) -{ -} - -//======================================================================= -// function : ~DXFPluginGUI -// purpose : Destructor -//======================================================================= -DXFPluginGUI::~DXFPluginGUI() -{ -} - -//======================================================================= -// function : OnGUIEvent() -// purpose : -//======================================================================= -bool DXFPluginGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent ) -{ - switch ( theCommandID ) { - case 1: - return OnGUIEvent("Export_DXF", parent); - case 2: - return OnGUIEvent("Import_DXF", parent); - default: - return OnGUIEvent("", parent); - } - return false; -} - -//======================================================================= -// function : OnGUIEvent() -// purpose : -//======================================================================= -bool DXFPluginGUI::OnGUIEvent( const QString& theCommandID, SUIT_Desktop* parent ) -{ - SalomeApp_Application* app = getGeometryGUI()->getApp(); - if (!app) return false; - - getGeometryGUI()->EmitSignalDeactivateDialog(); - - SUIT_FileDlg* dialog = NULL; - if( theCommandID == "Export_DXF" ) { - // Get selected objects - LightApp_SelectionMgr* sm = app->selectionMgr(); - if( !sm ) return false; - SALOME_ListIO selectedObjects; - sm->selectedObjects( selectedObjects ); - if( selectedObjects.Extent() == 0 ) { - SUIT_MessageBox::warning( app->desktop(), - QObject::tr("WRN_WARNING"), - QObject::tr("GEOM_WRN_NO_APPROPRIATE_SELECTION") ); - } - else { - SALOME_ListIteratorOfListIO It( selectedObjects ); - for( ; It.More(); It.Next() ) { - Handle(SALOME_InteractiveObject) IObject = It.Value(); - dialog = new DXFPlugin_ExportDlg( IObject, parent ); - if( dialog->exec() == QDialog::Accepted ) - delete dialog; - } - } - } - else if (theCommandID == "Import_DXF") { - dialog = new DXFPlugin_ImportDlg( parent ); - if (dialog != NULL) - dialog->show(); - if( dialog->exec() == QDialog::Accepted ) - delete dialog; - } - else { - app->putInfo( tr("GEOM_PRP_COMMAND").arg( theCommandID ) ); - } - - return true; -} - -//===================================================================================== -// EXPORTED METHODS -//===================================================================================== -extern "C" -{ -#ifdef WIN32 - __declspec( dllexport ) -#endif - GEOMGUI* GetLibGUI( GeometryGUI* parent ) - { - return new DXFPluginGUI( parent ); - } -} diff --git a/src/DXFPluginGUI.h b/src/DXFPluginGUI.h deleted file mode 100644 index 1e4419b..0000000 --- a/src/DXFPluginGUI.h +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (C) 2014 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, or (at your option) any later version. -// -// 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 DXFPluginGUI_H -#define DXFPluginGUI_H - -#include - -class DXFPluginGUI: public GEOMPluginGUI -{ -public: - DXFPluginGUI( GeometryGUI* parent ); - ~DXFPluginGUI(); - - bool OnGUIEvent( int commandId, SUIT_Desktop* ); - bool OnGUIEvent( const QString&, SUIT_Desktop* ); -}; - -#endif // DXFPluginGUI_H diff --git a/src/DXFPlugin_Engine.cxx b/src/DXFPlugin_Engine.cxx new file mode 100644 index 0000000..e3a40d2 --- /dev/null +++ b/src/DXFPlugin_Engine.cxx @@ -0,0 +1,31 @@ +// Copyright (C) 2014 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, or (at your option) any later version. +// +// 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 +// + +// internal includes +#include "DXFPlugin_Engine.hxx" +#include "DXFPlugin_OperationsCreator.hxx" + +extern "C" +{ + DXFPLUGINENGINE_EXPORT + GEOM_GenericOperationsCreator* GetOperationsCreator() + { + return new DXFPlugin_OperationsCreator(); + } +} diff --git a/src/DXFPlugin_Engine.hxx b/src/DXFPlugin_Engine.hxx index 0274c57..073d0df 100755 --- a/src/DXFPlugin_Engine.hxx +++ b/src/DXFPlugin_Engine.hxx @@ -21,7 +21,7 @@ #define _DXFPLUGIN_ENGINE_HXX_ #ifdef WIN32 - #if defined DXFPLUGINENGINE_EXPORTS || defined DXFPLUGINENGINE_EXPORTS + #if defined DXFPLUGINENGINE_EXPORTS || defined DXFPluginEngine_EXPORTS #define DXFPLUGINENGINE_EXPORT __declspec( dllexport ) #else #define DXFPLUGINENGINE_EXPORT __declspec( dllimport ) diff --git a/src/DXFPlugin_ExportDlg.cxx b/src/DXFPlugin_ExportDlg.cxx deleted file mode 100644 index e999d79..0000000 --- a/src/DXFPlugin_ExportDlg.cxx +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (C) 2014 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, or (at your option) any later version. -// -// 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 -// - -// internal includes -#include "DXFPlugin_ExportDlg.h" -#include "DXFPlugin_Operations_i.hh" - -// GUI includes -#include -#include -#include -#include -#include - -#include - -// GEOM includes -#include -#include -#include - -//================================================================================= -// Constructor -//================================================================================= -DXFPlugin_ExportDlg::DXFPlugin_ExportDlg( Handle(SALOME_InteractiveObject)& object, QWidget* parent ) -: SUIT_FileDlg( parent, false, true, true ), - GEOMBase_Helper( dynamic_cast( parent ) ) -{ - setWindowTitle( tr( "DXFPLUGIN_EXPORT_TITLE" ) ); - setNameFilter( tr( "DXFPLUGIN_DXF_FILES" ) ); - - myObject = object; - const char* objectName = myObject->getName(); - selectFile( QString( objectName ) ); -} - -//================================================================================= -// Destructor -//================================================================================= -DXFPlugin_ExportDlg::~DXFPlugin_ExportDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - -//================================================================================= -// function : createOperation -// purpose : -//================================================================================= -GEOM::GEOM_IOperations_ptr DXFPlugin_ExportDlg::createOperation() -{ - return getGeomEngine()->GetPluginOperations( getStudyId(), "DXFPluginEngine" ); -} - -//================================================================================= -// function : isValid -// purpose : -//================================================================================= -bool DXFPlugin_ExportDlg::isValid( QString& msg ) -{ - bool ok = true; - //@@ add custom validation actions here @@// - return ok; -} - -//================================================================================= -// function : execute -// purpose : -//================================================================================= -bool DXFPlugin_ExportDlg::execute( ObjectList& objects ) -{ - SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); - if (!app) return false; - - DXFPlugin::GEOM_IDXFPluginOperations_var aDXFOp = DXFPlugin::GEOM_IDXFPluginOperations::_narrow( getOperation() ); - if ( aDXFOp->_is_nil() ) return false; - - GEOM::GEOM_Object_var anObj = GEOMBase::ConvertIOinGEOMObject( myObject ); - if ( anObj->_is_nil() ) return false; - - QString aFile = selectedFile(); - - // User has pressed "Cancel" --> stop the operation - if ( aFile.isEmpty() ) - return false; - - GEOM_Operation* anOp = new GEOM_Operation( app, aDXFOp.in() ); - try { - SUIT_OverrideCursor wc; - app->putInfo( tr("GEOM_PRP_EXPORT").arg(SUIT_Tools::file( aFile, /*withExten=*/true )) ); - anOp->start(); - aDXFOp->ExportDXF( anObj, aFile.toUtf8().constData() ); - if( aDXFOp->IsDone() ) - anOp->commit(); - else { - anOp->abort(); - wc.suspend(); - SUIT_MessageBox::critical( app->desktop(), - QObject::tr("GEOM_ERROR"), - QObject::tr("GEOM_PRP_ABORT") + "\n" + QObject::tr( aDXFOp->GetErrorCode() ) ); - return false; - } - } - catch( const SALOME::SALOME_Exception& S_ex ) { - anOp->abort(); - return false; - } - - objects.push_back( anObj._retn() ); - return true; -} - -void DXFPlugin_ExportDlg::accept() -{ - SUIT_FileDlg::accept(); - onAccept(false); -} diff --git a/src/DXFPlugin_ExportDlg.h b/src/DXFPlugin_ExportDlg.h deleted file mode 100644 index 426d9a8..0000000 --- a/src/DXFPlugin_ExportDlg.h +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (C) 2014 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, or (at your option) any later version. -// -// 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 DXFPlugin_ExportDlg_H -#define DXFPlugin_ExportDlg_H - -// GUI includes -#include - -// GEOM includes -#include -#include - - -class DXFPlugin_ExportDlg: public SUIT_FileDlg, public GEOMBase_Helper -{ - Q_OBJECT - -public: - DXFPlugin_ExportDlg( Handle(SALOME_InteractiveObject)&, QWidget* = 0 ); - ~DXFPlugin_ExportDlg(); - -protected: - // redefined from GEOMBase_Helper - virtual GEOM::GEOM_IOperations_ptr createOperation(); - virtual bool isValid( QString& ); - virtual bool execute( ObjectList& ); - -protected slots: - void accept(); - -private: - Handle(SALOME_InteractiveObject) myObject; -}; - -#endif // DXFPlugin_ExportDlg_H diff --git a/src/DXFPlugin_ExportDriver.cxx b/src/DXFPlugin_ExportDriver.cxx index e0275e7..97dc381 100644 --- a/src/DXFPlugin_ExportDriver.cxx +++ b/src/DXFPlugin_ExportDriver.cxx @@ -20,7 +20,6 @@ // internal includes #include "DXFPlugin_ExportDriver.hxx" #include "DXFPlugin_IExport.hxx" -#include "DXFPlugin_Engine.hxx" // KERNEL includes #include diff --git a/src/DXFPlugin_ExportDriver.hxx b/src/DXFPlugin_ExportDriver.hxx index 05c6eaf..ad88707 100644 --- a/src/DXFPlugin_ExportDriver.hxx +++ b/src/DXFPlugin_ExportDriver.hxx @@ -33,17 +33,16 @@ DEFINE_STANDARD_HANDLE( DXFPlugin_ExportDriver, GEOM_BaseDriver ); class DXFPlugin_ExportDriver : public GEOM_BaseDriver { public: - Standard_EXPORT DXFPlugin_ExportDriver(); - Standard_EXPORT ~DXFPlugin_ExportDriver() {}; + DXFPlugin_ExportDriver(); + ~DXFPlugin_ExportDriver() {}; - Standard_EXPORT static const Standard_GUID& GetID(); - Standard_EXPORT virtual Standard_Integer Execute( TFunction_Logbook& log ) const; - Standard_EXPORT Standard_Boolean MustExecute( const TFunction_Logbook& ) const; - Standard_EXPORT virtual void Validate( TFunction_Logbook& ) const {} + static const Standard_GUID& GetID(); + virtual Standard_Integer Execute( TFunction_Logbook& log ) const; + Standard_Boolean MustExecute( const TFunction_Logbook& ) const; + virtual void Validate( TFunction_Logbook& ) const {} - Standard_EXPORT virtual - bool GetCreationInformation( std::string& theOperationName, - std::vector& params ); + virtual bool GetCreationInformation( std::string& theOperationName, + std::vector& params ); DEFINE_STANDARD_RTTI( DXFPlugin_ExportDriver ) }; diff --git a/src/DXFPlugin_GUI.cxx b/src/DXFPlugin_GUI.cxx new file mode 100644 index 0000000..6f74748 --- /dev/null +++ b/src/DXFPlugin_GUI.cxx @@ -0,0 +1,265 @@ +// Copyright (C) 2014 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, or (at your option) any later version. +// +// 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 +// + +// internal includes +#include "DXFPlugin_GUI.h" + +// GUI includes +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// GEOM includes +#include "GeometryGUI.h" +#include "GEOM_Operation.h" +#include "GEOMBase.h" +#include "GEOM_Displayer.h" + +#include +#include CORBA_SERVER_HEADER(DXFPlugin) + +//======================================================================= +// function : DXFPlugin_GUI() +// purpose : Constructor +//======================================================================= +DXFPlugin_GUI::DXFPlugin_GUI( GeometryGUI* parent ) : GEOMPluginGUI( parent ) +{ +} + +//======================================================================= +// function : ~DXFPlugin_GUI +// purpose : Destructor +//======================================================================= +DXFPlugin_GUI::~DXFPlugin_GUI() +{ +} + +//======================================================================= +// function : OnGUIEvent() +// purpose : +//======================================================================= +bool DXFPlugin_GUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent ) +{ + QString cmd; + switch ( theCommandID ) { + case 1: + cmd = "Export_DXF"; + case 2: + cmd = "Import_DXF"; + default: + break; + } + return OnGUIEvent( cmd, parent ); +} + +//======================================================================= +// function : OnGUIEvent() +// purpose : +//======================================================================= +bool DXFPlugin_GUI::OnGUIEvent( const QString& theCommandID, SUIT_Desktop* parent ) +{ + bool result = false; + + if ( theCommandID == "Export_DXF" ) + { + result = exportDXF( parent ); + } + else if ( theCommandID == "Import_DXF" ) + { + result = importDXF( parent ); + } + else + { + getGeometryGUI()->getApp()->putInfo( tr("GEOM_PRP_COMMAND").arg( theCommandID ) ); + } + return result; +} + +//======================================================================= +// function : importDXF +// purpose : +//======================================================================= +bool DXFPlugin_GUI::importDXF( SUIT_Desktop* parent ) +{ + SalomeApp_Application* app = getGeometryGUI()->getApp(); + if ( !app ) return false; + SalomeApp_Study* study = dynamic_cast ( app->activeStudy() ); + if ( !study ) return false; + + SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() ); + GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "DXFPluginEngine" ); + DXFPlugin::IDXFOperations_var dxfOp = DXFPlugin::IDXFOperations::_narrow( op ); + if ( CORBA::is_nil( dxfOp ) ) return false; + + QStringList fileNames = app->getOpenFileNames( SUIT_FileDlg::getLastVisitedPath().isEmpty() ? QDir::currentPath() : QString(""), + tr( "DXF_FILES" ), + tr( "IMPORT_TITLE" ), + parent ); + if ( fileNames.count() > 0 ) + { + QStringList entryList; + QStringList errors; + + foreach( QString fileName, fileNames ) + { + SUIT_OverrideCursor wc; + GEOM_Operation transaction( app, dxfOp.in() ); + + try + { + app->putInfo( tr( "GEOM_PRP_LOADING" ).arg( fileName ) ); + transaction.start(); + GEOM::ListOfGO_var result = dxfOp->ImportDXF( fileName.toUtf8().constData() ); + if ( result->length() > 0 && dxfOp->IsDone() ) + { + GEOM::GEOM_Object_var main = result[0]; + QString publishName = GEOMBase::GetDefaultName( SUIT_Tools::file( fileName, true ) ); + SALOMEDS::SObject_var so = GeometryGUI::GetGeomGen()->PublishInStudy( dsStudy, + SALOMEDS::SObject::_nil(), + main.in(), + publishName.toUtf8().constData() ); + + entryList.append( so->GetID() ); + transaction.commit(); + GEOM_Displayer( study ).Display( main.in() ); + } + else + { + transaction.abort(); + errors.append( QString( "%1 : %2" ).arg( fileName ).arg( dxfOp->GetErrorCode() ) ); + } + } + catch( const SALOME::SALOME_Exception& e ) + { + transaction.abort(); + } + } + getGeometryGUI()->updateObjBrowser( true ); + app->browseObjects( entryList ); + + if ( errors.count() > 0 ) + { + SUIT_MessageBox::critical( parent, + tr( "GEOM_ERROR" ), + tr( "GEOM_IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ) ); + } + } + return fileNames.count() > 0; +} + +//======================================================================= +// function : exportDXF +// purpose : +//======================================================================= +bool DXFPlugin_GUI::exportDXF( SUIT_Desktop* parent ) +{ + SalomeApp_Application* app = getGeometryGUI()->getApp(); + if ( !app ) return false; + SalomeApp_Study* study = dynamic_cast ( app->activeStudy() ); + if ( !study ) return false; + + SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() ); + GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "DXFPluginEngine" ); + DXFPlugin::IDXFOperations_var dxfOp = DXFPlugin::IDXFOperations::_narrow( op ); + if ( CORBA::is_nil( dxfOp ) ) return false; + + LightApp_SelectionMgr* sm = app->selectionMgr(); + if ( !sm ) return false; + + SALOME_ListIO selectedObjects; + sm->selectedObjects( selectedObjects ); + bool ok = false; + + SALOME_ListIteratorOfListIO it( selectedObjects ); + for ( ; it.More(); it.Next() ) + { + Handle(SALOME_InteractiveObject) io = it.Value(); + GEOM::GEOM_Object_var obj = GEOMBase::ConvertIOinGEOMObject( io ); + + if ( CORBA::is_nil( obj ) ) continue; + + QString fileName = app->getFileName( false, + QString( io->getName() ), + tr( "DXF_FILES" ), + tr( "EXPORT_TITLE" ), + parent ); + + if ( fileName.isEmpty() ) + return false; + + SUIT_OverrideCursor wc; + + GEOM_Operation transaction( app, dxfOp.in() ); + + try + { + app->putInfo( tr( "GEOM_PRP_EXPORT" ).arg( fileName ) ); + transaction.start(); + + dxfOp->ExportDXF( obj, fileName.toUtf8().constData() ); + + if ( dxfOp->IsDone() ) + { + transaction.commit(); + } + else + { + transaction.abort(); + SUIT_MessageBox::critical( parent, + tr( "GEOM_ERROR" ), + tr( "GEOM_PRP_ABORT" ) + "\n" + tr( dxfOp->GetErrorCode() ) ); + return false; + } + } + catch ( const SALOME::SALOME_Exception& e ) + { + transaction.abort(); + return false; + } + ok = true; + } + + if ( !ok ) + { + SUIT_MessageBox::warning( parent, + tr( "WRN_WARNING" ), + tr( "GEOM_WRN_NO_APPROPRIATE_SELECTION" ) ); + } + return ok; +} + +//===================================================================================== +// EXPORTED METHODS +//===================================================================================== +extern "C" +{ +#ifdef WIN32 + __declspec( dllexport ) +#endif + GEOMGUI* GetLibGUI( GeometryGUI* parent ) + { + return new DXFPlugin_GUI( parent ); + } +} diff --git a/src/DXFPlugin_GUI.h b/src/DXFPlugin_GUI.h new file mode 100644 index 0000000..99045fd --- /dev/null +++ b/src/DXFPlugin_GUI.h @@ -0,0 +1,40 @@ +// Copyright (C) 2014 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, or (at your option) any later version. +// +// 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 DXFPlugin_GUI_H +#define DXFPlugin_GUI_H + +#include + +class DXFPlugin_GUI: public GEOMPluginGUI +{ + Q_OBJECT +public: + DXFPlugin_GUI( GeometryGUI* parent ); + ~DXFPlugin_GUI(); + + bool OnGUIEvent( int commandId, SUIT_Desktop* ); + bool OnGUIEvent( const QString&, SUIT_Desktop* ); + +private: + bool importDXF( SUIT_Desktop* ); + bool exportDXF( SUIT_Desktop* ); +}; + +#endif // DXFPlugin_GUI_H diff --git a/src/DXFPlugin_IECallBack.cxx b/src/DXFPlugin_IECallBack.cxx index e66c3f7..8aa1685 100755 --- a/src/DXFPlugin_IECallBack.cxx +++ b/src/DXFPlugin_IECallBack.cxx @@ -19,16 +19,16 @@ // internal includes #include "DXFPlugin_IECallBack.hxx" +#include "DXFPlugin_IOperations.hxx" +#include "DXFPlugin_OperationsCreator.hxx" //============================================================================= /*! * constructor */ //============================================================================= -DXFPlugin_IECallBack::DXFPlugin_IECallBack( DXFPlugin_IOperations* theOperations ) -: GEOMImpl_IECallBack() +DXFPlugin_IECallBack::DXFPlugin_IECallBack() { - myPluginOperations = theOperations; } //============================================================================= @@ -45,11 +45,13 @@ DXFPlugin_IECallBack::~DXFPlugin_IECallBack() * Export */ //============================================================================= -bool DXFPlugin_IECallBack::Export( const Handle(GEOM_Object) theOriginal, - const TCollection_AsciiString& theFileName, - const TCollection_AsciiString& theFormatName ) +bool DXFPlugin_IECallBack::Export( int theDocId, + const Handle(GEOM_Object) theOriginal, + const TCollection_AsciiString& theFileName, + const TCollection_AsciiString& theFormatName ) { - myPluginOperations->ExportDXF( theOriginal, theFileName ); + DXFPlugin_IOperations* aPluginOperations = DXFPlugin_OperationsCreator::get( GetEngine(), theDocId ); + aPluginOperations->ExportDXF( theOriginal, theFileName ); return true; } @@ -59,9 +61,11 @@ bool DXFPlugin_IECallBack::Export( const Handle(GEOM_Object) theOriginal, */ //============================================================================= Handle(TColStd_HSequenceOfTransient) -DXFPlugin_IECallBack::Import( const TCollection_AsciiString& theFormatName, - const TCollection_AsciiString& theFileName ) +DXFPlugin_IECallBack::Import( int theDocId, + const TCollection_AsciiString& theFormatName, + const TCollection_AsciiString& theFileName ) { - return myPluginOperations->ImportDXF( theFileName ); + DXFPlugin_IOperations* aPluginOperations = DXFPlugin_OperationsCreator::get( GetEngine(), theDocId ); + return aPluginOperations->ImportDXF( theFileName ); } diff --git a/src/DXFPlugin_IECallBack.hxx b/src/DXFPlugin_IECallBack.hxx index 92e0265..0e0b5c1 100644 --- a/src/DXFPlugin_IECallBack.hxx +++ b/src/DXFPlugin_IECallBack.hxx @@ -30,22 +30,20 @@ // OCC includes #include -class DXFPlugin_IECallBack : public GEOMImpl_IECallBack +class DXFPLUGINENGINE_EXPORT DXFPlugin_IECallBack : public GEOMImpl_IECallBack { public: - Standard_EXPORT DXFPlugin_IECallBack( DXFPlugin_IOperations* theOperations ); - Standard_EXPORT ~DXFPlugin_IECallBack(); + DXFPlugin_IECallBack(); + ~DXFPlugin_IECallBack(); - Standard_EXPORT virtual bool Export( const Handle(GEOM_Object) theOriginal, - const TCollection_AsciiString& theFileName, - const TCollection_AsciiString& theFormatName ); - - Standard_EXPORT virtual - Handle(TColStd_HSequenceOfTransient) Import( const TCollection_AsciiString& theFormatName, - const TCollection_AsciiString& theFileName ); - -private: - DXFPlugin_IOperations* myPluginOperations; + bool Export( int theDocId, + const Handle(GEOM_Object) theOriginal, + const TCollection_AsciiString& theFileName, + const TCollection_AsciiString& theFormatName ); + + Handle(TColStd_HSequenceOfTransient) Import( int theDocId, + const TCollection_AsciiString& theFormatName, + const TCollection_AsciiString& theFileName ); }; #endif diff --git a/src/DXFPlugin_IOperations.cxx b/src/DXFPlugin_IOperations.cxx index 752c164..65b3732 100644 --- a/src/DXFPlugin_IOperations.cxx +++ b/src/DXFPlugin_IOperations.cxx @@ -60,12 +60,10 @@ DXFPlugin_IOperations::~DXFPlugin_IOperations() * Export a shape to DXF format * \param theOriginal The shape to export * \param theFileName The name of the file to exported - * \param theIsASCII The format of the exported file (ASCII or Binary) - * \param theDeflection The deflection of the shape to exported */ //============================================================================= void DXFPlugin_IOperations::ExportDXF( const Handle(GEOM_Object) theOriginal, - const TCollection_AsciiString& theFileName ) + const TCollection_AsciiString& theFileName ) { SetErrorCode(KO); if( theOriginal.IsNull() ) return; @@ -90,9 +88,7 @@ void DXFPlugin_IOperations::ExportDXF( const Handle(GEOM_Object) theOrigina //Perform the Export try { -#if OCC_VERSION_LARGE > 0x06010000 OCC_CATCH_SIGNALS; -#endif if( !GetSolver()->ComputeFunction( aFunction ) ) { SetErrorCode( "Not enough space on disk, or you haven't permissions to write this directory" ); return; @@ -144,9 +140,7 @@ DXFPlugin_IOperations::ImportDXF( const TCollection_AsciiString& theFileName ) Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient; try { -#if OCC_VERSION_LARGE > 0x06010000 OCC_CATCH_SIGNALS; -#endif if( !GetSolver()->ComputeFunction( aFunction ) ) { SetErrorCode( "Import driver failed" ); return NULL; diff --git a/src/DXFPlugin_IOperations.hxx b/src/DXFPlugin_IOperations.hxx index 40cea1e..c3d9d26 100644 --- a/src/DXFPlugin_IOperations.hxx +++ b/src/DXFPlugin_IOperations.hxx @@ -21,19 +21,22 @@ #ifndef _DXFPlugin_IOperations_HXX_ #define _DXFPlugin_IOperations_HXX_ +// internal includes +#include "DXFPlugin_Engine.hxx" + // GEOM includes #include -class DXFPlugin_IOperations: public GEOMImpl_IBaseIEOperations +class DXFPLUGINENGINE_EXPORT DXFPlugin_IOperations: public GEOMImpl_IBaseIEOperations { public: - Standard_EXPORT DXFPlugin_IOperations( GEOM_Engine*, int ); - Standard_EXPORT ~DXFPlugin_IOperations(); + DXFPlugin_IOperations( GEOM_Engine*, int ); + ~DXFPlugin_IOperations(); - Standard_EXPORT void ExportDXF( const Handle(GEOM_Object), - const TCollection_AsciiString& ); + void ExportDXF( const Handle(GEOM_Object), + const TCollection_AsciiString& ); - Standard_EXPORT Handle(TColStd_HSequenceOfTransient) ImportDXF( const TCollection_AsciiString& ); + Handle(TColStd_HSequenceOfTransient) ImportDXF( const TCollection_AsciiString& ); }; #endif diff --git a/src/DXFPlugin_IOperations_i.cc b/src/DXFPlugin_IOperations_i.cc new file mode 100644 index 0000000..bca345b --- /dev/null +++ b/src/DXFPlugin_IOperations_i.cc @@ -0,0 +1,109 @@ +// Copyright (C) 2014 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, or (at your option) any later version. +// +// 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 +// + +// internal includes +#include "DXFPlugin_IOperations_i.hh" +#include "DXFPlugin_IOperations.hxx" +#include + +// KERNEL includes +#include + +//============================================================================= +/*! + * constructor: + */ +//============================================================================= +DXFPlugin_IOperations_i::DXFPlugin_IOperations_i( PortableServer::POA_ptr thePOA, + GEOM::GEOM_Gen_ptr theEngine, + ::DXFPlugin_IOperations* theImpl ) +:GEOM_IOperations_i( thePOA, theEngine, theImpl ) +{ + MESSAGE( "DXFPlugin_Operations_i::DXFPlugin_Operations_i" ); +} + +//============================================================================= +/*! + * destructor + */ +//============================================================================= +DXFPlugin_IOperations_i::~DXFPlugin_IOperations_i() +{ + MESSAGE( "DXFPlugin_Operations_i::~DXFPlugin_Operations_i" ); +} + +//============================================================================= +/*! + * ExportDXF + * Export a shape to DXF format + * \param theOriginal The shape to export + * \param theFileName The name of the exported file + */ +//============================================================================= +void DXFPlugin_IOperations_i::ExportDXF( GEOM::GEOM_Object_ptr theOriginal, + const char* theFileName ) +{ + // duplicate the original shape + GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate( theOriginal ); + + //Set a not done flag + GetOperations()->SetNotDone(); + + //Get the reference shape + Handle(GEOM_Object) anOriginal = GetObjectImpl( theOriginal ); + if (anOriginal.IsNull()) return; + + //Export the shape to the file + GetOperations()->ExportDXF( anOriginal, theFileName ); +} + +//============================================================================= +/*! + * ImportDXF + * Import a shape from DXF format + * \param theFileName The name of the file to import + * \return List of GEOM_Objects, containing the created shape and propagation groups. + */ +//============================================================================= +GEOM::ListOfGO* DXFPlugin_IOperations_i::ImportDXF( const char* theFileName ) +{ + GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO; + + //Set a not done flag + GetOperations()->SetNotDone(); + + //Import the shape from the file + Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->ImportDXF( theFileName ); + + if( !GetOperations()->IsDone() || aHSeq.IsNull() ) + return aSeq._retn(); + + // Copy created objects. + Standard_Integer aLength = aHSeq->Length(); + aSeq->length( aLength ); + for( Standard_Integer i = 1; i <= aLength; i++ ) + aSeq[i-1] = GetObject( Handle(GEOM_Object)::DownCast( aHSeq->Value(i) ) ); + + return aSeq._retn(); +} + +DXFPlugin_IOperations* DXFPlugin_IOperations_i::GetOperations() +{ + return (DXFPlugin_IOperations*)GetImpl(); +} diff --git a/src/DXFPlugin_IOperations_i.hh b/src/DXFPlugin_IOperations_i.hh new file mode 100644 index 0000000..689e900 --- /dev/null +++ b/src/DXFPlugin_IOperations_i.hh @@ -0,0 +1,52 @@ +// Copyright (C) 2014 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, or (at your option) any later version. +// +// 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 _DXFPlugin_IOperations_i_HeaderFile +#define _DXFPlugin_IOperations_i_HeaderFile + +// idl includes +#include +#include CORBA_SERVER_HEADER( GEOM_Gen ) +#include CORBA_SERVER_HEADER( DXFPlugin ) + +// internal includes +#include "DXFPlugin_Engine.hxx" + +// GEOM includes +#include + +class DXFPlugin_IOperations; + +class DXFPLUGINENGINE_EXPORT DXFPlugin_IOperations_i : + public virtual POA_DXFPlugin::IDXFOperations, + public virtual GEOM_IOperations_i +{ +public: + DXFPlugin_IOperations_i( PortableServer::POA_ptr thePOA, + GEOM::GEOM_Gen_ptr theEngine, + DXFPlugin_IOperations* theImpl ); + ~DXFPlugin_IOperations_i(); + + void ExportDXF( GEOM::GEOM_Object_ptr, const char* ); + GEOM::ListOfGO* ImportDXF( const char* ); + + DXFPlugin_IOperations* GetOperations(); +}; + +#endif // _DXFPlugin_IOperations_i_HeaderFile diff --git a/src/DXFPlugin_ImportDlg.cxx b/src/DXFPlugin_ImportDlg.cxx deleted file mode 100644 index ba69e45..0000000 --- a/src/DXFPlugin_ImportDlg.cxx +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (C) 2014 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, or (at your option) any later version. -// -// 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 -// - -// internal includes -#include "DXFPlugin_ImportDlg.h" -#include "DXFPlugin_Operations_i.hh" - -// GUI includes -#include -#include -#include -#include -#include - -// GEOM includes -#include -#include - -//================================================================================= -// Constructor -//================================================================================= -DXFPlugin_ImportDlg::DXFPlugin_ImportDlg( QWidget* parent ) -: SUIT_FileDlg( parent, true, true, true ), - GEOMBase_Helper( dynamic_cast( parent ) ) -{ - setWindowTitle( tr( "DXFPLUGIN_IMPORT_TITLE" ) ); - setAcceptMode( AcceptOpen ); - setNameFilter( tr( "DXFPLUGIN_DXF_FILES" ) ); - setFileMode( QFileDialog::ExistingFiles ); -} - -//================================================================================= -// Destructor -//================================================================================= -DXFPlugin_ImportDlg::~DXFPlugin_ImportDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - -//================================================================================= -// function : createOperation -// purpose : -//================================================================================= -GEOM::GEOM_IOperations_ptr DXFPlugin_ImportDlg::createOperation() -{ - return getGeomEngine()->GetPluginOperations(getStudyId(), "DXFPluginEngine"); -} - -//================================================================================= -// function : isValid -// purpose : -//================================================================================= -bool DXFPlugin_ImportDlg::isValid (QString& msg) -{ - bool ok = true; - //@@ add custom validation actions here @@// - return ok; -} - -//================================================================================= -// function : execute -// purpose : -//================================================================================= -bool DXFPlugin_ImportDlg::execute( ObjectList& objects ) -{ - bool res = false; - GEOM::GEOM_Object_var anObj; - DXFPlugin::GEOM_IDXFPluginOperations_var anOper = DXFPlugin::GEOM_IDXFPluginOperations::_narrow( getOperation() ); - - SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); - - QStringList fileNames = selectedFiles(); - if ( fileNames.count() == 0 ) - return false; // nothing selected, return - - for( int i = 0; i < fileNames.size(); i++ ) { - QString aFileName = fileNames.at( i ); - if ( aFileName.isEmpty() ) - continue; - GEOM_Operation* anOp = new GEOM_Operation( app, anOper.in() ); - try { - app->putInfo( tr( "GEOM_PRP_LOADING" ).arg( SUIT_Tools::file( aFileName.toUtf8().constData(), /*withExten=*/true ) ) ); - anOp->start(); - GEOM::ListOfGO_var anObj = anOper->ImportDXF( aFileName.toUtf8().constData() ); - if( anObj->length() > 0 && anOper->IsDone() ) { - GEOM::GEOM_Object_ptr anObjPtr = anObj[0]._retn(); - objects.push_back( anObjPtr ); - QString aPublishObjName = GEOMBase::GetDefaultName( SUIT_Tools::file( fileNames.at( i ), - /*withExten=*/true ) ); - anObjPtr->SetName( aPublishObjName.toStdString().c_str() ); - anOp->commit(); - } - else { - anOp->abort(); - SUIT_MessageBox::critical( app->desktop(), - QObject::tr("GEOM_ERROR"), - QObject::tr("GEOM_PRP_ABORT") + "\n" + QObject::tr( anOper->GetErrorCode() ) ); - } - } - catch( const SALOME::SALOME_Exception& S_ex ) { - anOp->abort(); - } - } - return true; -} - -//================================================================================= -// function : accept -// purpose : -//================================================================================= -void DXFPlugin_ImportDlg::accept() -{ - SUIT_FileDlg::accept(); - onAccept(); -} - -//================================================================================= -// function : getObjectName -// purpose : -//================================================================================= -QString DXFPlugin_ImportDlg::getObjectName( GEOM::GEOM_Object_ptr object ) const -{ - if( object->_is_nil() ) - return QString::null; - return object->GetName(); -} diff --git a/src/DXFPlugin_ImportDlg.h b/src/DXFPlugin_ImportDlg.h deleted file mode 100644 index 48bdbf4..0000000 --- a/src/DXFPlugin_ImportDlg.h +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (C) 2014 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, or (at your option) any later version. -// -// 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 DXFPlugin_IMPORTDLG_H -#define DXFPlugin_IMPORTDLG_H - -// GUI includes -#include - -// GEOM includes -#include -#include - -class DXFPlugin_ImportDlg: public SUIT_FileDlg, public GEOMBase_Helper -{ - Q_OBJECT - -public: - DXFPlugin_ImportDlg( QWidget* = 0 ); - ~DXFPlugin_ImportDlg(); - -protected: - // redefined from GEOMBase_Helper - virtual GEOM::GEOM_IOperations_ptr createOperation(); - virtual bool isValid( QString& ); - virtual bool execute( ObjectList& ); - virtual QString getObjectName( GEOM::GEOM_Object_ptr object ) const; - -protected slots: - void accept(); -}; - -#endif // DXFPlugin_IMPORTDLG_H diff --git a/src/DXFPlugin_ImportDriver.cxx b/src/DXFPlugin_ImportDriver.cxx index ae700d0..c9615c2 100644 --- a/src/DXFPlugin_ImportDriver.cxx +++ b/src/DXFPlugin_ImportDriver.cxx @@ -20,7 +20,6 @@ // internal includes #include "DXFPlugin_ImportDriver.hxx" #include "DXFPlugin_IImport.hxx" -#include "DXFPlugin_Engine.hxx" // KERNEL includes #include diff --git a/src/DXFPlugin_ImportDriver.hxx b/src/DXFPlugin_ImportDriver.hxx index 2128c2b..dfc6ac4 100644 --- a/src/DXFPlugin_ImportDriver.hxx +++ b/src/DXFPlugin_ImportDriver.hxx @@ -33,17 +33,16 @@ DEFINE_STANDARD_HANDLE( DXFPlugin_ImportDriver, GEOM_BaseDriver ); class DXFPlugin_ImportDriver : public GEOM_BaseDriver { public: - Standard_EXPORT DXFPlugin_ImportDriver(); - Standard_EXPORT ~DXFPlugin_ImportDriver() {}; + DXFPlugin_ImportDriver(); + ~DXFPlugin_ImportDriver() {}; - Standard_EXPORT static const Standard_GUID& GetID(); - Standard_EXPORT virtual Standard_Integer Execute( TFunction_Logbook& log ) const; - Standard_EXPORT Standard_Boolean MustExecute( const TFunction_Logbook& ) const; - Standard_EXPORT virtual void Validate( TFunction_Logbook& ) const {} + static const Standard_GUID& GetID(); + virtual Standard_Integer Execute( TFunction_Logbook& log ) const; + Standard_Boolean MustExecute( const TFunction_Logbook& ) const; + virtual void Validate( TFunction_Logbook& ) const {} - Standard_EXPORT virtual - bool GetCreationInformation( std::string& theOperationName, - std::vector& params ); + virtual bool GetCreationInformation( std::string& theOperationName, + std::vector& params ); DEFINE_STANDARD_RTTI( DXFPlugin_ImportDriver ) }; diff --git a/src/DXFPlugin_OperationsCreator.cc b/src/DXFPlugin_OperationsCreator.cc deleted file mode 100644 index 41705b0..0000000 --- a/src/DXFPlugin_OperationsCreator.cc +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (C) 2014 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, or (at your option) any later version. -// -// 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 -// - -// internal includes -#include "DXFPlugin_OperationsCreator.hh" -#include "DXFPlugin_Operations_i.hh" -#include "DXFPlugin_ExportDriver.hxx" -#include "DXFPlugin_ImportDriver.hxx" -#include "DXFPlugin_IECallBack.hxx" - -// KERNEL includes -#include -#include - -// GEOM includes -#include - -// OCCT includes -#include - -//============================================================================ -// function : Create -// purpose : -//============================================================================ -GEOM_IOperations_i* DXFPlugin_OperationsCreator::Create( PortableServer::POA_ptr thePOA, - int theStudyId, - GEOM::GEOM_Gen_ptr theEngine, - ::GEOMImpl_Gen* theGenImpl ) -{ - Unexpect aCatch( SALOME_SalomeException ); - MESSAGE( "DXFPlugin_OperationsCreator::Create" ); - - if (_mapOfOperations.find( theStudyId ) == _mapOfOperations.end() ) { - DXFPlugin_IOperations* anOper = new DXFPlugin_IOperations( theGenImpl, theStudyId ); - _mapOfOperations[theStudyId] = anOper; - - // Import/Export DXF - TFunction_DriverTable::Get()->AddDriver( DXFPlugin_ExportDriver::GetID(), - new DXFPlugin_ExportDriver() ); - TFunction_DriverTable::Get()->AddDriver( DXFPlugin_ImportDriver::GetID(), - new DXFPlugin_ImportDriver() ); - - DXFPlugin_IECallBack* DXFCallBack = new DXFPlugin_IECallBack( anOper ); - GEOMImpl_IECallBack::Register( "DXF", DXFCallBack ); - } - - DXFPlugin_Operations_i* aServant = - new DXFPlugin_Operations_i( thePOA, theEngine, _mapOfOperations[theStudyId] ); - - return aServant; -} diff --git a/src/DXFPlugin_OperationsCreator.cxx b/src/DXFPlugin_OperationsCreator.cxx new file mode 100644 index 0000000..a20b6c8 --- /dev/null +++ b/src/DXFPlugin_OperationsCreator.cxx @@ -0,0 +1,71 @@ +// Copyright (C) 2014 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, or (at your option) any later version. +// +// 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 +// + +// internal includes +#include "DXFPlugin_OperationsCreator.hxx" +#include "DXFPlugin_IOperations_i.hh" +#include "DXFPlugin_ExportDriver.hxx" +#include "DXFPlugin_ImportDriver.hxx" +#include "DXFPlugin_IECallBack.hxx" + +// KERNEL includes +#include +#include + +// GEOM includes +#include + +// OCCT includes +#include + +std::map DXFPlugin_OperationsCreator::_mapOfOperations; + +DXFPlugin_OperationsCreator::DXFPlugin_OperationsCreator() +{ + // Register drivers + TFunction_DriverTable::Get()->AddDriver( DXFPlugin_ExportDriver::GetID(), + new DXFPlugin_ExportDriver() ); + TFunction_DriverTable::Get()->AddDriver( DXFPlugin_ImportDriver::GetID(), + new DXFPlugin_ImportDriver() ); + // Register callback + DXFPlugin_IECallBack* callback = new DXFPlugin_IECallBack(); + GEOMImpl_IECallBack::Register( "DXF", callback ); +} + +DXFPlugin_OperationsCreator::~DXFPlugin_OperationsCreator() +{ +} + +GEOM_IOperations_i* DXFPlugin_OperationsCreator::Create( PortableServer::POA_ptr thePOA, + int theStudyId, + GEOM::GEOM_Gen_ptr theEngine, + ::GEOMImpl_Gen* theGenImpl ) +{ + Unexpect aCatch( SALOME_SalomeException ); + MESSAGE( "DXFPlugin_OperationsCreator::Create" ); + return new DXFPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl, theStudyId ) ); +} + +DXFPlugin_IOperations* DXFPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl, + int theStudyId ) +{ + if (_mapOfOperations.find( theStudyId ) == _mapOfOperations.end() ) + _mapOfOperations[theStudyId] = new DXFPlugin_IOperations( theGenImpl, theStudyId ); + return _mapOfOperations[theStudyId]; +} diff --git a/src/DXFPlugin_OperationsCreator.hh b/src/DXFPlugin_OperationsCreator.hh deleted file mode 100755 index c3ca1ab..0000000 --- a/src/DXFPlugin_OperationsCreator.hh +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (C) 2014 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, or (at your option) any later version. -// -// 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 _GEOM_DXFPlugin_OperationsCreator_HXX_ -#define _GEOM_DXFPlugin_OperationsCreator_HXX_ - -// internal includes -#include "DXFPlugin_Engine.hxx" -#include "DXFPlugin_IOperations.hxx" - -// GEOM includes -#include "GEOM_Gen_i.hh" - -// C++ includes -#include - -//===================================================================== -// Operations creator -//===================================================================== -class DXFPLUGINENGINE_EXPORT DXFPlugin_OperationsCreator : public GEOM_GenericOperationsCreator -{ -public: - virtual GEOM_IOperations_i* Create( PortableServer::POA_ptr thePOA, - int theStudyId, - GEOM::GEOM_Gen_ptr theEngine, - ::GEOMImpl_Gen* theGenImpl ); - private: - std::map _mapOfOperations; -}; - -#endif diff --git a/src/DXFPlugin_OperationsCreator.hxx b/src/DXFPlugin_OperationsCreator.hxx new file mode 100755 index 0000000..3d8df73 --- /dev/null +++ b/src/DXFPlugin_OperationsCreator.hxx @@ -0,0 +1,57 @@ +// Copyright (C) 2014 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, or (at your option) any later version. +// +// 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 _GEOM_DXFPlugin_OperationsCreator_HXX_ +#define _GEOM_DXFPlugin_OperationsCreator_HXX_ + +// internal includes +#include "DXFPlugin_Engine.hxx" + +// GEOM includes +#include "GEOM_Gen_i.hh" + +// C++ includes +#include + +class DXFPlugin_IOperations; + +//===================================================================== +// Operations creator +//===================================================================== +class DXFPLUGINENGINE_EXPORT DXFPlugin_OperationsCreator : public GEOM_GenericOperationsCreator +{ +public: + DXFPlugin_OperationsCreator(); + ~DXFPlugin_OperationsCreator(); + + GEOM_IOperations_i* Create( PortableServer::POA_ptr thePOA, + int theStudyId, + GEOM::GEOM_Gen_ptr theEngine, + ::GEOMImpl_Gen* theGenImpl ); + +private: + static DXFPlugin_IOperations* get( ::GEOMImpl_Gen* theGenImpl, + int theStudyId ); + + static std::map _mapOfOperations; + + friend class DXFPlugin_IECallBack; +}; + +#endif diff --git a/src/DXFPlugin_Operations_i.cc b/src/DXFPlugin_Operations_i.cc deleted file mode 100644 index 115daf0..0000000 --- a/src/DXFPlugin_Operations_i.cc +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (C) 2014 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, or (at your option) any later version. -// -// 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 -// - -// internal includes -#include "DXFPlugin_Operations_i.hh" -#include - -// KERNEL includes -#include - -//============================================================================= -/*! - * constructor: - */ -//============================================================================= -DXFPlugin_Operations_i::DXFPlugin_Operations_i( PortableServer::POA_ptr thePOA, - GEOM::GEOM_Gen_ptr theEngine, - ::DXFPlugin_IOperations* theImpl ) -:GEOM_IOperations_i( thePOA, theEngine, theImpl ) -{ - MESSAGE( "DXFPlugin_Operations_i::DXFPlugin_Operations_i" ); -} - -//============================================================================= -/*! - * destructor - */ -//============================================================================= -DXFPlugin_Operations_i::~DXFPlugin_Operations_i() -{ - MESSAGE( "DXFPlugin_Operations_i::~DXFPlugin_Operations_i" ); -} - -//============================================================================= -/*! - * ExportDXF - * Export a shape to DXF format - * \param theOriginal The shape to export - * \param theFileName The name of the exported file - */ -//============================================================================= -void DXFPlugin_Operations_i::ExportDXF( GEOM::GEOM_Object_ptr theOriginal, - const char* theFileName ) -{ - // duplicate the original shape - GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate( theOriginal ); - - //Set a not done flag - GetOperations()->SetNotDone(); - - //Get the reference shape - Handle(GEOM_Object) anOriginal = GetObjectImpl( theOriginal ); - if (anOriginal.IsNull()) return; - - //Export the shape to the file - char* aFileName = strdup( theFileName ); - - GetOperations()->ExportDXF( anOriginal, aFileName ); - free( aFileName ); -} - -//============================================================================= -/*! - * ImportDXF - * Import a shape from DXF format - * \param theFileName The name of the file to import - * \return List of GEOM_Objects, containing the created shape and propagation groups. - */ -//============================================================================= -GEOM::ListOfGO* DXFPlugin_Operations_i::ImportDXF( const char* theFileName ) -{ - GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO; - - //Set a not done flag - GetOperations()->SetNotDone(); - - //Import the shape from the file - char* aFileName = strdup( theFileName ); - TCollection_AsciiString fileName( aFileName ); - - //Import the shape from the file - Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->ImportDXF( fileName ); - - free( aFileName ); - if( !GetOperations()->IsDone() || aHSeq.IsNull() ) - return aSeq._retn(); - - // Copy created objects. - Standard_Integer aLength = aHSeq->Length(); - aSeq->length( aLength ); - for( Standard_Integer i = 1; i <= aLength; i++ ) - aSeq[i-1] = GetObject( Handle(GEOM_Object)::DownCast( aHSeq->Value(i) ) ); - - return aSeq._retn(); -} - -//============================================================================= -/*! - * \brief Get version of the plugin. - * \return the version of the plugin -*/ -//============================================================================= - -int DXFPlugin_Operations_i::GetVersion() -{ - return DXFPLUGIN_VERSION; -} -//============================================================================= -/*! - * \brief Get version of the plugin. - * \return the string representation of the plugin's version -*/ -//============================================================================= - -char* DXFPlugin_Operations_i::GetVersionStr() -{ - return (char*)DXFPLUGIN_VERSION_STR; -} diff --git a/src/DXFPlugin_Operations_i.hh b/src/DXFPlugin_Operations_i.hh deleted file mode 100644 index 21488b2..0000000 --- a/src/DXFPlugin_Operations_i.hh +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (C) 2014 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, or (at your option) any later version. -// -// 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 _DXFPlugin_Operations_i_HeaderFile -#define _DXFPlugin_Operations_i_HeaderFile - -// idl includes -#include -#include CORBA_SERVER_HEADER( GEOM_Gen ) -#include CORBA_SERVER_HEADER( DXFPlugin_Gen ) - -// internal includes -#include "DXFPlugin_Engine.hxx" -#include "DXFPlugin_IOperations.hxx" - -// GEOM includes -#include - -class DXFPLUGINENGINE_EXPORT DXFPlugin_Operations_i : - public virtual POA_DXFPlugin::GEOM_IDXFPluginOperations, - public virtual GEOM_IOperations_i -{ -public: - DXFPlugin_Operations_i( PortableServer::POA_ptr thePOA, - GEOM::GEOM_Gen_ptr theEngine, - ::DXFPlugin_IOperations* theImpl ); - ~DXFPlugin_Operations_i(); - - void ExportDXF( GEOM::GEOM_Object_ptr, const char* ); - GEOM::ListOfGO* ImportDXF( const char* ); - - // Version information - virtual int GetVersion(); - virtual char* GetVersionStr(); - - ::DXFPlugin_IOperations* GetOperations() - { return (::DXFPlugin_IOperations*)GetImpl(); } -}; - -#endif diff --git a/src/resources/DXFPlugin_msg_en.ts b/src/resources/DXFPlugin_msg_en.ts index 24fc2b3..6021633 100644 --- a/src/resources/DXFPlugin_msg_en.ts +++ b/src/resources/DXFPlugin_msg_en.ts @@ -27,22 +27,19 @@ STB_IMPORTDXF Import DXF + + + DXFPlugin_GUI - DXFPLUGIN_DXF_FILES + DXF_FILES DXF files( *.dxf ) - - - DXFPlugin_ExportDlg - DXFPLUGIN_EXPORT_TITLE + EXPORT_TITLE Export DXF - - - DXFPlugin_ImportDlg - DXFPLUGIN_IMPORT_TITLE + IMPORT_TITLE Import DXF diff --git a/src/resources/DXFPlugin_msg_fr.ts b/src/resources/DXFPlugin_msg_fr.ts index 9f66bda..54f35a2 100644 --- a/src/resources/DXFPlugin_msg_fr.ts +++ b/src/resources/DXFPlugin_msg_fr.ts @@ -27,22 +27,19 @@ STB_IMPORTDXF Importer DXF + + + DXFPlugin_GUI - DXFPLUGIN_DXF_FILES + DXF_FILES DXF Fichiers( *.dxf ) - - - DXFPlugin_ExportDlg - DXFPLUGIN_EXPORT_TITLE + EXPORT_TITLE Exporter DXF - - - DXFPlugin_ImportDlg - DXFPLUGIN_IMPORT_TITLE + IMPORT_TITLE Importer DXF diff --git a/src/resources/DXFPlugin_msg_ja.ts b/src/resources/DXFPlugin_msg_ja.ts index 859d770..6c6461e 100644 --- a/src/resources/DXFPlugin_msg_ja.ts +++ b/src/resources/DXFPlugin_msg_ja.ts @@ -27,22 +27,19 @@ STB_IMPORTDXF Import DXF + + + DXFPlugin_GUI - DXFPLUGIN_DXF_FILES + DXF_FILES DXF files( *.dxf ) - - - DXFPlugin_ExportDlg - DXFPLUGIN_EXPORT_TITLE + EXPORT_TITLE Export DXF - - - DXFPlugin_ImportDlg - DXFPLUGIN_IMPORT_TITLE + IMPORT_TITLE Import DXF