Ignore:
Timestamp:
May 7, 2019, 2:17:08 PM (5 years ago)
Author:
djay
Message:

Merge prototype-v0 branch in trunk

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/zoo-project/zoo-services/cgal/Makefile

    r779 r917  
    11ZRPATH=../..
    22include ${ZRPATH}/zoo-kernel/ZOOMakefile.opts
    3 CFLAGS=-I${INST_INCLUDE} ${ZOO_CFLAGS} ${XML2CFLAGS} ${GDAL_CFLAGS} ${PYTHONCFLAGS} ${CGAL_CFLAGS} -frounding-math -fPIC -DLINUX_FREE_ISSUE #-DDEBUG
     3CFLAGS= ${ZOO_CFLAGS} ${XML2CFLAGS} ${GDAL_CFLAGS} ${PYTHONCFLAGS} ${CGAL_CFLAGS} -frounding-math -fPIC -DLINUX_FREE_ISSUE #-DDEBUG
    44CC=gcc
    55
     
    77        g++ ${CFLAGS} -c ./delaunay.c
    88        g++ ${CFLAGS} -c ./voronoi.c
    9         g++ ${CFLAGS} -shared -o cgi-env/cgal_service.zo ./delaunay.o ./voronoi.o ./cgal_service.o ${GDAL_LIBS} ${MACOS_LD_FLAGS} ${CGAL_LDFLAGS} -lCGAL -lgmp ${GDAL_LIBS} -L${ZRPATH}/zoo-kernel/ -lzoo_service
     9        g++ ${CFLAGS} -shared -o cgi-env/cgal_service.zo ./delaunay.o ./voronoi.o ./cgal_service.o ${GDAL_LIBS} ${CGAL_LDFLAGS} -lCGAL -lgmp ${GDAL_LIBS} -L${ZRPATH}/zoo-kernel/ -lzoo_service -lfcgi
    1010
    1111cgal_service.o: cgal_service.c cgal_service.h
  • trunk/zoo-project/zoo-services/cgal/cgal_service.c

    r775 r917  
    2424#include "cgal_service.h"
    2525
    26 int parseInput(maps* conf,maps* inputs, std::vector<Point>* points,char* filename){
     26int parseInput(maps* conf,maps* inputs, std::vector<Pointz>* points,char* filename){
    2727  map* tmpm=NULL;
    28   tmpm=getMapFromMaps(inputs,"InputPoints","value");
    29   VSILFILE *ifile=VSIFileFromMemBuffer(filename,(GByte*)tmpm->value,strlen(tmpm->value),FALSE);
    30   VSIFCloseL(ifile);
     28  tmpm=getMapFromMaps(inputs,"InputPoints","cache_file");
    3129#if GDAL_VERSION_MAJOR >= 2
    32   GDALDataset *ipoDS =
    33     (GDALDataset*) GDALOpenEx( filename,
    34                                GDAL_OF_READONLY | GDAL_OF_VECTOR,
    35                                NULL, NULL, NULL );
     30  GDALDataset *ipoDS;
    3631#else
    37   OGRDataSource* ipoDS = OGRSFDriverRegistrar::Open(filename,FALSE);
     32  OGRDataSource* ipoDS;
    3833#endif
     34  if(tmpm==NULL){
     35    tmpm=getMapFromMaps(inputs,"InputPoints","value");
     36    VSILFILE *ifile=VSIFileFromMemBuffer(filename,(GByte*)tmpm->value,strlen(tmpm->value),FALSE);
     37    VSIFCloseL(ifile);
     38#if GDAL_VERSION_MAJOR >= 2
     39  ipoDS = (GDALDataset*) GDALOpenEx( filename,
     40                                     GDAL_OF_READONLY | GDAL_OF_VECTOR,
     41                                     NULL, NULL, NULL );
     42#else
     43  ipoDS = OGRSFDriverRegistrar::Open(filename,FALSE);
     44#endif
     45  }else
     46#if GDAL_VERSION_MAJOR >= 2
     47    ipoDS = (GDALDataset*) GDALOpenEx( tmpm->value,
     48                                       GDAL_OF_READONLY | GDAL_OF_VECTOR,
     49                                       NULL, NULL, NULL );
     50#else
     51    ipoDS = OGRSFDriverRegistrar::Open(tmpm->value,FALSE);
     52#endif
     53   
    3954  if( ipoDS == NULL )
    4055    {
     
    87102          break;
    88103        if(poFeature->GetGeometryRef() != NULL){
    89           points->push_back(Point(OGR_G_GetX(poFeature->GetGeometryRef(),0),OGR_G_GetY(poFeature->GetGeometryRef(),0)));
     104          points->push_back(Pointz(OGR_G_GetX(poFeature->GetGeometryRef(),0),OGR_G_GetY(poFeature->GetGeometryRef(),0)));
    90105        }
    91106      }
  • trunk/zoo-project/zoo-services/cgal/cgal_service.h

    r469 r917  
    3838
    3939typedef CGAL::Exact_predicates_inexact_constructions_kernel            Kernel;
    40 typedef Kernel::Point_2                                                Point;
     40typedef Kernel::Point_2                                                Pointz;
    4141
    42 int parseInput(maps*,maps*, std::vector<Point>*,char*);
     42int parseInput(maps*,maps*, std::vector<Pointz>*,char*);
    4343
    4444#endif
  • trunk/zoo-project/zoo-services/cgal/cgi-env/Voronoi.zcfg

    r536 r917  
    4646    </Default>
    4747    <Supported>
     48      mimeType = image/png
     49      useMapserver = true
     50      asReference = true
     51      msStyle = STYLE COLOR 125 0 105 OUTLINECOLOR 0 0 0 WIDTH 0.3 OPACITY 65 END
     52    </Supported>
     53    <Supported>
    4854     mimeType = text/xml
    4955     encoding = base64
  • trunk/zoo-project/zoo-services/cgal/delaunay.c

    r775 r917  
    4040    OGRRegisterAll();
    4141
    42     std::vector<Point> points;
     42    std::vector<Pointz> points;
    4343    if(int res=parseInput(conf,inputs,&points,"/vsimem/tmp")!=SERVICE_SUCCEEDED)
    4444      return res;
  • trunk/zoo-project/zoo-services/cgal/voronoi.c

    r775 r917  
    2424
    2525#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>
    2727#include <CGAL/Delaunay_triangulation_2.h>
    28 #include <CGAL/Constrained_Delaunay_triangulation_2.h>
     28//#include <CGAL/Constrained_Delaunay_triangulation_2.h>
    2929#include <CGAL/Triangulation_conformer_2.h>
    3030#include <CGAL/Triangulation_face_base_2.h>
     
    3939
    4040typedef CGAL::Delaunay_triangulation_2<Kernel>  Triangulation;
     41typedef Triangulation::Face_iterator  Face_iterator;
    4142typedef Triangulation::Edge_iterator  Edge_iterator;
    4243typedef Triangulation::Vertex_circulator Vertex_circulator;
     
    4546
    4647  int Voronoi(maps*& conf,maps*& inputs,maps*& outputs){
    47 #ifdef DEBUG
     48    //#ifdef DEBUG
    4849    fprintf(stderr,"\nService internal print\nStarting\n");
    49 #endif
     50    //#endif
     51    //return SERVICE_FAILED;
    5052    maps* cursor=inputs;
    5153    OGRGeometryH geometry,res;
     
    5456    tmpm=getMapFromMaps(inputs,"InputPoints","value");
    5557
     58    fprintf(stderr," **** %s %d\n",__FILE__,__LINE__);
     59    fflush(stderr);
     60
    5661    OGRRegisterAll();
    5762
    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);
    6171   
    6272    Triangulation T;
    6373    T.insert(points.begin(), points.end());
    6474
    65     OGRRegisterAll();
     75    //OGRRegisterAll();
    6676    /* -------------------------------------------------------------------- */
    6777    /*      Try opening the output datasource as an existing, writable      */
     
    187197    int ns = 0;
    188198    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);
    189209    Edge_iterator eit =T.edges_begin();
    190210    for ( ; eit !=T.edges_end(); ++eit) {
    191211      CGAL::Object o = T.dual(eit);
    192212      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());
    195216#ifdef DEBUG
    196217        fprintf(stderr,"P1 %d %d | P2 %d %d\n",p1.x(),p1.y(),p2.x(),p2.y());
     
    210231      }
    211232      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);
    214235        OGRFeatureH hFeature = OGR_F_Create( OGR_L_GetLayerDefn( poDstLayer ) );
    215236        OGRGeometryH currLine=OGR_G_CreateGeometry(wkbLineString);
     
    250271    fprintf(stderr,"\nService internal print\n===\n");
    251272#endif
    252     OGRCleanupAll();
     273    //OGRCleanupAll();
    253274    return SERVICE_SUCCEEDED;
    254275  }
Note: See TracChangeset for help on using the changeset viewer.

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