From 29e1220de9b5f623fade3ad31af029dc0b4b0fa0 Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 10 Apr 2012 19:19:12 +0200 Subject: [PATCH] 0000658: Automake lacks option to build Mods: Assembly and Cam --- src/Mod/Cam/App/Makefile.am | 27 +- src/Mod/Cam/App/deviation.cpp | 456 +++++++++++++++++----------------- src/Mod/Cam/App/deviation.h | 104 ++++---- src/Mod/Cam/App/mergedata.cpp | 212 ++++++++-------- src/Mod/Cam/App/mergedata.h | 96 +++---- src/Mod/Cam/Gui/Makefile.am | 114 ++++----- 6 files changed, 512 insertions(+), 497 deletions(-) diff --git a/src/Mod/Cam/App/Makefile.am b/src/Mod/Cam/App/Makefile.am index a53c5c386..f08f1e84b 100644 --- a/src/Mod/Cam/App/Makefile.am +++ b/src/Mod/Cam/App/Makefile.am @@ -14,8 +14,12 @@ libCam_la_SOURCES=\ ConvertDyna.h \ cutting_tools.cpp \ cutting_tools.h \ + deviation.cpp \ + deviation.h \ edgesort.cpp \ edgesort.h \ + mergedata.cpp \ + mergedata.h \ path_simulate.cpp \ path_simulate.h \ PreCompiled.cpp \ @@ -31,16 +35,18 @@ libCam_la_SOURCES=\ WireExplorer.h # the library search path. -libCam_la_LDFLAGS = -L../../../3rdParty/OCCAdaptMesh -L../../../Base -L../../../App \ - -L../../../Mod/Part/App -L../../../Mod/Mesh/App -L/usr/X11R6/lib -L$(OCC_LIB) \ +libCam_la_LDFLAGS = -L../../../Base -L../../../App \ + $(sim_ac_coin_ldflags) $(sim_ac_coin_libs) \ + -L../../../Mod/Part/App -L../../../Mod/Mesh/App -L/usr/X11R6/lib -L$(OCC_LIB) -L/usr/lib/atlas \ $(GTS_LIBS) $(all_libraries) -version-info @LIB_CURRENT@:@LIB_REVISION@:@LIB_AGE@ -libCam_la_CPPFLAGS = -DAppCamExport= +libCam_la_CPPFLAGS = $(sim_ac_coin_cppflags) -DAppCamExport= + +#Binary file ./atlas/libclapack.so matches libCam_la_LIBADD = \ -lxerces-c \ -lboost_filesystem \ -l@PYTHON_LIB@ \ - -lOCCAdaptMesh \ -lFreeCADBase \ -lFreeCADApp \ -lPart \ @@ -65,7 +71,14 @@ libCam_la_LIBADD = \ -lTKMesh \ -lblas \ -lumfpack \ - -lamd + -lamd \ + -lcblas \ + -lANN \ + -lSMDS \ + -lSMESHDS \ + -lSMESH \ + -lclapack + %.cpp: %.xml $(top_srcdir)/src/Tools/generateTemplates/templateClassPyExport.py $(PYTHON) $(top_srcdir)/src/Tools/generate.py --outputPath $(@D) $< @@ -90,8 +103,8 @@ Cam_la_DEPENDENCIES = libCam.la # set the include path found by configure AM_CXXFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/src $(all_includes) -I$(OCC_INC) $(GTS_CFLAGS) \ - -I$(top_srcdir)/src/3rdParty -I$(top_srcdir)/src/3rdParty/OCCAdaptMesh/Include - + -I$(top_srcdir)/src/3rdParty $(QT4_CORE_CXXFLAGS) \ + -I$(top_srcdir)/src/3rdParty/salomesmesh/inc -I$(top_srcdir)/src/3rdParty/ANN/include libdir = $(prefix)/Mod/Cam diff --git a/src/Mod/Cam/App/deviation.cpp b/src/Mod/Cam/App/deviation.cpp index fdc9b7698..843bc9cd9 100644 --- a/src/Mod/Cam/App/deviation.cpp +++ b/src/Mod/Cam/App/deviation.cpp @@ -1,229 +1,229 @@ -/*************************************************************************** -* Copyright (c) 2007 * -* Joachim Zettler * -* Human Rezai * -* * -* 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" -#include "deviation.h" - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -Deviation::Deviation() -{} - -Deviation::~Deviation() -{} - -void Deviation::ImportGeometry(const TopoDS_Shape& aShape, const MeshCore::MeshKernel& aMesh) -{ - m_Mesh = aMesh; - m_Cad = aShape; -} - -bool Deviation::GenNormals() -{ - Base::Builder3D log; - TopExp_Explorer aExpFace; - - MeshPnt aMeshStruct; - std::pair inp; - std::map::iterator meshIt; - - MeshCore::MeshKernel FaceMesh; - MeshCore::MeshPointArray MeshPnts; - - int n; - - MeshPnts = m_MeshCad.GetPoints(); - m_pnts.resize(m_MeshCad.CountPoints()); - m_nlvec.resize((m_MeshCad.CountPoints())); - - for (unsigned int i=0; iNodes(); - - // create array of node points in absolute coordinate system - TColgp_Array1OfPnt aPoints(1, aNodes.Length()); - for (Standard_Integer i = 1; i <= aNodes.Length(); i++) - aPoints(i) = aNodes(i).Transformed(aLocation); - - const TColgp_Array1OfPnt2d& aUVNodes = aTr->UVNodes(); - - BRepAdaptor_Surface aSurface(aFace); - Base::Vector3f pnt, normal; - gp_Pnt2d par; - gp_Pnt P; - gp_Vec D1U, D1V; - - for (int i=1; i FailProj; - - MeshCore::MeshFacetGrid aFacetGrid(m_Mesh,10); - MeshCore::MeshAlgorithm malg(m_Mesh); - MeshCore::MeshAlgorithm malg2(m_Mesh); - MeshCore::MeshPointIterator p_it(m_MeshCad); - - Base::Vector3f projPoint, distVec, nvec(0,0,0), projPoint2; - unsigned long facetIndex; - std::stringstream text; - - unsigned int c=0; - int i=0; - - for (p_it.Begin(); p_it.More(); p_it.Next()) - { - if (malg.NearestFacetOnRay(*p_it, m_nlvec[i], aFacetGrid, projPoint, facetIndex)) // gridoptimiert - { - distVec = projPoint - *p_it; - m_nlvec[i] = distVec; // überschreibt normalenvektor - } - else - { - if (!malg2.NearestFacetOnRay(*p_it, m_nlvec[i], projPoint, facetIndex)) // nicht gridoptimiert - { - c++; - FailProj.push_back(i); - m_nlvec[i] = nvec; - } - else - { - distVec = projPoint - *p_it; - m_nlvec[i] = distVec; // überschreibt normalenvektor - } - } - - ++i; - } - - for(int i=0; i -#include -void Deviation::WriteOutput(const QString &dateiname) -{ - QFile anOutputFile(dateiname); - if (!anOutputFile.open(QIODevice::WriteOnly | QIODevice::Text)) - return; - QTextStream out(&anOutputFile); - - out << m_nlvec.size() << endl; - - for(int i=0; i * +* Human Rezai * +* * +* 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" +#include "deviation.h" + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +Deviation::Deviation() +{} + +Deviation::~Deviation() +{} + +void Deviation::ImportGeometry(const TopoDS_Shape& aShape, const MeshCore::MeshKernel& aMesh) +{ + m_Mesh = aMesh; + m_Cad = aShape; +} + +bool Deviation::GenNormals() +{ + Base::Builder3D log; + TopExp_Explorer aExpFace; + + MeshPnt aMeshStruct; + std::pair inp; + std::map::iterator meshIt; + + MeshCore::MeshKernel FaceMesh; + MeshCore::MeshPointArray MeshPnts; + + int n; + + MeshPnts = m_MeshCad.GetPoints(); + m_pnts.resize(m_MeshCad.CountPoints()); + m_nlvec.resize((m_MeshCad.CountPoints())); + + for (unsigned int i=0; iNodes(); + + // create array of node points in absolute coordinate system + TColgp_Array1OfPnt aPoints(1, aNodes.Length()); + for (Standard_Integer i = 1; i <= aNodes.Length(); i++) + aPoints(i) = aNodes(i).Transformed(aLocation); + + const TColgp_Array1OfPnt2d& aUVNodes = aTr->UVNodes(); + + BRepAdaptor_Surface aSurface(aFace); + Base::Vector3f pnt, normal; + gp_Pnt2d par; + gp_Pnt P; + gp_Vec D1U, D1V; + + for (int i=1; i FailProj; + + MeshCore::MeshFacetGrid aFacetGrid(m_Mesh,10); + MeshCore::MeshAlgorithm malg(m_Mesh); + MeshCore::MeshAlgorithm malg2(m_Mesh); + MeshCore::MeshPointIterator p_it(m_MeshCad); + + Base::Vector3f projPoint, distVec, nvec(0,0,0), projPoint2; + unsigned long facetIndex; + std::stringstream text; + + unsigned int c=0; + int i=0; + + for (p_it.Begin(); p_it.More(); p_it.Next()) + { + if (malg.NearestFacetOnRay(*p_it, m_nlvec[i], aFacetGrid, projPoint, facetIndex)) // gridoptimiert + { + distVec = projPoint - *p_it; + m_nlvec[i] = distVec; // überschreibt normalenvektor + } + else + { + if (!malg2.NearestFacetOnRay(*p_it, m_nlvec[i], projPoint, facetIndex)) // nicht gridoptimiert + { + c++; + FailProj.push_back(i); + m_nlvec[i] = nvec; + } + else + { + distVec = projPoint - *p_it; + m_nlvec[i] = distVec; // überschreibt normalenvektor + } + } + + ++i; + } + + for(int i=0; i +#include +void Deviation::WriteOutput(const QString &dateiname) +{ + QFile anOutputFile(dateiname); + if (!anOutputFile.open(QIODevice::WriteOnly | QIODevice::Text)) + return; + QTextStream out(&anOutputFile); + + out << m_nlvec.size() << endl; + + for(int i=0; i * -* Human Rezai * -* * -* 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 DEVIATION_H -#define DEVIATION_H - -#include "best_fit.h" -#include "SpringbackCorrection.h" -#include -#include - -class CamExport Deviation : public SpringbackCorrection -{ -public: - Deviation(); - ~Deviation(); - - bool GenNormals(); - void ImportGeometry(const TopoDS_Shape& aShape, const MeshCore::MeshKernel& aMesh); - void WriteOutput(const QString &dateiname); - bool Compute(); - - TopoDS_Shape m_Cad; // CAD-Geometrie - MeshCore::MeshKernel m_MeshCad; - MeshCore::MeshKernel m_Mesh; - - std::vector m_pnts, m_nlvec; -}; - - +/*************************************************************************** +* Copyright (c) 2007 * +* Joachim Zettler * +* Human Rezai * +* * +* 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 DEVIATION_H +#define DEVIATION_H + +#include "best_fit.h" +#include "SpringbackCorrection.h" +#include +#include + +class CamExport Deviation : public SpringbackCorrection +{ +public: + Deviation(); + ~Deviation(); + + bool GenNormals(); + void ImportGeometry(const TopoDS_Shape& aShape, const MeshCore::MeshKernel& aMesh); + void WriteOutput(const QString &dateiname); + bool Compute(); + + TopoDS_Shape m_Cad; // CAD-Geometrie + MeshCore::MeshKernel m_MeshCad; + MeshCore::MeshKernel m_Mesh; + + std::vector m_pnts, m_nlvec; +}; + + #endif //DEVIATION_H \ No newline at end of file diff --git a/src/Mod/Cam/App/mergedata.cpp b/src/Mod/Cam/App/mergedata.cpp index 073768bf4..f7a8368d5 100644 --- a/src/Mod/Cam/App/mergedata.cpp +++ b/src/Mod/Cam/App/mergedata.cpp @@ -1,106 +1,106 @@ - -#include "PreCompiled.h" -#include "mergedata.h" -#include - -#include -#include - - - -MergeData::MergeData(): -m_howmanypoints(0) -{ - -} - -MergeData::~MergeData() -{ - -} - - - - - -bool MergeData::Einlesen (const QStringList &dateinamen) -{ - for (int i=0;i + +#include +#include + + + +MergeData::MergeData(): +m_howmanypoints(0) +{ + +} + +MergeData::~MergeData() +{ + +} + + + + + +bool MergeData::Einlesen (const QStringList &dateinamen) +{ + for (int i=0;i * -* Human Rezai * -* * -* 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 MERGEDATA_H -#define MERGEDATA_H - -#include -#include - -class CamExport MergeData -{ -public: - MergeData(); - ~MergeData(); - - bool WriteOutput(const QString &dateiname); - void Open(); - bool Einlesen(const QStringList &filenames); - -private: - std::vector > m_mergedvalues; - bool m_fit; - long m_howmanypoints; -}; - - +/*************************************************************************** +* Copyright (c) 2007 * +* Joachim Zettler * +* Human Rezai * +* * +* 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 MERGEDATA_H +#define MERGEDATA_H + +#include +#include + +class CamExport MergeData +{ +public: + MergeData(); + ~MergeData(); + + bool WriteOutput(const QString &dateiname); + void Open(); + bool Einlesen(const QStringList &filenames); + +private: + std::vector > m_mergedvalues; + bool m_fit; + long m_howmanypoints; +}; + + #endif \ No newline at end of file diff --git a/src/Mod/Cam/Gui/Makefile.am b/src/Mod/Cam/Gui/Makefile.am index 983d99f66..266570c4a 100644 --- a/src/Mod/Cam/Gui/Makefile.am +++ b/src/Mod/Cam/Gui/Makefile.am @@ -1,60 +1,62 @@ - -lib_LTLIBRARIES=libCamGui.la CamGui.la - -BUILT_SOURCES=\ + +lib_LTLIBRARIES=libCamGui.la CamGui.la + +BUILT_SOURCES=\ ui_Cutting.h \ moc_Cutting.cpp - -libCamGui_la_SOURCES=\ + +libCamGui_la_SOURCES=\ Command.cpp \ Cutting.cpp \ Cutting.h \ PreCompiled.cpp \ - PreCompiled.h \ - Workbench.cpp \ - Workbench.h - -# the library search path. + PreCompiled.h \ + Workbench.cpp \ + Workbench.h + +# the library search path. libCamGui_la_LDFLAGS = -L../../../Base -L../../../App -L../../../Gui -L../App $(QT_LIBS) $(sim_ac_coin_ldflags) \ - $(sim_ac_coin_libs) $(sim_ac_soqt_ldflags) $(sim_ac_soqt_libs) -L$(OCC_LIB) $(all_libraries) \ - -version-info @LIB_CURRENT@:@LIB_REVISION@:@LIB_AGE@ -libCamGui_la_CPPFLAGS = -DAppCamExport= -DAppCamGuiExport= - -libCamGui_la_LIBADD = \ - -lxerces-c \ - -l@PYTHON_LIB@ \ - -lFreeCADBase \ - -lFreeCADApp \ - -lFreeCADGui \ - -lTKernel \ - -lCam - -#-------------------------------------------------------------------------------------- -# Loader of libCamGui - -CamGui_la_SOURCES=\ - AppCamGui.cpp - -# the library search path. -CamGui_la_LDFLAGS = $(libCamGui_la_LDFLAGS) -module -avoid-version -CamGui_la_CPPFLAGS = $(libCamGui_la_CPPFLAGS) - -CamGui_la_LIBADD = \ - $(libCamGui_la_LIBADD) \ - -lCamGui + -L../../Part/Gui \ + $(sim_ac_coin_libs) $(sim_ac_soqt_ldflags) $(sim_ac_soqt_libs) -L$(OCC_LIB) $(all_libraries) \ + -version-info @LIB_CURRENT@:@LIB_REVISION@:@LIB_AGE@ +libCamGui_la_CPPFLAGS = $(sim_ac_coin_cppflags) -DAppCamExport= -DAppCamGuiExport= + +libCamGui_la_LIBADD = \ + -lxerces-c \ + -l@PYTHON_LIB@ \ + -lFreeCADBase \ + -lFreeCADApp \ + -lFreeCADGui \ + -lTKernel \ + -lPartGui \ + -lCam + +#-------------------------------------------------------------------------------------- +# Loader of libCamGui + +CamGui_la_SOURCES=\ + AppCamGui.cpp + +# the library search path. +CamGui_la_LDFLAGS = $(libCamGui_la_LDFLAGS) -module -avoid-version +CamGui_la_CPPFLAGS = $(libCamGui_la_CPPFLAGS) + +CamGui_la_LIBADD = \ + $(libCamGui_la_LIBADD) \ + -lCamGui CamGui_la_DEPENDENCIES = libCamGui.la - -#-------------------------------------------------------------------------------------- - -# rule for Qt MetaObject Compiler: -moc_%.cpp: %.h + +#-------------------------------------------------------------------------------------- + +# rule for Qt MetaObject Compiler: +moc_%.cpp: %.h $(QT_MOC) $< -o $(@F) - -# rule for Qt MetaObject Compiler: -%.moc: %.h + +# rule for Qt MetaObject Compiler: +%.moc: %.h $(QT_MOC) $< -o $(@F) - + # rules for Qt User Interface Compiler: ui_%.h: %.ui $(QT_UIC) $< -o $(@F) @@ -63,14 +65,14 @@ ui_%.h: %.ui qrc_%.cpp: %.qrc $(QT_RCC) -name $(*F) $< -o $(@F) -# set the include path found by configure -AM_CXXFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/src $(QT_CXXFLAGS) -I$(OCC_INC) $(all_includes) - - -libdir = $(prefix)/Mod/Cam - -CLEANFILES = $(BUILT_SOURCES) - -EXTRA_DIST = \ +# set the include path found by configure +AM_CXXFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/src $(QT_CXXFLAGS) -I$(OCC_INC) $(all_includes) + + +libdir = $(prefix)/Mod/Cam + +CLEANFILES = $(BUILT_SOURCES) + +EXTRA_DIST = \ CMakeLists.txt \ - Cutting.ui + Cutting.ui