0000658: Automake lacks option to build Mods: Assembly and Cam
This commit is contained in:
parent
5b5d16c6c6
commit
29e1220de9
|
@ -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
|
||||
|
||||
|
|
|
@ -1,229 +1,229 @@
|
|||
/***************************************************************************
|
||||
* Copyright (c) 2007 *
|
||||
* Joachim Zettler <Joachim.Zettler@gmx.de> *
|
||||
* Human Rezai <human@mytum.de> *
|
||||
* *
|
||||
* 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 <Mod/Mesh/App/Core/MeshKernel.h>
|
||||
#include <Mod/Mesh/App/Core/Builder.h>
|
||||
#include <Mod/Mesh/App/Core/Grid.h>
|
||||
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <Base/Builder3D.h>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <GeomAPI_ProjectPointOnSurf.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <Poly_PolygonOnTriangulation.hxx>
|
||||
#include <Poly_Triangulation.hxx>
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
|
||||
|
||||
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<Base::Vector3f, MeshPnt> inp;
|
||||
std::map<Base::Vector3f,MeshPnt,MeshPntLess >::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; i<MeshPnts.size(); ++i)
|
||||
{
|
||||
aMeshStruct.pnt = MeshPnts[i]; // stores point
|
||||
aMeshStruct.index = i; // stores index
|
||||
inp.first = aMeshStruct.pnt;
|
||||
inp.second = aMeshStruct;
|
||||
MeshMap.insert(inp);
|
||||
}
|
||||
|
||||
// explores all faces ------------ Hauptschleife
|
||||
for (aExpFace.Init(m_Cad,TopAbs_FACE);aExpFace.More();aExpFace.Next())
|
||||
{
|
||||
TopoDS_Face aFace = TopoDS::Face(aExpFace.Current());
|
||||
TransferFaceTriangulationtoFreeCAD(aFace, FaceMesh);
|
||||
|
||||
MeshPnts.clear();
|
||||
MeshPnts = FaceMesh.GetPoints();
|
||||
n = MeshPnts.size();
|
||||
|
||||
TopLoc_Location aLocation;
|
||||
|
||||
Handle_Poly_Triangulation aTr = BRep_Tool::Triangulation(aFace,aLocation);
|
||||
const TColgp_Array1OfPnt& aNodes = aTr->Nodes();
|
||||
|
||||
// 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<n+1; ++i)
|
||||
{
|
||||
par = aUVNodes.Value(i);
|
||||
aSurface.D1(par.X(),par.Y(),P,D1U,D1V);
|
||||
P = aPoints(i);
|
||||
pnt.x = (float) P.X();
|
||||
pnt.y = (float) P.Y();
|
||||
pnt.z = (float) P.Z();
|
||||
|
||||
meshIt = MeshMap.find(pnt);
|
||||
if (meshIt == MeshMap.end())
|
||||
{
|
||||
cout << "error";
|
||||
return false;
|
||||
}
|
||||
|
||||
D1U.Cross(D1V);
|
||||
D1U.Normalize();
|
||||
|
||||
if (aFace.Orientation() == TopAbs_FORWARD) D1U.Scale(-1.0);
|
||||
|
||||
|
||||
normal.x = (float) D1U.X();
|
||||
normal.y = (float) D1U.Y();
|
||||
normal.z = (float) D1U.Z();
|
||||
|
||||
m_pnts[((*meshIt).second).index] = pnt;
|
||||
m_nlvec[((*meshIt).second).index] = normal;
|
||||
|
||||
log.addSingleArrow(pnt,pnt+normal);
|
||||
}
|
||||
}
|
||||
|
||||
log.saveToFile("c:/deviation.iv");
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Deviation::Compute()
|
||||
{
|
||||
Base::Builder3D log;
|
||||
|
||||
best_fit::Tesselate_Shape(m_Cad, m_MeshCad, float(0.1));
|
||||
GenNormals();
|
||||
|
||||
//return true;
|
||||
|
||||
std::vector<int> 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<m_nlvec.size(); i++)
|
||||
{
|
||||
log.addSingleArrow(m_pnts[i], m_pnts[i] + m_nlvec[i]);
|
||||
}
|
||||
|
||||
|
||||
log.saveToFile("c:/deviation2.iv");
|
||||
return true;
|
||||
}
|
||||
|
||||
#include <QFile>
|
||||
#include <QTextStream>
|
||||
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<m_nlvec.size(); i++)
|
||||
{
|
||||
out << m_pnts[i].x << ","
|
||||
<< m_pnts[i].y << ","
|
||||
<< m_pnts[i].z << ","
|
||||
<< m_nlvec[i].x << ","
|
||||
<< m_nlvec[i].y << ","
|
||||
<< m_nlvec[i].z << endl;
|
||||
}
|
||||
|
||||
anOutputFile.close();
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2007 *
|
||||
* Joachim Zettler <Joachim.Zettler@gmx.de> *
|
||||
* Human Rezai <human@mytum.de> *
|
||||
* *
|
||||
* 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 <Mod/Mesh/App/Core/MeshKernel.h>
|
||||
#include <Mod/Mesh/App/Core/Builder.h>
|
||||
#include <Mod/Mesh/App/Core/Grid.h>
|
||||
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <Base/Builder3D.h>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <GeomAPI_ProjectPointOnSurf.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <Poly_PolygonOnTriangulation.hxx>
|
||||
#include <Poly_Triangulation.hxx>
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
|
||||
|
||||
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<Base::Vector3f, MeshPnt> inp;
|
||||
std::map<Base::Vector3f,MeshPnt,MeshPntLess >::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; i<MeshPnts.size(); ++i)
|
||||
{
|
||||
aMeshStruct.pnt = MeshPnts[i]; // stores point
|
||||
aMeshStruct.index = i; // stores index
|
||||
inp.first = aMeshStruct.pnt;
|
||||
inp.second = aMeshStruct;
|
||||
MeshMap.insert(inp);
|
||||
}
|
||||
|
||||
// explores all faces ------------ Hauptschleife
|
||||
for (aExpFace.Init(m_Cad,TopAbs_FACE);aExpFace.More();aExpFace.Next())
|
||||
{
|
||||
TopoDS_Face aFace = TopoDS::Face(aExpFace.Current());
|
||||
TransferFaceTriangulationtoFreeCAD(aFace, FaceMesh);
|
||||
|
||||
MeshPnts.clear();
|
||||
MeshPnts = FaceMesh.GetPoints();
|
||||
n = MeshPnts.size();
|
||||
|
||||
TopLoc_Location aLocation;
|
||||
|
||||
Handle_Poly_Triangulation aTr = BRep_Tool::Triangulation(aFace,aLocation);
|
||||
const TColgp_Array1OfPnt& aNodes = aTr->Nodes();
|
||||
|
||||
// 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<n+1; ++i)
|
||||
{
|
||||
par = aUVNodes.Value(i);
|
||||
aSurface.D1(par.X(),par.Y(),P,D1U,D1V);
|
||||
P = aPoints(i);
|
||||
pnt.x = (float) P.X();
|
||||
pnt.y = (float) P.Y();
|
||||
pnt.z = (float) P.Z();
|
||||
|
||||
meshIt = MeshMap.find(pnt);
|
||||
if (meshIt == MeshMap.end())
|
||||
{
|
||||
cout << "error";
|
||||
return false;
|
||||
}
|
||||
|
||||
D1U.Cross(D1V);
|
||||
D1U.Normalize();
|
||||
|
||||
if (aFace.Orientation() == TopAbs_FORWARD) D1U.Scale(-1.0);
|
||||
|
||||
|
||||
normal.x = (float) D1U.X();
|
||||
normal.y = (float) D1U.Y();
|
||||
normal.z = (float) D1U.Z();
|
||||
|
||||
m_pnts[((*meshIt).second).index] = pnt;
|
||||
m_nlvec[((*meshIt).second).index] = normal;
|
||||
|
||||
log.addSingleArrow(pnt,pnt+normal);
|
||||
}
|
||||
}
|
||||
|
||||
log.saveToFile("c:/deviation.iv");
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Deviation::Compute()
|
||||
{
|
||||
Base::Builder3D log;
|
||||
|
||||
best_fit::Tesselate_Shape(m_Cad, m_MeshCad, float(0.1));
|
||||
GenNormals();
|
||||
|
||||
//return true;
|
||||
|
||||
std::vector<int> 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<m_nlvec.size(); i++)
|
||||
{
|
||||
log.addSingleArrow(m_pnts[i], m_pnts[i] + m_nlvec[i]);
|
||||
}
|
||||
|
||||
|
||||
log.saveToFile("c:/deviation2.iv");
|
||||
return true;
|
||||
}
|
||||
|
||||
#include <QFile>
|
||||
#include <QTextStream>
|
||||
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<m_nlvec.size(); i++)
|
||||
{
|
||||
out << m_pnts[i].x << ","
|
||||
<< m_pnts[i].y << ","
|
||||
<< m_pnts[i].z << ","
|
||||
<< m_nlvec[i].x << ","
|
||||
<< m_nlvec[i].y << ","
|
||||
<< m_nlvec[i].z << endl;
|
||||
}
|
||||
|
||||
anOutputFile.close();
|
||||
}
|
|
@ -1,53 +1,53 @@
|
|||
/***************************************************************************
|
||||
* Copyright (c) 2007 *
|
||||
* Joachim Zettler <Joachim.Zettler@gmx.de> *
|
||||
* Human Rezai <human@mytum.de> *
|
||||
* *
|
||||
* 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 <string.h>
|
||||
#include <QString>
|
||||
|
||||
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<Base::Vector3f> m_pnts, m_nlvec;
|
||||
};
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2007 *
|
||||
* Joachim Zettler <Joachim.Zettler@gmx.de> *
|
||||
* Human Rezai <human@mytum.de> *
|
||||
* *
|
||||
* 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 <string.h>
|
||||
#include <QString>
|
||||
|
||||
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<Base::Vector3f> m_pnts, m_nlvec;
|
||||
};
|
||||
|
||||
|
||||
#endif //DEVIATION_H
|
|
@ -1,106 +1,106 @@
|
|||
|
||||
#include "PreCompiled.h"
|
||||
#include "mergedata.h"
|
||||
#include <QFileDialog>
|
||||
|
||||
#include <QTextStream>
|
||||
#include <QMessageBox>
|
||||
|
||||
|
||||
|
||||
MergeData::MergeData():
|
||||
m_howmanypoints(0)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
MergeData::~MergeData()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
bool MergeData::Einlesen (const QStringList &dateinamen)
|
||||
{
|
||||
for (int i=0;i<dateinamen.size();i++)
|
||||
{
|
||||
QFileInfo aFileInfo(dateinamen.at(i));
|
||||
QString path = aFileInfo.absolutePath();
|
||||
QDir::setCurrent(path);
|
||||
QFile input(dateinamen.at(i));
|
||||
|
||||
if ( input.open ( QFile::ReadOnly ) )
|
||||
{
|
||||
QTextStream in ( &input );
|
||||
//Check the first line for a string-flag
|
||||
QString firstline = in.readLine();
|
||||
if(m_howmanypoints==0)
|
||||
{
|
||||
m_howmanypoints = firstline.toLong();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!(m_howmanypoints == firstline.toLong()))
|
||||
{
|
||||
return true;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if(i==0)
|
||||
{
|
||||
m_mergedvalues.resize(m_howmanypoints);
|
||||
for(int j=0; j<m_howmanypoints; j++)
|
||||
m_mergedvalues[j].resize(6);
|
||||
}
|
||||
int zeile = 0;
|
||||
while ( !in.atEnd() )
|
||||
{
|
||||
QString line = in.readLine();
|
||||
QStringList fields = line.split ( QLatin1Char(','),QString::SkipEmptyParts );
|
||||
if(fields.size()<5)
|
||||
return true;
|
||||
|
||||
m_mergedvalues[zeile][0] = fields[0].toFloat();
|
||||
m_mergedvalues[zeile][1] = fields[1].toFloat();
|
||||
m_mergedvalues[zeile][2] = fields[2].toFloat();
|
||||
m_mergedvalues[zeile][3] += fields[3].toFloat();
|
||||
m_mergedvalues[zeile][4] += fields[4].toFloat();
|
||||
m_mergedvalues[zeile][5] += fields[5].toFloat();
|
||||
|
||||
zeile++;
|
||||
}
|
||||
}
|
||||
input.close();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool MergeData::WriteOutput(const QString &dateiname)
|
||||
{
|
||||
QFile anOutputFile(dateiname);
|
||||
if (!anOutputFile.open(QIODevice::WriteOnly | QIODevice::Text))
|
||||
return false;
|
||||
QTextStream out(&anOutputFile);
|
||||
|
||||
|
||||
for(unsigned int i=0; i<m_mergedvalues.size(); i++)
|
||||
{
|
||||
out << m_mergedvalues[i][0] << " "
|
||||
<< m_mergedvalues[i][1] << " "
|
||||
<< m_mergedvalues[i][2] << " "
|
||||
<< m_mergedvalues[i][3] << " "
|
||||
<< m_mergedvalues[i][4] << " "
|
||||
<< m_mergedvalues[i][5] << endl;
|
||||
}
|
||||
|
||||
anOutputFile.close();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#include "PreCompiled.h"
|
||||
#include "mergedata.h"
|
||||
#include <QFileDialog>
|
||||
|
||||
#include <QTextStream>
|
||||
#include <QMessageBox>
|
||||
|
||||
|
||||
|
||||
MergeData::MergeData():
|
||||
m_howmanypoints(0)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
MergeData::~MergeData()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
bool MergeData::Einlesen (const QStringList &dateinamen)
|
||||
{
|
||||
for (int i=0;i<dateinamen.size();i++)
|
||||
{
|
||||
QFileInfo aFileInfo(dateinamen.at(i));
|
||||
QString path = aFileInfo.absolutePath();
|
||||
QDir::setCurrent(path);
|
||||
QFile input(dateinamen.at(i));
|
||||
|
||||
if ( input.open ( QFile::ReadOnly ) )
|
||||
{
|
||||
QTextStream in ( &input );
|
||||
//Check the first line for a string-flag
|
||||
QString firstline = in.readLine();
|
||||
if(m_howmanypoints==0)
|
||||
{
|
||||
m_howmanypoints = firstline.toLong();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!(m_howmanypoints == firstline.toLong()))
|
||||
{
|
||||
return true;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if(i==0)
|
||||
{
|
||||
m_mergedvalues.resize(m_howmanypoints);
|
||||
for(int j=0; j<m_howmanypoints; j++)
|
||||
m_mergedvalues[j].resize(6);
|
||||
}
|
||||
int zeile = 0;
|
||||
while ( !in.atEnd() )
|
||||
{
|
||||
QString line = in.readLine();
|
||||
QStringList fields = line.split ( QLatin1Char(','),QString::SkipEmptyParts );
|
||||
if(fields.size()<5)
|
||||
return true;
|
||||
|
||||
m_mergedvalues[zeile][0] = fields[0].toFloat();
|
||||
m_mergedvalues[zeile][1] = fields[1].toFloat();
|
||||
m_mergedvalues[zeile][2] = fields[2].toFloat();
|
||||
m_mergedvalues[zeile][3] += fields[3].toFloat();
|
||||
m_mergedvalues[zeile][4] += fields[4].toFloat();
|
||||
m_mergedvalues[zeile][5] += fields[5].toFloat();
|
||||
|
||||
zeile++;
|
||||
}
|
||||
}
|
||||
input.close();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool MergeData::WriteOutput(const QString &dateiname)
|
||||
{
|
||||
QFile anOutputFile(dateiname);
|
||||
if (!anOutputFile.open(QIODevice::WriteOnly | QIODevice::Text))
|
||||
return false;
|
||||
QTextStream out(&anOutputFile);
|
||||
|
||||
|
||||
for(unsigned int i=0; i<m_mergedvalues.size(); i++)
|
||||
{
|
||||
out << m_mergedvalues[i][0] << " "
|
||||
<< m_mergedvalues[i][1] << " "
|
||||
<< m_mergedvalues[i][2] << " "
|
||||
<< m_mergedvalues[i][3] << " "
|
||||
<< m_mergedvalues[i][4] << " "
|
||||
<< m_mergedvalues[i][5] << endl;
|
||||
}
|
||||
|
||||
anOutputFile.close();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,49 +1,49 @@
|
|||
/***************************************************************************
|
||||
* Copyright (c) 2007 *
|
||||
* Joachim Zettler <Joachim.Zettler@gmx.de> *
|
||||
* Human Rezai <human@mytum.de> *
|
||||
* *
|
||||
* 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 <QStringList>
|
||||
#include <vector>
|
||||
|
||||
class CamExport MergeData
|
||||
{
|
||||
public:
|
||||
MergeData();
|
||||
~MergeData();
|
||||
|
||||
bool WriteOutput(const QString &dateiname);
|
||||
void Open();
|
||||
bool Einlesen(const QStringList &filenames);
|
||||
|
||||
private:
|
||||
std::vector<std::vector<float> > m_mergedvalues;
|
||||
bool m_fit;
|
||||
long m_howmanypoints;
|
||||
};
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2007 *
|
||||
* Joachim Zettler <Joachim.Zettler@gmx.de> *
|
||||
* Human Rezai <human@mytum.de> *
|
||||
* *
|
||||
* 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 <QStringList>
|
||||
#include <vector>
|
||||
|
||||
class CamExport MergeData
|
||||
{
|
||||
public:
|
||||
MergeData();
|
||||
~MergeData();
|
||||
|
||||
bool WriteOutput(const QString &dateiname);
|
||||
void Open();
|
||||
bool Einlesen(const QStringList &filenames);
|
||||
|
||||
private:
|
||||
std::vector<std::vector<float> > m_mergedvalues;
|
||||
bool m_fit;
|
||||
long m_howmanypoints;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user