Ticket #83: cgal.patch

File cgal.patch, 1.6 KB (added by djay, 11 years ago)

Patch

  • ./service.c

     
    233233      if (const K::Segment_2 *tmp=CGAL::object_cast<K::Segment_2>(&o)) {
    234234       const K::Point_2 p1=tmp->source();
    235235       const K::Point_2 p2=tmp->target();
    236 #ifdef DEBUG
     236//#ifdef DEBUG
    237237       fprintf(stderr,"P1 %d %d | P2 %d %d\n",p1.x(),p1.y(),p2.x(),p2.y());
    238 #endif
     238//#endif
    239239       OGRFeatureH hFeature = OGR_F_Create( OGR_L_GetLayerDefn( poDstLayer ) );
    240240       OGRGeometryH currLine=OGR_G_CreateGeometry(wkbLineString);
    241241       OGR_G_AddPoint_2D(currLine,p1.x(),p1.y());
     
    249249       OGR_F_Destroy( hFeature );
    250250       ++ns ;
    251251      }
    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       }
    253269    }
    254270    OGR_DS_Destroy( poODS );
    255271    OGRCleanupAll();

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png