Approx.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (c) 2007                                                    *
00003  *   Joachim Zettler <Joachim.Zettler@gmx.de>                              *
00004  *   Human Rezai <human@mytum.de>                                          *
00005  *   Mohamad Najib Muhammad Noor <najib_bean@yahoo.co.uk>                  *
00006  *                                                                         *
00007  *   This file is part of the FreeCAD CAx development system.              *
00008  *                                                                         *
00009  *   This library is free software; you can redistribute it and/or         *
00010  *   modify it under the terms of the GNU Library General Public           *
00011  *   License as published by the Free Software Foundation; either          *
00012  *   version 2 of the License, or (at your option) any later version.      *
00013  *                                                                         *
00014  *   This library  is distributed in the hope that it will be useful,      *
00015  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00016  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00017  *   GNU Library General Public License for more details.                  *
00018  *                                                                         *
00019  *   You should have received a copy of the GNU Library General Public     *
00020  *   License along with this library; see the file COPYING.LIB. If not,    *
00021  *   write to the Free Software Foundation, Inc., 59 Temple Place,         *
00022  *   Suite 330, Boston, MA  02111-1307, USA                                *
00023  *                                                                         *
00024  ***************************************************************************/
00025 /**************APPROX.H*********************
00026 *Class Approximate, inheriting from Routines
00027 *Dependancies:- BOOST, ATLAS, UMFPACK, BLAS
00028 *    LAPACK
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 /*******MAIN INCLUDE*********/
00038 #include "routine.h"
00039 
00040 #include <GeomAdaptor_Surface.hxx>
00041 
00042 /*******BOOST********/
00043 #include <boost/numeric/ublas/matrix.hpp>
00044 
00045 /*****NAMESPACE******/
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     //void RemakeList(std::vector<MyMesh::VertexHandle> &v_neighbour);
00082 
00083 private:
00085     MeshCore::MeshKernel LocalMesh;  //Local Mesh
00087     MeshCore::MeshKernel ParameterMesh;   //Parameterized Mesh - ONLY USED FOR VISUALIZING TO CHECK FOR PARAMETERIZATION ERRORS
00089         int NumOfPoints;    //Info about the Mesh
00091     int NumOfInnerPoints;
00093     int NumOfOuterPoints;
00095     double tolerance;  //error level
00097     ublas::vector<double> ParameterX;   //Parameterized Coordinate Lists
00099     ublas::vector<double> ParameterY;
00101     ublas::vector<double> BoundariesX;  //Parametrized Boundaries' Coordinate List
00103     ublas::vector<double> BoundariesY;
00105     std::vector<double> UnparamBoundariesX;   //Original Boundaries' Coordinate List
00107     std::vector<double> UnparamBoundariesY;
00109     std::vector<double> UnparamBoundariesZ;
00111     std::vector<double> UnparamX; //Original Coordinate Lists
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     //NURBS
00124     NURBS MainNurb;
00125 
00126     //Bounding box
00127     double MinX;
00128     double MaxX;
00129     double MinY;
00130     double MaxY;
00131 
00132 };
00133 
00134 #endif  /*APPROX_H DEFINED*/
00135 

Generated on Wed Nov 23 18:59:56 2011 for FreeCAD by  doxygen 1.6.1