ENDIF(WIN32)
SET(SalomeIDLXTPlugin_IDLSOURCES
- XTPlugin_Gen.idl
+ XTPlugin.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 __XTPlugin_IDL__
+#define __XTPlugin_IDL__
+
+#include "GEOM_Gen.idl"
+
+module XTPlugin
+{
+ /*!
+ * \brief Interface for XTPlugin modeling functions.
+ */
+ interface IXTOperations : GEOM::GEOM_IOperations
+ {
+ /*!
+ * \brief Import a shape from the XT file.
+ *
+ * \param theFileName The file, containing the shape.
+ * \return List of GEOM_Objects, containing the created shape and propagation groups.
+ */
+ GEOM::ListOfGO ImportXT( in string theFileName );
+ };
+};
+
+#endif // __XTPlugin_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 __XTPlugin_GEN__
-#define __XTPlugin_GEN__
-
-#include "GEOM_Gen.idl"
-
-module XTPlugin {
-
- /*!
- * \brief Interface for XTPlugin modeling functions.
- */
- interface GEOM_IXTPluginOperations : GEOM::GEOM_IOperations
- {
- /*!
- * \brief Import a shape from the XT file.
- *
- * \param theFileName The file, containing the shape.
- * \return List of GEOM_Objects, containing the created shape and propagation groups.
- */
- GEOM::ListOfGO ImportXT( in string theFileName );
- };
-};
-
-#endif
${CAS_INCLUDE_DIRS}
${XT_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}
${XT_LIBRARIES}
${KERNEL_SALOMEBasics}
)
IF(SALOME_BUILD_GUI)
- SET(_link_LIBRARIES
- ${_link_LIBRARIES}
+ SET(_link_gui_LIBRARIES
+ SalomeIDLXTPlugin
+ ${GEOM_GEOMObject}
+ ${GEOM_GEOMBase}
${GEOM_GEOMBase}
)
ENDIF()
# --- headers ---
SET(XTPluginEngine_HEADERS
- XTPlugin_Operations_i.hh
+ XTPlugin_IOperations_i.hh
XTPlugin_Engine.hxx
- XTPlugin_OperationsCreator.hh
+ XTPlugin_OperationsCreator.hxx
XTPlugin_IOperations.hxx
XTPlugin_IImport.hxx
XTPlugin_ImportDriver.hxx
IF(SALOME_BUILD_GUI)
# header files / to be processed by moc
SET(_moc_HEADERS
- XTPlugin_ImportDlg.h
+ XTPlugin_GUI.h
)
ENDIF()
QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
SET(XTPluginGUI_SOURCES
- XTPluginGUI.cxx
- XTPlugin_ImportDlg.cxx
+ XTPlugin_GUI.cxx
${_moc_SOURCES}
)
ENDIF()
SET(XTPluginEngine_SOURCES
- XTPluginEngine.cxx
- XTPlugin_OperationsCreator.cc
- XTPlugin_Operations_i.cc
+ XTPlugin_Engine.cxx
+ XTPlugin_OperationsCreator.cxx
+ XTPlugin_IOperations_i.cc
XTPlugin_IOperations.cxx
XTPlugin_ImportDriver.cxx
XTPlugin_IECallBack.cxx
# install Engine library
ADD_LIBRARY(XTPluginEngine ${XTPluginEngine_SOURCES})
-TARGET_LINK_LIBRARIES(XTPluginEngine ${_link_LIBRARIES})
+TARGET_LINK_LIBRARIES(XTPluginEngine ${_link_engine_LIBRARIES})
INSTALL(TARGETS XTPluginEngine EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
# install GUI library
IF(SALOME_BUILD_GUI)
ADD_LIBRARY(XTPluginGUI ${XTPluginGUI_SOURCES})
- TARGET_LINK_LIBRARIES(XTPluginGUI ${_link_LIBRARIES})
+ TARGET_LINK_LIBRARIES(XTPluginGUI ${_link_gui_LIBRARIES})
INSTALL(TARGETS XTPluginGUI EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
# install resources
QT4_INSTALL_TS_RESOURCES("${XTPlugin_RESOURCES}" "${SALOME_XTPLUGIN_INSTALL_RES_DATA}")
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-from XTPlugin import GEOM_IXTPluginOperations
+from XTPlugin import IXTOperations
# Engine Library Name
__libraryName__ = "XTPluginEngine"
def GetXTPluginOperations(self):
anOp = self.GetPluginOperations(self.myStudyId, __libraryName__)
- return anOp._narrow(GEOM_IXTPluginOperations)
+ return anOp._narrow(IXTOperations)
## Import a shape from the XT file
# @param theFileName The file, containing the shape.
+++ /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 "XTPlugin_Engine.hxx"
-#include "XTPlugin_OperationsCreator.hh"
-
-extern "C"
-{
-XTPLUGINENGINE_EXPORT
- GEOM_GenericOperationsCreator* GetOperationsCreator()
- {
- XTPlugin_OperationsCreator* aCreator = new XTPlugin_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 "XTPluginGUI.h"
-#include "XTPlugin_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 : XTPluginGUI()
-// purpose : Constructor
-//=======================================================================
-XTPluginGUI::XTPluginGUI( GeometryGUI* parent ) : GEOMPluginGUI( parent )
-{
-}
-
-//=======================================================================
-// function : ~XTPluginGUI
-// purpose : Destructor
-//=======================================================================
-XTPluginGUI::~XTPluginGUI()
-{
-}
-
-//=======================================================================
-// function : OnGUIEvent()
-// purpose :
-//=======================================================================
-bool XTPluginGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
-{
- switch ( theCommandID ) {
- case 1:
- return OnGUIEvent("Import_XT", parent);
- default:
- return OnGUIEvent("", parent);
- }
- return false;
-}
-
-//=======================================================================
-// function : OnGUIEvent()
-// purpose :
-//=======================================================================
-bool XTPluginGUI::OnGUIEvent( const QString& theCommandID, SUIT_Desktop* parent )
-{
- SalomeApp_Application* app = getGeometryGUI()->getApp();
- if (!app) return false;
-
- getGeometryGUI()->EmitSignalDeactivateDialog();
-
- SUIT_FileDlg* dialog = NULL;
- if (theCommandID == "Import_XT") {
- dialog = new XTPlugin_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 XTPluginGUI( 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 XTPluginGUI_H
-#define XTPluginGUI_H
-
-#include <GEOMPluginGUI.h>
-
-class XTPluginGUI: public GEOMPluginGUI
-{
-public:
- XTPluginGUI( GeometryGUI* parent );
- ~XTPluginGUI();
-
- bool OnGUIEvent( int commandId, SUIT_Desktop* );
- bool OnGUIEvent( const QString&, SUIT_Desktop* );
-};
-
-#endif // XTPluginGUI_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 "XTPlugin_Engine.hxx"
+#include "XTPlugin_OperationsCreator.hxx"
+
+extern "C"
+{
+ XTPLUGINENGINE_EXPORT
+ GEOM_GenericOperationsCreator* GetOperationsCreator()
+ {
+ return new XTPlugin_OperationsCreator();
+ }
+}
#define _XTPLUGIN_ENGINE_HXX_
#ifdef WIN32
- #if defined XTPLUGINENGINE_EXPORTS || defined XTPLUGINENGINE_EXPORTS
+ #if defined XTPLUGINENGINE_EXPORTS || defined XTPluginEngine_EXPORTS
#define XTPLUGINENGINE_EXPORT __declspec( dllexport )
#else
#define XTPLUGINENGINE_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 "XTPlugin_GUI.h"
+#include "XTPlugin_IOperations_i.hh"
+
+// 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(XTPlugin)
+
+//=======================================================================
+// function : XTPlugin_GUI()
+// purpose : Constructor
+//=======================================================================
+XTPlugin_GUI::XTPlugin_GUI( GeometryGUI* parent ) : GEOMPluginGUI( parent )
+{
+}
+
+//=======================================================================
+// function : ~XTPlugin_GUI
+// purpose : Destructor
+//=======================================================================
+XTPlugin_GUI::~XTPlugin_GUI()
+{
+}
+
+//=======================================================================
+// function : OnGUIEvent()
+// purpose :
+//=======================================================================
+bool XTPlugin_GUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
+{
+ QString cmd;
+ switch ( theCommandID ) {
+ case 1:
+ cmd = "Import_XT";
+ default:
+ break;
+ }
+ return OnGUIEvent( cmd, parent );
+}
+
+//=======================================================================
+// function : OnGUIEvent()
+// purpose :
+//=======================================================================
+bool XTPlugin_GUI::OnGUIEvent( const QString& theCommandID, SUIT_Desktop* parent )
+{
+ bool result = false;
+
+ if ( theCommandID == "Import_XT" )
+ {
+ result = importXT( parent );
+ }
+ else
+ {
+ getGeometryGUI()->getApp()->putInfo( tr("GEOM_PRP_COMMAND").arg( theCommandID ) );
+ }
+
+ return result;
+
+}
+
+//=======================================================================
+// function : importXT
+// purpose :
+//=======================================================================
+bool XTPlugin_GUI::importXT( 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(), "XTPluginEngine" );
+ XTPlugin::IXTOperations_var xtOp = XTPlugin::IXTOperations::_narrow( op );
+ if ( CORBA::is_nil( xtOp ) ) return false;
+
+ QStringList fileNames = app->getOpenFileNames( SUIT_FileDlg::getLastVisitedPath().isEmpty() ? QDir::currentPath() : QString(""),
+ tr( "XT_FILES" ),
+ tr( "IMPORT_TITLE" ),
+ parent );
+ if ( fileNames.count() > 0 )
+ {
+ QStringList entryList;
+ QStringList errors;
+
+ foreach( QString fileName, fileNames )
+ {
+ SUIT_OverrideCursor wc;
+ GEOM_Operation transaction( app, xtOp.in() );
+
+ try
+ {
+ app->putInfo( tr( "GEOM_PRP_LOADING" ).arg( fileName ) );
+ transaction.start();
+ GEOM::ListOfGO_var result = xtOp->ImportXT( fileName.toUtf8().constData() );
+ if ( result->length() > 0 && xtOp->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( xtOp->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;
+}
+
+//=====================================================================================
+// EXPORTED METHODS
+//=====================================================================================
+extern "C"
+{
+#ifdef WIN32
+ __declspec( dllexport )
+#endif
+ GEOMGUI* GetLibGUI( GeometryGUI* parent )
+ {
+ return new XTPlugin_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 XTPlugin_GUI_H
+#define XTPlugin_GUI_H
+
+#include <GEOMPluginGUI.h>
+
+class XTPlugin_GUI: public GEOMPluginGUI
+{
+ Q_OBJECT
+public:
+ XTPlugin_GUI( GeometryGUI* parent );
+ ~XTPlugin_GUI();
+
+ bool OnGUIEvent( int commandId, SUIT_Desktop* );
+ bool OnGUIEvent( const QString&, SUIT_Desktop* );
+
+private:
+ bool importXT( SUIT_Desktop* );
+};
+
+#endif // XTPlugin_GUI_H
// internal includes
#include "XTPlugin_IECallBack.hxx"
+#include "XTPlugin_IOperations.hxx"
+#include "XTPlugin_OperationsCreator.hxx"
//=============================================================================
/*!
* constructor
*/
//=============================================================================
-XTPlugin_IECallBack::XTPlugin_IECallBack( XTPlugin_IOperations* theOperations )
-: GEOMImpl_IECallBack()
+XTPlugin_IECallBack::XTPlugin_IECallBack()
{
- myPluginOperations = theOperations;
}
//=============================================================================
*/
//=============================================================================
Handle(TColStd_HSequenceOfTransient)
-XTPlugin_IECallBack::Import( const TCollection_AsciiString& theFormatName,
- const TCollection_AsciiString& theFileName )
+XTPlugin_IECallBack::Import( int theDocId,
+ const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theFileName )
{
- return myPluginOperations->ImportXT( theFileName );
+ XTPlugin_IOperations* aPluginOperations = XTPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ return aPluginOperations->ImportXT( theFileName );
}
// OCC includes
#include <TCollection_AsciiString.hxx>
-class XTPlugin_IECallBack : public GEOMImpl_IECallBack
+class XTPLUGINENGINE_EXPORT XTPlugin_IECallBack : public GEOMImpl_IECallBack
{
public:
- Standard_EXPORT XTPlugin_IECallBack( XTPlugin_IOperations* theOperations );
- Standard_EXPORT ~XTPlugin_IECallBack();
+ XTPlugin_IECallBack();
+ ~XTPlugin_IECallBack();
- Standard_EXPORT virtual
- Handle(TColStd_HSequenceOfTransient) Import( const TCollection_AsciiString& theFormatName,
- const TCollection_AsciiString& theFileName );
-
-private:
- XTPlugin_IOperations* myPluginOperations;
+ Handle(TColStd_HSequenceOfTransient) Import( int theDocId,
+ const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theFileName );
};
#endif
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 _XTPlugin_IOperations_HXX_
#define _XTPlugin_IOperations_HXX_
+// internal includes
+#include "XTPlugin_Engine.hxx"
+
// GEOM includes
#include <GEOMImpl_IBaseIEOperations.hxx>
-class XTPlugin_IOperations: public GEOMImpl_IBaseIEOperations
+class XTPLUGINENGINE_EXPORT XTPlugin_IOperations: public GEOMImpl_IBaseIEOperations
{
public:
- Standard_EXPORT XTPlugin_IOperations( GEOM_Engine*, int );
- Standard_EXPORT ~XTPlugin_IOperations();
+ XTPlugin_IOperations( GEOM_Engine*, int );
+ ~XTPlugin_IOperations();
- Standard_EXPORT Handle(TColStd_HSequenceOfTransient) ImportXT( const TCollection_AsciiString& );
+ Handle(TColStd_HSequenceOfTransient) ImportXT( 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 "XTPlugin_IOperations_i.hh"
+#include "XTPlugin_IOperations.hxx"
+#include <XTPLUGIN_version.h>
+
+// KERNEL includes
+#include <utilities.h>
+
+//=============================================================================
+/*!
+ * constructor:
+ */
+//=============================================================================
+XTPlugin_IOperations_i::XTPlugin_IOperations_i( PortableServer::POA_ptr thePOA,
+ GEOM::GEOM_Gen_ptr theEngine,
+ ::XTPlugin_IOperations* theImpl )
+:GEOM_IOperations_i( thePOA, theEngine, theImpl )
+{
+ MESSAGE( "XTPlugin_Operations_i::XTPlugin_Operations_i" );
+}
+
+//=============================================================================
+/*!
+ * destructor
+ */
+//=============================================================================
+XTPlugin_IOperations_i::~XTPlugin_IOperations_i()
+{
+ MESSAGE( "XTPlugin_Operations_i::~XTPlugin_Operations_i" );
+}
+
+//=============================================================================
+/*!
+ * ImportXT
+ * Import a shape from XT format
+ * \param theFileName The name of the file to import
+ * \return List of GEOM_Objects, containing the created shape and propagation groups.
+ */
+//=============================================================================
+GEOM::ListOfGO* XTPlugin_IOperations_i::ImportXT( 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()->ImportXT( 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();
+}
+
+XTPlugin_IOperations* XTPlugin_IOperations_i::GetOperations()
+{
+ return (XTPlugin_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 _XTPlugin_IOperations_i_HeaderFile
+#define _XTPlugin_IOperations_i_HeaderFile
+
+// idl includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER( GEOM_Gen )
+#include CORBA_SERVER_HEADER( XTPlugin )
+
+// internal includes
+#include "XTPlugin_Engine.hxx"
+
+// GEOM includes
+#include <GEOM_IOperations_i.hh>
+
+class XTPlugin_IOperations;
+
+class XTPLUGINENGINE_EXPORT XTPlugin_IOperations_i :
+ public virtual POA_XTPlugin::IXTOperations,
+ public virtual GEOM_IOperations_i
+{
+public:
+ XTPlugin_IOperations_i( PortableServer::POA_ptr thePOA,
+ GEOM::GEOM_Gen_ptr theEngine,
+ XTPlugin_IOperations* theImpl );
+ ~XTPlugin_IOperations_i();
+
+ GEOM::ListOfGO* ImportXT( const char* );
+
+ XTPlugin_IOperations* GetOperations();
+};
+
+#endif // _XTPlugin_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 "XTPlugin_ImportDlg.h"
-#include "XTPlugin_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
-//=================================================================================
-XTPlugin_ImportDlg::XTPlugin_ImportDlg( QWidget* parent )
-: SUIT_FileDlg( parent, true, true, true ),
- GEOMBase_Helper( dynamic_cast<SUIT_Desktop*>( parent ) )
-{
- setWindowTitle( tr( "XTPLUGIN_IMPORT_TITLE" ) );
- setAcceptMode( AcceptOpen );
- setNameFilter( tr( "XTPLUGIN_XT_FILES" ) );
- setFileMode( QFileDialog::ExistingFiles );
-}
-
-//=================================================================================
-// Destructor
-//=================================================================================
-XTPlugin_ImportDlg::~XTPlugin_ImportDlg()
-{
- // no need to delete child widgets, Qt does it all for us
-}
-
-//=================================================================================
-// function : createOperation
-// purpose :
-//=================================================================================
-GEOM::GEOM_IOperations_ptr XTPlugin_ImportDlg::createOperation()
-{
- return getGeomEngine()->GetPluginOperations(getStudyId(), "XTPluginEngine");
-}
-
-//=================================================================================
-// function : isValid
-// purpose :
-//=================================================================================
-bool XTPlugin_ImportDlg::isValid (QString& msg)
-{
- bool ok = true;
- //@@ add custom validation actions here @@//
- return ok;
-}
-
-//=================================================================================
-// function : execute
-// purpose :
-//=================================================================================
-bool XTPlugin_ImportDlg::execute( ObjectList& objects )
-{
- bool res = false;
- GEOM::GEOM_Object_var anObj;
- XTPlugin::GEOM_IXTPluginOperations_var anOper = XTPlugin::GEOM_IXTPluginOperations::_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->ImportXT( 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 XTPlugin_ImportDlg::accept()
-{
- SUIT_FileDlg::accept();
- onAccept();
-}
-
-//=================================================================================
-// function : getObjectName
-// purpose :
-//=================================================================================
-QString XTPlugin_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 XTPlugin_IMPORTDLG_H
-#define XTPlugin_IMPORTDLG_H
-
-// GUI includes
-#include <SUIT_FileDlg.h>
-
-// GEOM includes
-#include <GEOMBase_Helper.h>
-#include <GEOM_GenericObjPtr.h>
-
-class XTPlugin_ImportDlg: public SUIT_FileDlg, public GEOMBase_Helper
-{
- Q_OBJECT
-
-public:
- XTPlugin_ImportDlg( QWidget* = 0 );
- ~XTPlugin_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 // XTPlugin_IMPORTDLG_H
class XTPlugin_ImportDriver : public GEOM_BaseDriver
{
public:
- Standard_EXPORT XTPlugin_ImportDriver();
- Standard_EXPORT ~XTPlugin_ImportDriver() {};
+ XTPlugin_ImportDriver();
+ ~XTPlugin_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( XTPlugin_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 "XTPlugin_OperationsCreator.hh"
-#include "XTPlugin_Operations_i.hh"
-#include "XTPlugin_ImportDriver.hxx"
-#include "XTPlugin_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* XTPlugin_OperationsCreator::Create( PortableServer::POA_ptr thePOA,
- int theStudyId,
- GEOM::GEOM_Gen_ptr theEngine,
- ::GEOMImpl_Gen* theGenImpl )
-{
- Unexpect aCatch( SALOME_SalomeException );
- MESSAGE( "XTPlugin_OperationsCreator::Create" );
-
- if (_mapOfOperations.find( theStudyId ) == _mapOfOperations.end() ) {
- XTPlugin_IOperations* anOper = new XTPlugin_IOperations( theGenImpl, theStudyId );
- _mapOfOperations[theStudyId] = anOper;
-
- // Import XT
- TFunction_DriverTable::Get()->AddDriver( XTPlugin_ImportDriver::GetID(),
- new XTPlugin_ImportDriver() );
-
- XTPlugin_IECallBack* XTCallBack = new XTPlugin_IECallBack( anOper );
- GEOMImpl_IECallBack::Register( "XT", XTCallBack );
- }
-
- XTPlugin_Operations_i* aServant =
- new XTPlugin_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 "XTPlugin_OperationsCreator.hxx"
+#include "XTPlugin_IOperations_i.hh"
+#include "XTPlugin_ImportDriver.hxx"
+#include "XTPlugin_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, XTPlugin_IOperations*> XTPlugin_OperationsCreator::_mapOfOperations;
+
+XTPlugin_OperationsCreator::XTPlugin_OperationsCreator()
+{
+ // Register drivers
+ TFunction_DriverTable::Get()->AddDriver( XTPlugin_ImportDriver::GetID(),
+ new XTPlugin_ImportDriver() );
+ // Register callback
+ XTPlugin_IECallBack* callback = new XTPlugin_IECallBack();
+ GEOMImpl_IECallBack::Register( "XT", callback );
+}
+
+XTPlugin_OperationsCreator::~XTPlugin_OperationsCreator()
+{
+}
+
+GEOM_IOperations_i* XTPlugin_OperationsCreator::Create( PortableServer::POA_ptr thePOA,
+ int theStudyId,
+ GEOM::GEOM_Gen_ptr theEngine,
+ ::GEOMImpl_Gen* theGenImpl )
+{
+ Unexpect aCatch( SALOME_SalomeException );
+ MESSAGE( "XTPlugin_OperationsCreator::Create" );
+ return new XTPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl, theStudyId ) );
+}
+
+XTPlugin_IOperations* XTPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl,
+ int theStudyId )
+{
+ if (_mapOfOperations.find( theStudyId ) == _mapOfOperations.end() )
+ _mapOfOperations[theStudyId] = new XTPlugin_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_XTPlugin_OperationsCreator_HXX_
-#define _GEOM_XTPlugin_OperationsCreator_HXX_
-
-// internal includes
-#include "XTPlugin_Engine.hxx"
-#include "XTPlugin_IOperations.hxx"
-
-// GEOM includes
-#include "GEOM_Gen_i.hh"
-
-// C++ includes
-#include <map>
-
-//=====================================================================
-// Operations creator
-//=====================================================================
-class XTPLUGINENGINE_EXPORT XTPlugin_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, XTPlugin_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_XTPlugin_OperationsCreator_HXX_
+#define _GEOM_XTPlugin_OperationsCreator_HXX_
+
+// internal includes
+#include "XTPlugin_Engine.hxx"
+
+// GEOM includes
+#include "GEOM_Gen_i.hh"
+
+// C++ includes
+#include <map>
+
+class XTPlugin_IOperations;
+
+//=====================================================================
+// Operations creator
+//=====================================================================
+class XTPLUGINENGINE_EXPORT XTPlugin_OperationsCreator : public GEOM_GenericOperationsCreator
+{
+public:
+ XTPlugin_OperationsCreator();
+ ~XTPlugin_OperationsCreator();
+
+ GEOM_IOperations_i* Create( PortableServer::POA_ptr thePOA,
+ int theStudyId,
+ GEOM::GEOM_Gen_ptr theEngine,
+ ::GEOMImpl_Gen* theGenImpl );
+
+private:
+ static XTPlugin_IOperations* get( ::GEOMImpl_Gen* theGenImpl,
+ int theStudyId );
+
+ static std::map <int, XTPlugin_IOperations*> _mapOfOperations;
+
+ friend class XTPlugin_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 "XTPlugin_Operations_i.hh"
-#include <XTPLUGIN_version.h>
-
-// KERNEL includes
-#include <utilities.h>
-
-//=============================================================================
-/*!
- * constructor:
- */
-//=============================================================================
-XTPlugin_Operations_i::XTPlugin_Operations_i( PortableServer::POA_ptr thePOA,
- GEOM::GEOM_Gen_ptr theEngine,
- ::XTPlugin_IOperations* theImpl )
-:GEOM_IOperations_i( thePOA, theEngine, theImpl )
-{
- MESSAGE( "XTPlugin_Operations_i::XTPlugin_Operations_i" );
-}
-
-//=============================================================================
-/*!
- * destructor
- */
-//=============================================================================
-XTPlugin_Operations_i::~XTPlugin_Operations_i()
-{
- MESSAGE( "XTPlugin_Operations_i::~XTPlugin_Operations_i" );
-}
-
-//=============================================================================
-/*!
- * ImportXT
- * Import a shape from XT format
- * \param theFileName The name of the file to import
- * \return List of GEOM_Objects, containing the created shape and propagation groups.
- */
-//=============================================================================
-GEOM::ListOfGO* XTPlugin_Operations_i::ImportXT( 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()->ImportXT( 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 XTPlugin_Operations_i::GetVersion()
-{
- return XTPLUGIN_VERSION;
-}
-//=============================================================================
-/*!
- * \brief Get version of the plugin.
- * \return the string representation of the plugin's version
-*/
-//=============================================================================
-
-char* XTPlugin_Operations_i::GetVersionStr()
-{
- return (char*)XTPLUGIN_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 _XTPlugin_Operations_i_HeaderFile
-#define _XTPlugin_Operations_i_HeaderFile
-
-// idl includes
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER( GEOM_Gen )
-#include CORBA_SERVER_HEADER( XTPlugin_Gen )
-
-// internal includes
-#include "XTPlugin_Engine.hxx"
-#include "XTPlugin_IOperations.hxx"
-
-// GEOM includes
-#include <GEOM_IOperations_i.hh>
-
-class XTPLUGINENGINE_EXPORT XTPlugin_Operations_i :
- public virtual POA_XTPlugin::GEOM_IXTPluginOperations,
- public virtual GEOM_IOperations_i
-{
-public:
- XTPlugin_Operations_i( PortableServer::POA_ptr thePOA,
- GEOM::GEOM_Gen_ptr theEngine,
- ::XTPlugin_IOperations* theImpl );
- ~XTPlugin_Operations_i();
-
- GEOM::ListOfGO* ImportXT( const char* );
-
- // Version information
- virtual int GetVersion();
- virtual char* GetVersionStr();
-
- ::XTPlugin_IOperations* GetOperations()
- { return (::XTPlugin_IOperations*)GetImpl(); }
-};
-
-#endif
<source>STB_IMPORTXT</source>
<translation>Import XT</translation>
</message>
+</context>
+<context>
+ <name>XTPlugin_GUI</name>
<message>
- <source>XTPLUGIN_XT_FILES</source>
+ <source>XT_FILES</source>
<translation>Parasolid Files ( *.x_t *.xt )</translation>
</message>
-</context>
-<context>
- <name>XTPlugin_ImportDlg</name>
<message>
- <source>XTPLUGIN_IMPORT_TITLE</source>
+ <source>IMPORT_TITLE</source>
<translation>Import XT</translation>
</message>
</context>
<source>STB_IMPORTXT</source>
<translation>Importer XT</translation>
</message>
+</context>
+<context>
+ <name>XTPlugin_GUI</name>
<message>
- <source>XTPLUGIN_XT_FILES</source>
+ <source>XT_FILES</source>
<translation>Parasolid Fichiers ( *.x_t *.xt )</translation>
</message>
-</context>
-<context>
- <name>XTPlugin_ImportDlg</name>
<message>
- <source>XTPLUGIN_IMPORT_TITLE</source>
+ <source>IMPORT_TITLE</source>
<translation>Importer XT</translation>
</message>
</context>
<source>STB_IMPORTXT</source>
<translation type="unfinished">Import XT</translation>
</message>
+</context>
+<context>
+ <name>XTPlugin_GUI</name>
<message>
- <source>XTPLUGIN_XT_FILES</source>
+ <source>XT_FILES</source>
<translation type="unfinished">Parasolid Files ( *.x_t *.xt )</translation>
</message>
-</context>
-<context>
- <name>XTPlugin_ImportDlg</name>
<message>
- <source>XTPLUGIN_IMPORT_TITLE</source>
+ <source>IMPORT_TITLE</source>
<translation type="unfinished">Import XT</translation>
</message>
</context>