Approx.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef APPROX_H
00032 #define APPROX_H
00033
00034 #ifndef NDEBUG //This is for faster matrix operations. In fact, some checks are turned off in the uBlas functions
00035 #define NDEBUG
00036 #endif
00037
00038 #include "routine.h"
00039
00040 #include <GeomAdaptor_Surface.hxx>
00041
00042
00043 #include <boost/numeric/ublas/matrix.hpp>
00044
00045
00046 using namespace boost::numeric;
00047
00060 class CamExport Approximate : protected Routines
00061 {
00062 public:
00063 Approximate(const MeshCore::MeshKernel &m, std::vector<double> &_Cntrl, std::vector<double> &_KnotU, std::vector<double> &_KnotV,
00064 int &_OrderU, int &_OrderV, double tol);
00065 ~Approximate();
00066 MeshCore::MeshKernel MeshParam;
00067
00068 GeomAdaptor_Surface aAdaptorSurface;
00069 protected:
00070 void ParameterBoundary();
00071 void ParameterInnerPoints();
00072 void ErrorApprox();
00073 void ApproxMain();
00074 double Reparam();
00075 void eFair2(ublas::compressed_matrix<double> &E_Matrix);
00076 void ComputeError(int &h, double eps_1, double eps_2, double &max_error,
00077 double &av, double &c2, std::vector <double> &err_w);
00078 void ExtendNurb(double c2, int h);
00079 void ReorderNeighbourList(std::set<unsigned long> &pnt,
00080 std::set<unsigned long> &face, std::vector<unsigned long> &nei,unsigned long CurInd);
00081
00082
00083 private:
00085 MeshCore::MeshKernel LocalMesh;
00087 MeshCore::MeshKernel ParameterMesh;
00089 int NumOfPoints;
00091 int NumOfInnerPoints;
00093 int NumOfOuterPoints;
00095 double tolerance;
00097 ublas::vector<double> ParameterX;
00099 ublas::vector<double> ParameterY;
00101 ublas::vector<double> BoundariesX;
00103 ublas::vector<double> BoundariesY;
00105 std::vector<double> UnparamBoundariesX;
00107 std::vector<double> UnparamBoundariesY;
00109 std::vector<double> UnparamBoundariesZ;
00111 std::vector<double> UnparamX;
00113 std::vector<double> UnparamY;
00115 std::vector<double> UnparamZ;
00116
00117 std::vector<int> mapper;
00119 std::list< std::vector <unsigned long> > BoundariesIndex;
00121 std::list< std::vector <Base::Vector3f> > BoundariesPoints;
00122
00123
00124 NURBS MainNurb;
00125
00126
00127 double MinX;
00128 double MaxX;
00129 double MinY;
00130 double MaxY;
00131
00132 };
00133
00134 #endif
00135