+++ /dev/null
-// Copyright (C) 2014 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
-//
-
-#include <ACISPLUGIN_exports.h>
-#include <ACISPLUGIN_version.h>
-
-#include <Basics_Utils.hxx>
-
-#include <IFSelect_ReturnStatus.hxx>
-#include <SatControl_Writer.hxx>
-#include <TCollection_AsciiString.hxx>
-#include <TopoDS_Shape.hxx>
-
-#ifdef ACIS_HASLICENSE
-#include <ACISPLUGIN_license.h>
-
-#include <OCCLicense_Activate.hxx>
-#include <Standard_LicenseError.hxx>
-#endif // ACIS_HASLICENSE
-
-extern "C"
-{
- /*!
- \brief Get version of the plugin.
- \return the version of the plugin
- */
- ACISPLUGIN_EXPORT
- int GetVersion()
- {
- return ACISPLUGIN_VERSION;
- }
-
- /*!
- \brief Get version of the plugin.
- \return the string representation of the plugin's version
- */
- ACISPLUGIN_EXPORT
- char* GetVersionStr()
- {
- return (char*)ACISPLUGIN_VERSION_STR;
- }
-
- /*!
- \brief Export shape to the ACIS format.
- \param theShape shape being exported
- \param theFileName file path
- \param theFormatName file format signature
- \return error status (0 in case of success)
- */
- ACISPLUGIN_EXPORT
- int Export(const TopoDS_Shape& theShape,
- const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theFormatName)
- {
-#ifdef ACIS_HASLICENSE
- try {
- OCCLicense_Activate("SAT-W-"OCC_VERSION_STRING, ACIS_WRITE_LICENSE);
- }
- catch (Standard_LicenseError) {
- return 1;
- }
-#endif // ACIS_HASLICENSE
-
- // Set "C" numeric locale to save numbers correctly
- Kernel_Utils::Localizer loc;
-
- SatControl_Writer aWriter;
-
- try {
- IFSelect_ReturnStatus status ;
- status = aWriter.TransferShape(theShape);
- if ( status == IFSelect_RetDone )
- status = aWriter.WriteFile( theFileName.ToCString() ) ;
- if ( status == IFSelect_RetDone )
- return 1;
- }
- catch(Standard_Failure) {
- return 1;
- }
- return 0;
- }
-} // end of extern "C"
+++ /dev/null
-// Copyright (C) 2014 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
-//
-
-#include <ACISPLUGIN_exports.h>
-#include <ACISPLUGIN_version.h>
-
-#include <Basics_Utils.hxx>
-
-#include <AcisAttr_AttribGenName.hxx>
-#include <AcisEnt_Attrib.hxx>
-#include <IFSelect_ReturnStatus.hxx>
-#include <Interface_InterfaceModel.hxx>
-#include <SatControl_Reader.hxx>
-#include <TCollection_AsciiString.hxx>
-#include <TDataStd_Name.hxx>
-#include <TDF_Label.hxx>
-#include <TNaming_Builder.hxx>
-#include <TopoDS_Shape.hxx>
-#include <TransferBRep.hxx>
-#include <Transfer_Binder.hxx>
-#include <Transfer_TransientProcess.hxx>
-#include <XSControl_TransferReader.hxx>
-#include <XSControl_WorkSession.hxx>
-
-#ifdef ACIS_HASLICENSE
-#include <ACISPLUGIN_license.h>
-
-#include <OCCLicense_Activate.hxx>
-#include <Standard_LicenseError.hxx>
-#endif // ACIS_HASLICENSE
-
-extern "C"
-{
- /*!
- \brief Get version of the plugin.
- \return the version of the plugin
- */
- ACISPLUGIN_EXPORT
- int GetVersion()
- {
- return ACISPLUGIN_VERSION;
- }
-
- /*!
- \brief Get version of the plugin.
- \return the string representation of the plugin's version
- */
- ACISPLUGIN_EXPORT
- char* GetVersionStr()
- {
- return (char*)ACISPLUGIN_VERSION_STR;
- }
-
- /*!
- \brief Import shape from the ACIS format.
- \param theFileName file path
- \param theFormatName file format signature
- \param theError error description, if there's any, is returned via this parameter
- \param theShapeLabel a label in the CAF tree where shape attributes are set to
- \return imported shape
- */
- ACISPLUGIN_EXPORT
- TopoDS_Shape Import(const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& /*theFormatName*/,
- TCollection_AsciiString& theError,
- const TDF_Label& theShapeLabel)
- {
- TopoDS_Shape aResShape;
-
-#ifdef ACIS_HASLICENSE
- try {
- OCCLicense_Activate( "SAT-R-"OCC_VERSION_STRING, ACIS_READ_LICENSE);
- }
- catch (Standard_LicenseError) {
- return aResShape;
- }
-#endif // ACIS_HASLICENSE
-
- // Set "C" numeric locale to save numbers correctly
- Kernel_Utils::Localizer loc;
-
- SatControl_Reader aReader;
-
- try {
- IFSelect_ReturnStatus status = aReader.ReadFile(theFileName.ToCString());
- if (status == IFSelect_RetDone) {
- aReader.TransferRoots();
- aResShape = aReader.OneShape();
- Handle(Interface_InterfaceModel) Model = aReader.WS()->Model();
- Handle(XSControl_TransferReader) TR = aReader.WS()->TransferReader();
- if( !TR.IsNull() ) {
- Handle(Transfer_TransientProcess) TP = TR->TransientProcess();
- Standard_Integer nb = Model->NbEntities();
- for (Standard_Integer i = 1; i <= nb; i ++) {
- Handle(AcisEnt_Attrib) attr = Handle(AcisEnt_Attrib)::DownCast ( Model->Value(i) );
- if ( attr.IsNull() ) continue; //not only Entity Label (f.18) but Name Property also
-
- TCollection_AsciiString aName;
- if ( attr->IsKind(STANDARD_TYPE(AcisAttr_AttribGenName)) ) {
- Handle(AcisAttr_AttribGenName) attrname = Handle(AcisAttr_AttribGenName)::DownCast ( attr );
- aName = attrname->myNameAttr;
- }
- else continue; // no name assigned
-
- // find target entity
- Handle(AcisEnt_Entity) ent;
- do {
- ent = attr->myEntity;
- attr = Handle(AcisEnt_Attrib)::DownCast ( ent );
- } while ( ! attr.IsNull() );
- if ( ent.IsNull() ) continue; // strange - no normal entity found ?
-
- // find target shape
- Handle(Transfer_Binder) binder = TP->Find ( ent );
- if ( binder.IsNull() ) continue;
- TopoDS_Shape S = TransferBRep::ShapeResult (binder);
- if ( S.IsNull() ) continue;
-
- //if( S.IsEqual(aResShape) ) continue;
-
- // create label and set shape
- TDF_Label L;
- TDF_TagSource aTag;
- L = aTag.NewChild(theShapeLabel);
- TNaming_Builder tnBuild(L);
- tnBuild.Generated(S);
-
- // set a name
- TCollection_ExtendedString str(aName);
- TDataStd_Name::Set(L,str);
- }
- }
- }
- else {
- theError = "Wrong format of the imported file. Can't import file.";
- aResShape.Nullify();
- }
- }
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- theError = aFail->GetMessageString();
- aResShape.Nullify();
- }
- return aResShape;
- }
-} // end of extern "C"
-
--- /dev/null
+// Copyright (C) 2014 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
+//
+
+#if !defined (__ACISPLUGIN_EXPORTS_H)
+#define __ACISPLUGIN_EXPORTS_H
+
+#ifdef WIN32
+# if defined ACISExport_EXPORTS || defined ACISEXPORTS_EXPORTS || defined ACISImport_EXPORTS || defined ACISIMPORT_EXPORTS
+# define ACISPLUGIN_EXPORT __declspec(dllexport)
+# else
+# define ACISPLUGIN_EXPORT __declspec(dllimport)
+# endif
+#else // WIN32
+# define ACISPLUGIN_EXPORT
+#endif // WIN32
+
+#endif // __ACISPLUGIN_EXPORTS_H
--- /dev/null
+// Copyright (C) 2014 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
+//
+
+#include <ACISPLUGIN_exports.h>
+#include <ACISPLUGIN_version.h>
+
+#include <Basics_Utils.hxx>
+
+#include <IFSelect_ReturnStatus.hxx>
+#include <SatControl_Writer.hxx>
+#include <TCollection_AsciiString.hxx>
+#include <TopoDS_Shape.hxx>
+
+#ifdef ACIS_HASLICENSE
+#include <ACISPLUGIN_license.h>
+
+#include <OCCLicense_Activate.hxx>
+#include <Standard_LicenseError.hxx>
+#endif // ACIS_HASLICENSE
+
+extern "C"
+{
+ /*!
+ \brief Get version of the plugin.
+ \return the version of the plugin
+ */
+ ACISPLUGIN_EXPORT
+ int GetVersion()
+ {
+ return ACISPLUGIN_VERSION;
+ }
+
+ /*!
+ \brief Get version of the plugin.
+ \return the string representation of the plugin's version
+ */
+ ACISPLUGIN_EXPORT
+ char* GetVersionStr()
+ {
+ return (char*)ACISPLUGIN_VERSION_STR;
+ }
+
+ /*!
+ \brief Export shape to the ACIS format.
+ \param theShape shape being exported
+ \param theFileName file path
+ \param theFormatName file format signature
+ \return error status (0 in case of success)
+ */
+ ACISPLUGIN_EXPORT
+ int Export(const TopoDS_Shape& theShape,
+ const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName)
+ {
+#ifdef ACIS_HASLICENSE
+ try {
+ OCCLicense_Activate("SAT-W-"OCC_VERSION_STRING, ACIS_WRITE_LICENSE);
+ }
+ catch (Standard_LicenseError) {
+ return 1;
+ }
+#endif // ACIS_HASLICENSE
+
+ // Set "C" numeric locale to save numbers correctly
+ Kernel_Utils::Localizer loc;
+
+ SatControl_Writer aWriter;
+
+ try {
+ IFSelect_ReturnStatus status ;
+ status = aWriter.TransferShape(theShape);
+ if ( status == IFSelect_RetDone )
+ status = aWriter.WriteFile( theFileName.ToCString() ) ;
+ if ( status == IFSelect_RetDone )
+ return 1;
+ }
+ catch(Standard_Failure) {
+ return 1;
+ }
+ return 0;
+ }
+} // end of extern "C"
--- /dev/null
+// Copyright (C) 2014 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
+//
+
+#include <ACISPLUGIN_exports.h>
+#include <ACISPLUGIN_version.h>
+
+#include <Basics_Utils.hxx>
+
+#include <AcisAttr_AttribGenName.hxx>
+#include <AcisEnt_Attrib.hxx>
+#include <IFSelect_ReturnStatus.hxx>
+#include <Interface_InterfaceModel.hxx>
+#include <SatControl_Reader.hxx>
+#include <TCollection_AsciiString.hxx>
+#include <TDataStd_Name.hxx>
+#include <TDF_Label.hxx>
+#include <TNaming_Builder.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TransferBRep.hxx>
+#include <Transfer_Binder.hxx>
+#include <Transfer_TransientProcess.hxx>
+#include <XSControl_TransferReader.hxx>
+#include <XSControl_WorkSession.hxx>
+
+#ifdef ACIS_HASLICENSE
+#include <ACISPLUGIN_license.h>
+
+#include <OCCLicense_Activate.hxx>
+#include <Standard_LicenseError.hxx>
+#endif // ACIS_HASLICENSE
+
+extern "C"
+{
+ /*!
+ \brief Get version of the plugin.
+ \return the version of the plugin
+ */
+ ACISPLUGIN_EXPORT
+ int GetVersion()
+ {
+ return ACISPLUGIN_VERSION;
+ }
+
+ /*!
+ \brief Get version of the plugin.
+ \return the string representation of the plugin's version
+ */
+ ACISPLUGIN_EXPORT
+ char* GetVersionStr()
+ {
+ return (char*)ACISPLUGIN_VERSION_STR;
+ }
+
+ /*!
+ \brief Import shape from the ACIS format.
+ \param theFileName file path
+ \param theFormatName file format signature
+ \param theError error description, if there's any, is returned via this parameter
+ \param theShapeLabel a label in the CAF tree where shape attributes are set to
+ \return imported shape
+ */
+ ACISPLUGIN_EXPORT
+ TopoDS_Shape Import(const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& /*theFormatName*/,
+ TCollection_AsciiString& theError,
+ const TDF_Label& theShapeLabel)
+ {
+ TopoDS_Shape aResShape;
+
+#ifdef ACIS_HASLICENSE
+ try {
+ OCCLicense_Activate( "SAT-R-"OCC_VERSION_STRING, ACIS_READ_LICENSE);
+ }
+ catch (Standard_LicenseError) {
+ return aResShape;
+ }
+#endif // ACIS_HASLICENSE
+
+ // Set "C" numeric locale to save numbers correctly
+ Kernel_Utils::Localizer loc;
+
+ SatControl_Reader aReader;
+
+ try {
+ IFSelect_ReturnStatus status = aReader.ReadFile(theFileName.ToCString());
+ if (status == IFSelect_RetDone) {
+ aReader.TransferRoots();
+ aResShape = aReader.OneShape();
+ Handle(Interface_InterfaceModel) Model = aReader.WS()->Model();
+ Handle(XSControl_TransferReader) TR = aReader.WS()->TransferReader();
+ if( !TR.IsNull() ) {
+ Handle(Transfer_TransientProcess) TP = TR->TransientProcess();
+ Standard_Integer nb = Model->NbEntities();
+ for (Standard_Integer i = 1; i <= nb; i ++) {
+ Handle(AcisEnt_Attrib) attr = Handle(AcisEnt_Attrib)::DownCast ( Model->Value(i) );
+ if ( attr.IsNull() ) continue; //not only Entity Label (f.18) but Name Property also
+
+ TCollection_AsciiString aName;
+ if ( attr->IsKind(STANDARD_TYPE(AcisAttr_AttribGenName)) ) {
+ Handle(AcisAttr_AttribGenName) attrname = Handle(AcisAttr_AttribGenName)::DownCast ( attr );
+ aName = attrname->myNameAttr;
+ }
+ else continue; // no name assigned
+
+ // find target entity
+ Handle(AcisEnt_Entity) ent;
+ do {
+ ent = attr->myEntity;
+ attr = Handle(AcisEnt_Attrib)::DownCast ( ent );
+ } while ( ! attr.IsNull() );
+ if ( ent.IsNull() ) continue; // strange - no normal entity found ?
+
+ // find target shape
+ Handle(Transfer_Binder) binder = TP->Find ( ent );
+ if ( binder.IsNull() ) continue;
+ TopoDS_Shape S = TransferBRep::ShapeResult (binder);
+ if ( S.IsNull() ) continue;
+
+ //if( S.IsEqual(aResShape) ) continue;
+
+ // create label and set shape
+ TDF_Label L;
+ TDF_TagSource aTag;
+ L = aTag.NewChild(theShapeLabel);
+ TNaming_Builder tnBuild(L);
+ tnBuild.Generated(S);
+
+ // set a name
+ TCollection_ExtendedString str(aName);
+ TDataStd_Name::Set(L,str);
+ }
+ }
+ }
+ else {
+ theError = "Wrong format of the imported file. Can't import file.";
+ aResShape.Nullify();
+ }
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ theError = aFail->GetMessageString();
+ aResShape.Nullify();
+ }
+ return aResShape;
+ }
+} // end of extern "C"
+
--- /dev/null
+// Copyright (C) 2014 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
+//
+
+#if !defined(__ACISPLUGIN_LICENSE_H)
+#define __ACISPLUGIN_LICENSE_H
+
+#define ACIS_READ_LICENSE "@ACIS_READ_LICENSE@"
+#define ACIS_WRITE_LICENSE "@ACIS_WRITE_LICENSE@"
+
+#endif // __ACISPLUGIN_LICENSE_H
+++ /dev/null
-// Copyright (C) 2014 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
-//
-
-#if !defined (__ACISPLUGIN_EXPORTS_H)
-#define __ACISPLUGIN_EXPORTS_H
-
-#ifdef WIN32
-# if defined ACISExport_EXPORTS || defined ACISEXPORTS_EXPORTS || defined ACISImport_EXPORTS || defined ACISIMPORT_EXPORTS
-# define ACISPLUGIN_EXPORT __declspec(dllexport)
-# else
-# define ACISPLUGIN_EXPORT __declspec(dllimport)
-# endif
-#else // WIN32
-# define ACISPLUGIN_EXPORT
-#endif // WIN32
-
-#endif // __ACISPLUGIN_EXPORTS_H
+++ /dev/null
-// Copyright (C) 2014 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
-//
-
-#if !defined(__ACISPLUGIN_LICENSE_H)
-#define __ACISPLUGIN_LICENSE_H
-
-#define ACIS_READ_LICENSE "@ACIS_READ_LICENSE@"
-#define ACIS_WRITE_LICENSE "@ACIS_WRITE_LICENSE@"
-
-#endif // __ACISPLUGIN_LICENSE_H