diff --git a/src/Mod/Import/App/FeatureImportIges.cpp b/src/Mod/Import/App/FeatureImportIges.cpp deleted file mode 100644 index f51f60a825..0000000000 --- a/src/Mod/Import/App/FeatureImportIges.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2002 Jürgen Riegel * - * * - * This file is part of the FreeCAD CAx development system. * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Library General Public * - * License as published by the Free Software Foundation; either * - * version 2 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 Library General Public License for more details. * - * * - * You should have received a copy of the GNU Library General Public * - * License along with this library; see the file COPYING.LIB. If not, * - * write to the Free Software Foundation, Inc., 59 Temple Place, * - * Suite 330, Boston, MA 02111-1307, USA * - * * - ***************************************************************************/ - -#include "PreCompiled.h" -#ifndef _PreComp_ -# include -# include -# include -#endif - -#include -#include -#include - -#include "FeatureImportIges.h" - - -using namespace Import; - -void FeatureImportIges::InitLabel(const TDF_Label &rcLabel) -{ - addProperty("String","FileName"); -} - - -Standard_Integer FeatureImportIges::Execute(void) -{ - Base::Console().Log("FeaturePartImportIges::Execute()\n"); - - try{ - - IGESControl_Reader aReader; - TopoDS_Shape aShape; - - std::string FileName = getPropertyString("FileName"); - - int i=_open(FileName.c_str(),O_RDONLY); - if( i != -1) - { - _close(i); - }else{ - Base::Console().Log("FeaturePartImportIges::Execute() not able to open %s!\n",FileName.c_str()); - return 1; - } - - // just do show the wait cursor when the Gui is up - Base::Sequencer().start("Load IGES", 1); - Base::Sequencer().next(); - - // read iges-file - if (aReader.ReadFile((const Standard_CString)FileName.c_str()) != IFSelect_RetDone) - throw Base::FileException("IGES read failed (load file)"); - - // make brep - aReader.TransferRoots(); - // one shape, who contain's all subshapes - aShape = aReader.OneShape(); - - setShape(aShape); - Base::Sequencer().stop(); - } - catch(...){ - Base::Sequencer().halt(); - Base::Console().Error("FeaturePartImportIges::Execute() failed!"); - return 1; - } - - return 0; -} - diff --git a/src/Mod/Import/App/FeatureImportIges.h b/src/Mod/Import/App/FeatureImportIges.h deleted file mode 100644 index d302e253cf..0000000000 --- a/src/Mod/Import/App/FeatureImportIges.h +++ /dev/null @@ -1,47 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2002 Jürgen Riegel * - * * - * This file is part of the FreeCAD CAx development system. * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Library General Public * - * License as published by the Free Software Foundation; either * - * version 2 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 Library General Public License for more details. * - * * - * You should have received a copy of the GNU Library General Public * - * License along with this library; see the file COPYING.LIB. If not, * - * write to the Free Software Foundation, Inc., 59 Temple Place, * - * Suite 330, Boston, MA 02111-1307, USA * - * * - ***************************************************************************/ - -#ifndef __FeatureImportIges_H__ -#define __FeatureImportIges_H__ - -#include - -class TDF_Label; - -namespace Import -{ - -class FeatureImportIges :public Part::Feature -{ -public: - - virtual void InitLabel(const TDF_Label &rcLabel); - - virtual Standard_Integer Execute(void); - - /// Returns the Name/Type of the feature - virtual const char *Type(void){return "PartImportIges";} -}; - -} - -#endif // __FeaturePartImportIges_H__ diff --git a/src/Mod/Import/App/FeatureImportStep.cpp b/src/Mod/Import/App/FeatureImportStep.cpp deleted file mode 100644 index b82d7a13ff..0000000000 --- a/src/Mod/Import/App/FeatureImportStep.cpp +++ /dev/null @@ -1,113 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2002 Jürgen Riegel * - * * - * This file is part of the FreeCAD CAx development system. * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Library General Public * - * License as published by the Free Software Foundation; either * - * version 2 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 Library General Public License for more details. * - * * - * You should have received a copy of the GNU Library General Public * - * License along with this library; see the file COPYING.LIB. If not, * - * write to the Free Software Foundation, Inc., 59 Temple Place, * - * Suite 330, Boston, MA 02111-1307, USA * - * * - ***************************************************************************/ - -#include "PreCompiled.h" -#ifndef _PreComp_ -# include -# include -# include -# include -#endif - -#include -#include - -#include "FeatureImportStep.h" - - -using namespace Import; - -void FeatureImportStep::InitLabel(const TDF_Label &rcLabel) -{ - addProperty("String","FileName"); - -} - - -Standard_Integer FeatureImportStep::Execute(void) -{ - Base::Console().Log("FeaturePartImportStep::Execute()\n"); - - try{ - - STEPControl_Reader aReader; - TopoDS_Shape aShape; - - std::string FileName = getPropertyString("FileName"); - - if( FileName == "") - return 1; - - int i=_open(FileName.c_str(),O_RDONLY); - if( i != -1) - { - _close(i); - }else{ - setError("File not readable"); - return 1; - } - - // just do show the wait cursor when the Gui is up - Base::Sequencer().start("Load IGES", 1); - Base::Sequencer().next(); - - Handle(TopTools_HSequenceOfShape) aHSequenceOfShape = new TopTools_HSequenceOfShape; - if (aReader.ReadFile((const Standard_CString)FileName.c_str()) != IFSelect_RetDone) - { - setError("File not readable"); - return 1; - } - - // Root transfers - Standard_Integer nbr = aReader.NbRootsForTransfer(); - - for ( Standard_Integer n = 1; n<= nbr; n++) - { - printf("STEP: Transferring Root %d\n",n); - aReader.TransferRoot(n); - // Collecting resulting entities - Standard_Integer nbs = aReader.NbShapes(); - if (nbs == 0) { - aHSequenceOfShape.Nullify(); - return 1; - } else { - for (Standard_Integer i =1; i<=nbs; i++) - { - printf("STEP: Transferring Shape %d\n",n); - aShape=aReader.Shape(i); - aHSequenceOfShape->Append(aShape); - } - } - } - - setShape(aShape); - Base::Sequencer().stop(); - } - catch(...){ - Base::Sequencer().halt(); - Base::Console().Error("FeaturePartImportStep::Execute() failed!"); - return 1; - } - - return 0; -} - diff --git a/src/Mod/Import/App/FeatureImportStep.h b/src/Mod/Import/App/FeatureImportStep.h deleted file mode 100644 index c6af747d27..0000000000 --- a/src/Mod/Import/App/FeatureImportStep.h +++ /dev/null @@ -1,48 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2002 Jürgen Riegel * - * * - * This file is part of the FreeCAD CAx development system. * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Library General Public * - * License as published by the Free Software Foundation; either * - * version 2 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 Library General Public License for more details. * - * * - * You should have received a copy of the GNU Library General Public * - * License along with this library; see the file COPYING.LIB. If not, * - * write to the Free Software Foundation, Inc., 59 Temple Place, * - * Suite 330, Boston, MA 02111-1307, USA * - * * - ***************************************************************************/ - -#ifndef __FeatureImportStep_H__ -#define __FeatureImportStep_H__ - -#include - - -namespace Import -{ - - class FeatureImportStep :public Part::Feature -{ -public: - - virtual void InitLabel(const TDF_Label &rcLabel); - - virtual Standard_Integer Execute(void); - - /// Returns the Name/Type of the feature - virtual const char *Type(void){return "PartImportStep";} -}; - - -} - - -#endif // __FeatureImportStep_H__