diff --git a/src/Mod/Assembly/App/AppAssembly.cpp b/src/Mod/Assembly/App/AppAssembly.cpp index 5291e5672..3a2434acd 100644 --- a/src/Mod/Assembly/App/AppAssembly.cpp +++ b/src/Mod/Assembly/App/AppAssembly.cpp @@ -39,12 +39,12 @@ PyDoc_STRVAR(module_Assembly_doc, /* Python entry */ extern "C" { -void AppAssemblyExport initAssembly() +void AssemblyExport initAssembly() { // load dependend module try { - Base::Interpreter().loadModule("Part"); - Base::Interpreter().loadModule("PartDesign"); + Base::Interpreter().runString("import Part"); + //Base::Interpreter().runString("import PartDesign"); } catch(const Base::Exception& e) { PyErr_SetString(PyExc_ImportError, e.what()); diff --git a/src/Mod/Assembly/App/CMakeLists.txt b/src/Mod/Assembly/App/CMakeLists.txt index 50537fd16..11eb37cc0 100644 --- a/src/Mod/Assembly/App/CMakeLists.txt +++ b/src/Mod/Assembly/App/CMakeLists.txt @@ -1,25 +1,78 @@ include_directories( ${CMAKE_SOURCE_DIR}/src + ${CMAKE_BINARY_DIR}/src + ${CMAKE_CURRENT_BINARY_DIR} ${Boost_INCLUDE_DIRS} ${OCC_INCLUDE_DIR} ${PYTHON_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR} ${XercesC_INCLUDE_DIRS} - # ${ODE_INCLUDE_DIRS} + ${ODE_INCLUDE_DIRS} ) set(Assembly_LIBS -# ${ODE_LIBRARIES} + ${ODE_LIBRARIES} + ${OCC_LIBRARIES} + Part FreeCADApp ) -SET(Assembly_SRCS +generate_from_xml(ItemPy) +generate_from_xml(ItemAssemblyPy) +generate_from_xml(ItemPartPy) +generate_from_xml(ConstraintGroupPy) + +SET(Features_SRCS + Item.cpp + Item.h + ItemPart.cpp + ItemPart.h + ItemAssembly.cpp + ItemAssembly.h + Constraint.cpp + Constraint.h + ConstraintGroup.cpp + ConstraintGroup.h + ConstraintAngle.cpp + ConstraintAngle.h + ConstraintAxis.cpp + ConstraintAxis.h + ConstraintContact.cpp + ConstraintContact.h + ConstraintFix.cpp + ConstraintFix.h + ConstraintOffset.cpp + ConstraintOffset.h +) +SOURCE_GROUP("Features" FILES ${Features_SRCS}) + +SET(Module_SRCS AppAssembly.cpp AppAssemblyPy.cpp PreCompiled.cpp PreCompiled.h ) +SOURCE_GROUP("Module" FILES ${Module_SRCS}) + +SET(Python_SRCS + ItemPy.xml + ItemPyImp.cpp + ItemAssemblyPy.xml + ItemAssemblyPyImp.cpp + ItemPartPy.xml + ItemPartPyImp.cpp + ConstraintGroupPy.xml + ConstraintGroupPyImp.cpp +) +SOURCE_GROUP("Python" FILES ${Python_SRCS}) + +SET(Assembly_SRCS + ${Features_SRCS} + ${Python_SRCS} + ${Module_SRCS} +) + add_library(Assembly SHARED ${Assembly_SRCS}) target_link_libraries(Assembly ${Assembly_LIBS}) diff --git a/src/Mod/Assembly/App/Constraint.cpp b/src/Mod/Assembly/App/Constraint.cpp new file mode 100644 index 000000000..01aa71c5a --- /dev/null +++ b/src/Mod/Assembly/App/Constraint.cpp @@ -0,0 +1,60 @@ +/*************************************************************************** + * Copyright (c) 2012 Juergen 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_ +#endif + +#include + +#include "Constraint.h" + + +using namespace Assembly; + +namespace Assembly { + + +PROPERTY_SOURCE(Assembly::Constraint, App::DocumentObject) + +Constraint::Constraint() +{ + ADD_PROPERTY(First, (0)); + ADD_PROPERTY(Second,(0)); +} + +short Constraint::mustExecute() const +{ + //if (Sketch.isTouched() || + // Length.isTouched()) + // return 1; + return 0; +} + +App::DocumentObjectExecReturn *Constraint::execute(void) +{ + + return App::DocumentObject::StdReturn; +} + +} \ No newline at end of file diff --git a/src/Mod/Assembly/App/Constraint.h b/src/Mod/Assembly/App/Constraint.h new file mode 100644 index 000000000..28b8fa086 --- /dev/null +++ b/src/Mod/Assembly/App/Constraint.h @@ -0,0 +1,59 @@ +/*************************************************************************** + * Copyright (c) 2012 Juergen 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 Assembly_Constraint_H +#define Assembly_Constraint_H + +#include +#include + + +namespace Assembly +{ + +class AssemblyExport Constraint : public App::DocumentObject +{ + PROPERTY_HEADER(Assembly::Constraint); + +public: + Constraint(); + + App::PropertyLinkSub First; + App::PropertyLinkSub Second; + + /** @name methods override feature */ + //@{ + /// recalculate the feature + App::DocumentObjectExecReturn *execute(void); + short mustExecute() const; + /// returns the type name of the view provider + //const char* getViewProviderName(void) const { + // return "PartDesignGui::ViewProviderConstraint"; + //} + //@} +}; + +} //namespace Assembly + + +#endif // Assembly_Constraint_H diff --git a/src/Mod/Assembly/App/ConstraintAngle.cpp b/src/Mod/Assembly/App/ConstraintAngle.cpp new file mode 100644 index 000000000..52d383375 --- /dev/null +++ b/src/Mod/Assembly/App/ConstraintAngle.cpp @@ -0,0 +1,59 @@ +/*************************************************************************** + * Copyright (c) 2010 Juergen 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_ +#endif + +#include + +#include "ConstraintAngle.h" + + +using namespace Assembly; + +namespace Assembly { + + +PROPERTY_SOURCE(Assembly::ConstraintAngle, Assembly::Constraint) + +ConstraintAngle::ConstraintAngle() +{ + ADD_PROPERTY(Angle,(0)); +} + +short ConstraintAngle::mustExecute() const +{ + //if (Sketch.isTouched() || + // Length.isTouched()) + // return 1; + return 0; +} + +App::DocumentObjectExecReturn *ConstraintAngle::execute(void) +{ + + return App::DocumentObject::StdReturn; +} + +} \ No newline at end of file diff --git a/src/Mod/Assembly/App/ConstraintAngle.h b/src/Mod/Assembly/App/ConstraintAngle.h new file mode 100644 index 000000000..13b2ae68a --- /dev/null +++ b/src/Mod/Assembly/App/ConstraintAngle.h @@ -0,0 +1,58 @@ +/*************************************************************************** + * Copyright (c) 2010 Juergen 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 Assembly_ConstraintAngle_H +#define Assembly_ConstraintAngle_H + +#include +#include "Constraint.h" + + +namespace Assembly +{ + +class AssemblyExport ConstraintAngle : public Assembly::Constraint +{ + PROPERTY_HEADER(Assembly::ConstraintAngle); + +public: + ConstraintAngle(); + + App::PropertyFloat Angle; + + /** @name methods override feature */ + //@{ + /// recalculate the feature + App::DocumentObjectExecReturn *execute(void); + short mustExecute() const; + /// returns the type name of the view provider + //const char* getViewProviderName(void) const { + // return "PartDesignGui::ViewProviderConstraintAngle"; + //} + //@} +}; + +} //namespace Assembly + + +#endif // Assembly_ConstraintAngle_H diff --git a/src/Mod/Assembly/App/ConstraintAxis.cpp b/src/Mod/Assembly/App/ConstraintAxis.cpp new file mode 100644 index 000000000..b2ed9ab40 --- /dev/null +++ b/src/Mod/Assembly/App/ConstraintAxis.cpp @@ -0,0 +1,59 @@ +/*************************************************************************** + * Copyright (c) 2012 Juergen 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_ +#endif + +#include + +#include "ConstraintAxis.h" + + +using namespace Assembly; + +namespace Assembly { + + +PROPERTY_SOURCE(Assembly::ConstraintAxis, Assembly::Constraint) + +ConstraintAxis::ConstraintAxis() +{ + +} + +short ConstraintAxis::mustExecute() const +{ + //if (Sketch.isTouched() || + // Length.isTouched()) + // return 1; + return 0; +} + +App::DocumentObjectExecReturn *ConstraintAxis::execute(void) +{ + + return App::DocumentObject::StdReturn; +} + +} \ No newline at end of file diff --git a/src/Mod/Assembly/App/ConstraintAxis.h b/src/Mod/Assembly/App/ConstraintAxis.h new file mode 100644 index 000000000..c776ce892 --- /dev/null +++ b/src/Mod/Assembly/App/ConstraintAxis.h @@ -0,0 +1,57 @@ +/*************************************************************************** + * Copyright (c) 2012 Juergen 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 Assembly_ConstraintAxis_H +#define Assembly_ConstraintAxis_H + +#include +#include "Constraint.h" + + +namespace Assembly +{ + +class AssemblyExport ConstraintAxis : public Assembly::Constraint +{ + PROPERTY_HEADER(Assembly::ConstraintAxis); + +public: + ConstraintAxis(); + + + /** @name methods override feature */ + //@{ + /// recalculate the feature + App::DocumentObjectExecReturn *execute(void); + short mustExecute() const; + /// returns the type name of the view provider + //const char* getViewProviderName(void) const { + // return "PartDesignGui::ViewProviderConstraintAxis"; + //} + //@} +}; + +} //namespace Assembly + + +#endif // Assembly_ConstraintAxis_H diff --git a/src/Mod/Assembly/App/ConstraintContact.cpp b/src/Mod/Assembly/App/ConstraintContact.cpp new file mode 100644 index 000000000..94c28bc71 --- /dev/null +++ b/src/Mod/Assembly/App/ConstraintContact.cpp @@ -0,0 +1,59 @@ +/*************************************************************************** + * Copyright (c) 2012 Juergen 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_ +#endif + +#include + +#include "ConstraintContact.h" + + +using namespace Assembly; + +namespace Assembly { + + +PROPERTY_SOURCE(Assembly::ConstraintContact, Assembly::Constraint) + +ConstraintContact::ConstraintContact() +{ + +} + +short ConstraintContact::mustExecute() const +{ + //if (Sketch.isTouched() || + // Length.isTouched()) + // return 1; + return 0; +} + +App::DocumentObjectExecReturn *ConstraintContact::execute(void) +{ + + return App::DocumentObject::StdReturn; +} + +} \ No newline at end of file diff --git a/src/Mod/Assembly/App/ConstraintContact.h b/src/Mod/Assembly/App/ConstraintContact.h new file mode 100644 index 000000000..659bf4000 --- /dev/null +++ b/src/Mod/Assembly/App/ConstraintContact.h @@ -0,0 +1,57 @@ +/*************************************************************************** + * Copyright (c) 2012 Juergen 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 Assembly_ConstraintContact_H +#define Assembly_ConstraintContact_H + +#include +#include "Constraint.h" + + +namespace Assembly +{ + +class AssemblyExport ConstraintContact : public Assembly::Constraint +{ + PROPERTY_HEADER(Assembly::ConstraintContact); + +public: + ConstraintContact(); + + + /** @name methods override feature */ + //@{ + /// recalculate the feature + App::DocumentObjectExecReturn *execute(void); + short mustExecute() const; + /// returns the type name of the view provider + //const char* getViewProviderName(void) const { + // return "PartDesignGui::ViewProviderConstraintContact"; + //} + //@} +}; + +} //namespace Assembly + + +#endif // Assembly_ConstraintContact_H diff --git a/src/Mod/Assembly/App/ConstraintFix.cpp b/src/Mod/Assembly/App/ConstraintFix.cpp new file mode 100644 index 000000000..033222172 --- /dev/null +++ b/src/Mod/Assembly/App/ConstraintFix.cpp @@ -0,0 +1,59 @@ +/*************************************************************************** + * Copyright (c) 2010 Juergen 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_ +#endif + +#include + +#include "ConstraintFix.h" + + +using namespace Assembly; + +namespace Assembly { + + +PROPERTY_SOURCE(Assembly::ConstraintFix, Assembly::Constraint) + +ConstraintFix::ConstraintFix() +{ + +} + +short ConstraintFix::mustExecute() const +{ + //if (Sketch.isTouched() || + // Length.isTouched()) + // return 1; + return 0; +} + +App::DocumentObjectExecReturn *ConstraintFix::execute(void) +{ + + return App::DocumentObject::StdReturn; +} + +} \ No newline at end of file diff --git a/src/Mod/Assembly/App/ConstraintFix.h b/src/Mod/Assembly/App/ConstraintFix.h new file mode 100644 index 000000000..c2b28035b --- /dev/null +++ b/src/Mod/Assembly/App/ConstraintFix.h @@ -0,0 +1,56 @@ +/*************************************************************************** + * Copyright (c) 2010 Juergen 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 Assembly_ConstraintFix_H +#define Assembly_ConstraintFix_H + +#include +#include "Constraint.h" + + +namespace Assembly +{ + +class AssemblyExport ConstraintFix : public Assembly::Constraint +{ + PROPERTY_HEADER(Assembly::ConstraintFix); + +public: + ConstraintFix(); + + /** @name methods override feature */ + //@{ + /// recalculate the feature + App::DocumentObjectExecReturn *execute(void); + short mustExecute() const; + /// returns the type name of the view provider + //const char* getViewProviderName(void) const { + // return "PartDesignGui::ViewProviderConstraintFix"; + //} + //@} +}; + +} //namespace Assembly + + +#endif // Assembly_ConstraintFix_H diff --git a/src/Mod/Assembly/App/ConstraintGroup.cpp b/src/Mod/Assembly/App/ConstraintGroup.cpp new file mode 100644 index 000000000..b27746f7e --- /dev/null +++ b/src/Mod/Assembly/App/ConstraintGroup.cpp @@ -0,0 +1,59 @@ +/*************************************************************************** + * Copyright (c) 2010 Juergen 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_ +#endif + +#include + +#include "ConstraintGroup.h" + + +using namespace Assembly; + +namespace Assembly { + + +PROPERTY_SOURCE(Assembly::ConstraintGroup, App::DocumentObject) + +ConstraintGroup::ConstraintGroup() +{ + ADD_PROPERTY(Constraints,(0)); +} + +short ConstraintGroup::mustExecute() const +{ + //if (Sketch.isTouched() || + // Length.isTouched()) + // return 1; + return 0; +} + +App::DocumentObjectExecReturn *ConstraintGroup::execute(void) +{ + + return App::DocumentObject::StdReturn; +} + +} \ No newline at end of file diff --git a/src/Mod/Assembly/App/ConstraintGroup.h b/src/Mod/Assembly/App/ConstraintGroup.h new file mode 100644 index 000000000..15406dacd --- /dev/null +++ b/src/Mod/Assembly/App/ConstraintGroup.h @@ -0,0 +1,58 @@ +/*************************************************************************** + * Copyright (c) 2010 Juergen 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 Assembly_ConstraintGroup_H +#define Assembly_ConstraintGroup_H + +#include +#include + + +namespace Assembly +{ + +class AssemblyExport ConstraintGroup : public App::DocumentObject +{ + PROPERTY_HEADER(Assembly::ConstraintGroup); + +public: + ConstraintGroup(); + + App::PropertyLinkList Constraints; + + /** @name methods override feature */ + //@{ + /// recalculate the feature + App::DocumentObjectExecReturn *execute(void); + short mustExecute() const; + /// returns the type name of the view provider + //const char* getViewProviderName(void) const { + // return "PartDesignGui::ViewProviderConstraintGroup"; + //} + //@} +}; + +} //namespace Assembly + + +#endif // Assembly_ConstraintGroup_H diff --git a/src/Mod/Assembly/App/ConstraintGroupPy.xml b/src/Mod/Assembly/App/ConstraintGroupPy.xml new file mode 100644 index 000000000..6ff8732e5 --- /dev/null +++ b/src/Mod/Assembly/App/ConstraintGroupPy.xml @@ -0,0 +1,17 @@ + + + + + + Base class of all objects in Assembly + + + diff --git a/src/Mod/Assembly/App/ConstraintGroupPyImp.cpp b/src/Mod/Assembly/App/ConstraintGroupPyImp.cpp new file mode 100644 index 000000000..0fbcfaff1 --- /dev/null +++ b/src/Mod/Assembly/App/ConstraintGroupPyImp.cpp @@ -0,0 +1,34 @@ + +#include "PreCompiled.h" + +#include "Mod/Assembly/App/ConstraintGroup.h" + +// inclusion of the generated files (generated out of ConstraintGroupPy.xml) +#include "ConstraintGroupPy.h" +#include "ConstraintGroupPy.cpp" + +using namespace Assembly; + +// returns a string which represents the object e.g. when printed in python +std::string ConstraintGroupPy::representation(void) const +{ + return std::string(""); +} + + + + + + + +PyObject *ConstraintGroupPy::getCustomAttributes(const char* /*attr*/) const +{ + return 0; +} + +int ConstraintGroupPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/) +{ + return 0; +} + + diff --git a/src/Mod/Assembly/App/ConstraintOffset.cpp b/src/Mod/Assembly/App/ConstraintOffset.cpp new file mode 100644 index 000000000..e9b62e957 --- /dev/null +++ b/src/Mod/Assembly/App/ConstraintOffset.cpp @@ -0,0 +1,59 @@ +/*************************************************************************** + * Copyright (c) 2010 Juergen 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_ +#endif + +#include + +#include "ConstraintOffset.h" + + +using namespace Assembly; + +namespace Assembly { + + +PROPERTY_SOURCE(Assembly::ConstraintOffset, Assembly::Constraint) + +ConstraintOffset::ConstraintOffset() +{ + ADD_PROPERTY(Offset,(0)); +} + +short ConstraintOffset::mustExecute() const +{ + //if (Sketch.isTouched() || + // Length.isTouched()) + // return 1; + return 0; +} + +App::DocumentObjectExecReturn *ConstraintOffset::execute(void) +{ + + return App::DocumentObject::StdReturn; +} + +} \ No newline at end of file diff --git a/src/Mod/Assembly/App/ConstraintOffset.h b/src/Mod/Assembly/App/ConstraintOffset.h new file mode 100644 index 000000000..26cdd20a3 --- /dev/null +++ b/src/Mod/Assembly/App/ConstraintOffset.h @@ -0,0 +1,58 @@ +/*************************************************************************** + * Copyright (c) 2010 Juergen 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 Assembly_ConstraintOffset_H +#define Assembly_ConstraintOffset_H + +#include +#include "Constraint.h" + + +namespace Assembly +{ + +class AssemblyExport ConstraintOffset : public Assembly::Constraint +{ + PROPERTY_HEADER(Assembly::ConstraintOffset); + +public: + ConstraintOffset(); + + App::PropertyFloat Offset; + + /** @name methods override feature */ + //@{ + /// recalculate the feature + App::DocumentObjectExecReturn *execute(void); + short mustExecute() const; + /// returns the type name of the view provider + //const char* getViewProviderName(void) const { + // return "PartDesignGui::ViewProviderConstraintOffset"; + //} + //@} +}; + +} //namespace PartDesign + + +#endif // PART_ConstraintOffset_H diff --git a/src/Mod/Assembly/App/Item.cpp b/src/Mod/Assembly/App/Item.cpp new file mode 100644 index 000000000..b77bb871e --- /dev/null +++ b/src/Mod/Assembly/App/Item.cpp @@ -0,0 +1,59 @@ +/*************************************************************************** + * Copyright (c) 2010 Juergen 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_ +#endif + +#include + +#include "Item.h" + + +using namespace Assembly; + +namespace Assembly { + + +PROPERTY_SOURCE(Assembly::Item, Part::Feature) + +Item::Item() +{ + ADD_PROPERTY(Model,(0)); +} + +short Item::mustExecute() const +{ + //if (Sketch.isTouched() || + // Length.isTouched()) + // return 1; + return 0; +} + +App::DocumentObjectExecReturn *Item::execute(void) +{ + + return App::DocumentObject::StdReturn; +} + +} \ No newline at end of file diff --git a/src/Mod/Assembly/App/Item.h b/src/Mod/Assembly/App/Item.h new file mode 100644 index 000000000..15f4f8af0 --- /dev/null +++ b/src/Mod/Assembly/App/Item.h @@ -0,0 +1,59 @@ +/*************************************************************************** + * Copyright (c) 2010 Juergen 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 Assembly_Item_H +#define Assembly_Item_H + +#include +#include + + +namespace Assembly +{ + +class AssemblyExport Item : public Part::Feature +{ + PROPERTY_HEADER(Assembly::Item); + +public: + Item(); + + App::PropertyLinkList Model; + App::PropertyLink Tip; + + /** @name methods override feature */ + //@{ + /// recalculate the feature + App::DocumentObjectExecReturn *execute(void); + short mustExecute() const; + /// returns the type name of the view provider + //const char* getViewProviderName(void) const { + // return "PartDesignGui::ViewProviderItem"; + //} + //@} +}; + +} //namespace PartDesign + + +#endif // PART_Item_H diff --git a/src/Mod/Assembly/App/ItemAssembly.cpp b/src/Mod/Assembly/App/ItemAssembly.cpp new file mode 100644 index 000000000..ce43002ec --- /dev/null +++ b/src/Mod/Assembly/App/ItemAssembly.cpp @@ -0,0 +1,59 @@ +/*************************************************************************** + * Copyright (c) 2012 Juergen 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_ +#endif + +#include + +#include "ItemAssembly.h" + + +using namespace Assembly; + +namespace Assembly { + + +PROPERTY_SOURCE(Assembly::ItemAssembly, Assembly::Item) + +ItemAssembly::ItemAssembly() +{ + ADD_PROPERTY(Items,(0)); +} + +short ItemAssembly::mustExecute() const +{ + //if (Sketch.isTouched() || + // Length.isTouched()) + // return 1; + return 0; +} + +App::DocumentObjectExecReturn *ItemAssembly::execute(void) +{ + + return App::DocumentObject::StdReturn; +} + +} \ No newline at end of file diff --git a/src/Mod/Assembly/App/ItemAssembly.h b/src/Mod/Assembly/App/ItemAssembly.h new file mode 100644 index 000000000..86b3ef242 --- /dev/null +++ b/src/Mod/Assembly/App/ItemAssembly.h @@ -0,0 +1,58 @@ +/*************************************************************************** + * Copyright (c) 2012 Juergen 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 ItemAssembly_ItemAssembly_H +#define ItemAssembly_ItemAssembly_H + +#include +#include "Item.h" + + +namespace Assembly +{ + +class AssemblyExport ItemAssembly : public Assembly::Item +{ + PROPERTY_HEADER(Assembly::ItemAssembly); + +public: + ItemAssembly(); + + App::PropertyLinkList Items; + + /** @name methods override feature */ + //@{ + /// recalculate the feature + App::DocumentObjectExecReturn *execute(void); + short mustExecute() const; + /// returns the type name of the view provider + //const char* getViewProviderName(void) const { + // return "PartDesignGui::ViewProviderItemAssembly"; + //} + //@} +}; + +} //namespace Assembly + + +#endif // Assembly_ItemAssembly_H diff --git a/src/Mod/Assembly/App/ItemAssemblyPy.xml b/src/Mod/Assembly/App/ItemAssemblyPy.xml new file mode 100644 index 000000000..e2f560946 --- /dev/null +++ b/src/Mod/Assembly/App/ItemAssemblyPy.xml @@ -0,0 +1,17 @@ + + + + + + Base class of all objects in Assembly + + + diff --git a/src/Mod/Assembly/App/ItemAssemblyPyImp.cpp b/src/Mod/Assembly/App/ItemAssemblyPyImp.cpp new file mode 100644 index 000000000..7542d312f --- /dev/null +++ b/src/Mod/Assembly/App/ItemAssemblyPyImp.cpp @@ -0,0 +1,34 @@ + +#include "PreCompiled.h" + +#include "Mod/Assembly/App/ItemAssembly.h" + +// inclusion of the generated files (generated out of ItemAssemblyPy.xml) +#include "ItemAssemblyPy.h" +#include "ItemAssemblyPy.cpp" + +using namespace Assembly; + +// returns a string which represents the object e.g. when printed in python +std::string ItemAssemblyPy::representation(void) const +{ + return std::string(""); +} + + + + + + + +PyObject *ItemAssemblyPy::getCustomAttributes(const char* /*attr*/) const +{ + return 0; +} + +int ItemAssemblyPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/) +{ + return 0; +} + + diff --git a/src/Mod/Assembly/App/ItemPart.cpp b/src/Mod/Assembly/App/ItemPart.cpp new file mode 100644 index 000000000..85e1db9e1 --- /dev/null +++ b/src/Mod/Assembly/App/ItemPart.cpp @@ -0,0 +1,59 @@ +/*************************************************************************** + * Copyright (c) 2012 Juergen 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_ +#endif + +#include + +#include "ItemPart.h" + + +using namespace Assembly; + +namespace Assembly { + + +PROPERTY_SOURCE(Assembly::ItemPart, Assembly::Item) + +ItemPart::ItemPart() +{ + ADD_PROPERTY(Model,(0)); +} + +short ItemPart::mustExecute() const +{ + //if (Sketch.isTouched() || + // Length.isTouched()) + // return 1; + return 0; +} + +App::DocumentObjectExecReturn *ItemPart::execute(void) +{ + + return App::DocumentObject::StdReturn; +} + +} \ No newline at end of file diff --git a/src/Mod/Assembly/App/ItemPart.h b/src/Mod/Assembly/App/ItemPart.h new file mode 100644 index 000000000..80acb8303 --- /dev/null +++ b/src/Mod/Assembly/App/ItemPart.h @@ -0,0 +1,58 @@ +/*************************************************************************** + * Copyright (c) 2012 Juergen 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 Assembly_ItemPart_H +#define Assembly_ItemPart_H + +#include +#include "Item.h" + + +namespace Assembly +{ + +class AssemblyExport ItemPart : public Assembly::Item +{ + PROPERTY_HEADER(Assembly::ItemPart); + +public: + ItemPart(); + + App::PropertyLink Model; + + /** @name methods override feature */ + //@{ + /// recalculate the feature + App::DocumentObjectExecReturn *execute(void); + short mustExecute() const; + /// returns the type name of the view provider + //const char* getViewProviderName(void) const { + // return "ItemPartDesignGui::ViewProviderItemPart"; + //} + //@} +}; + +} //namespace Assembly + + +#endif // Assembly_ItemPart_H diff --git a/src/Mod/Assembly/App/ItemPartPy.xml b/src/Mod/Assembly/App/ItemPartPy.xml new file mode 100644 index 000000000..02d47416f --- /dev/null +++ b/src/Mod/Assembly/App/ItemPartPy.xml @@ -0,0 +1,17 @@ + + + + + + Base class of all objects in Assembly + + + diff --git a/src/Mod/Assembly/App/ItemPartPyImp.cpp b/src/Mod/Assembly/App/ItemPartPyImp.cpp new file mode 100644 index 000000000..8d0792248 --- /dev/null +++ b/src/Mod/Assembly/App/ItemPartPyImp.cpp @@ -0,0 +1,34 @@ + +#include "PreCompiled.h" + +#include "Mod/Assembly/App/ItemPart.h" + +// inclusion of the generated files (generated out of ItemPartPy.xml) +#include "ItemPartPy.h" +#include "ItemPartPy.cpp" + +using namespace Assembly; + +// returns a string which represents the object e.g. when printed in python +std::string ItemPartPy::representation(void) const +{ + return std::string(""); +} + + + + + + + +PyObject *ItemPartPy::getCustomAttributes(const char* /*attr*/) const +{ + return 0; +} + +int ItemPartPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/) +{ + return 0; +} + + diff --git a/src/Mod/Assembly/App/ItemPy.xml b/src/Mod/Assembly/App/ItemPy.xml new file mode 100644 index 000000000..d9bca2eea --- /dev/null +++ b/src/Mod/Assembly/App/ItemPy.xml @@ -0,0 +1,17 @@ + + + + + + Base class of all objects in Assembly + + + diff --git a/src/Mod/Assembly/App/ItemPyImp.cpp b/src/Mod/Assembly/App/ItemPyImp.cpp new file mode 100644 index 000000000..b2f591856 --- /dev/null +++ b/src/Mod/Assembly/App/ItemPyImp.cpp @@ -0,0 +1,34 @@ + +#include "PreCompiled.h" + +#include "Mod/Assembly/App/Item.h" + +// inclusion of the generated files (generated out of ItemPy.xml) +#include "ItemPy.h" +#include "ItemPy.cpp" + +using namespace Assembly; + +// returns a string which represents the object e.g. when printed in python +std::string ItemPy::representation(void) const +{ + return std::string(""); +} + + + + + + + +PyObject *ItemPy::getCustomAttributes(const char* /*attr*/) const +{ + return 0; +} + +int ItemPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/) +{ + return 0; +} + + diff --git a/src/Mod/Assembly/App/PreCompiled.h b/src/Mod/Assembly/App/PreCompiled.h index ef82449af..8dfc4eb52 100644 --- a/src/Mod/Assembly/App/PreCompiled.h +++ b/src/Mod/Assembly/App/PreCompiled.h @@ -28,11 +28,11 @@ // Exporting of App classes #ifdef FC_OS_WIN32 -# define AppAssemblyExport __declspec(dllexport) +# define AssemblyExport __declspec(dllexport) # define PartExport __declspec(dllimport) # define MeshExport __declspec(dllimport) #else // for Linux -# define AppAssemblyExport +# define AssemblyExport # define PartExport # define MeshExport #endif diff --git a/src/Mod/Assembly/DevAssembly.py b/src/Mod/Assembly/DevAssembly.py index 43e12aafc..e6365961d 100644 --- a/src/Mod/Assembly/DevAssembly.py +++ b/src/Mod/Assembly/DevAssembly.py @@ -1,3 +1,5 @@ -import FreeCAD,Assembly +import FreeCAD,Assembly,time print "Script to test the assembly development" + +time.sleep(3)