diff --git a/.gitattributes b/.gitattributes index f0b6356affb..12e445c0bb1 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2276,8 +2276,6 @@ Tutorial/tutorial/Polyhedron/sgp2004/paper/figs/stock.ppt -text svneol=unset#uns Tutorial/tutorial/Polyhedron/sgp2004/paper/figs/subdivision.eps -text Tutorial/tutorial/Polyhedron/sgp2004/paper/figs/teaser.eps -text Tutorial/tutorial/Polyhedron/sgp2004/paper/figs/trimming.eps -text -Viewer_3/doc_tex/Viewer_3/viewer.eps -text -Viewer_3/doc_tex/Viewer_3/viewer.gif -text svneol=unset#unset Visibility_complex/demo/Visibility_complex/pixmaps/cw_flip.xpm -text Visibility_complex/demo/Visibility_complex/pixmaps/cw_flip_parallele.xpm -text Visibility_complex/demo/Visibility_complex/pixmaps/flip.xpm -text diff --git a/Viewer_3/Makefile b/Viewer_3/Makefile deleted file mode 100644 index 1bb794cd86f..00000000000 --- a/Viewer_3/Makefile +++ /dev/null @@ -1,66 +0,0 @@ -# Makefile for CGAL's Triangulation3 package. - -#CVS_MODULE_NAME=tet -Package=Viewer_3 - -#.PHONY: doc package test submit version rtag -VERSION=0.5 -WWW_base=/u/www-sop/0/www/htdocs/files/equipes/prisme/CGAL/DR:/Members -WWW_dir=$(WWW_base)/$(Package) -TMP_file=/tmp/submit-mail - -package: $(Package).tar.gz - @echo "-----------------------------------" - @echo "------------ Penser à: ------------" - @echo "-----------------------------------" - @echo "---- changes.txt ----" - @echo "---- make test ----" - @echo "---- make VERSION=4.11 version ----" - @echo "---- cvs commit ----" - @echo "---- make VERSION=4.11 rtag ----" - @echo "---- make package ----" - @echo "---- make submit ----" - @echo "-----------------------------------" - -version: - echo "$(VERSION) (`date '+%e %b %Y'`)" > version - echo "maintainer: Francois Rebufat " >> version - -#rtag: -# cvs rtag v`echo $(VERSION) | sed -e "s/\./_/g"` $(CVS_MODULE_NAME) - -submit: package - cp $(Package).tar.gz doc_ps/$(Package).ps version description.txt \ - $(WWW_dir) -# cvs update $(LOCAL)/Tetrahedralization - rm -f $(WWW_dir)/$(Package).ps.gz - gzip -9 $(WWW_dir)/$(Package).ps - echo > $(TMP_file) - echo "submission::" >> $(TMP_file) - echo "http://www-sop.inria.fr/prisme/CGAL/DR:/Members" >> $(TMP_file) - echo "/$(Package)/$(Package).tar.gz" >> $(TMP_file) - mail -s autohandle cgal-submit@cs.uu.nl rebufat < $(TMP_file) - rm -f $(TMP_file) - -test: ./test/Viewer_3/Viewer_test.o - $(MAKE) -C test/$(Package) - -clean: -# $(MAKE) -C doc_tex/support/$(Package) clean -# $(MAKE) -C examples/$(Package) clean - $(MAKE) -C test/$(Package) clean - rm -f $(Package).tar.gz - -$(Package).tar.gz: - tar -zcvf $(Package).tar.gz \ - --exclude=CVS --exclude=manual.tex --exclude=Makefile \ - --exclude=Viewer_3_ref \ - --exclude=TODO \ - --exclude=.pure --exclude=*.pv \ - --exclude=.nfs*\ - version description.txt \ - demo include doc_tex doc_ps src - -doc: doc_ps/$(Package).ps - $(MAKE) -C doc_tex/support/$(Package) - cp doc_tex/support/$(Package)/$(Package).ps doc_ps/ diff --git a/Viewer_3/demo/Viewer_3/custom_win.h b/Viewer_3/demo/Viewer_3/custom_win.h deleted file mode 100644 index bc1750f474e..00000000000 --- a/Viewer_3/demo/Viewer_3/custom_win.h +++ /dev/null @@ -1,117 +0,0 @@ -//#include -#include -#include "triang_2.h" - - - - -void close_c(Fl_Widget* w, void* v) -{ - - Fl_Window* win = (Fl_Window*) v; - delete win; - -} - - - - -void tri_cb(Fl_Widget* w, void* v) -{ - CGAL::Viewer_3* win = (CGAL::Viewer_3*) v; - typedef Triangulation_2::Point Point; - Triangulation_2* tr = new Triangulation_2(); - CGAL::Vector_2 disp( 425.0, 425.0 ); - CGAL::Random_points_in_square_2 > - g ( 500.0 ); - for (int i=0; i<100; i++) - tr->insert(*g++ + disp); - CGAL::Drawable_triangulation_2* dtr = new CGAL::Drawable_triangulation_2(*tr,win->get_color(1), CGAL::ORANGE,CGAL::RAW, 2); - win->add_drawable(dtr, win->get_group() + 1); - win->display(); -} - - -void del_cb(Fl_Widget* w, void* v) -{ - CGAL::Viewer_3* win = (CGAL::Viewer_3*) v; - typedef Delaunay_2::Point Point; - Delaunay_2* tr = new Delaunay_2(); - CGAL::Vector_2 disp( 425.0, 425.0 ); - CGAL::Random_points_in_square_2 > - g ( 500.0 ); - for (int i=0; i<100; i++) - tr->insert(*g++ + disp); - CGAL::Drawable_triangulation_2* dtr = new CGAL::Drawable_triangulation_2(*tr,win->get_color(1), CGAL::ORANGE,CGAL::RAW, 2); - win->add_drawable(dtr, win->get_group() + 1); - win->display(); -} - - -void vor_cb(Fl_Widget* w, void* v) -{ - CGAL::Viewer_3* win = (CGAL::Viewer_3*) v; - typedef Delaunay_2::Point Point; - Delaunay_2* tr = new Delaunay_2(); - CGAL::Vector_2 disp( 425.0, 425.0 ); - CGAL::Random_points_in_square_2 > - g ( 500.0 ); - for (int i=0; i<100; i++) - tr->insert(*g++ + disp); - CGAL:: Drawable_voronoi_2* vo = new CGAL::Drawable_voronoi_2(*tr,win->get_color(1), CGAL::RAW, 2); - win->add_drawable(vo, win->get_group() + 1); - win->display(); -} - - -void vord_cb(Fl_Widget* w, void* v) -{ - CGAL::Viewer_3* win = (CGAL::Viewer_3*) v; - typedef Delaunay_2::Point Point; - Delaunay_2* tr = new Delaunay_2(); - CGAL::Vector_2 disp( 425.0, 425.0 ); - CGAL::Random_points_in_square_2 > - g ( 500.0 ); - for (int i=0; i<100; i++) - tr->insert(*g++ + disp); - CGAL::Drawable_voronoi_2* vor = new CGAL::Drawable_voronoi_2(*tr,CGAL::ORANGE, CGAL::RAW, 2); - win->add_drawable(vor, win->get_group() + 1); - CGAL::Drawable_triangulation_2* dtr = new - CGAL::Drawable_triangulation_2(*tr,CGAL::BLUE, - CGAL::GREEN ,CGAL::RAW, 2); - win->add_drawable(dtr, win->get_group() ); - - win->display(); -} - - - - -void my_panel(CGAL::GL_win* win, CGAL::Viewer_3* view) -{ - - - Fl_Window* flwin = new Fl_Window(100,500,"Demo win"); - - Fl_Button* tri = new Fl_Button(5,5,80,25,"Triangulation"); - tri->callback(tri_cb,(void *) view); - - Fl_Button* del = new Fl_Button(5,35,80,25,"Delaunay"); - del->callback(del_cb,(void *) view); - - - Fl_Button* vor = new Fl_Button(5,65,80,25,"Voronoi"); - vor->callback(vor_cb,(void *) view); - - Fl_Button* vord = new Fl_Button(5,95,80,25,"Vor. and Del."); - vord->callback(vord_cb,(void *) view); - - - Fl_Button* close = new Fl_Button(5,470,80,25,"Done"); - close->callback(close_c,(void *) flwin); - flwin->end(); - flwin->show(); - -} - - diff --git a/Viewer_3/demo/Viewer_3/demo.C b/Viewer_3/demo/Viewer_3/demo.C deleted file mode 100644 index 6f7602ccf8a..00000000000 --- a/Viewer_3/demo/Viewer_3/demo.C +++ /dev/null @@ -1,132 +0,0 @@ -#include -#include - -#include "custom_win.h" -#include "myhandler.h" - - -typedef CGAL::Point_3 point_t; -typedef CGAL::Point_2 point2; -typedef CGAL::Segment_3 segment; -typedef CGAL::Segment_2 segment2; -typedef CGAL::Triangle_3 triangle; -typedef CGAL::Triangle_2 triangle2; -typedef CGAL::Tetrahedron_3 tetra; -typedef CGAL::Line_3 Line; -//typedef CGAL::Line_2 Line2; -typedef CGAL::Ray_3 Ray; -//typedef CGAL::Ray_2 Ray2; -typedef CGAL::Circle_2 circle2; -std::list all_points; - - - -int main(int argc, char *argv[]) -{ - - CGAL::Viewer_3 W(500); - W.init_window_thread(); - W.set_custom_panel(my_panel); - W.set_mouse_push_handler(myhandler); - stop(); - std::cerr << "after 1st stop" << std::endl; - point_t p1(100,100,100); - point_t p2(200,100,100); - point_t p3(300,100,100); - CGAL::Drawable_point_3 dp1(p1,CGAL::RED,CGAL::FILL,25,50); - - CGAL::Drawable_point_3 dp2(p2,CGAL::RED,CGAL::FILL,25,50); - CGAL::Drawable_point_3 dp3(p3,CGAL::RED,CGAL::FILL,25,50); - - - point_t p4(100,200,100); - point_t p5(200,200,100); - point_t p6(300,200,100); - - CGAL::Drawable_point_3 dp4(p4,CGAL::VIOLET,CGAL::FILL,5,50); - CGAL::Drawable_point_3 dp5(p5,CGAL::GRAY,CGAL::FILL,10,50); - CGAL::Drawable_point_3 dp6(p6,CGAL::DEEPBLUE,CGAL::FILL,15,50); - - point_t p7(100,300,-100); - point_t p8(200,300,-100); - point_t p9(300,300,-100); - - CGAL::Drawable_point_3 dp7(p7,CGAL::ORANGE,CGAL::FILL,10,15); - CGAL::Drawable_point_3 dp8(p8,CGAL::GREEN,CGAL::WIRE,10,15); - CGAL::Drawable_point_3 dp9(p9,CGAL::GREEN,CGAL::RAW,10,15); - - point_t p10(100,400,500); - point_t p11(200,400,500); - point_t p12(300,400,500); - - CGAL::Drawable_point_3 dp10(p10,CGAL::WHITE,CGAL::RAW,5,8); - CGAL::Drawable_point_3 dp11(p11,CGAL::PURPLE,CGAL::FILL,5,15); - CGAL::Drawable_point_3 dp12(p12,CGAL::YELLOW,CGAL::WIRE,50,20); - - Line ln(point_t(300,300,1),point_t(300,300,-1)); - Ray ry1(point_t(300,300,0), point_t(400,300,0)); - Ray ry2(point_t(300,300,0), point_t(400,350,0)); - - CGAL::Drawable_line_3 dln(ln,CGAL::RED,CGAL::FILL,5,20); - CGAL::Drawable_ray_3 dry1(ry1,CGAL::BLUE,CGAL::FILL,5,10); - CGAL::Drawable_ray_3 dry2(ry2,CGAL::BLUE,CGAL::RAW,5,10); - - - triangle tr(point_t(10,10,-200),point_t(300,10,-200),point_t(200,200,-100)); - - tetra - tet(point_t(100,100,-200),point_t(400,100,-300),point_t(400,300,-100),point_t(250,250, 100)); - - - CGAL::Drawable_triangle_3 dtr(tr,CGAL::GRAY,CGAL::RAW); - - CGAL::Drawable_tetrahedron_3 dtet(tet,CGAL::ORANGE); - - segment s(p10,p11); - CGAL::Drawable_segment_3 ds1(s,CGAL::VIOLET,CGAL::FILL,5,10); - - - std::list lp; - lp.push_back(point_t(10,10,0)); - lp.push_back(point_t(20,20,0)); - lp.push_back(point_t(30,30,0)); - lp.push_back(point_t(40,40,0)); - std::list::iterator first=lp.begin(), last=lp.end(); - CGAL::Drawable_points_set_3::iterator,point_t> - dlp(first,last,CGAL::RED,CGAL::FILL,5,30); - - // W << tr ; - W.add_drawable(&dp1); - W.add_drawable(&dp2); - W.add_drawable(&dp3); - W.display(); - stop(); - W.add_drawable(&dp4); - W.add_drawable(&dp5); - W.add_drawable(&dp6); - - W.add_drawable(&dp7); - W.add_drawable(&dp8); - W.add_drawable(&dp9); - - W.add_drawable(&dp10,2); - W.add_drawable(&dp11,2); - W.add_drawable(&dp12,2); - - W.add_drawable(&dln,3); - W.add_drawable(&dry1,3); - W.add_drawable(&dry2,3); - - - W.add_drawable(&dtr,4); - W.add_drawable(&dtet,5); - - W.add_drawable(&ds1,6); - - W.add_drawable(&dlp,7); - W.display(); - pthread_join(W.get_window_thread(), NULL); - // W.main_loop(); - return 0; // to satisfy MSVC... -} - diff --git a/Viewer_3/demo/Viewer_3/demo_win.h b/Viewer_3/demo/Viewer_3/demo_win.h deleted file mode 100644 index 8f9e80874b2..00000000000 --- a/Viewer_3/demo/Viewer_3/demo_win.h +++ /dev/null @@ -1,208 +0,0 @@ -#include -#include -#include - -#if !defined(_MSC_VER) && !defined(__BORLANDC__) -#include -#endif - -//#include "triang_2.h" - -typedef CGAL::Cartesian rep_t; -typedef CGAL::Triangulation_euclidean_traits_2< rep_t > Ttraits; -typedef CGAL::Triangulation_vertex_base_2 Vertex_base ; -typedef CGAL::Triangulation_face_base_2 Face_base ; -typedef CGAL::Triangulation_default_data_structure_2 TDS ; -typedef CGAL::Delaunay_triangulation_2 Delaunay_2; -typedef Delaunay_2::Point Point; -Delaunay_2* tr; - - -void step(int val) -{ - double a=5; - for (int i=0; i!=val*1000;i++) - a= (a*a)/3 + (a*a)/3; -} - - - - -void close_c(Fl_Widget* w, void* v) -{ - - Fl_Window* win = (Fl_Window*) v; - delete win; - -} - - -void del_cb(Fl_Widget* w, void* v) -{ - CGAL::Viewer_3* win = (CGAL::Viewer_3*) v; - tr->clear(); - CGAL::Vector_2 disp( 425.0, 425.0 ); - CGAL::Random_points_in_square_2 > - g ( 500.0 ); - for (int i=0; i<50; i++) - tr->insert(*g++ + disp); - CGAL::Drawable_triangulation_2* dtr = new CGAL::Drawable_triangulation_2(*tr,win->get_color(1), CGAL::ORANGE,CGAL::RAW, 2); - win->add_drawable(dtr, win->get_group()+1); - win->display(); -} - - -void parab_cb(Fl_Widget* w, void* v) -{ - CGAL::Viewer_3* win = (CGAL::Viewer_3*) v; - tr->clear(); - - float i= 0.00000000000001 ; - while (i < 0.0000000001) { - tr->insert(Point(i, i*i)); - i=i+0.00000000000001; - } - std::cerr << "number of faces : " << tr->number_of_faces() << std::endl; - CGAL::Drawable_triangulation_2* dtr = new CGAL::Drawable_triangulation_2(*tr,win->get_color(1), CGAL::ORANGE,CGAL::RAW, 2); - win->add_drawable(dtr, win->get_group()+1); - win->display(); -} - - - - -void iterator_cb(Fl_Widget* w, void* v) -{ - CGAL::Viewer_3* win = (CGAL::Viewer_3*) v; - Delaunay_2::Face_iterator it=tr->finite_faces_begin(); - int gr = win->get_group()+1; - int i=1; - int count = 1; - for (; it != tr->finite_faces_end() ;it++) - { - Delaunay_2::Triangle trg = tr->triangle(it); - CGAL::Drawable_triangle_2* - tri= new - CGAL::Drawable_triangle_2(trg, CGAL::ORANGE, CGAL::DEEPBLUE); - - win->add_drawable(tri,gr); - - win->display(); - - // step(1000); - // sleep(1); - win->remove_drawable(gr, 1); - if (i==500) { - std::cerr << "nombre de faces visitees : " << count << std::endl; - i=0; - } - count ++; - i++; - } - std::cerr << "delete group" << std::endl; - win->delete_group(gr); -} - -void line_face_cb(Fl_Widget* w, void* v) -{ - CGAL::Viewer_3* win = (CGAL::Viewer_3*) v; - CGAL::Vector_2 disp( 425.0, 425.0 ); - CGAL::Random_points_on_segment_2 > - g1 (Point(-100,10),Point(-100,900)); - CGAL::Random_points_on_segment_2 > - g2 (Point(900,10),Point(900,900)); - int gr = win->get_group()+1; - Delaunay_2::Segment sg=Delaunay_2::Segment(*g1,*g2); - CGAL::Drawable_segment_2* - seg= new - CGAL::Drawable_segment_2(sg, CGAL::PURPLE); - win->add_drawable(seg,gr); - Delaunay_2::Line_face_circulator lfc=tr->line_walk(*g1,*g2); - Delaunay_2::Line_face_circulator lfc_o=lfc; - - do { - if (!(tr->is_infinite(lfc))) { - Delaunay_2::Triangle trg = tr->triangle(lfc); - CGAL::Drawable_triangle_2* - tri= new - CGAL::Drawable_triangle_2(trg, CGAL::ORANGE, CGAL::DEEPBLUE); - - win->add_drawable(tri,gr); - - win->display(); - - step(1000); - } - lfc++; - } - - while (lfc != lfc_o); - } - - -void circulator_cb(Fl_Widget* w, void* v) -{ - - CGAL::Viewer_3* win = (CGAL::Viewer_3*) v; - Delaunay_2::Vertex_iterator vit=tr->finite_vertices_begin(); - Delaunay_2::Face_circulator fct, fct_o; - int gr = win->get_group()+1; - for (; vit != tr->finite_vertices_end() ;vit++) - { - fct=tr->incident_faces(vit); - fct_o=fct; - do - { - if (!(tr->is_infinite(fct))) { - Delaunay_2::Triangle trg = tr->triangle(fct); - CGAL::Drawable_triangle_2* - tri= new - CGAL::Drawable_triangle_2(trg, CGAL::ORANGE, CGAL::DEEPBLUE); - - win->add_drawable(tri,gr); - - win->display(); - - step(1000); - - win->remove_drawable(gr, 1); - - } - fct++; - } - while (fct != fct_o); - } - win->delete_group(gr); -} -void demo_panel(CGAL::GL_win* win, CGAL::Viewer_3* view) -{ - - - Fl_Window* flwin = new Fl_Window(100,500,"Demo win"); - - // Fl_Button* tri = new Fl_Button(5,5,80,25,"Triangulation"); - // tri->callback(tri_cb,(void *) view); - - Fl_Button* del = new Fl_Button(5,35,80,25,"Delaunay"); - del->callback(del_cb,(void *) view); - - - Fl_Button* iter = new Fl_Button(5,65,80,25,"iterator"); - iter->callback(iterator_cb,(void *) view); - - Fl_Button* circu = new Fl_Button(5,95,80,25,"circulator"); - circu->callback(circulator_cb,(void *) view); - - Fl_Button* lfc = new Fl_Button(5,125,80,25,"Line face"); - lfc->callback(line_face_cb,(void *) view); - - Fl_Button* para = new Fl_Button(5,155,80,25,"Parabola"); - para->callback(parab_cb,(void *) view); - - - Fl_Button* close = new Fl_Button(5,470,80,25,"Done"); - close->callback(close_c,(void *) flwin); - flwin->end(); - flwin->show(); - -} diff --git a/Viewer_3/demo/Viewer_3/facet_obj.C b/Viewer_3/demo/Viewer_3/facet_obj.C deleted file mode 100644 index 4fc0c88ed20..00000000000 --- a/Viewer_3/demo/Viewer_3/facet_obj.C +++ /dev/null @@ -1,41 +0,0 @@ - -#include "get_data.h" - -typedef CGAL::Point_3 point_t; -typedef CGAL::Tetrahedron_3 tetra; - - - -int main(int argc, char *argv[]) -{ - CGAL::Viewer_3 W(500); - W.init_window_thread(); - stop(); - Delaunay_3 tr; - - tr.insert(point_t(100,100,100)); - tr.insert(point_t(-100,450,-100)); - tr.insert(point_t(0,0,0)); - tr.insert(point_t(200,-130,170)); - tr.insert(point_t(100,-100,-100)); - tr.insert(point_t(400,100,300)); - tr.insert(point_t(210,140,0)); - tr.insert(point_t(-200,50,310)); - tr.insert(point_t(-100,100,-100)); - tr.insert(point_t(100,-300,0)); - tr.insert(point_t(500,-100,-200)); - tr.insert(point_t(200,140,-200)); - tr.insert(point_t(-140,400,-200)); - tr.insert(point_t(100,-350,0)); - tr.insert(point_t(500,-300,-250)); - tr.insert(point_t(300,-100,250)); - - CGAL::Drawable_facets_object_3 - df(tr,CGAL::ORANGE,CGAL::BLACK,"triangulation3"); - W.add_drawable(&df); - W.display(); - pthread_join(W.get_window_thread(), NULL); - // W.main_loop(); - std::cerr << "done." << std::endl; - return 0; -} diff --git a/Viewer_3/demo/Viewer_3/get_data.h b/Viewer_3/demo/Viewer_3/get_data.h deleted file mode 100644 index 4c1b5d06f9b..00000000000 --- a/Viewer_3/demo/Viewer_3/get_data.h +++ /dev/null @@ -1,101 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -typedef CGAL::Cartesian rep_t; -typedef CGAL::Triangulation_geom_traits_3 traits_3; -typedef CGAL::Triangulation_vertex_base_3 Vb ; -typedef CGAL::Triangulation_cell_base_3 Fb; -typedef CGAL::Triangulation_data_structure_3 TDS3 ; -typedef CGAL::Delaunay_triangulation_3 Delaunay_3; - - -CGAL::list_vertices get_vertices(const Delaunay_3 &fo) -{ - Delaunay_3::Vertex_iterator vit; - CGAL::list_vertices res; - CGAL::vertex v(3); - for (vit=fo.finite_vertices_begin(); vit!=fo.vertices_end();vit++) { - v[0]=CGAL::to_double(vit->point().x()); - v[1]=CGAL::to_double(vit->point().y()); - v[2]=CGAL::to_double(vit->point().z()); - res.push_back(v); - } -return res; -} - - -CGAL::list_edges get_edges(const Delaunay_3 &fo) -{ - Delaunay_3::Edge_iterator it; - CGAL::list_edges res; - CGAL::edge ed(2); - CGAL::vertex vx(3); - Delaunay_3::Cell_handle f; - int n1, n2; - Delaunay_3::Vertex_handle v1, v2; - for (it=fo.finite_edges_begin(); it!=fo.edges_end();it++) { - f = (*it).first; - n1 = (*it).second; - n2 = (*it).third; - v1 = f->vertex(n1); - v2 = f->vertex(n2); - vx[0]=CGAL::to_double(v1->point().x()); - vx[1]=CGAL::to_double(v1->point().y()); - vx[2]=CGAL::to_double(v1->point().z()); - ed[0]=vx; - vx[0]=CGAL::to_double(v2->point().x()); - vx[1]=CGAL::to_double(v2->point().y()); - vx[2]=CGAL::to_double(v2->point().z()); - ed[1]=vx; - res.push_back(ed); - } -return res; -} - -CGAL::list_facets get_facets(const Delaunay_3 &fo) -{ - Delaunay_3::Facet_iterator it; - CGAL::list_facets res; - CGAL::facet fa; - CGAL::vertex v(3); - for (it=fo.finite_facets_begin(); it!=fo.facets_end();it++) { - fa.clear(); - v[0]=CGAL::to_double((((*it).first)->vertex(((*it).second +1) - &3))->point().x()); - - v[1]=CGAL::to_double((((*it).first)->vertex(((*it).second +1) - &3))->point().y()); - - v[2]=CGAL::to_double((((*it).first)->vertex(((*it).second +1) - &3))->point().z()); - - fa.push_back(v); - v[0]=CGAL::to_double((((*it).first)->vertex(((*it).second +2) - &3))->point().x()); - - v[1]=CGAL::to_double((((*it).first)->vertex(((*it).second +2) - &3))->point().y()); - - v[2]=CGAL::to_double((((*it).first)->vertex(((*it).second +2) - &3))->point().z()); - - fa.push_back(v); - v[0]=CGAL::to_double((((*it).first)->vertex(((*it).second +3) - &3))->point().x()); - - v[1]=CGAL::to_double((((*it).first)->vertex(((*it).second +3) - &3))->point().y()); - - v[2]=CGAL::to_double((((*it).first)->vertex(((*it).second +3) - &3))->point().z()); - - fa.push_back(v); - res.push_back(fa); - } -return res; -} diff --git a/Viewer_3/demo/Viewer_3/makefile b/Viewer_3/demo/Viewer_3/makefile deleted file mode 100644 index c2bbc0126f5..00000000000 --- a/Viewer_3/demo/Viewer_3/makefile +++ /dev/null @@ -1,103 +0,0 @@ -# This is the makefile for compiling a CGAL application. - -#---------------------------------------------------------------------# -# include platform specific settings -#---------------------------------------------------------------------# -# Choose the right include file from the /make directory. - -#CGAL_MAKEFILE=$(UTIL)/CGAL/CGAL-I/make/makefile_sparc_SunOS-5.6_g++-2.95.2_LEDA -CGAL_MAKEFILE = $(UTIL)/CGAL/CGAL-2.2/make/makefile_sparc_SunOS-5.6_g++-2.95.2_LEDA -#makefile_sparc_SunOS-5.6_eg++-egcs-2.91.66_LEDA -#makefile_sparc_SunOS-5.6_eg++-egcs-2.91.66_LEDA -#makefile_i686_Linux-2.2.14_g++-2.95.2_LEDA -#makefile_sparc_SunOS-5.6_g++-2.95.2_LEDA -#makefile_sparc_SunOS-5.6_g++-2.95.2_LEDA - -include $(CGAL_MAKEFILE) - -FLTK_DIR = ${UTIL}/FLTK/SunOS/fltk-1.0.6 -# ---------------------------------------------------------------------# -# compiler flags -#---------------------------------------------------------------------# -# rajouter CGAL_LOCAL_CXXFLAGS si on veut les packages de Local - -CHECKS_OFF = -DCGAL_NO_PRECONDITIONS -DCGAL_NO_POSTCONDITIONS \ - -DCGAL_NO_ASSERTIONS -DCGAL_NO_WARNINGS - -CXXFLAGS = \ - -I../../include \ - -I../../../Postscript/include/CGAL/IO \ - -I../../../Postscript/src/ \ - -I../include/CGAL/IO \ - -I../include \ - -I../src/ \ - -I${FLTK_DIR} \ - -I/usr/X11R6/include/ \ - -B$(UTIL)/Binutils/$(UNAME)/bin/ \ - -B$(GCC_EXEC_PREFIX) $(LONG_NAME_PROBLEM_CXXFLAGS) \ - $(CGAL_CXXFLAGS) $(CHECKS_OFF) -DUSE_THREAD - - -#---------------------------------------------------------------------# -# linker flags -#---------------------------------------------------------------------# - -VIEWER3_LDFLAGS = \ - $(CGAL_WINDOW_LDFLAGS) \ - -L$(FLTK_DIR)/lib -L/usr/lib/X11 \ - -R$(FLTK_DIR)/lib -R/usr/lib/X11 -Wl \ - -lfltk -lXext -lX11 -lGL -lGLU -lpthread - - -#---------------------------------------------------------------------# -# target entries -#---------------------------------------------------------------------# - - -demo: demo.o - $(CGAL_CXX) -o $@ $(OFILES) demo.o -lpthread $(LDFLAGS) - - -facet_obj: facet_obj.o - $(CGAL_CXX) -o $@ $(OFILES) facet_obj.o -lpthread $(LDFLAGS) - - -tetra1: tetra1.o - $(CGAL_CXX) -o $@ $(OFILES) tetra1.o -lpthread $(LDFLAGS) - -tetra2: tetra2.o - $(CGAL_CXX) -o $@ $(OFILES) tetra2.o -lpthread $(LDFLAGS) - -tetra3: tetra3.o - $(CGAL_CXX) -o $@ $(OFILES) tetra3.o -lpthread $(LDFLAGS) - -terrain: terrain.o - $(CGAL_CXX) -o $@ $(OFILES) terrain.o -lpthread $(LDFLAGS) - -testter: testter.o - $(CGAL_CXX) -o $@ $(OFILES) testter.o -lpthread $(LDFLAGS) - -stream_ex: stream_ex.o - $(CGAL_CXX) -o $@ $(OFILES) stream_ex.o -lpthread $(LDFLAGS) - -all: facet_obj demo tetra1 tetra2 tetra3 terrain stream_ex - -#---------------------------------------------------------------------# -# suffix rules -#---------------------------------------------------------------------# - -.C.o: - $(CGAL_CXX) $(CXXFLAGS) -c -D_REENTRANT $< - -.c.o: - $(CGAL_CXX) $(CXXFLAGS) -c -D_REENTRANT $< - - - - -clean: - rm -f *.o core *~ - rm -f ii_files/* -distclean: clean - rm -f demo facet tetra1 tetra2 tetra3 terrain stream_ex - rm ../include/CGAL/*~ diff --git a/Viewer_3/demo/Viewer_3/makefile.vc b/Viewer_3/demo/Viewer_3/makefile.vc deleted file mode 100644 index c4d209254f5..00000000000 --- a/Viewer_3/demo/Viewer_3/makefile.vc +++ /dev/null @@ -1,115 +0,0 @@ -DEVEL_DIR_INCL = '-I..\..\include' -PTHREAD_DIR = d:\tmp\cgal\pthreads-snap-2000-12-29 -PTHREAD_DIR_INCL = '-I$(PTHREAD_DIR)' -# msvc settings. - -FLTK_DIR = d:\tmp\cgal\fltk\vc\fltk-1.0.10 -FLTK_LIBDIR = d:\tmp\cgal\fltk\vc\fltk-1.0.10\lib -FLTK_LIBPATH = '-LIBPATH:$(FLTK_LIBDIR)' -PTHREAD_LIBPATH = '-LIBPATH:$(PTHREAD_DIR)' - -FLTK_LIBS = \ -opengl32.lib glu32.lib fltk.lib wsock32.lib kernel32.lib user32.lib \ -gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib \ -oleaut32.lib uuid.lib \ -pthread.lib - - -#FLTK_LIBS = -lpthread -lfltk -lXext -lX11 -lGL -lGLU -#GL_DIR = /0/prisme_util/MESA/SunOS/Mesa-3.0/include/ -# GL_DIR = /usr/local/mesa - -CGAL_MAKEFILE=/d/tmp/cgal/CGAL-2.3-I-24/make/CLMT -include $(CGAL_MAKEFILE) - - - -#---------------------------------------------------------------------# -# compiler flags -#---------------------------------------------------------------------# - -CHECKS_OFF = -DCGAL_NO_PRECONDITIONS -DCGAL_NO_POSTCONDITIONS \ - -DCGAL_NO_ASSERTIONS -DCGAL_NO_WARNINGS - - -CXXFLAGS = $(DEVEL_DIR_INCL) $(PTHREAD_DIR_INCL) '-I$(FLTK_DIR)' \ - $(CGAL_CXXFLAGS) $(DEBUG_OPT) \ - $(CHECKS_OFF) \ - -DUSE_THREAD \ - -MT -DWIN32 -DNDEBUG -D_WINDOWS -DWIN32_LEAN_AND_MEAN \ - -DVC_EXTRA_LEAN -DWIN32_EXTRA_LEAN - -# -DUSE_THREAD \ -# -I../../include \ -# -I/usr/X11R6/include/ \ -# -B$(UTIL)/Binutils/SunOS/bin/ \ -# -B$(GCC_EXEC_PREFIX) $(LONG_NAME_PROBLEM_CXXFLAGS) \ - -#-I${GL_DIR}/include \ - -LDFLAGS = $(CGAL_LDFLAGS) $(FLTK_LIBPATH) $(PTHREAD_LIBPATH) $(FLTK_LIBS) - -#-lMesaGL -lMesaGLU - -#-L$(GL_DIR)/lib -#-R$(GL_DIR)/lib -#---------------------------------------------------------------------# -# target entries -#---------------------------------------------------------------------# - - -demo$(EXE_EXT): demo$(OBJ_EXT) - $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)demo $(OFILES) demo$(OBJ_EXT) $(LDFLAGS) - -facet_obj$(EXE_EXT): facet_obj$(OBJ_EXT) - $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)facet_obj $(OFILES) facet_obj$(OBJ_EXT) $(LDFLAGS) - - -tetra1$(EXE_EXT): tetra1$(OBJ_EXT) - $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)tetra1 $(OFILES) tetra1$(OBJ_EXT) $(LDFLAGS) - -tetra2$(EXE_EXT): tetra2$(OBJ_EXT) - $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)tetra2 $(OFILES) tetra2$(OBJ_EXT) $(LDFLAGS) - -tetra3$(EXE_EXT): tetra3$(OBJ_EXT) - $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)tetra3 $(OFILES) tetra3$(OBJ_EXT) $(LDFLAGS) - -terrain$(EXE_EXT): terrain$(OBJ_EXT) - $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)terrain $(OFILES) terrain$(OBJ_EXT) $(LDFLAGS) - -testter$(EXE_EXT): testter$(OBJ_EXT) - $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)testter $(OFILES) testter$(OBJ_EXT) $(LDFLAGS) - -stream_ex$(EXE_EXT): stream_ex$(OBJ_EXT) - $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)stream_ex $(OFILES) stream_ex$(OBJ_EXT) $(LDFLAGS) - -all: tetra3$(EXE_EXT) terrain$(EXE_EXT) stream_ex$(EXE_EXT) - -#all: facet$(EXE_EXT) demo$(EXE_EXT) tetra1$(EXE_EXT) tetra2$(EXE_EXT) tetra3$(EXE_EXT) terrain$(EXE_EXT) stream_ex$(EXE_EXT) - - - -#---------------------------------------------------------------------# -# suffix rules -#---------------------------------------------------------------------# - -.C$(OBJ_EXT): - $(CGAL_CXX) $(CXXFLAGS) -c -D_REENTRANT $< - -.c$(OBJ_EXT): - $(CGAL_CXX) $(CXXFLAGS) -c -D_REENTRANT $< - - - - -clean: \ - demo.clean \ - facet_obj.clean \ - tetra1.clean \ - tetra2.clean \ - tetra3.clean \ - terrain.clean \ - stream_ex.clean - -distclean: clean - rm ../include/CGAL/*~ diff --git a/Viewer_3/demo/Viewer_3/myhandler.h b/Viewer_3/demo/Viewer_3/myhandler.h deleted file mode 100644 index 7b8428d22b5..00000000000 --- a/Viewer_3/demo/Viewer_3/myhandler.h +++ /dev/null @@ -1,7 +0,0 @@ - -void myhandler(int x, int y, int but, CGAL::GL_win *W) { - std::vector v(3); - v[0]=x*2; v[1]=y*2; v[2]=0; - W->add_point_to_object(1,1,v); - -} diff --git a/Viewer_3/demo/Viewer_3/readtex.c b/Viewer_3/demo/Viewer_3/readtex.c deleted file mode 100644 index 77994169240..00000000000 --- a/Viewer_3/demo/Viewer_3/readtex.c +++ /dev/null @@ -1,353 +0,0 @@ -/* readtex.c */ - -/* - * Read an SGI .rgb image file and generate a mipmap texture set. - * Much of this code was borrowed from SGI's tk OpenGL toolkit. - */ - - - -#include -#include -#include -#include -#include - - -#ifndef SEEK_SET -# define SEEK_SET 0 -#endif - - -/* -** RGB Image Structure -*/ - -typedef struct _TK_RGBImageRec { - GLint sizeX, sizeY; - GLint components; - unsigned char *data; -} TK_RGBImageRec; - - - -/******************************************************************************/ - -typedef struct _rawImageRec { - unsigned short imagic; - unsigned short type; - unsigned short dim; - unsigned short sizeX, sizeY, sizeZ; - unsigned long min, max; - unsigned long wasteBytes; - char name[80]; - unsigned long colorMap; - FILE *file; - unsigned char *tmp, *tmpR, *tmpG, *tmpB, *tmpA; - unsigned long rleEnd; - GLuint *rowStart; - GLint *rowSize; -} rawImageRec; - -/******************************************************************************/ - -static void ConvertShort(unsigned short *array, long length) -{ - unsigned long b1, b2; - unsigned char *ptr; - - ptr = (unsigned char *)array; - while (length--) { - b1 = *ptr++; - b2 = *ptr++; - *array++ = (unsigned short) ((b1 << 8) | (b2)); - } -} - -static void ConvertLong(GLuint *array, long length) -{ - unsigned long b1, b2, b3, b4; - unsigned char *ptr; - - ptr = (unsigned char *)array; - while (length--) { - b1 = *ptr++; - b2 = *ptr++; - b3 = *ptr++; - b4 = *ptr++; - *array++ = (b1 << 24) | (b2 << 16) | (b3 << 8) | (b4); - } -} - -static rawImageRec *RawImageOpen(const char *fileName) -{ - union { - int testWord; - char testByte[4]; - } endianTest; - rawImageRec *raw; - GLenum swapFlag; - int x; - - endianTest.testWord = 1; - if (endianTest.testByte[0] == 1) { - swapFlag = GL_TRUE; - } else { - swapFlag = GL_FALSE; - } - - raw = (rawImageRec *)malloc(sizeof(rawImageRec)); - if (raw == NULL) { - fprintf(stderr, "Out of memory!\n"); - return NULL; - } - if ((raw->file = fopen(fileName, "rb")) == NULL) { - perror(fileName); - return NULL; - } - - fread(raw, 1, 12, raw->file); - - if (swapFlag) { - ConvertShort(&raw->imagic, 6); - } - - raw->tmp = (unsigned char *)malloc(raw->sizeX*256); - raw->tmpR = (unsigned char *)malloc(raw->sizeX*256); - raw->tmpG = (unsigned char *)malloc(raw->sizeX*256); - raw->tmpB = (unsigned char *)malloc(raw->sizeX*256); - if (raw->sizeZ==4) { - raw->tmpA = (unsigned char *)malloc(raw->sizeX*256); - } - if (raw->tmp == NULL || raw->tmpR == NULL || raw->tmpG == NULL || - raw->tmpB == NULL) { - fprintf(stderr, "Out of memory!\n"); - return NULL; - } - - if ((raw->type & 0xFF00) == 0x0100) { - x = raw->sizeY * raw->sizeZ * sizeof(GLuint); - raw->rowStart = (GLuint *)malloc(x); - raw->rowSize = (GLint *)malloc(x); - if (raw->rowStart == NULL || raw->rowSize == NULL) { - fprintf(stderr, "Out of memory!\n"); - return NULL; - } - raw->rleEnd = 512 + (2 * x); - fseek(raw->file, 512, SEEK_SET); - fread(raw->rowStart, 1, x, raw->file); - fread(raw->rowSize, 1, x, raw->file); - if (swapFlag) { - ConvertLong(raw->rowStart, (long) (x/sizeof(GLuint))); - ConvertLong((GLuint *)raw->rowSize, (long) (x/sizeof(GLint))); - } - } - return raw; -} - -static void RawImageClose(rawImageRec *raw) -{ - - fclose(raw->file); - free(raw->tmp); - free(raw->tmpR); - free(raw->tmpG); - free(raw->tmpB); - if (raw->sizeZ>3) { - free(raw->tmpA); - } - free(raw); -} - -static void RawImageGetRow(rawImageRec *raw, unsigned char *buf, int y, int z) -{ - unsigned char *iPtr, *oPtr, pixel; - int count, done = 0; - - if ((raw->type & 0xFF00) == 0x0100) { - fseek(raw->file, (long) raw->rowStart[y+z*raw->sizeY], SEEK_SET); - fread(raw->tmp, 1, (unsigned int)raw->rowSize[y+z*raw->sizeY], - raw->file); - - iPtr = raw->tmp; - oPtr = buf; - while (!done) { - pixel = *iPtr++; - count = (int)(pixel & 0x7F); - if (!count) { - done = 1; - return; - } - if (pixel & 0x80) { - while (count--) { - *oPtr++ = *iPtr++; - } - } else { - pixel = *iPtr++; - while (count--) { - *oPtr++ = pixel; - } - } - } - } else { - fseek(raw->file, 512+(y*raw->sizeX)+(z*raw->sizeX*raw->sizeY), - SEEK_SET); - fread(buf, 1, raw->sizeX, raw->file); - } -} - - -static void RawImageGetData(rawImageRec *raw, TK_RGBImageRec *final) -{ - unsigned char *ptr; - int i, j; - - final->data = (unsigned char *)malloc((raw->sizeX+1)*(raw->sizeY+1)*4); - if (final->data == NULL) { - fprintf(stderr, "Out of memory!\n"); - } - - ptr = final->data; - for (i = 0; i < (int)(raw->sizeY); i++) { - RawImageGetRow(raw, raw->tmpR, i, 0); - RawImageGetRow(raw, raw->tmpG, i, 1); - RawImageGetRow(raw, raw->tmpB, i, 2); - if (raw->sizeZ>3) { - RawImageGetRow(raw, raw->tmpA, i, 3); - } - for (j = 0; j < (int)(raw->sizeX); j++) { - *ptr++ = *(raw->tmpR + j); - *ptr++ = *(raw->tmpG + j); - *ptr++ = *(raw->tmpB + j); - if (raw->sizeZ>3) { - *ptr++ = *(raw->tmpA + j); - } - } - } -} - - -static TK_RGBImageRec *tkRGBImageLoad(const char *fileName) -{ - rawImageRec *raw; - TK_RGBImageRec *final; - - raw = RawImageOpen(fileName); - if (!raw) { - fprintf(stderr, "File not found\n"); - return NULL; - } - final = (TK_RGBImageRec *)malloc(sizeof(TK_RGBImageRec)); - if (final == NULL) { - fprintf(stderr, "Out of memory!\n"); - return NULL; - } - final->sizeX = raw->sizeX; - final->sizeY = raw->sizeY; - final->components = raw->sizeZ; - RawImageGetData(raw, final); - RawImageClose(raw); - return final; -} - - -static void FreeImage( TK_RGBImageRec *image ) -{ - free(image->data); - free(image); -} - - -/* - * Load an SGI .rgb file and generate a set of 2-D mipmaps from it. - * Input: imageFile - name of .rgb to read - * intFormat - internal texture format to use, or number of components - * Return: GL_TRUE if success, GL_FALSE if error. - */ -GLboolean LoadRGBMipmaps( const char *imageFile, GLint intFormat ) -{ - GLint error; - GLenum format; - TK_RGBImageRec *image; - - image = tkRGBImageLoad( imageFile ); - if (!image) { - return GL_FALSE; - } - - if (image->components==3) { - format = GL_RGB; - } - else if (image->components==4) { - format = GL_RGBA; - } - else { - /* not implemented */ - fprintf(stderr, - "Error in LoadRGBMipmaps %d-component images not implemented\n", - image->components ); - return GL_FALSE; - } - - error = gluBuild2DMipmaps( GL_TEXTURE_2D, - intFormat, - image->sizeX, image->sizeY, - format, - GL_UNSIGNED_BYTE, - image->data ); - - FreeImage(image); - return error ? GL_FALSE : GL_TRUE; -} - - - -/* - * Load an SGI .rgb file and return a pointer to the image data. - * Input: imageFile - name of .rgb to read - * Output: width - width of image - * height - height of image - * format - format of image (GL_RGB or GL_RGBA) - * Return: pointer to image data or NULL if error - */ -GLubyte *LoadRGBImage( const char *imageFile, GLint *width, GLint *height, - GLenum *format ) -{ - TK_RGBImageRec *image; - GLint bytes; - GLubyte *buffer; - - image = tkRGBImageLoad( imageFile ); - if (!image) { - return NULL; - } - - if (image->components==3) { - *format = GL_RGB; - } - else if (image->components==4) { - *format = GL_RGBA; - } - else { - /* not implemented */ - fprintf(stderr, - "Error in LoadRGBImage %d-component images not implemented\n", - image->components ); - return NULL; - } - - *width = image->sizeX; - *height = image->sizeY; - - bytes = image->sizeX * image->sizeY * image->components; - buffer = (GLubyte *) malloc(bytes); - if (!buffer) - return NULL; - - memcpy( (void *) buffer, (void *) image->data, bytes ); - - FreeImage(image); - - return buffer; -} - diff --git a/Viewer_3/demo/Viewer_3/stream_ex.C b/Viewer_3/demo/Viewer_3/stream_ex.C deleted file mode 100644 index d3e08c80d08..00000000000 --- a/Viewer_3/demo/Viewer_3/stream_ex.C +++ /dev/null @@ -1,35 +0,0 @@ -#include -#include - -typedef CGAL::Cartesian rep_t; -typedef CGAL::Point_3 point_t; - -int main(int argc, char *argv[]) -{ - - CGAL::Viewer_3 W(500); - W.init_window_thread(); - stop(); - point_t p1(100,50,0); - point_t p2(200,50,0); - point_t p3(300,50,0); - point_t p4(100,200,100); - point_t p5(200,200,100); - point_t p6(300,200,100); - point_t p7(100,300,-100); - point_t p8(200,300,-100); - point_t p9(300,300,-100); - W << CGAL::set_precision(100); - W << CGAL::set_color_1(CGAL::RED) << p1 << CGAL::set_precision(10) << p2 - << CGAL::set_precision(100) << p3; - W.display(); - stop(); - W << CGAL::set_size(50); - W << CGAL::set_color_1(CGAL::ORANGE) << p4 << p5 << p6; - W.display(); - stop(); - W << CGAL::set_style(CGAL::WIRE)<< CGAL::set_precision(10); - W << CGAL::set_color_1(CGAL::BLUE) << p7 << p8 << p9; - W.display(); - pthread_join(W.get_window_thread(), NULL); -} diff --git a/Viewer_3/demo/Viewer_3/terrain.C b/Viewer_3/demo/Viewer_3/terrain.C deleted file mode 100644 index 7685d744340..00000000000 --- a/Viewer_3/demo/Viewer_3/terrain.C +++ /dev/null @@ -1,85 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -#include -#include -#include -#include -#include -#include - - -#include -//#include "demo_win.h" -#ifndef V_UTILS -#include -#endif - -#include - -typedef double db; -typedef CGAL::Cartesian Rpp; -typedef CGAL::Triangulation_euclidean_traits_xy_3 Gtt; -typedef Gtt::Point Point_t ; -typedef Gtt::Segment Segment_t; -typedef Gtt::Triangle Triangle_t; -typedef CGAL::Triangulation_vertex_base_2 Vbt; -typedef CGAL::Constrained_triangulation_face_base_2 Fbt; -typedef CGAL::Triangulation_default_data_structure_2 Tdst; -typedef CGAL::Constrained_Delaunay_triangulation_2 Triangulation; -typedef Triangulation::Face_handle Face_handle; -typedef Triangulation::Vertex_handle Vertex_handle; -typedef Triangulation::Line_face_circulator Line_face_circulator; -typedef Triangulation::Face_iterator Face_iterator; - -typedef CGAL::Point_3 point3; -typedef CGAL::Triangle_3 triangle3; - - -std::list lpt; - - -std::list set_z_zero(std::list lp) -{ - - std::list::iterator it; - std::list res; - for (it=lp.begin(); it!=lp.end(); it++) - res.push_back(point3(it->hx(),it->hy(),-200,1)); - return res; -} - - - -int main() -{ - - Triangulation dtp; - - std::ifstream is("./terrain_2.dat"); - CGAL::set_ascii_mode(is); - std::istream_iterator it(is); - std::istream_iterator end; - - for( ; it != end; it++) { - dtp.insert( *it); - } - - CGAL::Drawable_triangulation_3 ddtp(dtp,CGAL::PURPLE,CGAL::WHITE); - - CGAL::Viewer_3 W(500); - W.init_window_thread(); - // W.set_custom_panel(demo_panel); - W.add_drawable(&ddtp,1); - W.display(); - stop(); - pthread_join(W.get_window_thread(), NULL); -} diff --git a/Viewer_3/demo/Viewer_3/tetra1.C b/Viewer_3/demo/Viewer_3/tetra1.C deleted file mode 100644 index 2b72f09aa6b..00000000000 --- a/Viewer_3/demo/Viewer_3/tetra1.C +++ /dev/null @@ -1,51 +0,0 @@ -#include -#include -#include -#include -#include - - -typedef CGAL::Cartesian rep_t; -typedef CGAL::Point_3 point_t; -typedef CGAL::Tetrahedron_3 tetra; - -typedef CGAL::Triangulation_geom_traits_3 traits_3; -typedef CGAL::Triangulation_vertex_base_3 Vb ; -typedef CGAL::Triangulation_cell_base_3 Fb; -typedef CGAL::Triangulation_data_structure_3 TDS3 ; -typedef CGAL::Triangulation_3< traits_3 , TDS3> Triangulation_3; -typedef CGAL::Delaunay_triangulation_3 Delaunay_3; - -int main(int argc, char *argv[]) -{ - CGAL::Viewer_3 W(-140, 500, -350, 400, 0, 500); - - Delaunay_3 tr; - - tr.insert(point_t(100,100,100)); - tr.insert(point_t(400,100,300)); - tr.insert(point_t(-100,100,-100)); - tr.insert(point_t(100,-300,0)); - tr.insert(point_t(500,-100,-200)); - tr.insert(point_t(-140,400,-200)); - tr.insert(point_t(100,-350,0)); - tr.insert(point_t(500,-300,-250)); -#ifndef _MSC_VER - W << CGAL::set_color_1(CGAL::ORANGE) ; -#else - { - CGAL::O_manip xxx = CGAL::set_color_1(CGAL::ORANGE); - xxx.f(W,xxx.i); - } -#endif - Delaunay_3::Cell_iterator cit; - tetra t; - for (cit = tr.finite_cells_begin(); cit != tr.cells_end(); cit++) { - t = tr.tetrahedron(cit->handle()); - W << t; - } - W.main_loop(); - return 0; -} - - diff --git a/Viewer_3/demo/Viewer_3/tetra2.C b/Viewer_3/demo/Viewer_3/tetra2.C deleted file mode 100644 index ae394ac4e5b..00000000000 --- a/Viewer_3/demo/Viewer_3/tetra2.C +++ /dev/null @@ -1,99 +0,0 @@ -#include - -#include -#include - -#include - -#include - -typedef CGAL::Cartesian rep_t; -typedef CGAL::Point_3 point_t; -typedef CGAL::Tetrahedron_3 tetra; - -typedef CGAL::Triangle_3 triangle; -typedef CGAL::Line_3 line; -typedef CGAL::Segment_3 segment; - - -typedef CGAL::Triangulation_geom_traits_3 traits_3; -typedef CGAL::Triangulation_vertex_base_3 Vb ; -typedef CGAL::Triangulation_cell_base_3 Fb; -typedef CGAL::Triangulation_data_structure_3 TDS3 ; -typedef CGAL::Triangulation_3< traits_3 , TDS3> Triangulation_3; -typedef CGAL::Delaunay_triangulation_3 Delaunay_3; - -CGAL::Color change(CGAL::Color &c) -{ - if (c==CGAL::RED) return CGAL::YELLOW; - if (c==CGAL::YELLOW) return CGAL::ORANGE; - if (c==CGAL::ORANGE) return CGAL::RED; - return CGAL::WHITE; -} - - - -tetra schrink(tetra tet) -{ - point_t p1,p2,p3,p4; - double sx,sy,sz; - double bx= (tet[0].x()+ tet[1].x()+ tet[2].x()+tet[3].x())/4; - double by= (tet[0].y()+ tet[1].y()+ tet[2].y()+tet[3].y())/4; - double bz= (tet[0].z()+ tet[1].z()+ tet[2].z()+tet[3].z())/4; - sx= (bx - tet[0].x())/3; - sy= (by - tet[0].y())/3; - sz= (bz - tet[0].z())/3; - p1 = point_t(tet[0].x()+sx,tet[0].y()+sy,tet[0].z()+sz); - sx= (bx - tet[1].x())/3; - sy= (by - tet[1].y())/3; - sz= (bz - tet[1].z())/3; - p2 = point_t(tet[1].x()+sx,tet[1].y()+sy,tet[1].z()+sz); - sx= (bx - tet[2].x())/3; - sy= (by - tet[2].y())/3; - sz= (bz - tet[2].z())/3; - p3 = point_t(tet[2].x()+sx,tet[2].y()+sy,tet[2].z()+sz); - sx= (bx - tet[3].x())/3; - sy= (by - tet[3].y())/3; - sz= (bz - tet[3].z())/3; - p4 = point_t(tet[3].x()+sx,tet[3].y()+sy,tet[3].z()+sz); - return tetra(p1,p2,p3,p4); -} - -int main(int argc, char *argv[]) -{ - - CGAL::Viewer_3 W(-200, 600, -400, 400, -250, 300); - - Delaunay_3 tr; - - tr.insert(point_t(100,100,100)); - // tr.insert(point_t(100,100,100)); - tr.insert(point_t(400,100,300)); - tr.insert(point_t(-100,100,-100)); - tr.insert(point_t(100,-300,0)); - tr.insert(point_t(500,-100,-200)); - - tr.insert(point_t(-140,400,-200)); - tr.insert(point_t(100,-350,0)); - tr.insert(point_t(500,-300,-250)); - - CGAL::Color c=CGAL::ORANGE ; - Delaunay_3::Cell_iterator cit; - int i=1; - tetra t; - for (cit = tr.finite_cells_begin(); cit != tr.cells_end(); cit++) { - t= schrink(tr.tetrahedron(cit->handle())); - CGAL::Drawable_tetrahedron_3* tet = new CGAL::Drawable_tetrahedron_3(t,c,CGAL::FILL); - W.add_drawable(tet,i); - i++; - c=change(c); - } - - - W.main_loop(); - return 0; - - -} - - diff --git a/Viewer_3/demo/Viewer_3/tetra3.C b/Viewer_3/demo/Viewer_3/tetra3.C deleted file mode 100644 index 5e7cf6734d1..00000000000 --- a/Viewer_3/demo/Viewer_3/tetra3.C +++ /dev/null @@ -1,48 +0,0 @@ -#include - -#include -#include - -#include - -#include -#include "text.h" - - -typedef CGAL::Cartesian rep_t; -typedef CGAL::Point_3 point_t; -typedef CGAL::Tetrahedron_3 tetra; - - -typedef CGAL::Triangulation_geom_traits_3 traits_3; -typedef CGAL::Triangulation_vertex_base_3 Vb ; -typedef CGAL::Triangulation_cell_base_3 Fb; -typedef CGAL::Triangulation_data_structure_3 TDS3 ; -typedef CGAL::Triangulation_3< traits_3 , TDS3> Triangulation_3; -typedef CGAL::Delaunay_triangulation_3 Delaunay_3; - - -int main(int argc, char *argv[]) -{ - CGAL::Viewer_3 W(500); - - - Delaunay_3 tr; - - tr.insert(point_t(100,100,100)); - tr.insert(point_t(100,100,100)); - tr.insert(point_t(400,100,300)); - tr.insert(point_t(-100,100,-100)); - tr.insert(point_t(100,-300,0)); - tr.insert(point_t(500,-100,-200)); - tr.insert(point_t(-140,400,-200)); - tr.insert(point_t(100,-350,0)); - tr.insert(point_t(500,-300,-250)); - - CGAL::Drawable_triangulation_3 dtr(tr,CGAL::PURPLE); - W.add_drawable(&dtr,1); - W.main_loop(); - return 0; -} - - diff --git a/Viewer_3/demo/Viewer_3/text.h b/Viewer_3/demo/Viewer_3/text.h deleted file mode 100644 index 5b816be3f8f..00000000000 --- a/Viewer_3/demo/Viewer_3/text.h +++ /dev/null @@ -1,226 +0,0 @@ - - -#include "readtex.c" - - - -typedef CGAL::Point_3 > point_3; - - -#define TABLE_TEXTURE "psy.rgb" - - - - - -static GLubyte *Image = NULL; - - - -static int ImgWidth, ImgHeight; -static GLenum ImgFormat; - - - -void draw_tri_tex(double x1, double y1, double z1,double x2, double - y2, double z2,double x3, double y3, double z3) - -{ - glPolygonMode(GL_FRONT,GL_FILL); - glBegin(GL_TRIANGLES); - - std::vector v1(3); - std::vector v2(3); - v1 = CGAL::normal(x1,y1,z1,x2,y2,z2,x3,y3,z3); - - v2[0]= -v1[0]; v2[1]=-v1[1] ; v2[2]= -v1[2]; - glNormal3d(v1[0],v1[1],v1[2]); - glTexCoord2f( 0.0, 0.0 ); - glVertex3f(x1,y1,z1); - glNormal3d(v2[0],v2[1],v2[2]); - glTexCoord2f( 1.0, 0.0 ); - glVertex3f(x2,y2,z2); - glNormal3d(v1[0],v1[1],v1[2]); - glTexCoord2f( 1,1 ); - glVertex3f(x3,y3,z3); - glEnd(); -} - - -void schrink_point(point_3 &p1, point_3 &p2, point_3 &p3, point_3 &p4) -{ -double sx,sy,sz; - double bx= (p1.x()+ p2.x()+ p3.x()+p4.x())/4; - double by= (p1.y()+ p2.y()+ p3.y()+p4.y())/4; - double bz= (p1.z()+ p2.z()+ p3.z()+p4.z())/4; - sx= (bx - p1.x())/3; - sy= (by - p1.y())/3; - sz= (bz - p1.z())/3; - p1 = point_3(p1.x()+sx,p1.y()+sy,p1.z()+sz); - sx= (bx - p2.x())/3; - sy= (by - p2.y())/3; - sz= (bz - p2.z())/3; - p2 = point_3(p2.x()+sx,p2.y()+sy,p2.z()+sz); - sx= (bx - p3.x())/3; - sy= (by - p3.y())/3; - sz= (bz - p3.z())/3; - p3 = point_3(p3.x()+sx,p3.y()+sy,p3.z()+sz); - sx= (bx - p4.x())/3; - sy= (by - p4.y())/3; - sz= (bz - p4.z())/3; - p4 = point_3(p4.x()+sx,p4.y()+sy,p4.z()+sz); -} - -CGAL_BEGIN_NAMESPACE - -template -class Drawable_tetrahedron_tex: public Drawable_object -{ -private: - tetrahedron tr; - -public: - - Drawable_tetrahedron_tex(){type="Tetrahedron";} - Drawable_tetrahedron_tex(const tetrahedron &tet,Color c, Style - sty=WIRE, Size s=5, Precision prec=15) - - { - tr=tet; - color = c; size=s; - set_center();lind=0;type="Tetrahedron";style=sty;precision=prec; - } - - void set_center() - { - o_center[0]=(tr[0].x()+tr[1].x()+tr[2].x()+tr[3].x())/4; - o_center[1]=(tr[0].y()+tr[1].y()+tr[2].y()+tr[3].y())/4; - o_center[2]=(tr[0].z()+tr[1].z()+tr[2].z()+tr[3].z())/4; - } - -void draw() - { - glEnable( GL_TEXTURE_2D ); - if(lind) - glCallList(lind); - else { - lind = glGenLists(1); - Image = LoadRGBImage( TABLE_TEXTURE, &ImgWidth, &ImgHeight, &ImgFormat - ); - - gluBuild2DMipmaps(GL_TEXTURE_2D, 3, ImgWidth, ImgHeight, - GL_RGB, GL_UNSIGNED_BYTE, Image); - //glTexImage2D(GL_TEXTURE_2D,0,3, ImgWidth, ImgHeight,0,GL_RGB, GL_UNSIGNED_//BYTE, Image); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT ); - // glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); - // glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST - // ); - // glEnable( GL_TEXTURE_2D ); - - glNewList(lind,GL_COMPILE_AND_EXECUTE); - glLineWidth(size); - set_color(color); - draw_tri_tex(tr[0].x(),tr[0].y(),tr[0].z(),tr[1].x(),tr[1].y(), - tr[1].z(),tr[2].x(),tr[2].y(),tr[2].z()); - draw_tri_tex(tr[0].x(),tr[0].y(),tr[0].z(),tr[1].x(),tr[1].y(), - tr[1].z(),tr[3].x(),tr[3].y(),tr[3].z()); - draw_tri_tex(tr[0].x(),tr[0].y(),tr[0].z(),tr[3].x(),tr[3].y(), - tr[3].z(),tr[2].x(),tr[2].y(),tr[2].z()); - draw_tri_tex(tr[1].x(),tr[1].y(),tr[1].z(),tr[2].x(),tr[2].y(), - tr[2].z(),tr[3].x(),tr[3].y(),tr[3].z()); - } - - glEndList(); - glDisable( GL_TEXTURE_2D ); - } - -}; - - -template -class Drawable_triangulation_3: public CGAL::Drawable_object -{ -private: - triangulation_3 tr; - -public: - - -Drawable_triangulation_3(){type="Tetrahedron";} - - - Drawable_triangulation_3(const triangulation_3 &tet,Color c, Style - sty=WIRE, Size s=5, Precision prec=15) - - { - tr=tet; - color = c; size=s; - set_center();lind=0;type="Triangulation_3";style=sty;precision=prec; - // Image = LoadRGBImage( TABLE_TEXTURE, &ImgWidth, &ImgHeight, &ImgFormat); - // int i =gluBuild2DMipmaps(GL_TEXTURE_2D, 3,ImgWidth,ImgHeight , - // GL_RGB, GL_UNSIGNED_BYTE, Image); - // glTexImage2D(GL_TEXTURE_2D,0,3, ImgWidth, ImgHeight,0,G// L_RGB, GL_UNSIGNED_BYTE, Image); - - // glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT ); - // glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT ); - // glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - // glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - } - - void set_center() - { - - typename triangulation_3::Vertex_iterator vit; - o_center[0]=0;o_center[1]=0;o_center[2]=0; - for (vit=tr.finite_vertices_begin() ; vit != tr.vertices_end(); vit++) { - o_center[0]= o_center[0] + vit->point().x(); - o_center[1]= o_center[1] + vit->point().y(); - o_center[2]= o_center[2] + vit->point().z(); - } - o_center[0] = o_center[0]/tr.number_of_vertices(); - o_center[1] = o_center[1]/tr.number_of_vertices(); - o_center[2] = o_center[2]/tr.number_of_vertices(); - } - - void draw() - { - // glEnable( GL_TEXTURE_2D ); - if(lind) - glCallList(lind); - else { - lind = glGenLists(1); - glNewList(lind,GL_COMPILE_AND_EXECUTE); - point_3 p0,p1,p2, p3; - set_color(color); - typename triangulation_3::Cell_iterator cit; - for (cit = tr.finite_cells_begin(); cit != tr.cells_end(); cit++) - { - p0=(cit->vertex(0))->point(); - p1=(cit->vertex(1))->point(); - p2=(cit->vertex(2))->point(); - p3=(cit->vertex(3))->point(); - schrink_point(p0,p1,p2,p3); - - draw_tri_tex(p1.x(),p1.y(),p1.z(),p3.x(),p3.y(),p3.z(),p2.x(),p2.y(),p2.z()); - - draw_tri_tex(p0.x(),p0.y(),p0.z(),p2.x(),p2.y(),p2.z(),p3.x(),p3.y(),p3.z()); - draw_tri_tex(p0.x(),p0.y(),p0.z(),p3.x(),p3.y(),p3.z(),p1.x(),p1.y(),p1.z()); - draw_tri_tex(p0.x(),p0.y(),p0.z(),p1.x(),p1.y(),p1.z(),p2.x(),p2.y(),p2.z()); - } - } - glEndList(); - // glDisable( GL_TEXTURE_2D ); - } - - void add_point(double x, double y ,double z) - { - glDeleteLists(lind,1); - lind=0; - typedef typename triangulation_3::Point Point; - tr.insert(Point(x,y,z)); - set_center(); - } -}; - -CGAL_END_NAMESPACE diff --git a/Viewer_3/demo/Viewer_3/triang_2.h b/Viewer_3/demo/Viewer_3/triang_2.h deleted file mode 100644 index e965c85f869..00000000000 --- a/Viewer_3/demo/Viewer_3/triang_2.h +++ /dev/null @@ -1,111 +0,0 @@ - -#include -#include -#include -#include -#include -#include - -#include - -#include - - -typedef CGAL::Cartesian rep_t; - -typedef CGAL::Line_2 Line2; -typedef CGAL::Ray_2 Ray2; - -typedef CGAL::Triangulation_euclidean_traits_2< rep_t > Ttraits; -typedef CGAL::Triangulation_vertex_base_2 Vertex_base ; -typedef CGAL::Triangulation_face_base_2 Face_base ; -typedef CGAL::Triangulation_default_data_structure_2 TDS ; -typedef CGAL::Triangulation_2< Ttraits , TDS> Triangulation_2; -typedef CGAL::Delaunay_triangulation_2< Ttraits , TDS> Delaunay_2; - - -CGAL_BEGIN_NAMESPACE - - -template -class Drawable_voronoi_2: public Drawable_object -{ -private: - triangulation_2 tr; - -public: - - -Drawable_voronoi_2(){type="voronoi_2";} - -Drawable_voronoi_2(const triangulation_2 &tet,Color c, Style - sty=WIRE, Size s=5, Precision prec=15) - { - tr=tet; - color = c; size=s; - set_center();lind=0;type="voronoi_2";style=sty;precision=prec; - } - - void set_center() - { - - typename triangulation_2::Vertex_iterator vit; - o_center[0]=0;o_center[1]=0;o_center[2]=0; - for (vit=tr.finite_vertices_begin() ; vit != tr.vertices_end(); vit++) { - o_center[0]= o_center[0] + vit->point().x(); - o_center[1]= o_center[1] + vit->point().y(); - } - o_center[0] = o_center[0]/tr.number_of_vertices(); - o_center[1] = o_center[1]/tr.number_of_vertices(); - } - - void draw() - { - if(lind) - glCallList(lind); - else { - lind = glGenLists(1); - glNewList(lind,GL_COMPILE_AND_EXECUTE); - set_color(color); - glLineWidth(size); - - typedef typename triangulation_2::Edge_iterator Edge_iterator; - - Edge_iterator it = tr.edges_begin(), - beyond = tr.edges_end(); - glBegin( GL_LINES ); - for ( ;it != beyond; ++it) { - CGAL::Object o = tr.dual(it); - Line2 l; - Ray2 r; - typename triangulation_2::Segment s; - if (assign(s,o)) { - glVertex2f(s.source().x(),s.source().y() ); - glVertex2f(s.target().x(),s.target().y()); - } - if (assign(r,o)) { - glVertex2f(r.source().x(),r.source().y() ); - glVertex2f(r.point(1000).x(),r.point(1000).y()); - } - if (assign(l,o)) { - glVertex2f(l.point(-1000).x(),l.point(-1000).y()); - glVertex2f(l.point(1000).x(),l.point(1000).y()); - } - } - glEnd(); - } - glEndList(); - } - - - void add_point(double x, double y ,double z) - { - glDeleteLists(lind,1); - lind=0; - typedef typename triangulation_2::Point Point; - tr.insert(Point(x,y)); - set_center(); - } -}; - -CGAL_END_NAMESPACE diff --git a/Viewer_3/description.txt b/Viewer_3/description.txt deleted file mode 100644 index 90db7db7c02..00000000000 --- a/Viewer_3/description.txt +++ /dev/null @@ -1 +0,0 @@ -A 3D viewer for CGAL objects. Based on OpenGL and FLTK. diff --git a/Viewer_3/doc_tex/Viewer_3/main.tex b/Viewer_3/doc_tex/Viewer_3/main.tex deleted file mode 100644 index 5b06f2a42f4..00000000000 --- a/Viewer_3/doc_tex/Viewer_3/main.tex +++ /dev/null @@ -1,30 +0,0 @@ -% +------------------------------------------------------------------------+ -% | CGAL Reference Manual: wrapper.tex -% +------------------------------------------------------------------------+ -% | Main TeX file for testing CGAL packages. -% +------------------------------------------------------------------------+ - -%\documentclass{book} - -%\usepackage{cprog} -%\usepackage{cc_manual} -%\usepackage{cc_manual_index} -%\usepackage{amssymb} -%\usepackage{graphicx} -%\usepackage{path} -%\usepackage{ipe} -%\input{psfig} -% page dimensions -% --------------- -% The page dimensions are compulsory and may not be changed in main.tex. - - -% default column layout -% --------------------- -% This is the recommended layout. It may be changed inside main.tex. - - -\input{Viewer_3/viewer} - - -%% EOF %% diff --git a/Viewer_3/doc_tex/Viewer_3/viewer.eps b/Viewer_3/doc_tex/Viewer_3/viewer.eps deleted file mode 100644 index 8e09e62e242..00000000000 --- a/Viewer_3/doc_tex/Viewer_3/viewer.eps +++ /dev/null @@ -1,217 +0,0 @@ -%!PS-Adobe-2.0 EPSF-2.0 -%%Title: viewer.eps -%%Creator: fig2dev Version 3.2 Patchlevel 1 -%%CreationDate: Tue Nov 23 14:08:47 1999 -%%For: frebufat@algorab (Francois Rebufat,L016,657762) -%%Orientation: Portrait -%%BoundingBox: 0 0 306 347 -%%Pages: 0 -%%BeginSetup -%%EndSetup -%%Magnification: 1.0000 -%%EndComments -/$F2psDict 200 dict def -$F2psDict begin -$F2psDict /mtrx matrix put -/col-1 {0 setgray} bind def -/col0 {0.000 0.000 0.000 srgb} bind def -/col1 {0.000 0.000 1.000 srgb} bind def -/col2 {0.000 1.000 0.000 srgb} bind def -/col3 {0.000 1.000 1.000 srgb} bind def -/col4 {1.000 0.000 0.000 srgb} bind def -/col5 {1.000 0.000 1.000 srgb} bind def -/col6 {1.000 1.000 0.000 srgb} bind def -/col7 {1.000 1.000 1.000 srgb} bind def -/col8 {0.000 0.000 0.560 srgb} bind def -/col9 {0.000 0.000 0.690 srgb} bind def -/col10 {0.000 0.000 0.820 srgb} bind def -/col11 {0.530 0.810 1.000 srgb} bind def -/col12 {0.000 0.560 0.000 srgb} bind def -/col13 {0.000 0.690 0.000 srgb} bind def -/col14 {0.000 0.820 0.000 srgb} bind def -/col15 {0.000 0.560 0.560 srgb} bind def -/col16 {0.000 0.690 0.690 srgb} bind def -/col17 {0.000 0.820 0.820 srgb} bind def -/col18 {0.560 0.000 0.000 srgb} bind def -/col19 {0.690 0.000 0.000 srgb} bind def -/col20 {0.820 0.000 0.000 srgb} bind def -/col21 {0.560 0.000 0.560 srgb} bind def -/col22 {0.690 0.000 0.690 srgb} bind def -/col23 {0.820 0.000 0.820 srgb} bind def -/col24 {0.500 0.190 0.000 srgb} bind def -/col25 {0.630 0.250 0.000 srgb} bind def -/col26 {0.750 0.380 0.000 srgb} bind def -/col27 {1.000 0.500 0.500 srgb} bind def -/col28 {1.000 0.630 0.630 srgb} bind def -/col29 {1.000 0.750 0.750 srgb} bind def -/col30 {1.000 0.880 0.880 srgb} bind def -/col31 {1.000 0.840 0.000 srgb} bind def -/col32 {0.286 0.271 0.278 srgb} bind def -/col33 {0.780 0.780 0.745 srgb} bind def - -end -save --146.0 430.0 translate -1 -1 scale - -/cp {closepath} bind def -/ef {eofill} bind def -/gr {grestore} bind def -/gs {gsave} bind def -/sa {save} bind def -/rs {restore} bind def -/l {lineto} bind def -/m {moveto} bind def -/rm {rmoveto} bind def -/n {newpath} bind def -/s {stroke} bind def -/sh {show} bind def -/slc {setlinecap} bind def -/slj {setlinejoin} bind def -/slw {setlinewidth} bind def -/srgb {setrgbcolor} bind def -/rot {rotate} bind def -/sc {scale} bind def -/sd {setdash} bind def -/ff {findfont} bind def -/sf {setfont} bind def -/scf {scalefont} bind def -/sw {stringwidth} bind def -/tr {translate} bind def -/tnt {dup dup currentrgbcolor - 4 -2 roll dup 1 exch sub 3 -1 roll mul add - 4 -2 roll dup 1 exch sub 3 -1 roll mul add - 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} - bind def -/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul - 4 -2 roll mul srgb} bind def - /DrawEllipse { - /endangle exch def - /startangle exch def - /yrad exch def - /xrad exch def - /y exch def - /x exch def - /savematrix mtrx currentmatrix def - x y tr xrad yrad sc 0 0 1 startangle endangle arc - closepath - savematrix setmatrix - } def - -/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def -/$F2psEnd {$F2psEnteredState restore end} def -%%EndProlog - -$F2psBegin -10 setmiterlimit -n -1000 8158 m -1000 -1000 l 8533 -1000 l 8533 8158 l cp clip - 0.06000 0.06000 sc -% Polyline -30.000 slw -n 2475 2850 m 7500 2850 l 7500 7125 l 2475 7125 l cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -15.000 slw -n 2625 3675 m 3450 3675 l 3450 7050 l 2625 7050 l cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -7.500 slw -gs clippath -6630 3504 m 6600 3600 l 6570 3504 l 6570 3615 l 6630 3615 l cp -clip -n 5325 1725 m 6600 1725 l 6600 3600 l gs col0 s gr gr - -% arrowhead -n 6630 3504 m 6600 3600 l 6570 3504 l 6600 3480 l 6630 3504 l cp gs 0.00 setgray ef gr col0 s -% Polyline -15.000 slw -n 3675 3675 m 7350 3675 l 7350 6975 l 3675 6975 l cp gs col32 1.00 shd ef gr gs col0 s gr -/Times-Bold ff 180.00 scf sf -2775 3900 m -gs 1 -1 sc (Group) col0 sh gr -% Polyline - [15 68] 68 sd -n 3000 4125 m 3000 5700 l gs col33 1.00 shd ef gr gs col0 s gr [] 0 sd -7.500 slw -% Ellipse -n 4875 5025 480 480 0 360 DrawEllipse gs col7 s gr - -% Polyline -n 4275 5775 m 5400 4125 l gs col7 s gr -% Polyline -n 5550 4950 m 5025 5625 l 5925 5850 l cp gs col7 s gr -% Polyline -n 2625 3000 m 3375 3000 l 3375 3225 l 2625 3225 l cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 3525 3000 m 4275 3000 l 4275 3225 l 3525 3225 l cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 4425 3000 m 5175 3000 l 5175 3225 l 4425 3225 l cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -gs clippath -3180 3429 m 3150 3525 l 3120 3429 l 3120 3540 l 3180 3540 l cp -clip -n 3150 1875 m 3150 3525 l gs col33 1.00 shd ef gr gs col0 s gr gr - -% arrowhead -n 3180 3429 m 3150 3525 l 3120 3429 l 3150 3405 l 3180 3429 l cp gs 0.00 setgray ef gr col0 s -% Polyline -gs clippath -3596 3529 m 3525 3600 l 3543 3501 l 3491 3599 l 3545 3627 l cp -clip -n 3525 3600 m 4350 2025 l gs col33 1.00 shd ef gr gs col0 s gr gr - -% arrowhead -n 3596 3529 m 3525 3600 l 3543 3501 l 3581 3494 l 3596 3529 l cp gs 0.00 setgray ef gr col0 s -% Polyline -gs clippath -5055 4404 m 5025 4500 l 4995 4404 l 4995 4515 l 5055 4515 l cp -clip -n 5025 2475 m 5025 4500 l gs col33 1.00 shd ef gr gs col0 s gr gr - -% arrowhead -n 5055 4404 m 5025 4500 l 4995 4404 l 5025 4380 l 5055 4404 l cp gs 0.00 setgray ef gr col0 s -% Polyline -gs clippath -3541 2826 m 3525 2925 l 3482 2834 l 3497 2944 l 3557 2936 l cp -clip -n 3375 1875 m 3525 2925 l gs col33 1.00 shd ef gr gs col0 s gr gr - -% arrowhead -n 3541 2826 m 3525 2925 l 3482 2834 l 3508 2806 l 3541 2826 l cp gs 0.00 setgray ef gr col0 s -% Polyline -gs clippath -2824 2837 m 2775 2925 l 2766 2825 l 2743 2933 l 2801 2946 l cp -clip -n 3000 1875 m 2775 2925 l gs col33 1.00 shd ef gr gs col0 s gr gr - -% arrowhead -n 2824 2837 m 2775 2925 l 2766 2825 l 2800 2808 l 2824 2837 l cp gs 0.00 setgray ef gr col0 s -% Polyline -gs clippath -3457 3842 m 3375 3900 l 3410 3806 l 3342 3894 l 3390 3930 l cp -clip -n 4650 2250 m 3375 3900 l gs col33 1.00 shd ef gr gs col0 s gr gr - -% arrowhead -n 3457 3842 m 3375 3900 l 3410 3806 l 3448 3805 l 3457 3842 l cp gs 0.00 setgray ef gr col0 s -/Times-Bold ff 210.00 scf sf -3300 1575 m -gs 1 -1 sc (Viewer_3) col0 sh gr -/Times-Bold ff 210.00 scf sf -4050 1800 m -gs 1 -1 sc (GL_window) col0 sh gr -/Times-Bold ff 210.00 scf sf -4350 2025 m -gs 1 -1 sc (Scene_Graph) col0 sh gr -/Times-Bold ff 210.00 scf sf -4650 2250 m -gs 1 -1 sc (Scene_Group) col0 sh gr -/Times-Bold ff 210.00 scf sf -4950 2475 m -gs 1 -1 sc (Drawable_object) col0 sh gr -/Times-Bold ff 210.00 scf sf -2775 1800 m -gs 1 -1 sc (widgets) col0 sh gr -% Ellipse -n 4500 4725 375 375 0 360 DrawEllipse gs col7 s gr - -$F2psEnd -rs diff --git a/Viewer_3/doc_tex/Viewer_3/viewer.gif b/Viewer_3/doc_tex/Viewer_3/viewer.gif deleted file mode 100644 index b0832a8031d..00000000000 Binary files a/Viewer_3/doc_tex/Viewer_3/viewer.gif and /dev/null differ diff --git a/Viewer_3/doc_tex/Viewer_3/viewer.tex b/Viewer_3/doc_tex/Viewer_3/viewer.tex deleted file mode 100644 index 6940f48a0b1..00000000000 --- a/Viewer_3/doc_tex/Viewer_3/viewer.tex +++ /dev/null @@ -1,1252 +0,0 @@ - -\chapter{CGAL 3D Viewer} - -\section{Introduction} -\ccc{Viewer\_3} is a CGAL class that implements a three dimensional viewer for -geometric objects. It is based on OpenGL for the graphic part and FLTK -(Fast Light Tools Kit) -for the window, the widgets and the events handling. \\ -As it uses OpenGL graphic capabilities, the viewer can display -3-dimensional objects with full graphic quality (including lights, -material properties, textures, special effects as blending -or fog...). Obviously, the cost in time computation is proportional -to the quality of the rendering.\\ -The FLTK library provides all the necessary tools to add -interacivity to the interface : buttons, menu bars, sliders, -browsers, windows and subwindows, mouse events handling...\\ -The class \ccc{Viewer\_3} is build as a multithreading application. The avantage is -that the main function can be interrupted easily with a stop signal, -giving control to the viewer thread. A simple click on the viewer -``Exit thread'' button suspends the viewer thread and wakes up the main -one. As some platform doesn't support multithreading application, a -flag \ccc{USE\_THREAD} has to be set in the makefile to allow -multithreading functionnalities.\\ -Graphical geometric objects inherit from a virtual class -\ccc{Drawable\_object}. All of them have the same interface. They are stored by the -viewer in a two level scene graph that can be accessed interactively -with the viewer window or by functions in the main program. \\ -In order to use the \ccc{Viewer\_3}, you will need to install the FLTK -library (http://www.fltk.org/about.html) and the OpenGL (or Mesa) -library (http://www.opengl.org/, http://mesa3d.sourceforge.net/). - - -\section{Global view} -\begin{ccTexOnly} -\begin{center} -\includegraphics[width=10cm]{Viewer_3/viewer.eps} -\end{center} -\end{ccTexOnly} -\begin{ccHtmlOnly} -
-The wiever -
-\end{ccHtmlOnly} - - - -The package contains two major classes : \ccc{Viewer\_3} and -\ccc{GL\_win}. Two more classes implement the scene graph : \ccc{Scene\_graph} and \ccc{Scene\_group}. Several classes are provided to -define drawable objects which inherit from a single virtual class : -\ccc{Drawable\_object}. - -\subsection{The viewer class and window} - -The \ccc{Viewer\_3} constructor takes one argument, the scale of the scene to -be visualized. The user has to give a inetger value that match the -coordinates of its datas. -\\ -By default, the size of the window is a square of 600 -pixels but it can be reshaped as needed. \\ -The main data member (except all the widgets) is a \ccc{GL_win} -visualization window to -display the drawable objects into. Some functions are provided to interact -with the OpenGl window (\ccc{display, add\_drawable, -remove\_drawable}) or get its reference. - -\subsection{The OpenGL window : \protect \ccc{GL_win}} - -The class \ccc{GL\_win} implements an FLTK window to visualize OpenGL -drawing. In fact, it is more than that, because it contains -the scene graph, the projection and transformations parameters, the -information on how mouse events are interpreted inside the window, -light definition and modification...\\ -The \ccc{GL\_win} contains all the information it needed to draw the -scene graph and interact with it. - -\subsection{The scene graph} - -This is the container for drawable objects. The scene graph is a -member of the \ccc{GL\_win} and contains -scene groups (class \ccc{Scene\_group}) that store pointers to -drawable objects (because \ccc{Drawable\_object} is a virtual class, -all the objects that inherit from it must be use by reference for -correct function calls). Each scene group has its proper matrices for -transformation and stores information about the visibility of each -object. The scene graph panel modes allow to ``hide'' non selected -objects groups, by assigning their visibility status to false. - -\subsection{The drawable object} - -Each drawable object inherits from the virtual class -\ccc{Drawable\_object}. A drawable object knows few things : its coordinates -(eventually a pointer to a CGAL object for complex structures), its -center (a point used by the scene graph to compute the center of -rotation for the whole scene), how to draw itself and eventually how to add a -new point if the drawable object has a \ccc{add_point()} method -implemented (the corresponding \cgal\ object sould handle point -insertion). - -\section{The viewer interface} - -Within the viewer window several modes and actions are provided. In -all cases (except in user mode or if the ``Group tranforms'' mode is -on) the left mouse button controls global translation and the middle -one global rotation. Two sliders provide control on the viewing -perspective and it is possible to switch from orthogonal to -perspective projection. - -\subsection{General parameters} - -The viewer provides a panel to control the scene lightning (``Set -light''). Another panel is provided to set parameters as the default -parameters for drawable objects. The viewer stores two colors, a -precision, a style and a size parameters that can be assign to -drawable objects as default parameters. They is also a panel to control cliping planes (``Cliping''). \\ -A button (``Exit Thread'') stops the viewer thread and gives back the -control to the main thread. The ``Reset'' button sets all the -transformation matrices (translation, rotation) to identity. - -\subsection{Viewer global modes} - -Four global modes are implemented. -\begin{description} -\item{$\triangleright$} {\bf View : } This is the standard mode for -visualization. Objects are displayed in the \ccc{GL_win} window and -the mouse handles translation (left button) and rotation (middle button). -\item{$\triangleright$} {\bf Insert point : } This mode allow the user -to add a point (to the scene graph or to a specific - selected - -object). A transluent plan is drawn and user can move the -plan (with the roller under the window), the scene and an additional point to -place it where he wanted to. Using the menu ``Insert'', the point is -inserted in the first selected group (``In group''), in a new group -(``In new group'') or into a selected drawable object that implement a point -insertion (``In object''). If no such implementation is provided, -nothing is done. The new point can be moved in its support plane by -using right mouse button. -\item{$\triangleright$} {\bf Slice : } Clips the scene with two -cliping planes, displaying only a slice of the scene. The slice -(width, coordinates, direction) is controlled by the ``Cliping'' -panel. -\item{$\triangleright$} {\bf User mode : } The user mode switches -mouse events from standard mode to user defined mouse events (user -have to implement how mouse event are handled). -\end{description} - - -\subsection{The scene graph browser and modes} - -A browser (on the left), a ``Graph'' and a ``View mode'' menu -allow the user to interact with the scene graph. All the groups -and the drawables they contain are displayed in the -browser. Selections can be made via clicking on groups in the browser -and actions can occur on them via the ``Graph'' menu : remove -selected drawable, reset local transformation for the first selected group, -add new group).\\ -The ``View mode'' allows to set how the scene graph has to be viewed : -all drawables are displayed, only selected groups are displayed, -transformations occur locally on selected groups, selected groups are -highlighted. \\ -Objects can move from group to group by using the up and down arrows -on the left of the browser. - -\subsection{The user panel} - -Users can define their own buttons and actions in a special panel -activated by the ``User Panel'' button. By default, there is nothing -but a ``Close'' button in this panel. - -\section{The drawable objects} - -The class \ccc{Drawable\_object} provides the interface for all user -defined drawable objects. Actually, a file \ccc{draw_CGAL_Objects.h} -implements this interface and provides drawable objects for the CGAL -kernel objects in two and three dimensions.\\ -The constructor of a drawable object takes several arguments as : -a reference to a \cgal\ object, two colors, a style, parameter and a -precision parameter. - -Actually, color can be defined using the class \ccc{Color} (Color.h) with -RGBA values. we provide some predefined colors : RED, GREEN, BLUE, -ORANGE, VIOLET, PURPLE, DEEPBLUE, GRAY, BLACK, WHITE.\\ -How the style parameter is handled depends of the specific drawable -object implementation. FILL means generally nice, filled, solid -object. WIRE is often what it usually means and RAW is the costeless -(in computation time) way to define an object (but the worst in terms -of rendering).\\ -The precision is important in FILL style (sometimes in WIRE style -too) because it sets how many facets will model the object. The size -parameter -sets the line width for WIRE and RAW style and the width of a drawable -point. \\ -All drawable objects must implement their constructors, their -\ccc{set\_center()} and \ccc{draw()} functions. If it is suitable for -the object, \ccc{add\_point()} could be provided.\\ -The best way to write your own drawable objects is to have a look to -the ones that are already implemented. It could be useful to learn a -little bit of OpenGL if a special rendering is wanted. - -\subsection{Adding object into the scene graph} - -To add drawable objects to the scene graph, the \ccc{Viewer\_3} class -provides a function \ccc{add\_drawable\_object(Drawable\_object *, -int)}. We recall that the scene graph contains only pointers to -drawable objects for polymorphism to be effective. The second -argument (an int) specifies the group where the user want to put the -object. \\ -For usability reason, we provide stream-like function to send -CGAL object directly to the scene graph. In this case, the drawable is built -using the viewer default values for color, size, style and -precision. All objects are added in the first object -group. Stream-like functions are provided too for modifying these -viewer values using manipulators. - -\subsection{Defining your own drawable object} - -To define and implement your own drawable object you have to proceed -as follow : \\ -Add a new class that inherits from \ccc{Drawable\_object}, implement -what is needed by this class : specific data members, constructors, -\ccc{set\_center()} and \ccc{draw()} functions...\\ -Write a \ccc{convert\_type} function that converts your geometric object into -a drawable object using the viewer default parameters (see Stream support). That's all. - -\section{User defined event and action} - -Users can defined their owns mouse events when the viewer is set in -``User mode''. To do that, they have to implement their own \ccc{mouse\_push}, -\ccc{mouse\_release} and \ccc{mouse\_grab} functions. These functions must have -the following signatures : - -\ccc{void my\_mouse\_push(int x, int y, int but, GL\_win * w);}\\ -\ccc{void my\_mouse\_release(int x, int y, int but, GL\_win * w);}\\ -\ccc{void my\_mouse\_grab(int x1,int y1,int x2,int y2,int dx ,int dy,int but,GL\_win * w);} - - -The ``push'' and release functions catch the x/y-coordinates (in -screen coordinates) where the mouse is actived. The \ccc{but} -parameter gives witch mouse button has been activated (1,2 or 3). The forth -parameter is a pointer on the \ccc{GL_win}.\\ -The ``grab'' function gives the coordinates of the initial click -(x1,y1), the coordinates of the current position (x2,y2) and -difference between two positions (dx,dy) for one event loop. The last -two parameters are the same as previouly.\\ -To register these events, the \ccc{Viewer\_3} class provides three -functions : - - -\ccc{typedef void (*Mouse\_click)(int , int , int , GL\_win *);} \\ -\ccc{typedef void (*Mouse\_grab)(int ,int,int,int,int,int,int,GL\_win *);} \\ -\ccc{void set\_mouse\_push\_handler(GL\_win::Mouse\_click);}\\ -\ccc{void set\_mouse\_grab\_handler(GL\_win::Mouse\_grab);}\\ -\ccc{void set\_mouse\_release\_handler(GL\_win::Mouse\_click);}\\ - - -Users can build their owns widgets panel and add callback for them -too. They have to define a new function with the following signature : - - -\ccc{void my\_panel(GL\_win* win, Viewer\_3* view)} - -The body will define a new {\tt Fl\_Window} and new widgets with their -callback functions.\\ -To register the new panel to the viewer use the function : - - -\ccc{typedef void (*User\_ctr\_win)(GL\_win *,Viewer\_3 *);} \\ -\ccc{void set\_custom\_panel(User\_ctr\_win\ fct);} - -Examples of user defined events and user defined button panel are -provided in the examples section. - -\begin{ccClass}{Viewer_3} -\section{The Viever Class \protect \ccClassTemplateName} - -This is the main class that implements the viewer by itself. It -contains several widgets (and associated callback functions) to -interact whith it and a \ccc{GL\_win} to display OpenGL graphic -commands. The \ccc{GL\_win} has a fixed size but its scale (the -dimension of the effective viewing volume) can be defined as a -parameter in the \ccc{Viewer\_3} constructor. The origine of the -system of coordinates is approximativelly (depend on the perspective -choosen) put in the middle of the viewing cube. - -\ccInclude{CGAL/Viewer_3.h} - -\ccTypes -\ccThree{typedef void (*User_ctr_win User_ctr_win and so on }{}{A -function pointer and so on and so on and so on} -\ccThreeToTwo - -\ccTypedef{typedef void (*User_ctr_win)(GL_win *,Viewer_3 *) User_ctr_win;}{A -function pointer used as type for the member function -\ccc{set\_custom\_panel(User\_ctr\_win)}.} - - - - -\subsection{Functionalities} - -\ccCreation -\ccCreationVariable{w} -\ccThree{Viewer_3();}{t = tr bidulebidulebidulebidule}{} -\ccThreeToTwo -\ccConstructor{Viewer_3();}{Defines and displays a new viewer with a -viasualization window scaled on a 500~$\times$~500~$\times$~500 units cube. } - -\ccConstructor{Viewer_3(int scale);}{Defines and displays a new viewer scaled on a scale~$\times$~scale~$\times$~scale units cube.} - -\ccConstructor{Viewer_3(int x, int y, int z);}{Defines and displays a new viewer scaled on a x~$\times$~y~$\times$~z units cube.} - -\ccConstructor{Viewer_3(int x_min, int x_max, int y_min, int y_max, -int z_min, int z_max);}{Defines and displays a new viewer scaled on a -(x_max-x_min)~$\times$~(x_max-x_min)~$\times$~(x_max-x_min) units cube -whose origin is (x_min, y_min, z_min).} - -\ccHeading{Adding things} - -\ccMethod{void add_group();}{Adds a new empty group at the end of the -scene graph.} - -\ccMethod{void add_drawable(Drawable_object* obj, int g=1);}{Adds the -drawable object obj into the group g.} - -\ccAccessFunctions - -\ccMethod{pthread_t get_window_thread();}{Returns window's thread.} - -\ccMethod{Size get_size();}{Returns the default drawable object \ccc{Size}.} - -\ccMethod{Style get_style();}{Returns the default drawable object -\ccc{Style}.} - -\ccMethod{Precision get_precision();}{Returns the default drawable -object \ccc{Precision}.} - -\ccMethod{Color get_color(int i);}{Returns the default viewer first \ccc{Color} if i=1, the second \ccc{Color} elsewhere.} - -\ccMethod{GL_win* get_window();}{Returns a pointer on the \ccc{GL\_win} member.} - -\ccMethod{int get_group();}{The total number of groups in the scene graph.} - -\ccHeading{Setting} - -\ccMethod{void reset();}{Sets to identity all transformation -matrices.} - -\ccMethod{void reset_groups();}{for all groups, sets all local -transformations matrices to identity.} - -\ccMethod{void set_size(Size s);}{Sets the default drawable object \ccc{Size} -to s.} -\ccMethod{void set_style(Style s);}{Sets the default drawable object \ccc{Style} -to s.} - -\ccMethod{void set_precision(Precision p);}{Sets the default drawable object -\ccc{Precision} to p.} - -\ccMethod{void set_color(Color c, int i);}{Sets the default viewer -first \ccc{Color} to c if i=1, the second elsewhere.} -\ccMethod{void set_custom_panel(User_ctr_win fct);}{Sets the viewer -user panel to be defined by the function \ccc{fct}.} - -\ccMethod{void set_mouse_push_handler(GL_win::Mouse_click hand_fct);}{Sets the -mouse push handler for the user mode menu to be \ccc{hand\_fct} function.} - -\ccMethod{void set_mouse_release_handler(GL_win::Mouse_click hand_fct);}{Sets the -mouse release handler for the user mode menu to be\ccc{ hand\_fct} function.} - -\ccMethod{void set_mouse_grab_handler(GL_win::Mouse_grab hand_fct);}{Sets the -mouse grab handler for the user mode menu to be \ccc{hand\_fct} function.} - -\ccHeading{Insertion, Removal} - -\ccMethod{void add_drawable(Drawable_object* obj , int gr=1);}{Adds -drawable \ccc{obj} to the scene graph in group \ccc{gr}.} - -\ccMethod{void remove_drawable(int gr, int i);}{Removes in group \ccc{gr}, the -drawable indiced by \ccc{i}.} - -\ccMethod{void delete_drawable(int gr, int i);}{Deletes in group\ccc{gr}, the -drawable indiced by \ccc{i}. The drawable is definitely deleted.} - -\ccMethod{void delete_selection();}{Deletes selection made in the -viewer graph browser.} - -\ccMethod{void delete_group(int g);}{Deletes the group of drawables -indiced by g;} - -\ccHeading{Miscellaneous} - -\ccMethod{void display();}{Displays the content of the scene graph on -the screen. Necessary to call each time a modification is done on the -scene.} - -\ccMethod{void init_window_thread();}{Inits viewer thread. This function -has to be called only if mode multi-threads is choosen.} - -\ccMethod{void main_loop();}{Launches the viewer main loop. If -multi-threading is used, then the function \ccc{init\_window\_thread()} will -automatically calls the \ccc{main\_loop()}. If not, \ccc{main\_loop()} has to be -explicitaly calls at the end of the main program.} - -\end{ccClass} - -\begin{ccClass}{GL_win} - -\section{The GL window class \protect \ccClassTemplateName } - - -The class \ccc{GL\_win} implements the visualisation window where OpenGL -primitives are displayed. It also contains matrices for tranformation, -mouse events catched into the \ccc{GL\_win} and associated -callbacks. \ccc{GL\_win} object is the main data member of the class \ccc{Viewer\_3}. For elementary -usage of the viewer, users do not have to interfer with the \ccc{GL\_win} -object and use \ccc{GL\_win} member functions. For developping more advanced -application (such as defining a custom actions), it could be necessary -to access some of the \ccc{GL\_win} functions and parameters. - -For more information about this class, see the reference manual. -\ccInclude{CGAL/GL_win.h} -\end{ccClass} - -\begin{ccClass}{Drawable_object} - -\section{The Drawable Object Class and its inherited ones : \protect \ccClassTemplateName} - -The class \ccc{Drawable\_object} is a virtual class that implement the -generic representation for a drawable object. All drawable objects -contained in the scene graph derive from this virtual class. The -principal functions it defines are not implemented in the virtual -\ccc{Drawable\_object} class but in its derived classes, as each drawable -has its proper way to draw itself, compute its gravity center and so -on. - -\ccInclude{CGAL/Drawable_object.h} - -For streams support and users comfort, some types (\cgal\ types) are -defined : - -\ccTypes -\ccThree{typedef unsigned char Precision}{}{The Rendering quality for -a drawable object.} -\ccThreeToTwo - -\ccEnum{enum Style {FILL=1, WIRE, RAW, FOS1, FOS2, FOS3, FOS4, FOS5};}{FILL, WIRE and RAW are standard styles for drawables, and FOS are -special styles for facets objects.} - -\ccTypedef{typedef int Size;}{The size of a drawable object.} -\ccGlue -\ccTypedef{typedef unsigned char Precision;}{The Rendering quality for -a drawable object.} - -A drawable object has several data members : two colors, style, -precision and center of mass. It also has an OpenGL display list flag, -\ccc{lind}, for the object that said if OpenGL display list (to speed up GL -computation) is already computed or not; \ccc{lind} is 0 if the object has -never been drawn (no call to draw function) and 1 when the first call to -draw is made. If the object is change (color, add of point, etc), \ccc{lind} -must be reset to 0 to force the draw function to rebuild the display -list. (see OpenGL programming manual for more information on display -lists). - - - - -\ccCreation -\ccCreationVariable{obj} -\ccThree{Drawable_object();}{t = tr bidulebidulebidulebidule}{} -\ccThreeToTwo -\ccConstructor{Drawable_object();}{Empty constructor;} - -\subsection{Functionalities} - - -\ccMethod{virtual void draw();}{Virtual drawing method.} - -\ccMethod{void set_center();}{Generic function to compute the gravity -center of the object.} - -\ccMethod{double get_center(int i);}{Returns the i-coordinate of the -gravity center (i=0,1,2).} - -\ccMethod{void set_style(Style s);}{Sets the objects drawing style to -be s.} -\ccMethod{void set_colors(Color c1, Color c2);}{Sets the color to \ccc{c1} and -the second color to \ccc{c2}.} - -\ccMethod{void set_color1(Color c1);}{Sets the first color to \ccc{c1}.} - -\ccMethod{void set_color2(Color c1);}{Sets the second color to \ccc{c1}.} - -\ccMethod{virtual void add_point(double x, double y, double -z);}{Virtual function to add a point to an object.} - -\ccMethod{virtual void to_ps(PS_Stream_3 &ps);}{Virtual function to -send the scene to the postscript stream.} -\end{ccClass} - -\subsection{Predifined drawable objects} - -The file \ccc{draw\_CGAL\_Object.h} implements several drawable objects -in two and three dimensions. All these classes are derived (public) from the -virtual interface \ccc{Drawable\_object} and are templated by a geometric -object. All these drawables are using \cgal\ standard acces functions -for accessing coordinates of objects. All coordinates number types -(for the template objects) must support the \cgal\ standard -\ccc{to_double} function. Note that all drawables make a copy of the -\cgal\ object they represent. - -\ccInclude{CGAL/draw\_CGAL\_Object.h} - -\subsubsection{Two dimensional objects.} - -\ccCreation -\ccCreationVariable{obj} -\ccThree{Drawable_object();}{t = tr bidulebidulebidulebidule}{} -\ccThreeToTwo - - -\begin{ccClassTemplate}{Drawable_point_2} - -\ccConstructor{Drawable_point_2(const Point2& p, Color c, Style - sty=RAW, Size s = 5 , Precision - prec=5);}{Object constructor.The \ccc{Point2} must provide - \ccc{x()} and \ccc{y()} access functions.} - - -\ccConstructor{Drawable_point_2(const double& x1,const double& y1, - Color c, Style sty=RAW, Size s = 5 , Precision - prec=5);}{Object constructor. A \ccc{Point_2} -template parameter type on double coordinates must be provided.} -\end{ccClassTemplate} - -\begin{ccClassTemplate}{Drawable_segment_2} -\ccConstructor{Drawable_segment_2(const Segment2& sg, Color c, Style -sty= RAW, Size s=2, Precision prec=0);}{The \ccc{Segment2} type must provide - \ccc{target().x()} and \ccc{source().y()} access functions.} -\end{ccClassTemplate} - - -\begin{ccClassTemplate}{Drawable_line_2} -\ccConstructor{Drawable_line_2(const Line2& ln, Color c, Style -sty= RAW, Size s=2, Precision prec=15);}{The \ccc{Line2} type must provide - \ccc{point(int i).x()} acces \ccc{point(int i).y()} access functions.} -\end{ccClassTemplate} - -\begin{ccClassTemplate}{Drawable_ray_2} -\ccConstructor{Drawable_ray_2(const Ray2& ry, Color c, Style -sty= RAW, Size s=2, Precision prec=15);}{The \ccc{Ray2} type must provide - \ccc{point(int i).x/y()} function and source().x/y() function.} -\end{ccClassTemplate} - -\begin{ccClassTemplate}{Drawable_triangle_2} -\ccConstructor{Drawable_triangle_2(const Triangle2& -tri, Color c1, Color c2=BLACK, Style sty=FILL, Size s=2, Precision prec=0);}{The -\ccc{Triangle2} must provide \ccc{tr[i].x/y()} (i=0,1,2) access functions.} -\end{ccClassTemplate} - -\begin{ccClassTemplate}{Drawable_circle_2} -\ccConstructor{Drawable_circle_2(const Circle2& -crl, Color c, Style sty= RAW, Size s=5, Precision prec=5);}{The -\ccc{Circle2} type must have \ccc{center().x/y()} and -\ccc{squared\_radius()} functions.} -\end{ccClassTemplate} - - -\begin{ccClassTemplate}{Drawable_triangulation_2} -\ccConstructor{Drawable_triangulation_2(triangulation_2* tri, Color c1, -Color c2, Style sty=WIRE, Size s=5, Precision prec=15);}{ The -\ccc{Triangulation2} must provide a \cgal\ like interface -(\ccc{Edge_iterator, Vertex_iterator, Vertex_handle, Face_handle} and -functions associated to them).} -\end{ccClassTemplate} - -\subsubsection{Three dimensional objects.} - -\begin{ccClassTemplate}{Drawable_point_3} -\ccConstructor{Drawable_point_3(const Point3 &p, Color c, Style -sty=FILL, Size s=5, Precision prec=15);}{The type \ccc{Point3} must provide - \ccc{x()}, \ccc{y()}, \ccc{z()} access functions.} -\end{ccClassTemplate} - - -\begin{ccClassTemplate}{Drawable_point_3} -\ccConstructor{Drawable_point_3(const double& x, const double& y,const -double& z, Color c, Style -sty=FILL, Size s=5, Precision prec=15);}{Constructor with three double -for coordinates. A \ccc{Point_3} template type parameter on double -cordinates must be provided.} -\end{ccClassTemplate} - -\begin{ccClassTemplate}{Drawable_points_set_3} -\ccConstructor{Drawable_points_set_3(InputIterator first, -InputIterator last, Color c, Style -sty=FILL, Size s=5, Precision prec=15);}{\ccc{first} and \ccc{last} -are iterators on a container containing \ccc{point3} objects.} -\end{ccClassTemplate} - -\begin{ccClassTemplate}{Drawable_segment_3} -\ccConstructor{Drawable_segment_3(const segment3& sg, Color c, Style -sty=RAW, Size s=5, Precision prec=15);}{The type \ccc{segment3} must -provide \ccc{source()} and \ccc{target()} access functions.} -\end{ccClassTemplate} - -\begin{ccClassTemplate}{Drawable_line_3} -\ccConstructor{Drawable_line_3(const line3& ln, Color c, Style -sty=RAW, Size s=2, Precision prec=15);}{The type \ccc{line3} must -provide \ccc{point(int)} function.} -\end{ccClassTemplate} - -\begin{ccClassTemplate}{Drawable_ray_3} -\ccConstructor{Drawable_ray_3(const ray3& ry, Color c, Style -sty=RAW, Size s=2, Precision prec=15);}{The type \ccc{ray3} must -provide \ccc{point(int)} and source() functions.} -\end{ccClassTemplate} - -\begin{ccClassTemplate}{Drawable_triangle_3} -\ccConstructor{Drawable_triangle_3(const triangle3& tri, Color c, Style -sty=WIRE, Size s=2, Precision prec=0);}{The type\ccc{triangle3} must -provide \ccc{tr[i]} for accessing vertices and \ccc{x()}, \ccc{y()}, -\ccc{z()} access functions for coordinates of each vertex.} -\end{ccClassTemplate} - -\begin{ccClassTemplate}{Drawable_tetrahedron_3} -\ccConstructor{Drawable_tetrahedron_3(const tetrahedron3& tet, Color c, Style -sty=FILL, Size s=2, Precision prec=0);}{The type \ccc{tetrahedron3} must -provide \ccc{tr[i]} for accessing vertices and \ccc{x()}, -\ccc{y()}, \ccc{z()} access functions for coordinates of each vertex.} -\end{ccClassTemplate} - -\begin{ccClassTemplate}{Drawable_triangulation_3} -\ccConstructor{Drawable_triangulation_3(const triangulation3& tri, -Color c1, Color c2, Style sty=FILL, Size s=2, Precision prec=0);}{The type \ccc{triangulation3} must -provide \ccc{tr[i]} for accessing vertices and \ccc{x()}, -\ccc{y()}, \ccc{z()} access functions for coordinates of each vertex.} -\end{ccClassTemplate} - -\subsubsection{Three dimensional facet objects.} - -The file \ccc{facet\_object.h} implements a special kind of drawable object : -a generic implementation for 3-dimensional object that can be -represented with facets (triangulations, polyhedral surfaces,...). -special menu is defined in the viewer window to interact with these -kind of objects, essentially, by offering several predefined way to -display them. - -\ccInclude{CGAL/facet\_object.h} - -This file exports several \cgal\ types that are used into the -\ccc{Drawable\_facets\_object\_3} class and have to be used by user to -build the interface between its own geometric objects and a -\ccc{Drawable\_facets\_object\_3}. - -\ccTypes -\ccThree{typedef Gt::Triangleblblblnl}{}{the triangulatiooooooooooooooooooooooo} -\ccThreeToTwo - -\ccTypedef{typedef std::vector vertex ;}{The vertex type.} -\ccGlue -\ccTypedef{typedef std::vector edge ;}{The edge type.} -\ccGlue -\ccTypedef{typedef std::list facet;}{The facet type.} -\ccGlue -\ccTypedef{typedef std::list list_vertices;}{A list of -vertices.} -\ccGlue -\ccTypedef{typedef std::list list_edges;}{A list of edges.} -\ccGlue -\ccTypedef{typedef std::list list_facets;}{Alist of facets.} - -The user must provide its own interface between its object and a -\ccc{Drawable\_facets\_object\_3} in the form of three functions : - -\ccThree{typedef Gt::Triangle}{}{the triangulatiooooooooooooooooooooooo} -\ccThreeToTwo -\ccFunction{template list_vertices -get_vertices(const facet_object &fo);} {Returns the list of vertices -of the object \ccc{fo}.} - -\ccFunction{template list_edges get_edges(const -facet_object &fo);} {Returns the list of edges of the object \ccc{fo}.} - -\ccFunction{template list_facets get_facets(const -facet_object &fo);}{Returns the list of facets of the object\ccc{fo}.} - -(Warning : this interface may change in futur) - -Facet objects of class \ccc{Drawable\_facets\_object\_3} are like regular -drawable objects (inherits from \ccc{Drawable\_object}). They are templated by -the geometric objects and the template class must be the same as the -one given to the three interface function described bellow. The style -can be of five type : \ccc{FOS1}, \ccc{FOS2}, \ccc{FOS3}, \ccc{FOS4} and \ccc{FOS5}. \ccc{FO1} is a raw -wire frame style, \ccc{FO2} adds raw vertices to the previous one, \ccc{FO3} is -wire frame style with only visible edges shown, \ccc{FO4} shows facets and -\ccc{FO5} is a nice wire frame style build with cylinders for edges and -spheres for vertices. - -\begin{ccClassTemplate}{Drawable_facets_object_3} -\ccConstructor{Drawable_facets_object_3(const facets_object_3 &obj -,char* name="Facet Object",Color c, Color c2=BLACK, Style sty=FOS1, -Sizes=2, Precision prec=10);}{Builds a new Drawable\_facets\_object\_3.} -\end{ccClassTemplate} - -\begin{ccClass}{Scene_graph} -\subsection{The Scene graph Class, \protect \ccClassTemplateName} - -The scene graph of the viewer is implemented in the file -\ccc{scene\_graph.h}. It looks like a list of scene groups and acts as a -container for these groups of drawable objects. It contains also the -transformation matrices (rotation, translation) for the scene and the -center of the scene as data members. - -\ccInclude{CGAL/scene\_graph.h} - -\end{ccClass} -\begin{ccClass}{Scene_group} -\subsection{The scene group, \protect \ccClassTemplateName} - -Scene groups are the elementary drawable objects containers. It is -implemented in the file \ccc{scene\_group.h}. An object of class -\ccc{Scene\_group} contains a vector of drawable object, informations about the -visibility of the group and its objects, its center of mass and two -local transformation matrices for rotation and translation. It exports -its own iterator type to browse through the objects of the group. - -\ccInclude{CGAL/scene\_group.h} - -\end{ccClass} - -\subsection{Stream support} - -\cgal\ objects could directly be sended to the viewer via standard -streams. In this case, drawable objects are automatically builded with -default parameters. Streams are provided for \cgal\ objects (see the -listing bellow), for \ccc{Color}, \ccc{Size} and \ccc{Precision}. For -user defined drawable objects, the implementor must provide a -\ccc{convert_type} for its drawable type that build a drawable object -and send it to the viewer. This function will be automaticaly called -by the stream operator. - -\ccInclude{CGAL/Viewer_stream.h} - -\subsubsection{Input streams} - -\ccThree{Viewer_3& operator}{operator<<(Viewer_3& W, Style s);}{} -\ccThreeToTwo -\ccFunction{Viewer_3& operator<<(Viewer_3& W, Object o);} -{Sends the object \ccc{o} to the viewer.} - -\subsubsection{Convert functions} - -The stream operator for a \cgal\ object is defined generically for any -object type. It calls a function named \ccc{convert_type(Object o, -Viewer_3 &W)} that returns a reference to a drawable object build with -default parameters stored in the viewer. Each \cgal\ object should -implements such \ccc{convert_type} function in order to use the viewer -stream. - -The interface for such function is as follows : - -\begin{cprog} -template -Drawable_Object >* -convert_type(Object p, Viewer_3 &W) -{ - Drawable_Object >* d_obj = new - Drawable_Object >(p,W.get_color(),W.get_style(),W.get_size(),W.get_precision()); - return(d_obj); -} -\end{cprog} - -The file \ccc{Viewer_stream.h} provides \ccc{convert_type} functions -for the kernel objects : - -\ccc{Point_3}, \ccc{Segment_3}, \ccc{Triangle_3}, -\ccc{Tetrahedron_3}, \ccc{Line_3}, \ccc{Ray_3}, -\ccc{Point_2}, \ccc{Segment_2}, \ccc{Line_2}, \ccc{Ray_2}, -\ccc{Triangle_2}, \ccc{Circle_2}. - -A function that takes a \ccc{std::vector} with three elements and -returns a \ccc{Drawable_point_3} is also provided. - -\subsubsection{Manipulators for assigning \protect \ccc{Viewer_3} parameters} - -The stream support offer stream facilities to set some Viewer -parameters like default colors, size, precision, etc. It use a manipulator class \ccc{O_manip} that implements -generic stream function : - -\ccFunction{Viewer_3& operator<< (Viewer_3& W, const O_manip& -m);}{} - -In order to use it, a manipulator must be build. The -\ccc{Viewer_stream.h} defines several manipulator constructor for -standards parameters. - -\ccFunction{O_manip set_precision(Precision i);}{Defines a -manipulator to set the viewer default precision parameter.} -\ccGlue - \ccFunction{O_manip set_color1(Color c);}{Defines a -manipulator to set the viewer default first color parameter.} -\ccGlue - \ccFunction{O_manip set_color2(Color c);}{Defines a -manipulator to set the viewer default second color parameter.} -\ccGlue -\ccFunction{O_manip set_size(Size i);}{Defines a -manipulator to set the viewer default size parameter.} -\ccGlue -\ccFunction{O_manip