ENDIF(WIN32)
SET(SalomeIDLDXFPlugin_IDLSOURCES
- DXFPlugin_Gen.idl
+ DXFPlugin.idl
)
SET(IDL_INCLUDE_DIRS
--- /dev/null
+// 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__
+
+++ /dev/null
-// 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
${CAS_INCLUDE_DIRS}
${DXF_INCLUDE_DIRS}
${KERNEL_INCLUDE_DIRS}
- ${GUI_INCLUDE_DIRS}
${PROJECT_BINARY_DIR}
${PROJECT_BINARY_DIR}/idl
)
IF(SALOME_BUILD_GUI)
INCLUDE_DIRECTORIES(
${QT_INCLUDE_DIRS}
+ ${GUI_INCLUDE_DIRS}
+ ${GEOM_INCLUDE_DIRS}
)
ENDIF()
ENDIF()
# libraries to link to
-SET(_link_LIBRARIES
+SET(_link_engine_LIBRARIES
${CAS_TKXSBase}
${DXF_LIBRARIES}
${KERNEL_SALOMEBasics}
)
IF(SALOME_BUILD_GUI)
- SET(_link_LIBRARIES
- ${_link_LIBRARIES}
+ SET(_link_gui_LIBRARIES
+ SalomeIDLDXFPlugin
+ ${GEOM_GEOMObject}
+ ${GEOM_GEOMBase}
${GEOM_GEOMBase}
)
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
IF(SALOME_BUILD_GUI)
# header files / to be processed by moc
SET(_moc_HEADERS
- DXFPlugin_ExportDlg.h
- DXFPlugin_ImportDlg.h
+ DXFPlugin_GUI.h
)
ENDIF()
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
# 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}")
# 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.
+++ /dev/null
-// 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;
- }
-}
+++ /dev/null
-// 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 <SUIT_Desktop.h>
-#include <SUIT_MessageBox.h>
-#include <SalomeApp_Application.h>
-#include <SALOME_ListIteratorOfListIO.hxx>
-#include <LightApp_SelectionMgr.h>
-
-// GEOM includes
-#include <GeometryGUI.h>
-
-//=======================================================================
-// 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 );
- }
-}
+++ /dev/null
-// 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 <GEOMPluginGUI.h>
-
-class DXFPluginGUI: public GEOMPluginGUI
-{
-public:
- DXFPluginGUI( GeometryGUI* parent );
- ~DXFPluginGUI();
-
- bool OnGUIEvent( int commandId, SUIT_Desktop* );
- bool OnGUIEvent( const QString&, SUIT_Desktop* );
-};
-
-#endif // DXFPluginGUI_H
--- /dev/null
+// 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();
+ }
+}
#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 )
+++ /dev/null
-// 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 <SUIT_Session.h>
-#include <SUIT_Desktop.h>
-#include <SUIT_Tools.h>
-#include <SUIT_MessageBox.h>
-#include <SUIT_OverrideCursor.h>
-
-#include <SalomeApp_Application.h>
-
-// GEOM includes
-#include <GEOMBase.h>
-#include <GEOM_Operation.h>
-#include <GEOM_Constants.h>
-
-//=================================================================================
-// Constructor
-//=================================================================================
-DXFPlugin_ExportDlg::DXFPlugin_ExportDlg( Handle(SALOME_InteractiveObject)& object, QWidget* parent )
-: SUIT_FileDlg( parent, false, true, true ),
- GEOMBase_Helper( dynamic_cast<SUIT_Desktop*>( 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);
-}
+++ /dev/null
-// 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 <SUIT_FileDlg.h>
-
-// GEOM includes
-#include <GEOM_GenericObjPtr.h>
-#include <GEOMBase_Helper.h>
-
-
-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
// internal includes
#include "DXFPlugin_ExportDriver.hxx"
#include "DXFPlugin_IExport.hxx"
-#include "DXFPlugin_Engine.hxx"
// KERNEL includes
#include <Basics_Utils.hxx>
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<GEOM_Param>& params );
+ virtual bool GetCreationInformation( std::string& theOperationName,
+ std::vector<GEOM_Param>& params );
DEFINE_STANDARD_RTTI( DXFPlugin_ExportDriver )
};
--- /dev/null
+// 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 <SUIT_Desktop.h>
+#include <SUIT_FileDlg.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_OverrideCursor.h>
+#include <SUIT_Tools.h>
+#include <LightApp_SelectionMgr.h>
+#include <SalomeApp_Application.h>
+#include <SalomeApp_Study.h>
+#include <SALOME_ListIO.hxx>
+
+// GEOM includes
+#include "GeometryGUI.h"
+#include "GEOM_Operation.h"
+#include "GEOMBase.h"
+#include "GEOM_Displayer.h"
+
+#include <SALOMEconfig.h>
+#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<SalomeApp_Study*> ( 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<SalomeApp_Study*> ( 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 );
+ }
+}
--- /dev/null
+// 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 <GEOMPluginGUI.h>
+
+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
// 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;
}
//=============================================================================
* 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;
}
*/
//=============================================================================
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 );
}
// OCC includes
#include <TCollection_AsciiString.hxx>
-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
* 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;
//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;
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;
#ifndef _DXFPlugin_IOperations_HXX_
#define _DXFPlugin_IOperations_HXX_
+// internal includes
+#include "DXFPlugin_Engine.hxx"
+
// GEOM includes
#include <GEOMImpl_IBaseIEOperations.hxx>
-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
--- /dev/null
+// 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 <DXFPLUGIN_version.h>
+
+// KERNEL includes
+#include <utilities.h>
+
+//=============================================================================
+/*!
+ * 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();
+}
--- /dev/null
+// 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 <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER( GEOM_Gen )
+#include CORBA_SERVER_HEADER( DXFPlugin )
+
+// internal includes
+#include "DXFPlugin_Engine.hxx"
+
+// GEOM includes
+#include <GEOM_IOperations_i.hh>
+
+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
+++ /dev/null
-// 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 <SUIT_Session.h>
-#include <SUIT_MessageBox.h>
-#include <SUIT_Desktop.h>
-#include <SUIT_Tools.h>
-#include <SalomeApp_Application.h>
-
-// GEOM includes
-#include <GEOMBase.h>
-#include <GEOM_Operation.h>
-
-//=================================================================================
-// Constructor
-//=================================================================================
-DXFPlugin_ImportDlg::DXFPlugin_ImportDlg( QWidget* parent )
-: SUIT_FileDlg( parent, true, true, true ),
- GEOMBase_Helper( dynamic_cast<SUIT_Desktop*>( 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();
-}
+++ /dev/null
-// 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 <SUIT_FileDlg.h>
-
-// GEOM includes
-#include <GEOMBase_Helper.h>
-#include <GEOM_GenericObjPtr.h>
-
-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
// internal includes
#include "DXFPlugin_ImportDriver.hxx"
#include "DXFPlugin_IImport.hxx"
-#include "DXFPlugin_Engine.hxx"
// KERNEL includes
#include <Basics_Utils.hxx>
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<GEOM_Param>& params );
+ virtual bool GetCreationInformation( std::string& theOperationName,
+ std::vector<GEOM_Param>& params );
DEFINE_STANDARD_RTTI( DXFPlugin_ImportDriver )
};
+++ /dev/null
-// 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 <Utils_ExceptHandlers.hxx>
-#include <utilities.h>
-
-// GEOM includes
-#include <GEOMImpl_IECallBack.hxx>
-
-// OCCT includes
-#include <TFunction_DriverTable.hxx>
-
-//============================================================================
-// 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;
-}
--- /dev/null
+// 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 <Utils_ExceptHandlers.hxx>
+#include <utilities.h>
+
+// GEOM includes
+#include <GEOMImpl_IECallBack.hxx>
+
+// OCCT includes
+#include <TFunction_DriverTable.hxx>
+
+std::map <int, DXFPlugin_IOperations*> 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];
+}
+++ /dev/null
-// 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 <map>
-
-//=====================================================================
-// 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 <int, DXFPlugin_IOperations*> _mapOfOperations;
-};
-
-#endif
--- /dev/null
+// 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 <map>
+
+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 <int, DXFPlugin_IOperations*> _mapOfOperations;
+
+ friend class DXFPlugin_IECallBack;
+};
+
+#endif
+++ /dev/null
-// 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 <DXFPLUGIN_version.h>
-
-// KERNEL includes
-#include <utilities.h>
-
-//=============================================================================
-/*!
- * 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;
-}
+++ /dev/null
-// 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 <SALOMEconfig.h>
-#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 <GEOM_IOperations_i.hh>
-
-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
<source>STB_IMPORTDXF</source>
<translation>Import DXF</translation>
</message>
+</context>
+<context>
+ <name>DXFPlugin_GUI</name>
<message>
- <source>DXFPLUGIN_DXF_FILES</source>
+ <source>DXF_FILES</source>
<translation>DXF files( *.dxf )</translation>
</message>
-</context>
-<context>
- <name>DXFPlugin_ExportDlg</name>
<message>
- <source>DXFPLUGIN_EXPORT_TITLE</source>
+ <source>EXPORT_TITLE</source>
<translation>Export DXF</translation>
</message>
-</context>
-<context>
- <name>DXFPlugin_ImportDlg</name>
<message>
- <source>DXFPLUGIN_IMPORT_TITLE</source>
+ <source>IMPORT_TITLE</source>
<translation>Import DXF</translation>
</message>
</context>
<source>STB_IMPORTDXF</source>
<translation>Importer DXF</translation>
</message>
+</context>
+<context>
+ <name>DXFPlugin_GUI</name>
<message>
- <source>DXFPLUGIN_DXF_FILES</source>
+ <source>DXF_FILES</source>
<translation>DXF Fichiers( *.dxf )</translation>
</message>
-</context>
-<context>
- <name>DXFPlugin_ExportDlg</name>
<message>
- <source>DXFPLUGIN_EXPORT_TITLE</source>
+ <source>EXPORT_TITLE</source>
<translation>Exporter DXF</translation>
</message>
-</context>
-<context>
- <name>DXFPlugin_ImportDlg</name>
<message>
- <source>DXFPLUGIN_IMPORT_TITLE</source>
+ <source>IMPORT_TITLE</source>
<translation>Importer DXF</translation>
</message>
</context>
<source>STB_IMPORTDXF</source>
<translation type="unfinished">Import DXF</translation>
</message>
+</context>
+<context>
+ <name>DXFPlugin_GUI</name>
<message>
- <source>DXFPLUGIN_DXF_FILES</source>
+ <source>DXF_FILES</source>
<translation type="unfinished">DXF files( *.dxf )</translation>
</message>
-</context>
-<context>
- <name>DXFPlugin_ExportDlg</name>
<message>
- <source>DXFPLUGIN_EXPORT_TITLE</source>
+ <source>EXPORT_TITLE</source>
<translation type="unfinished">Export DXF</translation>
</message>
-</context>
-<context>
- <name>DXFPlugin_ImportDlg</name>
<message>
- <source>DXFPLUGIN_IMPORT_TITLE</source>
+ <source>IMPORT_TITLE</source>
<translation type="unfinished">Import DXF</translation>
</message>
</context>