--- /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 __ACISPlugin_IDL__
+#define __ACISPlugin_IDL__
+
+#include "GEOM_Gen.idl"
+
+module ACISPlugin
+{
+ /*!
+ * \brief Interface for ACISPlugin modeling functions.
+ */
+ interface IACISOperations : GEOM::GEOM_IOperations
+ {
+ /*!
+ * \brief Export the given shape into a file with given name in ACIS format.
+ *
+ * \param theObject Shape to be stored in the file.
+ * \param theFileName Name of the file to store the given shape in.
+ */
+ void ExportACIS( in GEOM::GEOM_Object theObject,
+ in string theFileName );
+
+ /*!
+ * \brief Import a shape from the ACIS file.
+ *
+ * \param theFileName The file, containing the shape.
+ * \return List of GEOM_Objects, containing the created shape and propagation groups.
+ */
+ GEOM::ListOfGO ImportACIS( in string theFileName );
+ };
+};
+
+#endif // __ACISPlugin_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 __ACISPlugin_GEN__
-#define __ACISPlugin_GEN__
-
-#include "GEOM_Gen.idl"
-
-module ACISPlugin {
-
- /*!
- * \brief Interface for ACISPlugin modeling functions.
- */
- interface GEOM_IACISPluginOperations : GEOM::GEOM_IOperations
- {
- /*!
- * \brief Export the given shape into a file with given name in ACIS format.
- *
- * \param theObject Shape to be stored in the file.
- * \param theFileName Name of the file to store the given shape in.
- */
- void ExportACIS( in GEOM::GEOM_Object theObject,
- in string theFileName );
-
- /*!
- * \brief Import a shape from the ACIS file.
- *
- * \param theFileName The file, containing the shape.
- * \return List of GEOM_Objects, containing the created shape and propagation groups.
- */
- GEOM::ListOfGO ImportACIS( in string theFileName );
- };
-};
-
-#endif
ENDIF(WIN32)
SET(SalomeIDLACISPlugin_IDLSOURCES
- ACISPlugin_Gen.idl
+ ACISPlugin.idl
)
SET(IDL_INCLUDE_DIRS
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-from ACISPlugin import GEOM_IACISPluginOperations
+from ACISPlugin import IACISOperations
# Engine Library Name
__libraryName__ = "ACISPluginEngine"
def GetACISPluginOperations(self):
anOp = self.GetPluginOperations(self.myStudyId, __libraryName__)
- return anOp._narrow(GEOM_IACISPluginOperations)
+ return anOp._narrow(IACISOperations)
## Export the given shape into a file with given name in ACIS 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 "ACISPlugin_Engine.hxx"
-#include "ACISPlugin_OperationsCreator.hh"
-
-extern "C"
-{
-ACISPLUGINENGINE_EXPORT
- GEOM_GenericOperationsCreator* GetOperationsCreator()
- {
- ACISPlugin_OperationsCreator* aCreator = new ACISPlugin_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 "ACISPluginGUI.h"
-#include "ACISPlugin_ExportDlg.h"
-#include "ACISPlugin_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 : ACISPluginGUI()
-// purpose : Constructor
-//=======================================================================
-ACISPluginGUI::ACISPluginGUI( GeometryGUI* parent ) : GEOMPluginGUI( parent )
-{
-}
-
-//=======================================================================
-// function : ~ACISPluginGUI
-// purpose : Destructor
-//=======================================================================
-ACISPluginGUI::~ACISPluginGUI()
-{
-}
-
-//=======================================================================
-// function : OnGUIEvent()
-// purpose :
-//=======================================================================
-bool ACISPluginGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
-{
- switch ( theCommandID ) {
- case 1:
- return OnGUIEvent("Export_ACIS", parent);
- case 2:
- return OnGUIEvent("Import_ACIS", parent);
- default:
- return OnGUIEvent("", parent);
- }
- return false;
-}
-
-//=======================================================================
-// function : OnGUIEvent()
-// purpose :
-//=======================================================================
-bool ACISPluginGUI::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_ACIS" ) {
- // 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 ACISPlugin_ExportDlg( IObject, parent );
- if( dialog->exec() == QDialog::Accepted )
- delete dialog;
- }
- }
- }
- else if (theCommandID == "Import_ACIS") {
- dialog = new ACISPlugin_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 ACISPluginGUI( 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 ACISPluginGUI_H
-#define ACISPluginGUI_H
-
-#include <GEOMPluginGUI.h>
-
-class ACISPluginGUI: public GEOMPluginGUI
-{
-public:
- ACISPluginGUI( GeometryGUI* parent );
- ~ACISPluginGUI();
-
- bool OnGUIEvent( int commandId, SUIT_Desktop* );
- bool OnGUIEvent( const QString&, SUIT_Desktop* );
-};
-
-#endif // ACISPluginGUI_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 "ACISPlugin_Engine.hxx"
+#include "ACISPlugin_OperationsCreator.hxx"
+
+extern "C"
+{
+ ACISPLUGINENGINE_EXPORT
+ GEOM_GenericOperationsCreator* GetOperationsCreator()
+ {
+ return new ACISPlugin_OperationsCreator();
+ }
+}
#define _ACISPLUGIN_ENGINE_HXX_
#ifdef WIN32
- #if defined ACISPLUGINENGINE_EXPORTS || defined ACISPLUGINENGINE_EXPORTS
+ #if defined ACISPLUGINENGINE_EXPORTS || defined ACISPluginEngine_EXPORTS
#define ACISPLUGINENGINE_EXPORT __declspec( dllexport )
#else
#define ACISPLUGINENGINE_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 "ACISPlugin_ExportDlg.h"
-#include "ACISPlugin_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
-//=================================================================================
-ACISPlugin_ExportDlg::ACISPlugin_ExportDlg( Handle(SALOME_InteractiveObject)& object, QWidget* parent )
-: SUIT_FileDlg( parent, false, true, true ),
- GEOMBase_Helper( dynamic_cast<SUIT_Desktop*>( parent ) )
-{
- setWindowTitle( tr( "ACISPLUGIN_EXPORT_TITLE" ) );
- setNameFilter( tr( "ACISPLUGIN_ACIS_FILES" ) );
-
- myObject = object;
- const char* objectName = myObject->getName();
- selectFile( QString( objectName ) );
-}
-
-//=================================================================================
-// Destructor
-//=================================================================================
-ACISPlugin_ExportDlg::~ACISPlugin_ExportDlg()
-{
- // no need to delete child widgets, Qt does it all for us
-}
-
-//=================================================================================
-// function : createOperation
-// purpose :
-//=================================================================================
-GEOM::GEOM_IOperations_ptr ACISPlugin_ExportDlg::createOperation()
-{
- return getGeomEngine()->GetPluginOperations( getStudyId(), "ACISPluginEngine" );
-}
-
-//=================================================================================
-// function : isValid
-// purpose :
-//=================================================================================
-bool ACISPlugin_ExportDlg::isValid( QString& msg )
-{
- bool ok = true;
- //@@ add custom validation actions here @@//
- return ok;
-}
-
-//=================================================================================
-// function : execute
-// purpose :
-//=================================================================================
-bool ACISPlugin_ExportDlg::execute( ObjectList& objects )
-{
- SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
- if (!app) return false;
-
- ACISPlugin::GEOM_IACISPluginOperations_var aACISOp = ACISPlugin::GEOM_IACISPluginOperations::_narrow( getOperation() );
- if ( aACISOp->_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, aACISOp.in() );
- try {
- SUIT_OverrideCursor wc;
- app->putInfo( tr("GEOM_PRP_EXPORT").arg(SUIT_Tools::file( aFile, /*withExten=*/true )) );
- anOp->start();
- aACISOp->ExportACIS( anObj, aFile.toUtf8().constData() );
- if( aACISOp->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( aACISOp->GetErrorCode() ) );
- return false;
- }
- }
- catch( const SALOME::SALOME_Exception& S_ex ) {
- anOp->abort();
- return false;
- }
-
- objects.push_back( anObj._retn() );
- return true;
-}
-
-void ACISPlugin_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 ACISPlugin_ExportDlg_H
-#define ACISPlugin_ExportDlg_H
-
-// GUI includes
-#include <SUIT_FileDlg.h>
-
-// GEOM includes
-#include <GEOM_GenericObjPtr.h>
-#include <GEOMBase_Helper.h>
-
-
-class ACISPlugin_ExportDlg: public SUIT_FileDlg, public GEOMBase_Helper
-{
- Q_OBJECT
-
-public:
- ACISPlugin_ExportDlg( Handle(SALOME_InteractiveObject)&, QWidget* = 0 );
- ~ACISPlugin_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 // ACISPlugin_ExportDlg_H
// internal includes
#include "ACISPlugin_ExportDriver.hxx"
#include "ACISPlugin_IExport.hxx"
-#include "ACISPlugin_Engine.hxx"
// KERNEL includes
#include <Basics_Utils.hxx>
#include <GEOM_BaseDriver.hxx>
// OCCT includes
-#ifndef _TFunction_Logbook_HeaderFile
#include <TFunction_Logbook.hxx>
-#endif
DEFINE_STANDARD_HANDLE( ACISPlugin_ExportDriver, GEOM_BaseDriver );
class ACISPlugin_ExportDriver : public GEOM_BaseDriver
{
public:
- Standard_EXPORT ACISPlugin_ExportDriver();
- Standard_EXPORT ~ACISPlugin_ExportDriver() {};
+ ACISPlugin_ExportDriver();
+ ~ACISPlugin_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& heOperationName,
+ std::vector<GEOM_Param>& params );
DEFINE_STANDARD_RTTI( ACISPlugin_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 "ACISPlugin_GUI.h"
+#include "ACISPlugin_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(ACISPlugin)
+
+//=======================================================================
+// function : ACISPlugin_GUI()
+// purpose : Constructor
+//=======================================================================
+ACISPlugin_GUI::ACISPlugin_GUI( GeometryGUI* parent ) : GEOMPluginGUI( parent )
+{
+}
+
+//=======================================================================
+// function : ~ACISPlugin_GUI
+// purpose : Destructor
+//=======================================================================
+ACISPlugin_GUI::~ACISPlugin_GUI()
+{
+}
+
+//=======================================================================
+// function : OnGUIEvent()
+// purpose :
+//=======================================================================
+bool ACISPlugin_GUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
+{
+ QString cmd;
+ switch ( theCommandID ) {
+ case 1:
+ cmd = "Export_ACIS";
+ case 2:
+ cmd = "Import_ACIS";
+ default:
+ break;
+ }
+ return OnGUIEvent( cmd, parent );
+}
+
+//=======================================================================
+// function : OnGUIEvent()
+// purpose :
+//=======================================================================
+bool ACISPlugin_GUI::OnGUIEvent( const QString& theCommandID, SUIT_Desktop* parent )
+{
+ bool result = false;
+
+ if ( theCommandID == "Export_ACIS" )
+ {
+ result = exportACIS( parent );
+ }
+ else if ( theCommandID == "Import_ACIS" )
+ {
+ result = importACIS( parent );
+ }
+ else
+ {
+ getGeometryGUI()->getApp()->putInfo( tr("GEOM_PRP_COMMAND").arg( theCommandID ) );
+ }
+ return result;
+}
+
+//=======================================================================
+// function : importACIS
+// purpose :
+//=======================================================================
+bool ACISPlugin_GUI::importACIS( 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(), "ACISPluginEngine" );
+ ACISPlugin::IACISOperations_var acisOp = ACISPlugin::IACISOperations::_narrow( op );
+ if ( CORBA::is_nil( acisOp ) ) return false;
+
+ QStringList fileNames = app->getOpenFileNames( SUIT_FileDlg::getLastVisitedPath().isEmpty() ? QDir::currentPath() : QString(""),
+ tr( "ACIS_FILES" ),
+ tr( "IMPORT_TITLE" ),
+ parent );
+ if ( fileNames.count() > 0 )
+ {
+ QStringList entryList;
+ QStringList errors;
+
+ SUIT_MessageBox::StandardButton acisAnswer = SUIT_MessageBox::NoButton;
+
+ foreach( QString fileName, fileNames )
+ {
+ SUIT_OverrideCursor wc;
+ GEOM_Operation transaction( app, acisOp.in() );
+
+ try
+ {
+ app->putInfo( tr( "GEOM_PRP_LOADING" ).arg( fileName ) );
+ transaction.start();
+
+ if ( acisAnswer != SUIT_MessageBox::YesToAll && acisAnswer != SUIT_MessageBox::NoToAll ) {
+ SUIT_MessageBox::StandardButtons btns = SUIT_MessageBox::Yes | SUIT_MessageBox::No;
+ btns = btns | SUIT_MessageBox::YesToAll | SUIT_MessageBox::NoToAll;
+ acisAnswer = SUIT_MessageBox::question( app->desktop(),
+ "Question",
+ tr("GEOM_PUBLISH_NAMED_SHAPES"),
+ btns | SUIT_MessageBox::Cancel,
+ SUIT_MessageBox::No );
+ if ( acisAnswer == SUIT_MessageBox::Cancel ) {
+ acisOp->SetErrorCode(OK);
+ return true; // cancel (break) import operation
+ }
+ }
+ GEOM::ListOfGO_var result = acisOp->ImportACIS( fileName.toUtf8().constData() );
+
+ if ( result->length() > 0 && acisOp->IsDone() ) {
+ GEOM::GEOM_Object_var main = result[0];
+ QString publishName = GEOMBase::GetDefaultName( SUIT_Tools::file( fileName, true ) );
+ main.in()->SetName( publishName.toStdString().c_str() );
+ SALOMEDS::SObject_var so = GeometryGUI::GetGeomGen()->PublishInStudy( dsStudy,
+ SALOMEDS::SObject::_nil(),
+ main.in(),
+ publishName.toUtf8().constData() );
+ if ( acisAnswer == SUIT_MessageBox::Yes || acisAnswer == SUIT_MessageBox::YesToAll )
+ GeometryGUI::GetGeomGen()->PublishNamedShapesInStudy( dsStudy, main.in() );
+
+ entryList.append( so->GetID() );
+ transaction.commit();
+ }
+ else
+ {
+ transaction.abort();
+ errors.append( QString( "%1 : %2" ).arg( fileName ).arg( acisOp->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 : exportACIS
+// purpose :
+//=======================================================================
+bool ACISPlugin_GUI::exportACIS( 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(), "ACISPluginEngine" );
+ ACISPlugin::IACISOperations_var acisOp = ACISPlugin::IACISOperations::_narrow( op );
+ if ( CORBA::is_nil( acisOp ) ) 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( "ACIS_FILES" ),
+ tr( "EXPORT_TITLE" ),
+ parent );
+
+ if ( fileName.isEmpty() )
+ return false;
+
+ SUIT_OverrideCursor wc;
+
+ GEOM_Operation transaction( app, acisOp.in() );
+
+ try
+ {
+ app->putInfo( tr( "GEOM_PRP_EXPORT" ).arg( fileName ) );
+ transaction.start();
+
+ acisOp->ExportACIS( obj, fileName.toUtf8().constData() );
+
+ if ( acisOp->IsDone() )
+ {
+ transaction.commit();
+ }
+ else
+ {
+ transaction.abort();
+ SUIT_MessageBox::critical( parent,
+ tr( "GEOM_ERROR" ),
+ tr( "GEOM_PRP_ABORT" ) + "\n" + tr( acisOp->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 ACISPlugin_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 ACISPlugin_GUI_H
+#define ACISPlugin_GUI_H
+
+#include <GEOMPluginGUI.h>
+
+class ACISPlugin_GUI: public GEOMPluginGUI
+{
+ Q_OBJECT
+public:
+ ACISPlugin_GUI( GeometryGUI* parent );
+ ~ACISPlugin_GUI();
+
+ bool OnGUIEvent( int commandId, SUIT_Desktop* );
+ bool OnGUIEvent( const QString&, SUIT_Desktop* );
+
+private:
+ bool importACIS( SUIT_Desktop* );
+ bool exportACIS( SUIT_Desktop* );
+};
+
+#endif // ACISPlugin_GUI_H
// internal includes
#include "ACISPlugin_IECallBack.hxx"
+#include "ACISPlugin_IOperations.hxx"
+#include "ACISPlugin_OperationsCreator.hxx"
//=============================================================================
/*!
* constructor
*/
//=============================================================================
-ACISPlugin_IECallBack::ACISPlugin_IECallBack( ACISPlugin_IOperations* theOperations )
-: GEOMImpl_IECallBack()
+ACISPlugin_IECallBack::ACISPlugin_IECallBack()
{
- myPluginOperations = theOperations;
}
//=============================================================================
* Export
*/
//=============================================================================
-bool ACISPlugin_IECallBack::Export( const Handle(GEOM_Object) theOriginal,
- const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theFormatName )
+bool ACISPlugin_IECallBack::Export( int theDocId,
+ const Handle(GEOM_Object) theOriginal,
+ const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName )
{
- myPluginOperations->ExportACIS( theOriginal, theFileName );
+ ACISPlugin_IOperations* aPluginOperations = ACISPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ aPluginOperations->ExportACIS( theOriginal, theFileName );
return true;
}
*/
//=============================================================================
Handle(TColStd_HSequenceOfTransient)
-ACISPlugin_IECallBack::Import( const TCollection_AsciiString& theFormatName,
- const TCollection_AsciiString& theFileName )
+ACISPlugin_IECallBack::Import( int theDocId,
+ const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theFileName )
{
- return myPluginOperations->ImportACIS( theFileName );
+ ACISPlugin_IOperations* aPluginOperations = ACISPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ return aPluginOperations->ImportACIS( theFileName );
}
// OCC includes
#include <TCollection_AsciiString.hxx>
-class ACISPlugin_IECallBack : public GEOMImpl_IECallBack
+class ACISPLUGINENGINE_EXPORT ACISPlugin_IECallBack : public GEOMImpl_IECallBack
{
public:
- Standard_EXPORT ACISPlugin_IECallBack( ACISPlugin_IOperations* theOperations );
- Standard_EXPORT ~ACISPlugin_IECallBack();
+ ACISPlugin_IECallBack();
+ ~ACISPlugin_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:
- ACISPlugin_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 ACIS 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 ACISPlugin_IOperations::ExportACIS( 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 _ACISPlugin_IOperations_HXX_
#define _ACISPlugin_IOperations_HXX_
+// internal includes
+#include "ACISPlugin_Engine.hxx"
+
// GEOM includes
#include <GEOMImpl_IBaseIEOperations.hxx>
-class ACISPlugin_IOperations: public GEOMImpl_IBaseIEOperations
+class ACISPLUGINENGINE_EXPORT ACISPlugin_IOperations: public GEOMImpl_IBaseIEOperations
{
public:
- Standard_EXPORT ACISPlugin_IOperations( GEOM_Engine*, int );
- Standard_EXPORT ~ACISPlugin_IOperations();
+ ACISPlugin_IOperations( GEOM_Engine*, int );
+ ~ACISPlugin_IOperations();
- Standard_EXPORT void ExportACIS( const Handle(GEOM_Object),
- const TCollection_AsciiString& );
+ void ExportACIS( const Handle(GEOM_Object),
+ const TCollection_AsciiString& );
- Standard_EXPORT Handle(TColStd_HSequenceOfTransient) ImportACIS( const TCollection_AsciiString& );
+ Handle(TColStd_HSequenceOfTransient) ImportACIS( 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 "ACISPlugin_IOperations_i.hh"
+#include "ACISPlugin_IOperations.hxx"
+#include <ACISPLUGIN_version.h>
+
+// KERNEL includes
+#include <utilities.h>
+
+//=============================================================================
+/*!
+ * constructor:
+ */
+//=============================================================================
+ACISPlugin_IOperations_i::ACISPlugin_IOperations_i( PortableServer::POA_ptr thePOA,
+ GEOM::GEOM_Gen_ptr theEngine,
+ ::ACISPlugin_IOperations* theImpl )
+:GEOM_IOperations_i( thePOA, theEngine, theImpl )
+{
+ MESSAGE( "ACISPlugin_Operations_i::ACISPlugin_Operations_i" );
+}
+
+//=============================================================================
+/*!
+ * destructor
+ */
+//=============================================================================
+ACISPlugin_IOperations_i::~ACISPlugin_IOperations_i()
+{
+ MESSAGE( "ACISPlugin_Operations_i::~ACISPlugin_Operations_i" );
+}
+
+//=============================================================================
+/*!
+ * ExportACIS
+ * Export a shape to ACIS format
+ * \param theOriginal The shape to export
+ * \param theFileName The name of the exported file
+ */
+//=============================================================================
+void ACISPlugin_IOperations_i::ExportACIS( 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()->ExportACIS( anOriginal, theFileName );
+}
+
+//=============================================================================
+/*!
+ * ImportACIS
+ * Import a shape from ACIS format
+ * \param theFileName The name of the file to import
+ * \return List of GEOM_Objects, containing the created shape and propagation groups.
+ */
+//=============================================================================
+GEOM::ListOfGO* ACISPlugin_IOperations_i::ImportACIS( 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()->ImportACIS( 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();
+}
+
+ACISPlugin_IOperations* ACISPlugin_IOperations_i::GetOperations()
+{
+ return (ACISPlugin_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 _ACISPlugin_IOperations_i_HeaderFile
+#define _ACISPlugin_IOperations_i_HeaderFile
+
+// idl includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER( GEOM_Gen )
+#include CORBA_SERVER_HEADER( ACISPlugin )
+
+// internal includes
+#include "ACISPlugin_Engine.hxx"
+
+// GEOM includes
+#include <GEOM_IOperations_i.hh>
+
+class ACISPlugin_IOperations;
+
+class ACISPLUGINENGINE_EXPORT ACISPlugin_IOperations_i :
+ public virtual POA_ACISPlugin::IACISOperations,
+ public virtual GEOM_IOperations_i
+{
+public:
+ ACISPlugin_IOperations_i( PortableServer::POA_ptr thePOA,
+ GEOM::GEOM_Gen_ptr theEngine,
+ ACISPlugin_IOperations* theImpl );
+ ~ACISPlugin_IOperations_i();
+
+ void ExportACIS( GEOM::GEOM_Object_ptr, const char* );
+ GEOM::ListOfGO* ImportACIS( const char* );
+
+ ACISPlugin_IOperations* GetOperations();
+};
+
+#endif // _ACISPlugin_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 "ACISPlugin_ImportDlg.h"
-#include "ACISPlugin_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>
-#include <SalomeApp_Study.h>
-
-// GEOM includes
-#include <GeometryGUI.h>
-#include <GEOMBase.h>
-#include <GEOM_Operation.h>
-
-//=================================================================================
-// Constructor
-//=================================================================================
-ACISPlugin_ImportDlg::ACISPlugin_ImportDlg( QWidget* parent )
-: SUIT_FileDlg( parent, true, true, true ),
- GEOMBase_Helper( dynamic_cast<SUIT_Desktop*>( parent ) )
-{
- setWindowTitle( tr( "ACISPLUGIN_IMPORT_TITLE" ) );
- setAcceptMode( AcceptOpen );
- setNameFilter( tr( "ACISPLUGIN_ACIS_FILES" ) );
- setFileMode( QFileDialog::ExistingFiles );
-}
-
-//=================================================================================
-// Destructor
-//=================================================================================
-ACISPlugin_ImportDlg::~ACISPlugin_ImportDlg()
-{
- // no need to delete child widgets, Qt does it all for us
-}
-
-//=================================================================================
-// function : createOperation
-// purpose :
-//=================================================================================
-GEOM::GEOM_IOperations_ptr ACISPlugin_ImportDlg::createOperation()
-{
- return getGeomEngine()->GetPluginOperations(getStudyId(), "ACISPluginEngine");
-}
-
-//=================================================================================
-// function : isValid
-// purpose :
-//=================================================================================
-bool ACISPlugin_ImportDlg::isValid (QString& msg)
-{
- bool ok = true;
- //@@ add custom validation actions here @@//
- return ok;
-}
-
-//=================================================================================
-// function : execute
-// purpose :
-//=================================================================================
-bool ACISPlugin_ImportDlg::execute( ObjectList& objects )
-{
- bool res = false;
- GEOM::GEOM_Object_var anObj;
- ACISPlugin::GEOM_IACISPluginOperations_var anOper = ACISPlugin::GEOM_IACISPluginOperations::_narrow( getOperation() );
-
- SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
- _PTR(Study) aStudy = dynamic_cast<SalomeApp_Study*> ( app->activeStudy() )->studyDS();
- SALOMEDS::Study_var aDSStudy = GeometryGUI::ClientStudyToStudy( aStudy );
-
- QStringList fileNames = selectedFiles();
- if ( fileNames.count() == 0 )
- return false; // nothing selected, return
-
- SUIT_MessageBox::StandardButton acisAnswer = SUIT_MessageBox::NoButton;
-
- 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();
-
- if ( acisAnswer != SUIT_MessageBox::YesToAll && acisAnswer != SUIT_MessageBox::NoToAll ) {
- SUIT_MessageBox::StandardButtons btns = SUIT_MessageBox::Yes | SUIT_MessageBox::No;
- if ( i < fileNames.count()-1 ) btns = btns | SUIT_MessageBox::YesToAll | SUIT_MessageBox::NoToAll;
- acisAnswer = SUIT_MessageBox::question( app->desktop(),
- "Question",//tr("WRN_WARNING"),
- tr("GEOM_PUBLISH_NAMED_SHAPES"),
- btns | SUIT_MessageBox::Cancel,
- SUIT_MessageBox::No );
- if ( acisAnswer == SUIT_MessageBox::Cancel ) {
- anOper->SetErrorCode(OK);
- return true; // cancel (break) import operation
- }
- }
-
- GEOM::ListOfGO_var anObj = anOper->ImportACIS( 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( aFileName, /*withExten=*/true ) );
- anObjPtr->SetName( aPublishObjName.toStdString().c_str() );
-
- SALOMEDS::SObject_var aSO =
- GeometryGUI::GetGeomGen()->PublishInStudy( aDSStudy,
- SALOMEDS::SObject::_nil(),
- anObjPtr,
- aPublishObjName.toLatin1().constData() );
- if ( acisAnswer == SUIT_MessageBox::Yes || acisAnswer == SUIT_MessageBox::YesToAll )
- GeometryGUI::GetGeomGen()->PublishNamedShapesInStudy( aDSStudy, anObjPtr );
-
- 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 ACISPlugin_ImportDlg::accept()
-{
- SUIT_FileDlg::accept();
- onAccept( false );
-}
-
-//=================================================================================
-// function : getObjectName
-// purpose :
-//=================================================================================
-QString ACISPlugin_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 ACISPlugin_IMPORTDLG_H
-#define ACISPlugin_IMPORTDLG_H
-
-// GUI includes
-#include <SUIT_FileDlg.h>
-
-// GEOM includes
-#include <GEOMBase_Helper.h>
-#include <GEOM_GenericObjPtr.h>
-
-class ACISPlugin_ImportDlg: public SUIT_FileDlg, public GEOMBase_Helper
-{
- Q_OBJECT
-
-public:
- ACISPlugin_ImportDlg( QWidget* = 0 );
- ~ACISPlugin_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 // ACISPlugin_IMPORTDLG_H
// internal includes
#include "ACISPlugin_ImportDriver.hxx"
#include "ACISPlugin_IImport.hxx"
-#include "ACISPlugin_Engine.hxx"
// KERNEL includes
#include <Basics_Utils.hxx>
class ACISPlugin_ImportDriver : public GEOM_BaseDriver
{
public:
- Standard_EXPORT ACISPlugin_ImportDriver();
- Standard_EXPORT ~ACISPlugin_ImportDriver() {};
+ ACISPlugin_ImportDriver();
+ ~ACISPlugin_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( ACISPlugin_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 "ACISPlugin_OperationsCreator.hh"
-#include "ACISPlugin_Operations_i.hh"
-#include "ACISPlugin_ExportDriver.hxx"
-#include "ACISPlugin_ImportDriver.hxx"
-#include "ACISPlugin_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* ACISPlugin_OperationsCreator::Create( PortableServer::POA_ptr thePOA,
- int theStudyId,
- GEOM::GEOM_Gen_ptr theEngine,
- ::GEOMImpl_Gen* theGenImpl )
-{
- Unexpect aCatch( SALOME_SalomeException );
- MESSAGE( "ACISPlugin_OperationsCreator::Create" );
-
- if (_mapOfOperations.find( theStudyId ) == _mapOfOperations.end() ) {
- ACISPlugin_IOperations* anOper = new ACISPlugin_IOperations( theGenImpl, theStudyId );
- _mapOfOperations[theStudyId] = anOper;
-
- // Import/Export ACIS
- TFunction_DriverTable::Get()->AddDriver( ACISPlugin_ExportDriver::GetID(),
- new ACISPlugin_ExportDriver() );
- TFunction_DriverTable::Get()->AddDriver( ACISPlugin_ImportDriver::GetID(),
- new ACISPlugin_ImportDriver() );
-
- ACISPlugin_IECallBack* ACISCallBack = new ACISPlugin_IECallBack( anOper );
- GEOMImpl_IECallBack::Register( "ACIS", ACISCallBack );
- }
-
- ACISPlugin_Operations_i* aServant =
- new ACISPlugin_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 "ACISPlugin_OperationsCreator.hxx"
+#include "ACISPlugin_IOperations_i.hh"
+#include "ACISPlugin_ExportDriver.hxx"
+#include "ACISPlugin_ImportDriver.hxx"
+#include "ACISPlugin_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, ACISPlugin_IOperations*> ACISPlugin_OperationsCreator::_mapOfOperations;
+
+ACISPlugin_OperationsCreator::ACISPlugin_OperationsCreator()
+{
+ // Register drivers
+ TFunction_DriverTable::Get()->AddDriver( ACISPlugin_ExportDriver::GetID(),
+ new ACISPlugin_ExportDriver() );
+ TFunction_DriverTable::Get()->AddDriver( ACISPlugin_ImportDriver::GetID(),
+ new ACISPlugin_ImportDriver() );
+ // Register callback
+ ACISPlugin_IECallBack* callback = new ACISPlugin_IECallBack();
+ GEOMImpl_IECallBack::Register( "ACIS", callback );
+}
+
+ACISPlugin_OperationsCreator::~ACISPlugin_OperationsCreator()
+{
+}
+
+GEOM_IOperations_i* ACISPlugin_OperationsCreator::Create( PortableServer::POA_ptr thePOA,
+ int theStudyId,
+ GEOM::GEOM_Gen_ptr theEngine,
+ ::GEOMImpl_Gen* theGenImpl )
+{
+ Unexpect aCatch( SALOME_SalomeException );
+ MESSAGE( "ACISPlugin_OperationsCreator::Create" );
+ return new ACISPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl, theStudyId ) );
+}
+
+ACISPlugin_IOperations* ACISPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl,
+ int theStudyId )
+{
+ if (_mapOfOperations.find( theStudyId ) == _mapOfOperations.end() )
+ _mapOfOperations[theStudyId] = new ACISPlugin_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_ACISPlugin_OperationsCreator_HXX_
-#define _GEOM_ACISPlugin_OperationsCreator_HXX_
-
-// internal includes
-#include "ACISPlugin_Engine.hxx"
-#include "ACISPlugin_IOperations.hxx"
-
-// GEOM includes
-#include "GEOM_Gen_i.hh"
-
-// C++ includes
-#include <map>
-
-//=====================================================================
-// Operations creator
-//=====================================================================
-class ACISPLUGINENGINE_EXPORT ACISPlugin_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, ACISPlugin_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_ACISPlugin_OperationsCreator_HXX_
+#define _GEOM_ACISPlugin_OperationsCreator_HXX_
+
+// internal includes
+#include "ACISPlugin_Engine.hxx"
+
+// GEOM includes
+#include "GEOM_Gen_i.hh"
+
+// C++ includes
+#include <map>
+
+class ACISPlugin_IOperations;
+
+//=====================================================================
+// Operations creator
+//=====================================================================
+class ACISPLUGINENGINE_EXPORT ACISPlugin_OperationsCreator : public GEOM_GenericOperationsCreator
+{
+public:
+ ACISPlugin_OperationsCreator();
+ ~ACISPlugin_OperationsCreator();
+
+ GEOM_IOperations_i* Create( PortableServer::POA_ptr thePOA,
+ int theStudyId,
+ GEOM::GEOM_Gen_ptr theEngine,
+ ::GEOMImpl_Gen* theGenImpl );
+
+private:
+ static ACISPlugin_IOperations* get( ::GEOMImpl_Gen* theGenImpl,
+ int theStudyId );
+
+ static std::map <int, ACISPlugin_IOperations*> _mapOfOperations;
+
+ friend class ACISPlugin_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 "ACISPlugin_Operations_i.hh"
-#include <ACISPLUGIN_version.h>
-
-// KERNEL includes
-#include <utilities.h>
-
-//=============================================================================
-/*!
- * constructor:
- */
-//=============================================================================
-ACISPlugin_Operations_i::ACISPlugin_Operations_i( PortableServer::POA_ptr thePOA,
- GEOM::GEOM_Gen_ptr theEngine,
- ::ACISPlugin_IOperations* theImpl )
-:GEOM_IOperations_i( thePOA, theEngine, theImpl )
-{
- MESSAGE( "ACISPlugin_Operations_i::ACISPlugin_Operations_i" );
-}
-
-//=============================================================================
-/*!
- * destructor
- */
-//=============================================================================
-ACISPlugin_Operations_i::~ACISPlugin_Operations_i()
-{
- MESSAGE( "ACISPlugin_Operations_i::~ACISPlugin_Operations_i" );
-}
-
-//=============================================================================
-/*!
- * ExportACIS
- * Export a shape to ACIS format
- * \param theOriginal The shape to export
- * \param theFileName The name of the exported file
- */
-//=============================================================================
-void ACISPlugin_Operations_i::ExportACIS( 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()->ExportACIS( anOriginal, aFileName );
- free( aFileName );
-}
-
-//=============================================================================
-/*!
- * ImportACIS
- * Import a shape from ACIS format
- * \param theFileName The name of the file to import
- * \return List of GEOM_Objects, containing the created shape and propagation groups.
- */
-//=============================================================================
-GEOM::ListOfGO* ACISPlugin_Operations_i::ImportACIS( 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()->ImportACIS( 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 ACISPlugin_Operations_i::GetVersion()
-{
- return ACISPLUGIN_VERSION;
-}
-//=============================================================================
-/*!
- * \brief Get version of the plugin.
- * \return the string representation of the plugin's version
-*/
-//=============================================================================
-
-char* ACISPlugin_Operations_i::GetVersionStr()
-{
- return (char*)ACISPLUGIN_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 _ACISPlugin_Operations_i_HeaderFile
-#define _ACISPlugin_Operations_i_HeaderFile
-
-// idl includes
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER( GEOM_Gen )
-#include CORBA_SERVER_HEADER( ACISPlugin_Gen )
-
-// internal includes
-#include "ACISPlugin_Engine.hxx"
-#include "ACISPlugin_IOperations.hxx"
-
-// GEOM includes
-#include <GEOM_IOperations_i.hh>
-
-class ACISPLUGINENGINE_EXPORT ACISPlugin_Operations_i :
- public virtual POA_ACISPlugin::GEOM_IACISPluginOperations,
- public virtual GEOM_IOperations_i
-{
-public:
- ACISPlugin_Operations_i( PortableServer::POA_ptr thePOA,
- GEOM::GEOM_Gen_ptr theEngine,
- ::ACISPlugin_IOperations* theImpl );
- ~ACISPlugin_Operations_i();
-
- void ExportACIS( GEOM::GEOM_Object_ptr, const char* );
- GEOM::ListOfGO* ImportACIS( const char* );
-
- // Version information
- virtual int GetVersion();
- virtual char* GetVersionStr();
-
- ::ACISPlugin_IOperations* GetOperations()
- { return (::ACISPlugin_IOperations*)GetImpl(); }
-};
-
-#endif
${CAS_INCLUDE_DIRS}
${ACIS_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}
${ACIS_LIBRARIES}
${KERNEL_SALOMEBasics}
)
IF(SALOME_BUILD_GUI)
- SET(_link_LIBRARIES
- ${_link_LIBRARIES}
+ SET(_link_gui_LIBRARIES
+ SalomeIDLACISPlugin
+ ${GEOM_GEOMObject}
+ ${GEOM_GEOMBase}
${GEOM_GEOMBase}
)
ENDIF()
# --- headers ---
SET(ACISPluginEngine_HEADERS
- ACISPlugin_Operations_i.hh
+ ACISPlugin_IOperations_i.hh
ACISPlugin_Engine.hxx
- ACISPlugin_OperationsCreator.hh
+ ACISPlugin_OperationsCreator.hxx
ACISPlugin_IOperations.hxx
ACISPlugin_IExport.hxx
ACISPlugin_IImport.hxx
IF(SALOME_BUILD_GUI)
# header files / to be processed by moc
SET(_moc_HEADERS
- ACISPlugin_ExportDlg.h
- ACISPlugin_ImportDlg.h
+ ACISPlugin_GUI.h
)
ENDIF()
QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
SET(ACISPluginGUI_SOURCES
- ACISPluginGUI.cxx
- ACISPlugin_ExportDlg.cxx
- ACISPlugin_ImportDlg.cxx
+ ACISPlugin_GUI.cxx
${_moc_SOURCES}
)
ENDIF()
SET(ACISPluginEngine_SOURCES
- ACISPluginEngine.cxx
- ACISPlugin_OperationsCreator.cc
- ACISPlugin_Operations_i.cc
+ ACISPlugin_Engine.cxx
+ ACISPlugin_OperationsCreator.cxx
+ ACISPlugin_IOperations_i.cc
ACISPlugin_IOperations.cxx
ACISPlugin_ExportDriver.cxx
ACISPlugin_ImportDriver.cxx
# install Engine library
ADD_LIBRARY(ACISPluginEngine ${ACISPluginEngine_SOURCES})
-TARGET_LINK_LIBRARIES(ACISPluginEngine ${_link_LIBRARIES})
+TARGET_LINK_LIBRARIES(ACISPluginEngine ${_link_engine_LIBRARIES})
INSTALL(TARGETS ACISPluginEngine EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
# install GUI library
IF(SALOME_BUILD_GUI)
ADD_LIBRARY(ACISPluginGUI ${ACISPluginGUI_SOURCES})
- TARGET_LINK_LIBRARIES(ACISPluginGUI ${_link_LIBRARIES})
+ TARGET_LINK_LIBRARIES(ACISPluginGUI ${_link_gui_LIBRARIES})
INSTALL(TARGETS ACISPluginGUI EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
# install resources
QT4_INSTALL_TS_RESOURCES("${ACISPlugin_RESOURCES}" "${SALOME_ACISPLUGIN_INSTALL_RES_DATA}")
<source>STB_IMPORTACIS</source>
<translation>Import ACIS</translation>
</message>
+</context>
+<context>
+ <name>ACISPlugin_GUI</name>
<message>
- <source>ACISPLUGIN_ACIS_FILES</source>
+ <source>ACIS_FILES</source>
<translation>ACIS files( *.sat )</translation>
</message>
-</context>
-<context>
- <name>ACISPlugin_ExportDlg</name>
<message>
- <source>ACISPLUGIN_EXPORT_TITLE</source>
+ <source>EXPORT_TITLE</source>
<translation>Export ACIS</translation>
</message>
-</context>
-<context>
- <name>ACISPlugin_ImportDlg</name>
<message>
- <source>ACISPLUGIN_IMPORT_TITLE</source>
+ <source>IMPORT_TITLE</source>
<translation>Import ACIS</translation>
</message>
</context>
<source>STB_IMPORTACIS</source>
<translation>Importer ACIS</translation>
</message>
+</context>
+<context>
+ <name>ACISPlugin_GUI</name>
<message>
- <source>ACISPLUGIN_ACIS_FILES</source>
+ <source>ACIS_FILES</source>
<translation>ACIS Fichiers( *.sat )</translation>
</message>
-</context>
-<context>
- <name>ACISPlugin_ExportDlg</name>
<message>
- <source>ACISPLUGIN_EXPORT_TITLE</source>
+ <source>EXPORT_TITLE</source>
<translation>Exporter ACIS</translation>
</message>
-</context>
-<context>
- <name>ACISPlugin_ImportDlg</name>
<message>
- <source>ACISPLUGIN_IMPORT_TITLE</source>
+ <source>IMPORT_TITLE</source>
<translation>Importer ACIS</translation>
</message>
</context>
<source>STB_IMPORTACIS</source>
<translation type="unfinished">Import ACIS</translation>
</message>
+</context>
+<context>
+ <name>ACISPlugin_GUI</name>
<message>
- <source>ACISPLUGIN_ACIS_FILES</source>
+ <source>ACIS_FILES</source>
<translation type="unfinished">ACIS files( *.sat )</translation>
</message>
-</context>
-<context>
- <name>ACISPlugin_ExportDlg</name>
<message>
- <source>ACISPLUGIN_EXPORT_TITLE</source>
+ <source>EXPORT_TITLE</source>
<translation type="unfinished">Export ACIS</translation>
</message>
-</context>
-<context>
- <name>ACISPlugin_ImportDlg</name>
<message>
- <source>ACISPLUGIN_IMPORT_TITLE</source>
+ <source>IMPORT_TITLE</source>
<translation type="unfinished">Import ACIS</translation>
</message>
</context>