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
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050 #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
00051 #include <CGAL/Triangulation_euclidean_traits_xy_3.h>
00052 #include <CGAL/Delaunay_triangulation_2.h>
00053 #include <CGAL/squared_distance_2.h>
00054 #include <CGAL/Interpolation_traits_2.h>
00055 #include <CGAL/natural_neighbor_coordinates_2.h>
00056 #include <CGAL/interpolation_functions.h>
00057
00058 #include <CGAL/point_generators_2.h>
00059 #include <CGAL/copy_n.h>
00060 #include <CGAL/Origin.h>
00061 #include <fstream>
00062
00063 struct K : CGAL::Exact_predicates_inexact_constructions_kernel {};
00064 typedef K::FT Coord_type;
00065 typedef K::Vector_2 Vector;
00066 typedef K::Point_2 Point;
00067
00068
00069
00070 typedef CGAL::Delaunay_triangulation_2<K> Delaunay;
00071 typedef CGAL::Interpolation_traits_2<K> Traits;
00072
00073 typedef Delaunay::Vertex_circulator Vertex_circulator;
00074 typedef Delaunay::Edge_circulator Edge_circulator;
00075 typedef Delaunay::Vertex Vertex;
00076 typedef Delaunay::Face Face;
00077 typedef Delaunay::Edge Edge;
00078 typedef Delaunay::Vertex_handle Vertex_handle;
00079 typedef Delaunay::Face_handle Face_handle;
00080 typedef Delaunay::Face_circulator Face_circulator;
00081
00082 typedef Delaunay::Locate_type Locate_type;
00083 typedef Delaunay::Finite_edges_iterator Edge_iterator;
00084 typedef Delaunay::Vertex_iterator Vertex_iterator;
00085 typedef Delaunay::All_vertices_iterator All_vertices_iterator;
00086 typedef Delaunay::All_faces_iterator All_faces_iterator;
00087
00088 typedef std::vector< std::pair<Point, Coord_type> > Coordinate_vector;
00089 typedef std::map<Point, Coord_type, K::Less_xy_2> Point_value_map;
00090 typedef std::map<Point, Vector, K::Less_xy_2 > Point_vector_map;
00091 typedef std::pair<Vertex_handle,Vertex_handle> GEdge;
00092
00093 #include <iostream>
00094 #include <algorithm>
00095 #include <functional>
00096 #include <vector>
00097 typedef std::vector<GEdge> EdgeVector ;
00098 typedef EdgeVector::iterator EdgeVectorIterator ;
00099
00100
00101 #include <CGAL/Cartesian.h>
00102 #include <CGAL/Polygon_2.h>
00103 #include <iostream>
00104
00105 typedef CGAL::Cartesian<double> K1;
00106 typedef K1::Point_2 GPoint;
00107 typedef CGAL::Polygon_2<K1> Polygon_2;
00108
00109
00110 bool getPlaneEqn(int x1,int y1,int z1,int x2,int y2,int z2,int x3,int y3,int z3,double *a,double *b);
00111 double getCost(double a1,double b1,double a2,double b2);
00112
00113 bool processForCost(Face_handle f1,int i,Point_value_map values,Delaunay *dt);
00114
00115
00116 #include "cv.h"
00117 #include <highgui.h>
00118 #include <assert.h>