Changeset 862 for branches/prototype-v0/zoo-project/zoo-services/cgal
- Timestamp:
- Feb 1, 2018, 11:27:28 AM (7 years ago)
- Location:
- branches/prototype-v0/zoo-project/zoo-services/cgal
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/prototype-v0/zoo-project/zoo-services/cgal/Makefile
r779 r862 1 1 ZRPATH=../.. 2 2 include ${ZRPATH}/zoo-kernel/ZOOMakefile.opts 3 CFLAGS= -I${INST_INCLUDE}${ZOO_CFLAGS} ${XML2CFLAGS} ${GDAL_CFLAGS} ${PYTHONCFLAGS} ${CGAL_CFLAGS} -frounding-math -fPIC -DLINUX_FREE_ISSUE #-DDEBUG3 CFLAGS= ${ZOO_CFLAGS} ${XML2CFLAGS} ${GDAL_CFLAGS} ${PYTHONCFLAGS} ${CGAL_CFLAGS} -frounding-math -fPIC -DLINUX_FREE_ISSUE #-DDEBUG 4 4 CC=gcc 5 5 … … 7 7 g++ ${CFLAGS} -c ./delaunay.c 8 8 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_service9 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 10 10 11 11 cgal_service.o: cgal_service.c cgal_service.h -
branches/prototype-v0/zoo-project/zoo-services/cgal/cgal_service.c
r775 r862 24 24 #include "cgal_service.h" 25 25 26 int parseInput(maps* conf,maps* inputs, std::vector<Point >* points,char* filename){26 int parseInput(maps* conf,maps* inputs, std::vector<Pointz>* points,char* filename){ 27 27 map* tmpm=NULL; 28 28 tmpm=getMapFromMaps(inputs,"InputPoints","value"); … … 87 87 break; 88 88 if(poFeature->GetGeometryRef() != NULL){ 89 points->push_back(Point (OGR_G_GetX(poFeature->GetGeometryRef(),0),OGR_G_GetY(poFeature->GetGeometryRef(),0)));89 points->push_back(Pointz(OGR_G_GetX(poFeature->GetGeometryRef(),0),OGR_G_GetY(poFeature->GetGeometryRef(),0))); 90 90 } 91 91 } -
branches/prototype-v0/zoo-project/zoo-services/cgal/cgal_service.h
r469 r862 38 38 39 39 typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; 40 typedef Kernel::Point_2 Point ;40 typedef Kernel::Point_2 Pointz; 41 41 42 int parseInput(maps*,maps*, std::vector<Point >*,char*);42 int parseInput(maps*,maps*, std::vector<Pointz>*,char*); 43 43 44 44 #endif -
branches/prototype-v0/zoo-project/zoo-services/cgal/cgi-env/Voronoi.zcfg
r536 r862 46 46 </Default> 47 47 <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> 48 54 mimeType = text/xml 49 55 encoding = base64 -
branches/prototype-v0/zoo-project/zoo-services/cgal/delaunay.c
r775 r862 40 40 OGRRegisterAll(); 41 41 42 std::vector<Point > points;42 std::vector<Pointz> points; 43 43 if(int res=parseInput(conf,inputs,&points,"/vsimem/tmp")!=SERVICE_SUCCEEDED) 44 44 return res; -
branches/prototype-v0/zoo-project/zoo-services/cgal/voronoi.c
r775 r862 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 */ … … 191 201 CGAL::Object o = T.dual(eit); 192 202 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();203 const Pointz p1=tmp->source(); 204 const Pointz p2=tmp->target(); 195 205 #ifdef DEBUG 196 206 fprintf(stderr,"P1 %d %d | P2 %d %d\n",p1.x(),p1.y(),p2.x(),p2.y()); … … 210 220 } 211 221 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);222 const Pointz p1=tmp->source(); 223 const Pointz p2=tmp->point(2); 214 224 OGRFeatureH hFeature = OGR_F_Create( OGR_L_GetLayerDefn( poDstLayer ) ); 215 225 OGRGeometryH currLine=OGR_G_CreateGeometry(wkbLineString); … … 250 260 fprintf(stderr,"\nService internal print\n===\n"); 251 261 #endif 252 OGRCleanupAll();262 //OGRCleanupAll(); 253 263 return SERVICE_SUCCEEDED; 254 264 }
Note: See TracChangeset
for help on using the changeset viewer.