Ticket #83: cgal.patch
File cgal.patch, 1.6 KB (added by djay, 12 years ago) |
---|
Patch |
-
./service.c
233 233 if (const K::Segment_2 *tmp=CGAL::object_cast<K::Segment_2>(&o)) { 234 234 const K::Point_2 p1=tmp->source(); 235 235 const K::Point_2 p2=tmp->target(); 236 #ifdef DEBUG236 //#ifdef DEBUG 237 237 fprintf(stderr,"P1 %d %d | P2 %d %d\n",p1.x(),p1.y(),p2.x(),p2.y()); 238 #endif238 //#endif 239 239 OGRFeatureH hFeature = OGR_F_Create( OGR_L_GetLayerDefn( poDstLayer ) ); 240 240 OGRGeometryH currLine=OGR_G_CreateGeometry(wkbLineString); 241 241 OGR_G_AddPoint_2D(currLine,p1.x(),p1.y()); … … 249 249 OGR_F_Destroy( hFeature ); 250 250 ++ns ; 251 251 } 252 else if (CGAL::object_cast<K::Ray_2>(&o)) {++nr;} 252 else if (const K::Ray_2 *tmp=CGAL::object_cast<K::Ray_2>(&o)) { 253 const K::Point_2 p1=tmp->source(); 254 const K::Point_2 p2=tmp->point(100); 255 OGRFeatureH hFeature = OGR_F_Create( OGR_L_GetLayerDefn( poDstLayer ) ); 256 OGRGeometryH currLine=OGR_G_CreateGeometry(wkbLineString); 257 OGR_G_AddPoint_2D(currLine,p1.x(),p1.y()); 258 OGR_G_AddPoint_2D(currLine,p2.x(),p2.y()); 259 OGR_F_SetGeometry( hFeature, currLine ); 260 OGR_G_DestroyGeometry(currLine); 261 if( OGR_L_CreateFeature( poDstLayer, hFeature ) != OGRERR_NONE ){ 262 setMapInMaps(conf,"lenv","message","Failed to create feature in file.\n"); 263 return SERVICE_FAILED; 264 } 265 OGR_F_Destroy( hFeature ); 266 ++nr; 267 fprintf(stderr,"Edge as a ray: P1 %d %d | P2 %d %d \n",p1.x(),p1.y(),p2.x(),p2.y()); 268 } 253 269 } 254 270 OGR_DS_Destroy( poODS ); 255 271 OGRCleanupAll();