Changeset 917 for trunk/zoo-project/zoo-services/cgal/voronoi.c
- Timestamp:
- May 7, 2019, 2:17:08 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property
svn:mergeinfo
set to
False
/branches/prototype-v0 merged eligible
-
Property
svn:mergeinfo
set to
False
-
trunk/zoo-project/zoo-services/cgal/voronoi.c
r775 r917 24 24 25 25 #include <CGAL/Exact_predicates_inexact_constructions_kernel.h> 26 #include <CGAL/Triangulation_euclidean_traits_xy_3.h>26 //#include <CGAL/Triangulation_euclidean_traits_2.h> 27 27 #include <CGAL/Delaunay_triangulation_2.h> 28 #include <CGAL/Constrained_Delaunay_triangulation_2.h>28 //#include <CGAL/Constrained_Delaunay_triangulation_2.h> 29 29 #include <CGAL/Triangulation_conformer_2.h> 30 30 #include <CGAL/Triangulation_face_base_2.h> … … 39 39 40 40 typedef CGAL::Delaunay_triangulation_2<Kernel> Triangulation; 41 typedef Triangulation::Face_iterator Face_iterator; 41 42 typedef Triangulation::Edge_iterator Edge_iterator; 42 43 typedef Triangulation::Vertex_circulator Vertex_circulator; … … 45 46 46 47 int Voronoi(maps*& conf,maps*& inputs,maps*& outputs){ 47 #ifdef DEBUG48 //#ifdef DEBUG 48 49 fprintf(stderr,"\nService internal print\nStarting\n"); 49 #endif 50 //#endif 51 //return SERVICE_FAILED; 50 52 maps* cursor=inputs; 51 53 OGRGeometryH geometry,res; … … 54 56 tmpm=getMapFromMaps(inputs,"InputPoints","value"); 55 57 58 fprintf(stderr," **** %s %d\n",__FILE__,__LINE__); 59 fflush(stderr); 60 56 61 OGRRegisterAll(); 57 62 58 std::vector<Point> points; 59 if(int res=parseInput(conf,inputs,&points,"/vsimem/tmp")!=SERVICE_SUCCEEDED) 60 return res; 63 std::vector<Pointz> points; 64 if(int res=parseInput(conf,inputs,&points,"/vsimem/tmp")!=SERVICE_SUCCEEDED){ 65 fprintf(stderr," **** %s %d\n",__FILE__,__LINE__); 66 fflush(stderr); 67 return SERVICE_FAILED; 68 } 69 fprintf(stderr," **** %s %d\n",__FILE__,__LINE__); 70 fflush(stderr); 61 71 62 72 Triangulation T; 63 73 T.insert(points.begin(), points.end()); 64 74 65 OGRRegisterAll();75 //OGRRegisterAll(); 66 76 /* -------------------------------------------------------------------- */ 67 77 /* Try opening the output datasource as an existing, writable */ … … 187 197 int ns = 0; 188 198 int nr = 0; 199 int nf = 0; 200 Face_iterator fit =T.faces_begin(); 201 FILE* f=fopen("/tmp/toto.log","w+"); 202 for ( ; fit !=T.faces_end(); ++fit) { 203 fprintf(stderr," *** %s %d %d %d\n",__FILE__,__LINE__,nf,fit.info()); 204 fflush(stderr); 205 206 nf++; 207 } 208 fclose(f); 189 209 Edge_iterator eit =T.edges_begin(); 190 210 for ( ; eit !=T.edges_end(); ++eit) { 191 211 CGAL::Object o = T.dual(eit); 192 212 if (const Kernel::Segment_2 *tmp=CGAL::object_cast<Kernel::Segment_2>(&o)) { 193 const Point p1=tmp->source(); 194 const Point p2=tmp->target(); 213 const Pointz p1=tmp->source(); 214 const Pointz p2=tmp->target(); 215 fprintf(stderr,"P1 %d %d | P2 %d %d\n",p1.x(),p1.y(),p2.x(),p2.y()); 195 216 #ifdef DEBUG 196 217 fprintf(stderr,"P1 %d %d | P2 %d %d\n",p1.x(),p1.y(),p2.x(),p2.y()); … … 210 231 } 211 232 else if (const Kernel::Ray_2 *tmp=CGAL::object_cast<Kernel::Ray_2>(&o)) { 212 const Point p1=tmp->source();213 const Point p2=tmp->point(2);233 const Pointz p1=tmp->source(); 234 const Pointz p2=tmp->point(2); 214 235 OGRFeatureH hFeature = OGR_F_Create( OGR_L_GetLayerDefn( poDstLayer ) ); 215 236 OGRGeometryH currLine=OGR_G_CreateGeometry(wkbLineString); … … 250 271 fprintf(stderr,"\nService internal print\n===\n"); 251 272 #endif 252 OGRCleanupAll();273 //OGRCleanupAll(); 253 274 return SERVICE_SUCCEEDED; 254 275 }
Note: See TracChangeset
for help on using the changeset viewer.