Approximate Class Reference

The main class for the approximate routine. More...

#include <Approx.h>

Inheritance diagram for Approximate:
Routines

List of all members.

Public Member Functions

 Approximate (const MeshCore::MeshKernel &m, std::vector< double > &_Cntrl, std::vector< double > &_KnotU, std::vector< double > &_KnotV, int &_OrderU, int &_OrderV, double tol)
 ~Approximate ()

Public Attributes

GeomAdaptor_Surface aAdaptorSurface
MeshCore::MeshKernel MeshParam

Protected Member Functions

void ApproxMain ()
 Main Approximation Program.
void ComputeError (int &h, double eps_1, double eps_2, double &max_error, double &av, double &c2, std::vector< double > &err_w)
 This function will compute the current error.
void eFair2 (ublas::compressed_matrix< double > &E_Matrix)
 Smoothing.
void ErrorApprox ()
 Main Error Approximations routine.
void ExtendNurb (double c2, int h)
 Extend the Nurb.
void ParameterBoundary ()
 Parameterizing the Boundary Points.
void ParameterInnerPoints ()
 Parameterizing the Inner Points.
void ReorderNeighbourList (std::set< unsigned long > &pnt, std::set< unsigned long > &face, std::vector< unsigned long > &nei, unsigned long CurInd)
 Reorder the neighbour list.
double Reparam ()
 Reparameterization after error computation.

Detailed Description

The main class for the approximate routine.

Inheriting the Routines class defined in Routines.h, it takes a mesh structure and tolerance level as it's input parameter.

As output, it gives out the following NURBS info:- Control Points, Knot U, Knot V, Order U, Order V

where Control Points, Knot U, Knot V are of type std::vectors, Order U and Order V of type int

In this program, it will be directly converted into a topo surface from the given information

Definition at line 60 of file Approx.h.


Constructor & Destructor Documentation

Approximate::Approximate ( const MeshCore::MeshKernel m,
std::vector< double > &  _Cntrl,
std::vector< double > &  _KnotU,
std::vector< double > &  _KnotV,
int &  _OrderU,
int &  _OrderV,
double  tol 
)
Approximate::~Approximate (  ) 

Definition at line 246 of file Approx.cpp.


Member Function Documentation

void Approximate::ApproxMain (  )  [protected]

Main Approximation Program.

Definition at line 251 of file Approx.cpp.

References ErrorApprox(), ParameterBoundary(), and ParameterInnerPoints().

Referenced by Approximate().

void Approximate::ComputeError ( int &  h,
double  eps_1,
double  eps_2,
double &  max_error,
double &  av,
double &  c2,
std::vector< double > &  err_w 
) [protected]
void Approximate::eFair2 ( ublas::compressed_matrix< double > &  E_Matrix  )  [protected]
void Approximate::ErrorApprox (  )  [protected]
void Approximate::ExtendNurb ( double  c2,
int  h 
) [protected]

Extend the Nurb.

Once error is computed and the generated nurb is stil not satisfactory (i.e max_err > tolerance), this function will extend the given Nurb by extending the Knot vectors by 2 and, because the degree is held constant, the control points

Definition at line 1453 of file Approx.cpp.

References NURBS::DegreeU, NURBS::DegreeV, Routines::ExtendKnot(), NURBS::KnotU, NURBS::KnotV, NURBS::MaxKnotU, NURBS::MaxKnotV, NURBS::MaxU, and NURBS::MaxV.

void Approximate::ParameterBoundary (  )  [protected]

Parameterizing the Boundary Points.

This function will first parameterized the boundary points. Using Routines::FindCorner() that it inherited to find the corner points, it will parameterized from side to side, using the ratio between the distance between current evaluated point and the it's next boundary to the total distance of the side.

Definition at line 269 of file Approx.cpp.

References FemExample::b, MeshCore::MeshPointIterator::Begin(), RobotExampleTrajectoryOutOfShapes::count, MeshCore::MeshKernel::CountPoints(), MeshCore::MeshPointIterator::EndReached(), SketcherExample::f, draftlibs::fcvec::find(), Routines::FindCorner(), MeshCore::MeshKernel::GetBoundBox(), MeshCore::MeshAlgorithm::GetMeshBorders(), MeshCore::MeshKernel::GetPoint(), Py::int, Base::BoundBox3< _Precision >::MaxX, Base::BoundBox3< _Precision >::MaxY, Base::BoundBox3< _Precision >::MinX, Base::BoundBox3< _Precision >::MinY, MeshCore::MeshPointIterator::Position(), and KDL::sqrt().

Referenced by ApproxMain().

void Approximate::ParameterInnerPoints (  )  [protected]
void Approximate::ReorderNeighbourList ( std::set< unsigned long > &  pnt,
std::set< unsigned long > &  face,
std::vector< unsigned long > &  nei,
unsigned long  CurInd 
) [protected]

Reorder the neighbour list.

This function will reorder the list in one-direction. Clockwise or counter clockwise is depending on the facet list and will not be checked by this function. (i.e the third vertex i.e vertex in first facet that is not the CurIndex or the first neighbour in pnt[Ok, I am also lost with this..., just debug and step to see what I mean...])

Definition at line 1473 of file Approx.cpp.

References draftlibs::fcvec::find(), MeshCore::MeshKernel::GetFacets(), MeshCore::MeshKernel::GetPoints(), and k.

Referenced by ParameterInnerPoints().

double Approximate::Reparam (  )  [protected]

Member Data Documentation

GeomAdaptor_Surface Approximate::aAdaptorSurface

Definition at line 68 of file Approx.h.

Referenced by Approximate(), and CamGui::Cutting::on_best_fit_go_button_clicked().


The documentation for this class was generated from the following files:

Generated on Wed Nov 23 19:01:31 2011 for FreeCAD by  doxygen 1.6.1