diff --git a/Packages/Nef_S2/TODO b/Packages/Nef_S2/TODO index 1b00335f5e4..237ecd6b074 100644 --- a/Packages/Nef_S2/TODO +++ b/Packages/Nef_S2/TODO @@ -1,4 +1,6 @@ Possible Improvements for future releases are 1) introduce clean spherical kernel trais +2) clean up edge pair architecture +3) introduce filtering diff --git a/Packages/Nef_S2/description.txt b/Packages/Nef_S2/description.txt index 6f67e9697e2..d0b50d6de99 100644 --- a/Packages/Nef_S2/description.txt +++ b/Packages/Nef_S2/description.txt @@ -1 +1 @@ -Nef polyhedra in the plane +Nef polyhedra in the sphere surface diff --git a/Packages/Nef_S2/examples/Nef_S2/README b/Packages/Nef_S2/examples/Nef_S2/README new file mode 100644 index 00000000000..9c03ba1b623 --- /dev/null +++ b/Packages/Nef_S2/examples/Nef_S2/README @@ -0,0 +1,13 @@ + + construction.C + + a simple example showing construction syntax + +HowTo build these demos: + + 1) Set the environment variable CGAL_MAKEFILE to the makefile + of choice after the configuration of CGAL. Makefiles + (configurations) can be found in ../../make + + 2) Engage (type "make ") + diff --git a/Packages/Nef_S2/examples/Nef_S2/construction.C b/Packages/Nef_S2/examples/Nef_S2/construction.C new file mode 100644 index 00000000000..105e6b5f893 --- /dev/null +++ b/Packages/Nef_S2/examples/Nef_S2/construction.C @@ -0,0 +1,33 @@ +// file : examples/Nef_S2/construction.C + +#include +#include +#include + +typedef CGAL::Gmpz RT; +typedef CGAL::Homogeneous Kernel; +typedef CGAL::Nef_polyhedron_S2 Nef_polyhedron; +typedef Nef_polyhedron::Sphere_point Sphere_point; +typedef Nef_polyhedron::Sphere_segment Sphere_segment; +typedef Nef_polyhedron::Sphere_circle Sphere_circle; + +int main() { + + Nef_polyhedron N1(Nef_polyhedron::COMPLETE); + + Sphere_circle c(1,1,1); // c : x + y + z = 0 + Nef_polyhedron N2(c,Nef_polyhedron::INCLUDED); + Nef_polyhedron N3 = N2.complement(); + CGAL_assertion(N1 == N2.join(N3)); + + Sphere_point p1(1,0,0), p2(0,1,0), p3(0,0,1); + Sphere_segment s1(p1,p2), s2(p2,p3), s3(p3,p1); + Sphere_segment triangle[3] = { s1, s2, s3 }; + Nef_polyhedron N4(triangle, triangle+3); + Nef_polyhedron N5 = N2.intersection(N4); + CGAL_assertion(N5 <= N2 && N5 <= N4); + + return 0; +} + + diff --git a/Packages/Nef_S2/examples/Nef_S2/makefile b/Packages/Nef_S2/examples/Nef_S2/makefile new file mode 100644 index 00000000000..10f2920ab27 --- /dev/null +++ b/Packages/Nef_S2/examples/Nef_S2/makefile @@ -0,0 +1,59 @@ +# Created by the script create_makefile +# This is the makefile for compiling a CGAL application. + +#---------------------------------------------------------------------# +# include platform specific settings +#---------------------------------------------------------------------# +# Choose the right include file from the /make directory. + +# CGAL_MAKEFILE = ENTER_YOUR_INCLUDE_MAKEFILE_HERE +include $(CGAL_MAKEFILE) + +#---------------------------------------------------------------------# +# compiler flags +#---------------------------------------------------------------------# + +CXXFLAGS = \ + $(EXTRA_FLAGS) \ + $(CGAL_CXXFLAGS) \ + $(LONG_NAME_PROBLEM_CXXFLAGS) \ + $(DEBUG_OPT) + +#---------------------------------------------------------------------# +# linker flags +#---------------------------------------------------------------------# + +LIBPATH = \ + $(CGAL_LIBPATH) + +LDFLAGS = \ + $(LONG_NAME_PROBLEM_LDFLAGS) \ + $(CGAL_LDFLAGS) + +#---------------------------------------------------------------------# +# target entries +#---------------------------------------------------------------------# + +all: \ + construction$(EXE_EXT) \ + simple$(EXE_EXT) + +construction$(EXE_EXT): construction$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)construction \ + construction$(OBJ_EXT) $(LDFLAGS) + +simple$(EXE_EXT): simple$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)simple \ + simple$(OBJ_EXT) $(LDFLAGS) + +clean: \ + construction.clean \ + simple.clean + +#---------------------------------------------------------------------# +# suffix rules +#---------------------------------------------------------------------# + +.C$(OBJ_EXT): + $(CGAL_CXX) $(CXXFLAGS) $(OBJ_OPT) $< + diff --git a/Packages/Nef_S2/examples/Nef_S2/simple.C b/Packages/Nef_S2/examples/Nef_S2/simple.C new file mode 100644 index 00000000000..68bef4afab3 --- /dev/null +++ b/Packages/Nef_S2/examples/Nef_S2/simple.C @@ -0,0 +1,18 @@ +// file : examples/Nef_S2/simple.C + +#include +#include +#include + +typedef CGAL::Gmpz RT; +typedef CGAL::Homogeneous Kernel; +typedef CGAL::Nef_polyhedron_S2 Nef_polyhedron; +typedef Nef_polyhedron::Sphere_circle Sphere_circle; + +int main() +{ + Nef_polyhedron N1(Sphere_circle(1,0,0)); + Nef_polyhedron N2(Sphere_circle(0,1,0), Nef_polyhedron::EXCLUDED); + Nef_polyhedron N3 = N1 * N2; // line (*) + return 0; +} diff --git a/Packages/Nef_S2/include/CGAL/Nef_S2/SM_decorator.h b/Packages/Nef_S2/include/CGAL/Nef_S2/SM_decorator.h index e08fba87b4e..e1eb83d69b5 100644 --- a/Packages/Nef_S2/include/CGAL/Nef_S2/SM_decorator.h +++ b/Packages/Nef_S2/include/CGAL/Nef_S2/SM_decorator.h @@ -298,7 +298,7 @@ Face_handle new_face() const void delete_vertex_only(Vertex_handle v) const /*{\Mop deletes |v| without any connectivity update.}*/ -{ return psm_->delete_vertex(v); } +{ psm_->delete_vertex(v); } void delete_edge_pair_only(Halfedge_handle e) const /*{\Mop deletes |e| and its twin without any connectivity update.}*/ @@ -310,7 +310,7 @@ void delete_halfedge_only(Halfedge_handle e) const void delete_face_only(Face_handle f) const /*{\Mop deletes |f| without any connectivity update.}*/ -{ return psm_->delete_face(f); } +{ psm_->delete_face(f); } void delete_loop_only() const /*{\Mop deletes the loop and its twin without any connectivity update.}*/ diff --git a/Packages/Nef_S2/include/CGAL/Nef_S2/SM_io_parser.h b/Packages/Nef_S2/include/CGAL/Nef_S2/SM_io_parser.h index 4e5b334c3cf..460e1525016 100644 --- a/Packages/Nef_S2/include/CGAL/Nef_S2/SM_io_parser.h +++ b/Packages/Nef_S2/include/CGAL/Nef_S2/SM_io_parser.h @@ -66,11 +66,11 @@ class SM_io_parser : public Decorator_ public: /*{\Mcreation 3}*/ -SM_io_parser(istream& is, const Base& D); +SM_io_parser(std::istream& is, const Base& D); /*{\Mcreate creates an instance |\Mvar| of type |\Mname| to input |H| from |is|.}*/ -SM_io_parser(ostream& os, const Base& D); +SM_io_parser(std::ostream& os, const Base& D); /*{\Mcreate creates an instance |\Mvar| of type |\Mname| to output |H| to |os|.}*/ @@ -101,7 +101,7 @@ static void dump(const Decorator_& D, std::ostream& os = cerr); template SM_io_parser:: -SM_io_parser(istream& iin, const Decorator_& H) : +SM_io_parser(std::istream& iin, const Decorator_& H) : Base(H), in(iin), out(std::cout), verbose(0), vn(0), en(0), fn(0), ln(0) { clear(); } diff --git a/Packages/Nef_S2/include/CGAL/Nef_S2/Sphere_geometry_OGL.h b/Packages/Nef_S2/include/CGAL/Nef_S2/Sphere_geometry_OGL.h index 4ef2c3aa919..a2ec1d6ab17 100644 --- a/Packages/Nef_S2/include/CGAL/Nef_S2/Sphere_geometry_OGL.h +++ b/Packages/Nef_S2/include/CGAL/Nef_S2/Sphere_geometry_OGL.h @@ -769,7 +769,7 @@ void init() glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mat_diffuse ); glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, mat_specular ); glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, mat_shininess ); -//#define SCREENSHOTS +#define SCREENSHOTS #ifdef SCREENSHOTS GLfloat mat_emission[] = { 0.1, 0.1, 0.2, 0.0 }; glMaterialfv(GL_FRONT, GL_EMISSION, mat_emission); diff --git a/Packages/Nef_S2/noweb/Sphere_geometry.lw b/Packages/Nef_S2/noweb/Sphere_geometry.lw deleted file mode 100644 index 274eff0ae25..00000000000 --- a/Packages/Nef_S2/noweb/Sphere_geometry.lw +++ /dev/null @@ -1,28 +0,0 @@ -%------------------------------------------------------------------------------ -%KILLSTART -%LDEL TRACE.*?\)\; -\documentclass[a4paper]{article} -\usepackage{amsmath,MyLweb,version} -\input{defs} -\excludeversion{ignorecodeparts} - -\begin{document} -\title{Spherical Geometry} -\author{Michael Seel} -\maketitle -\tableofcontents -\newpage - -\section{The manual page} - -\input{manpages/Sphere_point.man} -\input{manpages/Sphere_segment.man} -\input{manpages/Sphere_circle.man} -\input{manpages/Sphere_direction.man} -\input{manpages/Sphere_triangle.man} -\newpage - -\bibliographystyle{alpha} -\bibliography{diss} -\end{document} - diff --git a/Packages/Nef_S2/test/Nef_S2/Sphere_geometry-test.C b/Packages/Nef_S2/test/Nef_S2/Sphere_geometry-test.C index 40db5ea83fe..4020206dc38 100644 --- a/Packages/Nef_S2/test/Nef_S2/Sphere_geometry-test.C +++ b/Packages/Nef_S2/test/Nef_S2/Sphere_geometry-test.C @@ -55,7 +55,7 @@ int main() L.push_back(s2); L.push_back(s3); SCircle pos_xy(0,0,1); - partition( pos_xy, L.begin(), L.end(), Lp); + CGAL::partition( pos_xy, L.begin(), L.end(), Lp); for (it = Lp.begin(); it != Lp.end(); ++it) { std::cout << *it << std::endl; }