+ unify DLL export defines to namespace names
git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5000 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
This commit is contained in:
72
src/Mod/Import/App/AppImport.cpp
Normal file
72
src/Mod/Import/App/AppImport.cpp
Normal file
@@ -0,0 +1,72 @@
|
||||
/***************************************************************************
|
||||
* (c) Jürgen Riegel (juergen.riegel@web.de) 2002 *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU Library General Public License (LGPL) *
|
||||
* as published by the Free Software Foundation; either version 2 of *
|
||||
* the License, or (at your option) any later version. *
|
||||
* for detail see the LICENCE text file. *
|
||||
* *
|
||||
* FreeCAD 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 FreeCAD; if not, write to the Free Software *
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
||||
* USA *
|
||||
* *
|
||||
* Juergen Riegel 2002 *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#include "PreCompiled.h"
|
||||
#ifndef _PreComp_
|
||||
# include <stdio.h>
|
||||
# if defined (_POSIX_C_SOURCE)
|
||||
# undef _POSIX_C_SOURCE
|
||||
# endif // (re-)defined in pyconfig.h
|
||||
# include <Python.h>
|
||||
#endif
|
||||
|
||||
#include <Base/Console.h>
|
||||
#include <Base/Interpreter.h>
|
||||
|
||||
#include <App/Application.h>
|
||||
#include <Mod/Part/App/TopologyPy.h>
|
||||
|
||||
#include "FeatureImportStep.h"
|
||||
#include "FeatureImportIges.h"
|
||||
|
||||
|
||||
/* registration table */
|
||||
extern struct PyMethodDef Import_methods[];
|
||||
|
||||
|
||||
// python entry
|
||||
#ifdef FC_OS_WIN32
|
||||
# define ModuleExport __declspec(dllexport)
|
||||
#else
|
||||
# define ModuleExport
|
||||
#endif
|
||||
extern "C" {
|
||||
void ModuleExport initImport() {
|
||||
|
||||
(void) Py_InitModule("Import", Import_methods); /* mod name, table ptr */
|
||||
|
||||
// load dependend module
|
||||
Base::Interpreter().loadModule("Part");
|
||||
|
||||
App::AbstractFeatureFactory().AddProducer("ImportStep",new App::AbstractFeatureProducer<Import::FeatureImportStep>);
|
||||
App::AbstractFeatureFactory().AddProducer("ImportIges",new App::AbstractFeatureProducer<Import::FeatureImportIges>);
|
||||
|
||||
Base::Console().Log("Import loaded\n");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
} // extern "C" {
|
||||
118
src/Mod/Import/App/AppImportPy.cpp
Normal file
118
src/Mod/Import/App/AppImportPy.cpp
Normal file
@@ -0,0 +1,118 @@
|
||||
/***************************************************************************
|
||||
* (c) Jürgen Riegel (juergen.riegel@web.de) 2002 *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU Library General Public License (LGPL) *
|
||||
* as published by the Free Software Foundation; either version 2 of *
|
||||
* the License, or (at your option) any later version. *
|
||||
* for detail see the LICENCE text file. *
|
||||
* *
|
||||
* FreeCAD 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 FreeCAD; if not, write to the Free Software *
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
||||
* USA *
|
||||
* *
|
||||
* Juergen Riegel 2002 *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#include "PreCompiled.h"
|
||||
#ifndef _PreComp_
|
||||
# include <stdio.h>
|
||||
# if defined (_POSIX_C_SOURCE)
|
||||
# undef _POSIX_C_SOURCE
|
||||
# endif // (re-)defined in pyconfig.h
|
||||
# include <Python.h>
|
||||
# include <BRep_Builder.hxx>
|
||||
# include <BRepTools.hxx>
|
||||
#endif
|
||||
|
||||
#include <Base/Console.h>
|
||||
#include <Base/Interpreter.h>
|
||||
|
||||
#include <App/Application.h>
|
||||
#include <App/Document.h>
|
||||
#include <App/Feature.h>
|
||||
#include <App/Property.h>
|
||||
#include <Mod/Part/App/TopologyPy.h>
|
||||
|
||||
|
||||
|
||||
/* module functions */
|
||||
static PyObject *
|
||||
open(PyObject *self, PyObject *args)
|
||||
{
|
||||
const char* Name;
|
||||
if (! PyArg_ParseTuple(args, "s",&Name))
|
||||
return NULL;
|
||||
|
||||
Base::Console().Log("Open in Import with %s",Name);
|
||||
|
||||
// extract ending
|
||||
std::string cEnding(Name);
|
||||
unsigned int pos = cEnding.find_last_of('.');
|
||||
if(pos == cEnding.size())
|
||||
Py_Error(PyExc_Exception,"no file ending");
|
||||
cEnding.erase(0,pos+1);
|
||||
|
||||
if(cEnding == "stp" || cEnding == "step")
|
||||
{
|
||||
// create new document and add Import feature
|
||||
App::Document *pcDoc = App::GetApplication().newDocument();
|
||||
App::AbstractFeature *pcFeature = pcDoc->addFeature("ImportStep","Step Import");
|
||||
pcFeature->setPropertyString (Name,"FileName");
|
||||
pcFeature->TouchProperty("FileName");
|
||||
pcDoc->recompute();
|
||||
|
||||
}else if(cEnding == "igs" || cEnding == "iges")
|
||||
{
|
||||
// create new document and add Import feature
|
||||
App::Document *pcDoc = App::GetApplication().newDocument();
|
||||
App::AbstractFeature *pcFeature = pcDoc->addFeature("ImportIges","Iges Import");
|
||||
assert(0);
|
||||
// pcFeature->GetProperty("FileName").Set(Name);
|
||||
pcFeature->TouchProperty("FileName");
|
||||
pcDoc->recompute();
|
||||
|
||||
}else
|
||||
|
||||
Py_Error(PyExc_Exception,"unknown file ending");
|
||||
|
||||
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
/* module functions */
|
||||
static PyObject *
|
||||
save(PyObject *self, PyObject *args)
|
||||
{
|
||||
char* str;
|
||||
|
||||
if (! PyArg_ParseTuple(args, "s",&str))
|
||||
return NULL;
|
||||
|
||||
TopoDS_Shape ResultShape;
|
||||
BRep_Builder aBuilder;
|
||||
|
||||
BRepTools::Read(ResultShape,(const Standard_CString)str,aBuilder);
|
||||
|
||||
return new Part::TopoShapePy(ResultShape); /* convert C -> Python */
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* registration table */
|
||||
struct PyMethodDef Import_methods[] = {
|
||||
{"open", open, 1}, /* method name, C func ptr, always-tuple */
|
||||
{"save", save, 1},
|
||||
|
||||
{NULL, NULL} /* end of table marker */
|
||||
};
|
||||
45
src/Mod/Import/App/CMakeLists.txt
Normal file
45
src/Mod/Import/App/CMakeLists.txt
Normal file
@@ -0,0 +1,45 @@
|
||||
add_definitions(-DFCAppImport -DFC_DEBUG)
|
||||
|
||||
include_directories(
|
||||
# ${CMAKE_SOURCE_DIR}/src
|
||||
# ${OPENCV_INCLUDE_DIR}
|
||||
${OCC_INCLUDE_DIR}
|
||||
# ${PYTHON_INCLUDE_PATH}
|
||||
${ZLIB_INCLUDE_DIR}
|
||||
${XERCES_INCLUDE_DIR})
|
||||
|
||||
if(WIN32)
|
||||
set(Import_LIBS
|
||||
# ${OPENCV_LIBRARIES}
|
||||
# -lTKIGES \
|
||||
# -lTKSTEP \
|
||||
Part
|
||||
FreeCADApp)
|
||||
else(WIN32)
|
||||
set(Import_LIBS
|
||||
# -lTKIGES \
|
||||
# -lTKSTEP \
|
||||
# -lFreeCADBase \
|
||||
# -lFreeCADApp \
|
||||
# -lPart
|
||||
)
|
||||
endif(WIN32)
|
||||
|
||||
set(Import_SRCS
|
||||
AppImport.cpp
|
||||
AppImportPy.cpp
|
||||
FeatureImportIges.cpp
|
||||
FeatureImportIges.h
|
||||
FeatureImportStep.cpp
|
||||
FeatureImportStep.h
|
||||
PreCompiled.cpp
|
||||
PreCompiled.h
|
||||
)
|
||||
|
||||
add_library(Import SHARED ${Import_SRCS})
|
||||
|
||||
target_link_libraries(Import ${Import_LIBS})
|
||||
|
||||
set_target_properties(Import PROPERTIES SUFFIX ".pyd")
|
||||
|
||||
install(TARGETS Import DESTINATION lib)
|
||||
124
src/Mod/Import/App/FeatureImportIges.cpp
Normal file
124
src/Mod/Import/App/FeatureImportIges.cpp
Normal file
@@ -0,0 +1,124 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) Jürgen Riegel (juergen.riegel@web.de) 2002 *
|
||||
* *
|
||||
* 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 <fcntl.h>
|
||||
# include <TopTools_HSequenceOfShape.hxx>
|
||||
# include <IGESControl_Writer.hxx>
|
||||
# include <IGESControl_Reader.hxx>
|
||||
# include <TopoDS_Shape.hxx>
|
||||
# include <TFunction_Logbook.hxx>
|
||||
#endif
|
||||
|
||||
#include <Base/Console.h>
|
||||
#include <Base/Exception.h>
|
||||
#include <Base/Sequencer.h>
|
||||
#include "FeatureImportIges.h"
|
||||
|
||||
|
||||
using namespace Import;
|
||||
|
||||
void FeatureImportIges::InitLabel(const TDF_Label &rcLabel)
|
||||
{
|
||||
addProperty("String","FileName");
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
bool FeaturePartImportStep::MustExecute(void)
|
||||
{
|
||||
Base::Console().Log("PartBoxFeature::MustExecute()\n");
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
Standard_Integer FeatureImportIges::Execute(void)
|
||||
{
|
||||
Base::Console().Log("FeaturePartImportIges::Execute()\n");
|
||||
|
||||
/* cout << GetFloatProperty("x") << endl;
|
||||
cout << GetFloatProperty("y") << endl;
|
||||
cout << GetFloatProperty("z") << endl;
|
||||
cout << GetFloatProperty("l") << endl;
|
||||
cout << GetFloatProperty("h") << endl;
|
||||
cout << GetFloatProperty("w") << endl;*/
|
||||
|
||||
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::Exception("IGES read failed (load file)");
|
||||
|
||||
// check iges-file (memory)
|
||||
//if (!aReader.Check(Standard_True))
|
||||
// Base::Console().Warning( "IGES model contains errors! try loading anyway....\n" );
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
/*
|
||||
void FeatureImportIges::Validate(void)
|
||||
{
|
||||
Base::Console().Log("FeaturePartImportStep::Validate()\n");
|
||||
|
||||
// We validate the object label ( Label() ), all the arguments and the results of the object:
|
||||
log.SetValid(Label(), Standard_True);
|
||||
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
58
src/Mod/Import/App/FeatureImportIges.h
Normal file
58
src/Mod/Import/App/FeatureImportIges.h
Normal file
@@ -0,0 +1,58 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) Jürgen Riegel (juergen.riegel@web.de) 2002 *
|
||||
* *
|
||||
* 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 <Mod/Part/App/PartFeature.h>
|
||||
|
||||
namespace Import
|
||||
{
|
||||
|
||||
|
||||
class FeatureImportIges :public Part::Feature
|
||||
{
|
||||
public:
|
||||
|
||||
virtual void InitLabel(const TDF_Label &rcLabel);
|
||||
|
||||
// virtual bool MustExecute(void);
|
||||
|
||||
virtual Standard_Integer Execute(void);
|
||||
|
||||
// virtual void Validate(void);
|
||||
|
||||
/// Returns the Name/Type of the feature
|
||||
virtual const char *Type(void){return "PartImportIges";};
|
||||
};
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // __FeaturePartImportIges_H__
|
||||
141
src/Mod/Import/App/FeatureImportStep.cpp
Normal file
141
src/Mod/Import/App/FeatureImportStep.cpp
Normal file
@@ -0,0 +1,141 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) Jürgen Riegel (juergen.riegel@web.de) 2002 *
|
||||
* *
|
||||
* 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 <fcntl.h>
|
||||
# include <TopTools_HSequenceOfShape.hxx>
|
||||
# include <STEPControl_Writer.hxx>
|
||||
# include <STEPControl_Reader.hxx>
|
||||
# include <TopoDS_Shape.hxx>
|
||||
# include <TFunction_Logbook.hxx>
|
||||
#endif
|
||||
|
||||
#include <Base/Console.h>
|
||||
#include <Base/Sequencer.h>
|
||||
#include "FeatureImportStep.h"
|
||||
|
||||
|
||||
using namespace Import;
|
||||
|
||||
void FeatureImportStep::InitLabel(const TDF_Label &rcLabel)
|
||||
{
|
||||
addProperty("String","FileName");
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
bool FeaturePartImportStep::MustExecute(void)
|
||||
{
|
||||
Base::Console().Log("PartBoxFeature::MustExecute()\n");
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
Standard_Integer FeatureImportStep::Execute(void)
|
||||
{
|
||||
Base::Console().Log("FeaturePartImportStep::Execute()\n");
|
||||
|
||||
/* cout << GetFloatProperty("x") << endl;
|
||||
cout << GetFloatProperty("y") << endl;
|
||||
cout << GetFloatProperty("z") << endl;
|
||||
cout << GetFloatProperty("l") << endl;
|
||||
cout << GetFloatProperty("h") << endl;
|
||||
cout << GetFloatProperty("w") << endl;*/
|
||||
|
||||
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();
|
||||
//aReader.PrintCheckTransfer (failsonly, IFSelect_ItemsByEntity);
|
||||
for ( Standard_Integer n = 1; n<= nbr; n++)
|
||||
{
|
||||
printf("STEP: Transfering 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: Transfering 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;
|
||||
}
|
||||
|
||||
/*
|
||||
void FeatureImportStep::Validate(void)
|
||||
{
|
||||
Base::Console().Log("FeaturePartImportStep::Validate()\n");
|
||||
|
||||
// We validate the object label ( Label() ), all the arguments and the results of the object:
|
||||
log.SetValid(Label(), Standard_True);
|
||||
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
56
src/Mod/Import/App/FeatureImportStep.h
Normal file
56
src/Mod/Import/App/FeatureImportStep.h
Normal file
@@ -0,0 +1,56 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) Jürgen Riegel (juergen.riegel@web.de) 2002 *
|
||||
* *
|
||||
* 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 <Mod/Part/App/PartFeature.h>
|
||||
|
||||
namespace Import
|
||||
{
|
||||
|
||||
|
||||
class FeatureImportStep :public Part::Feature
|
||||
{
|
||||
public:
|
||||
|
||||
virtual void InitLabel(const TDF_Label &rcLabel);
|
||||
|
||||
virtual Standard_Integer Execute(void);
|
||||
|
||||
// virtual void Validate(void);
|
||||
|
||||
/// Returns the Name/Type of the feature
|
||||
virtual const char *Type(void){return "PartImportStep";};
|
||||
};
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // __FeatureImportStep_H__
|
||||
41
src/Mod/Import/App/Makefile.am
Normal file
41
src/Mod/Import/App/Makefile.am
Normal file
@@ -0,0 +1,41 @@
|
||||
|
||||
lib_LTLIBRARIES=libImport.la
|
||||
|
||||
libImport_la_SOURCES=\
|
||||
AppImport.cpp \
|
||||
AppImportPy.cpp \
|
||||
FeatureImportIges.cpp \
|
||||
FeatureImportIges.h \
|
||||
FeatureImportStep.cpp \
|
||||
FeatureImportStep.h \
|
||||
PreCompiled.cpp \
|
||||
PreCompiled.h
|
||||
|
||||
|
||||
# the library search path.
|
||||
libImport_la_LDFLAGS = -L../../../Base -L../../../App -L../../Part/App $(all_libraries) \
|
||||
-version-info @LIB_CURRENT@:@LIB_REVISION@:@LIB_AGE@
|
||||
libImport_la_CPPFLAGS = -DAppPartExport=
|
||||
|
||||
libImport_la_LIBADD = \
|
||||
-lTKIGES \
|
||||
-lTKSTEP \
|
||||
-lFreeCADBase \
|
||||
-lFreeCADApp \
|
||||
-lPart
|
||||
|
||||
# set the include path found by configure
|
||||
AM_CXXFLAGS = $(all_includes) -I../../../
|
||||
|
||||
libdir = $(prefix)/Mod/Import
|
||||
|
||||
# We need this softlink for Python to load
|
||||
install-data-local:
|
||||
cd $(DESTDIR)$(libdir) && \
|
||||
rm -f Import.so && \
|
||||
$(LN_S) libImport.so Import.so
|
||||
|
||||
EXTRA_DIST = \
|
||||
AppImport.dsp \
|
||||
AppImport.vcproj \
|
||||
Libs.cpp
|
||||
25
src/Mod/Import/App/PreCompiled.cpp
Normal file
25
src/Mod/Import/App/PreCompiled.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) Jürgen Riegel (juergen.riegel@web.de) 2002 *
|
||||
* *
|
||||
* 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"
|
||||
|
||||
247
src/Mod/Import/App/PreCompiled.h
Normal file
247
src/Mod/Import/App/PreCompiled.h
Normal file
@@ -0,0 +1,247 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) Jürgen Riegel (juergen.riegel@web.de) 2002 *
|
||||
* *
|
||||
* 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 __PRECOMPILED__
|
||||
#define __PRECOMPILED__
|
||||
|
||||
#include <FCConfig.h>
|
||||
#ifdef _PreComp_
|
||||
|
||||
/// here get the warnings of to long specifieres disabled (needet for VC6)
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning( disable : 4251 )
|
||||
# pragma warning( disable : 4503 )
|
||||
# pragma warning( disable : 4786 ) // specifier longer then 255 chars
|
||||
#endif
|
||||
|
||||
|
||||
// Importing of App classes
|
||||
|
||||
#ifdef FC_OS_WIN32
|
||||
# define AppPartExport __declspec(dllimport)
|
||||
#else // for Linux
|
||||
# define AppPartExport
|
||||
#endif
|
||||
|
||||
|
||||
// standard
|
||||
#include <list>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <io.h>
|
||||
#include <fcntl.h>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
// Xerces
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
|
||||
// OpenCasCade =====================================================================================
|
||||
// Base
|
||||
#include <Standard_Failure.hxx>
|
||||
#include <Standard_GUID.hxx>
|
||||
#include <Standard_AbortiveTransaction.hxx>
|
||||
#include <Standard_Address.hxx>
|
||||
#include <Standard_AncestorIterator.hxx>
|
||||
#include <Standard_BasicMap.hxx>
|
||||
#include <Standard_BasicMapIterator.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Byte.hxx>
|
||||
#include <Standard_Character.hxx>
|
||||
#include <Standard_ConstructionError.hxx>
|
||||
#include <Standard_Container.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
#include <Standard_ctype.hxx>
|
||||
#include <Standard_DBHandle.hxx>
|
||||
#include <Standard_DefineHandle.hxx>
|
||||
#include <Standard_DimensionError.hxx>
|
||||
#include <Standard_DimensionMismatch.hxx>
|
||||
#include <Standard_DivideByZero.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
#include <Standard_ErrorHandler.hxx>
|
||||
#include <Standard_ExtCharacter.hxx>
|
||||
#include <Standard_ExtString.hxx>
|
||||
#include <Standard_Failure.hxx>
|
||||
#include <Standard_ForMapOfTypes.hxx>
|
||||
#include <Standard_GUID.hxx>
|
||||
#include <Standard_ImmutableObject.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_InternalType.hxx>
|
||||
#include <Standard_IStream.hxx>
|
||||
#include <Standard_KindOfType.hxx>
|
||||
#include <Standard_LicenseError.hxx>
|
||||
#include <Standard_LicenseNotFound.hxx>
|
||||
#include <Standard_Macro.hxx>
|
||||
#include <Standard_MapOfTypes.hxx>
|
||||
#include <Standard_math.hxx>
|
||||
#include <Standard_MultiplyDefined.hxx>
|
||||
#include <Standard_MyMapOfStringsHasher.hxx>
|
||||
#include <Standard_MyMapOfTypes.hxx>
|
||||
#include <Standard_NegativeValue.hxx>
|
||||
#include <Standard_NoMoreObject.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Standard_NullObject.hxx>
|
||||
#include <Standard_NullValue.hxx>
|
||||
#include <Standard_NumericError.hxx>
|
||||
#include <Standard_OId.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
#include <Standard_OutOfMemory.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_Overflow.hxx>
|
||||
#include <Standard_Persistent.hxx>
|
||||
#include <Standard_Persistent_proto.hxx>
|
||||
#include <Standard_PForMapOfTypes.hxx>
|
||||
#include <Standard_PrimitiveTypes.hxx>
|
||||
#include <Standard_ProgramError.hxx>
|
||||
#include <Standard_RangeError.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_ShortReal.hxx>
|
||||
#include <Standard_SStream.hxx>
|
||||
#include <Standard_Static.hxx>
|
||||
#include <Standard_Storable.hxx>
|
||||
#include <Standard_Stream.hxx>
|
||||
#include <Standard_String.hxx>
|
||||
#include <Standard_theForMapOfTypes.hxx>
|
||||
#include <Standard_TooManyUsers.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <Standard_Transient_proto.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <Standard_TypeDef.hxx>
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#include <Standard_Underflow.hxx>
|
||||
#include <Standard_UUID.hxx>
|
||||
#include <Standard_WayOfLife.hxx>
|
||||
#include <Quantity_Date.hxx>
|
||||
|
||||
|
||||
#include <TCollection_ExtendedString.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <TColStd_SequenceOfExtendedString.hxx>
|
||||
// OCAF
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TDF_ChildIterator.hxx>
|
||||
#include <TDF_Tool.hxx>
|
||||
#include <TDF_ListIteratorOfAttributeList.hxx>
|
||||
#include <TDocStd_Application.hxx>
|
||||
#include <TDataStd_Real.hxx>
|
||||
#include <TDataStd_Integer.hxx>
|
||||
#include <TDataStd_Name.hxx>
|
||||
#include <TDataStd_RealArray.hxx>
|
||||
#include <TDataStd_IntegerArray.hxx>
|
||||
#include <TDataStd_Comment.hxx>
|
||||
|
||||
#include <BRepBuilderAPI.hxx>
|
||||
|
||||
#include <BRepTools.hxx>
|
||||
#include <Standard_DefineHandle.hxx>
|
||||
#include <DsgPrs_LengthPresentation.hxx>
|
||||
#include <GCE2d_MakeSegment.hxx>
|
||||
#include <GCPnts_TangentialDeflection.hxx>
|
||||
#include <Geom_Axis2Placement.hxx>
|
||||
#include <Geom_CartesianPoint.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <Geom2d_BezierCurve.hxx>
|
||||
#include <Geom2d_BSplineCurve.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom2d_TrimmedCurve.hxx>
|
||||
#include <Geom2dAdaptor_Curve.hxx>
|
||||
#include <GeomAbs_CurveType.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
#include <GeomTools_Curve2dSet.hxx>
|
||||
#include <gp_Ax2d.hxx>
|
||||
#include <gp_Circ2d.hxx>
|
||||
#include <gp_Dir2d.hxx>
|
||||
#include <gp_Lin2d.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <OSD_Environment.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Quantity_Factor.hxx>
|
||||
#include <Quantity_Length.hxx>
|
||||
#include <Quantity_NameOfColor.hxx>
|
||||
#include <Quantity_PhysicalQuantity.hxx>
|
||||
#include <Quantity_PlaneAngle.hxx>
|
||||
#include <Quantity_TypeOfColor.hxx>
|
||||
#include <ShapeSchema.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
#include <Standard_ErrorHandler.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_IStream.hxx>
|
||||
#include <Standard_Macro.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
#include <TColgp_HArray1OfPnt2d.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <TColStd_HSequenceOfTransient.hxx>
|
||||
#include <TColStd_MapIteratorOfMapOfTransient.hxx>
|
||||
#include <TColStd_MapOfTransient.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Compound.hxx>
|
||||
#include <TopoDS_ListIteratorOfListOfShape.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Solid.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
#include <TopTools_HSequenceOfShape.hxx>
|
||||
#include <UnitsAPI.hxx>
|
||||
#include <BRepPrimAPI_MakeBox.hxx>
|
||||
#include <BRepPrimAPI_MakeCylinder.hxx>
|
||||
|
||||
// OCAF
|
||||
#include <TDocStd_Document.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TDF_Reference.hxx>
|
||||
#include <TDF_ChildIterator.hxx>
|
||||
#include <TNaming_NamedShape.hxx>
|
||||
#include <TNaming_Builder.hxx>
|
||||
#include <TDataStd_Real.hxx>
|
||||
#include <TFunction_Logbook.hxx>
|
||||
#include <TDataStd_Name.hxx>
|
||||
#include <TFunction_DriverTable.hxx>
|
||||
#include <TFunction_Function.hxx>
|
||||
#include <TDataStd_Integer.hxx>
|
||||
|
||||
// IO
|
||||
#include <IGESControl_Controller.hxx>
|
||||
#include <IGESControl_Writer.hxx>
|
||||
#include <IGESControl_Reader.hxx>
|
||||
#include <STEPControl_Writer.hxx>
|
||||
#include <STEPControl_Reader.hxx>
|
||||
|
||||
|
||||
#endif //_PreComp_
|
||||
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user