diff --git a/CMakeLists.txt b/CMakeLists.txt index fc7240bc43..6513b17737 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -212,6 +212,7 @@ MARK_AS_ADVANCED(FORCE FREECAD_LIBPACK_CHECKFILE6X FREECAD_LIBPACK_CHECKFILE7X) message("-- OpenCASCADE Community Edition has been found.") add_definitions ( -DHAVE_CONFIG_H ) set( OCC_LIBRARIES "TKFeat;TKFillet;TKMesh;TKernel;TKG2d;TKG3d;TKMath;TKIGES;TKSTL;TKShHealing;TKXSBase;TKBool;TKBO;TKBRep;TKTopAlgo;TKGeomAlgo;TKGeomBase;TKOffset;TKPrim;TKSTEP;TKSTEPBase;TKSTEPAttr;TKHLR" ) #lib list copied from FreeCAD's FindOpenCasCade.cmake + set( OCC_OCAF_LIBRARIES "TKCAF;TKXCAF;TKLCAF;TKXDESTEP;TKXDEIGES" ) #lib list copied from FreeCAD's FindOpenCasCade.cmake set( OCC_INCLUDE_DIR ${OCE_INCLUDE_DIRS} ) set( OCC_FOUND ${OCE_FOUND} ) else() #look for OpenCASCADE diff --git a/cMake/FindOpenCasCade.cmake b/cMake/FindOpenCasCade.cmake index 1b04f709da..df0aa010b6 100644 --- a/cMake/FindOpenCasCade.cmake +++ b/cMake/FindOpenCasCade.cmake @@ -1,12 +1,12 @@ # Try to find OCC # Once done this will define # -# OCC_FOUND - system has OCC - OpenCASCADE -# OCC_INCLUDE_DIR - where the OCC include directory can be found -# OCC_LIBRARY_DIR - where the OCC library directory can be found -# OCC_LIBRARIES - Link this to use OCC -# - +# OCC_FOUND - system has OCC - OpenCASCADE +# OCC_INCLUDE_DIR - where the OCC include directory can be found +# OCC_LIBRARY_DIR - where the OCC library directory can be found +# OCC_LIBRARIES - Link this to use OCC +# OCC_OCAF_LIBRARIES - Link this to use OCC OCAF framework + IF (WIN32) IF (CYGWIN OR MINGW) @@ -80,5 +80,12 @@ IF(OCC_LIBRARY) TKHLR TKFeat ) + set(OCC_OCAF_LIBRARIES + TKCAF + TKXCAF + TKLCAF + TKXDESTEP + TKXDEIGES + ) ENDIF(OCC_LIBRARY) diff --git a/src/Mod/Draft/Draft.py b/src/Mod/Draft/Draft.py index 471cafad67..7939900df0 100644 --- a/src/Mod/Draft/Draft.py +++ b/src/Mod/Draft/Draft.py @@ -2402,6 +2402,7 @@ class _ViewProviderRectangle(_ViewProviderDraft): self.Object = vobj.Object def onChanged(self, vp, prop): + from pivy import coin if prop == "TextureImage": r = vp.RootNode if os.path.exists(vp.TextureImage): diff --git a/src/Mod/Drawing/App/AppDrawingPy.cpp b/src/Mod/Drawing/App/AppDrawingPy.cpp index 345c629a12..892504a727 100644 --- a/src/Mod/Drawing/App/AppDrawingPy.cpp +++ b/src/Mod/Drawing/App/AppDrawingPy.cpp @@ -105,9 +105,10 @@ projectToSVG(PyObject *self, PyObject *args) PyObject *pcObjDir=0; const char *type=0; float scale=1.0f; + float tol=0.1f; - if (!PyArg_ParseTuple(args, "O!|O!sf", &(TopoShapePy::Type), &pcObjShape, - &(Base::VectorPy::Type), &pcObjDir, &type, &scale)) + if (!PyArg_ParseTuple(args, "O!|O!sff", &(TopoShapePy::Type), &pcObjShape, + &(Base::VectorPy::Type), &pcObjDir, &type, &scale, &tol)) return NULL; PY_TRY { @@ -121,7 +122,7 @@ projectToSVG(PyObject *self, PyObject *args) if (type && std::string(type) == "ShowHiddenLines") hidden = true; - Py::String result(Alg.getSVG(hidden?ProjectionAlgos::WithHidden:ProjectionAlgos::Plain, scale)); + Py::String result(Alg.getSVG(hidden?ProjectionAlgos::WithHidden:ProjectionAlgos::Plain, scale, tol)); return Py::new_reference_to(result); } PY_CATCH; @@ -134,9 +135,10 @@ projectToDXF(PyObject *self, PyObject *args) PyObject *pcObjDir=0; const char *type=0; float scale=1.0f; + float tol=0.1f; - if (!PyArg_ParseTuple(args, "O!|O!sf", &(TopoShapePy::Type), &pcObjShape, - &(Base::VectorPy::Type), &pcObjDir, &type, &scale)) + if (!PyArg_ParseTuple(args, "O!|O!sff", &(TopoShapePy::Type), &pcObjShape, + &(Base::VectorPy::Type), &pcObjDir, &type, &scale, &tol)) return NULL; PY_TRY { @@ -150,7 +152,7 @@ projectToDXF(PyObject *self, PyObject *args) if (type && std::string(type) == "ShowHiddenLines") hidden = true; - Py::String result(Alg.getDXF(hidden?ProjectionAlgos::WithHidden:ProjectionAlgos::Plain, scale)); + Py::String result(Alg.getDXF(hidden?ProjectionAlgos::WithHidden:ProjectionAlgos::Plain, scale, tol)); return Py::new_reference_to(result); } PY_CATCH; diff --git a/src/Mod/Drawing/App/FeatureViewPart.cpp b/src/Mod/Drawing/App/FeatureViewPart.cpp index 0eee19f3a2..93d201c625 100644 --- a/src/Mod/Drawing/App/FeatureViewPart.cpp +++ b/src/Mod/Drawing/App/FeatureViewPart.cpp @@ -70,6 +70,8 @@ using namespace std; // FeatureViewPart //=========================================================================== +App::PropertyFloatConstraint::Constraints FeatureViewPart::floatRange = {0.01f,5.0f,0.05f}; + PROPERTY_SOURCE(Drawing::FeatureViewPart, Drawing::FeatureView) @@ -83,6 +85,8 @@ FeatureViewPart::FeatureViewPart(void) ADD_PROPERTY_TYPE(ShowHiddenLines ,(false),group,App::Prop_None,"Control the appearance of the dashed hidden lines"); ADD_PROPERTY_TYPE(ShowSmoothLines ,(false),group,App::Prop_None,"Control the appearance of the smooth lines"); ADD_PROPERTY_TYPE(LineWidth,(0.35f),vgroup,App::Prop_None,"The thickness of the resulting lines"); + ADD_PROPERTY_TYPE(Tolerance,(0.05f),vgroup,App::Prop_None,"The tessellation tolerance"); + Tolerance.setConstraints(&floatRange); } FeatureViewPart::~FeatureViewPart() @@ -198,7 +202,7 @@ App::DocumentObjectExecReturn *FeatureViewPart::execute(void) ProjectionAlgos::SvgExtractionType type = ProjectionAlgos::Plain; if (hidden) type = (ProjectionAlgos::SvgExtractionType)(type|ProjectionAlgos::WithHidden); if (smooth) type = (ProjectionAlgos::SvgExtractionType)(type|ProjectionAlgos::WithSmooth); - result << Alg.getSVG(type, this->LineWidth.getValue() / this->Scale.getValue()); + result << Alg.getSVG(type, this->LineWidth.getValue() / this->Scale.getValue(), this->Tolerance.getValue()); result << "" << endl; diff --git a/src/Mod/Drawing/App/FeatureViewPart.h b/src/Mod/Drawing/App/FeatureViewPart.h index 68ad3551f2..6a47fbcb4d 100644 --- a/src/Mod/Drawing/App/FeatureViewPart.h +++ b/src/Mod/Drawing/App/FeatureViewPart.h @@ -53,7 +53,8 @@ public: App::PropertyBool ShowHiddenLines; App::PropertyBool ShowSmoothLines; App::PropertyFloat LineWidth; - + App::PropertyFloatConstraint Tolerance; + /** @name methods overide Feature */ //@{ @@ -65,6 +66,9 @@ public: virtual const char* getViewProviderName(void) const { return "DrawingGui::ViewProviderDrawingView"; } + +private: + static App::PropertyFloatConstraint::Constraints floatRange; }; typedef App::FeaturePythonT FeatureViewPartPython; diff --git a/src/Mod/Drawing/App/ProjectionAlgos.cpp b/src/Mod/Drawing/App/ProjectionAlgos.cpp index b37c6cb482..d50706e687 100644 --- a/src/Mod/Drawing/App/ProjectionAlgos.cpp +++ b/src/Mod/Drawing/App/ProjectionAlgos.cpp @@ -149,7 +149,7 @@ void ProjectionAlgos::execute(void) } -std::string ProjectionAlgos::getSVG(SvgExtractionType type, float scale) +std::string ProjectionAlgos::getSVG(SvgExtractionType type, float scale, float tolerance) { std::stringstream result; SVGOutput output; @@ -157,7 +157,7 @@ std::string ProjectionAlgos::getSVG(SvgExtractionType type, float scale) if (!H.IsNull() && (type & WithHidden)) { float width = hfactor * scale; - BRepMesh::Mesh(H,0.1); + BRepMesh::Mesh(H,tolerance); result << " # include # include +# include # include # include # include @@ -55,6 +56,7 @@ # include # include # include +# include #if OCC_VERSION_HEX >= 0x060500 # include # else @@ -664,8 +666,21 @@ static PyObject * exporter(PyObject *self, PyObject *args) Base::FileInfo file(filename); if (file.hasExtension("stp") || file.hasExtension("step")) { + //Interface_Static::SetCVal("write.step.schema", "AP214IS"); STEPCAFControl_Writer writer; writer.Transfer(hDoc, STEPControl_AsIs); + + // edit STEP header +#if OCC_VERSION_HEX >= 0x060500 + APIHeaderSection_MakeHeader makeHeader(writer.ChangeWriter().Model()); +#else + APIHeaderSection_MakeHeader makeHeader(writer.Writer().Model()); +#endif + makeHeader.SetName(new TCollection_HAsciiString((const Standard_CString)filename)); + makeHeader.SetAuthorValue (1, new TCollection_HAsciiString("FreeCAD")); + makeHeader.SetOrganizationValue (1, new TCollection_HAsciiString("FreeCAD")); + makeHeader.SetOriginatingSystem(new TCollection_HAsciiString("FreeCAD")); + makeHeader.SetDescriptionValue(1, new TCollection_HAsciiString("FreeCAD Model")); writer.Write(filename); } else if (file.hasExtension("igs") || file.hasExtension("iges")) { diff --git a/src/Mod/Part/App/AppPart.cpp b/src/Mod/Part/App/AppPart.cpp index 6bcc488602..aee9f90b1c 100644 --- a/src/Mod/Part/App/AppPart.cpp +++ b/src/Mod/Part/App/AppPart.cpp @@ -95,11 +95,11 @@ void PartExport initPart() // see Init.py #if defined (_OCC64) #if OCC_VERSION_HEX < 0x060503 - App::GetApplication().addImportType("STEP AP203 format (*.step *.stp)","Part"); - App::GetApplication().addExportType("STEP AP203 format (*.step *.stp)","Part"); + App::GetApplication().addImportType("STEP (*.step *.stp)","Part"); + App::GetApplication().addExportType("STEP (*.step *.stp)","Part"); #else - App::GetApplication().addImportType("STEP AP214 format (*.step *.stp)","ImportGui"); - App::GetApplication().addExportType("STEP AP214 format (*.step *.stp)","ImportGui"); + App::GetApplication().addImportType("STEP with colors (*.step *.stp)","ImportGui"); + App::GetApplication().addExportType("STEP with colors (*.step *.stp)","ImportGui"); #endif #endif diff --git a/src/Mod/Part/Gui/Command.cpp b/src/Mod/Part/Gui/Command.cpp index a7e9b8154b..51f84675c6 100644 --- a/src/Mod/Part/Gui/Command.cpp +++ b/src/Mod/Part/Gui/Command.cpp @@ -446,9 +446,10 @@ CmdPartImport::CmdPartImport() void CmdPartImport::activated(int iMsg) { QStringList filter; - filter << QString::fromAscii("STEP AP203 (*.stp *.step)"); - filter << QString::fromAscii("STEP AP214 (*.stp *.step)"); + filter << QString::fromAscii("STEP (*.stp *.step)"); + filter << QString::fromAscii("STEP with colors (*.stp *.step)"); filter << QString::fromAscii("IGES (*.igs *.iges)"); + filter << QString::fromAscii("IGES with colors (*.igs *.iges)"); filter << QString::fromAscii("BREP (*.brp *.brep)"); QString select; @@ -459,7 +460,7 @@ void CmdPartImport::activated(int iMsg) if (!pDoc) return; // no document openCommand("Import Part"); if (select == filter[1] || - select == filter[2]) { + select == filter[3]) { doCommand(Doc, "import ImportGui"); doCommand(Doc, "ImportGui.insert(\"%s\",\"%s\")", (const char*)fn.toUtf8(), pDoc->getName()); } @@ -504,9 +505,10 @@ CmdPartExport::CmdPartExport() void CmdPartExport::activated(int iMsg) { QStringList filter; - filter << QString::fromAscii("STEP AP203 (*.stp *.step)"); - filter << QString::fromAscii("STEP AP214 (*.stp *.step)"); + filter << QString::fromAscii("STEP (*.stp *.step)"); + filter << QString::fromAscii("STEP with colors (*.stp *.step)"); filter << QString::fromAscii("IGES (*.igs *.iges)"); + filter << QString::fromAscii("IGES with colors (*.igs *.iges)"); filter << QString::fromAscii("BREP (*.brp *.brep)"); QString select; @@ -515,7 +517,7 @@ void CmdPartExport::activated(int iMsg) App::Document* pDoc = getDocument(); if (!pDoc) return; // no document if (select == filter[1] || - select == filter[2]) { + select == filter[3]) { Gui::Application::Instance->exportTo((const char*)fn.toUtf8(),pDoc->getName(),"ImportGui"); } else { diff --git a/src/Mod/Part/Init.py b/src/Mod/Part/Init.py index 33a81998e3..6da3a0373e 100644 --- a/src/Mod/Part/Init.py +++ b/src/Mod/Part/Init.py @@ -54,9 +54,9 @@ FreeCAD.addExportType("IGES format (*.iges *.igs)","Part") # The registration of the STEP filetype for 64-bit is handled in initPart() import platform if platform.architecture()[0]=='32bit': - FreeCAD.addImportType("STEP AP214 format (*.step *.stp)","ImportGui") - FreeCAD.addExportType("STEP AP214 format (*.step *.stp)","ImportGui") + FreeCAD.addImportType("STEP with colors (*.step *.stp)","ImportGui") + FreeCAD.addExportType("STEP with colors (*.step *.stp)","ImportGui") #else: -# FreeCAD.addImportType("STEP AP203 format (*.step *.stp)","Part") -# FreeCAD.addExportType("STEP AP203 format (*.step *.stp)","Part") +# FreeCAD.addImportType("STEP (*.step *.stp)","Part") +# FreeCAD.addExportType("STEP (*.step *.stp)","Part") diff --git a/src/Mod/Ship/CMakeLists.txt b/src/Mod/Ship/CMakeLists.txt index 9e7ed7347d..cb2a119ba9 100644 --- a/src/Mod/Ship/CMakeLists.txt +++ b/src/Mod/Ship/CMakeLists.txt @@ -58,7 +58,6 @@ SET(ShipExamples_SRCS Examples/s60_katamaran.fcstd Examples/wigley.fcstd Examples/wigley_katamaran.fcstd - OpenCL/simInit.cl ) SOURCE_GROUP("shipexamples" FILES ${ShipExamples_SRCS}) diff --git a/src/Mod/Ship/Makefile.am b/src/Mod/Ship/Makefile.am index 2c643646ce..87e1f22cbe 100644 --- a/src/Mod/Ship/Makefile.am +++ b/src/Mod/Ship/Makefile.am @@ -55,7 +55,6 @@ nobase_data_DATA = \ Examples/s60_katamaran.fcstd \ Examples/wigley.fcstd \ Examples/wigley_katamaran.fcstd \ - OpenCL/simInit.cl \ shipLoadExample/__init__.py \ shipLoadExample/TaskPanel.py \ shipLoadExample/TaskPanel.ui \ diff --git a/src/Mod/Ship/OpenCL/simInit.cl b/src/Mod/Ship/OpenCL/simInit.cl deleted file mode 100644 index 7bb8a3c2f2..0000000000 --- a/src/Mod/Ship/OpenCL/simInit.cl +++ /dev/null @@ -1,99 +0,0 @@ -/* - * ----------------------------------------------------------------------- - * - * This source file is part of AQUA-gpusph. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA - * - * - * Authors: - * - Cercos Pita, Jose Luis - * - Miguel Gonzalez, Leo - * - Saelices, Jaime - * - Souto Iglesias, Antonio - * - * ----------------------------------------------------------------------- - */ - -#ifndef M_PI - #define M_PI 3,14159265359 -#endif - -#ifdef _g - #error '_g' is already defined. -#endif -#define _g __global - -#ifdef _l - #error '_l' is already defined. -#endif -#define _l __local - -#ifdef _c - #error '_c' is already defined. -#endif -#define _c __constant - -#ifndef _grav - #define _grav 9.81 -#endif - -/** Setup velocity and acceleration potential for initial time step. - * @param pos Cell position. - * @param v Cell velocity. - * @param f Cell acceleration. - * @param waves Waves (A,T,phase,heading) - * @param phi Velocity potential. - * @param Phi Acceleration potential - * @param N Number of cell elements at each direction. - * @param n Number of waves. - */ -__kernel void FS(_g float4* pos, _g float4* v, _g float4* f, - _g float4* waves, _g float* phi, _g float* Phi, - uint2 N, uint n) -{ - // find position in global arrays - unsigned int i = get_global_id(0); - unsigned int j = get_global_id(1); - if( (i >= N.x) || (j >= N.y) ) - return; - unsigned int id = i*N.y + j; - - // ---- | ------------------------ | ---- - // ---- V ---- Your code here ---- V ---- - - unsigned int w; - for(w=0;w + diff --git a/src/WindowsInstaller/ModShip.wxi b/src/WindowsInstaller/ModShip.wxi new file mode 100644 index 0000000000..274c0fc786 --- /dev/null +++ b/src/WindowsInstaller/ModShip.wxi @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +