diff --git a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/GeneralPolygonSetDcel.tex b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/GeneralPolygonSetDcel.tex index cb4a1d201ca..ec7afe796a2 100755 --- a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/GeneralPolygonSetDcel.tex +++ b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/GeneralPolygonSetDcel.tex @@ -2,27 +2,23 @@ \begin{ccRefConcept}{GeneralPolygonSetDcel} -A doubly-connected edge-list (\dcel\ for short) data-structure. It consists -of three containers of records: vertices $V$, halfedges $E$, and faces $F$. -It maintains the incidence relation among them. The halfedges are ordered -in pairs sometimes referred to as twins, such that each halfedge pair -represent an edge. +\ccDefinition +% =========== +The concept \ccRefName{} refines the corresponding arrangemen-\dcel{} +concept \ccc{ArrangemenDcel}. A model of this concept must provide the +types \ccStyle{Vertex}, \ccStyle{Halfedge}, \ccStyle{Face}, +\ccStyle{Hole}, and \ccStyle{Isolated_vertex}, which must model the +concepts +\ccc{ArrangementDcelVertex}, +\ccc{ArrangementDcelHalfedge}, +\ccc{GeneralPolygonSetDcelFace}, +\ccc{ArrangementDcelHole}, and +\ccc{ArrangementDcelIsolatedVertex} respectively. +Notice that this concept differs from the base concept \ccc{ArrangemenDcel} +only in the type \ccStyle{Face}. -A model of the \ccRefName\ concept must provide the following types and -operations. (In addition to the requirements here, the local types -\ccHtmlNoLinksFrom{\ccStyle{Vertex},\ccStyle{Halfedge}, \ccStyle{Face} -\ccStyle{Hole} and \ccStyle{Isolated_vertex}} -must be models of the concepts -\ccc{ArrangementDcelVertex}\lcTex{ -(\ccRefPage{ArrangementDcelVertex})}, -\ccc{ArrangementDcelHalfedge}\lcTex{ -(\ccRefPage{ArrangementDcelHalfedge})}, -\ccc{ArrangementDcelFace}\lcTex{ -(\ccRefPage{ArrangementDcelFace})}, -\ccc{ArrangementDcelHole}\lcTex{ -(\ccRefPage{ArrangementDcelHole})} and -\ccc{ArrangementDcelIsolatedVertex}\lcTex{ -(\ccRefPage{ArrangementDcelIsolatedVertex})} respectively.) +\ccRefines +\ccc{ArrangementDcel} % \ccTypes %======= @@ -42,9 +38,6 @@ must be models of the concepts \ccc{Gps_default_dcel}\lcTex{ (\ccRefPage{CGAL::Gps_default_dcel})} -\ccSeeAlso - \ccc{ArrangementDcel}\lcTex{(\ccRefPage{ArrangementDcel})} - \end{ccRefConcept} \ccRefPageEnd diff --git a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/GeneralPolygonSetDcelFace.tex b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/GeneralPolygonSetDcelFace.tex new file mode 100644 index 00000000000..843dd5f07c6 --- /dev/null +++ b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/GeneralPolygonSetDcelFace.tex @@ -0,0 +1,60 @@ +\ccRefPageBegin + +\begin{ccRefConcept}{GeneralPolygonSetDcelFace} + +\ccDefinition +% =========== +A face record in a \dcel{} data structure used by the +\ccc{General_polygon_set_2} and \ccc{Polygon_set_2} class-templates +to represent the undelying internal \ccc{Arrangement_2} data structure. + +\ccRefines +\ccc{ArrangementDcelFace} + +% \ccTypes + +\ccCreation +\ccCreationVariable{f} +% ========= +\ccConstructor{Gps_dcel_face();} + {default constructor.} + +\ccMethod{void assign (const Self& other);} + {assigns \ccVar{} with the contents of the \ccc{other} face.} + +\ccHtmlNoLinksFrom{ % to avoid linkage of Vertex, etc to HDS::Vertex + +\ccAccessFunctions +% ================ +\ccMethod{bool contained() const;}{% + returns \ccc{true} if the face is contained in the general-polygon set, + and \ccc{false} otherwise.} + +\ccMethod{bool visited();}{% + returns \ccc{true} if the face has been visited, and \ccc{false} otherwise. + This is used internally by the some of the operations of the + \ccc{General_polygon_set_2} class that traverse the arrangement faces.} + +\ccModifiers +% ========== +\ccMethod{void set_contained(bool flag);}{% + marks the face as contained (if \ccc{flag} is \ccc{true}), or as a hole + (if it is \ccc{false}).} + +\ccMethod{void set_visited(bool flag);} + {marks the face as visited (if \ccc{flag} is \ccc{true}), or as not visited + (if it is \ccc{false}). This is used internally by the some of the + operations of the \ccc{General_polygon_set_2} class that traverse the + arrangement faces..} + +} % ccHtmlNoLinksFrom + +\ccSeeAlso + +\ccc{ArrangementDcel}\lcTex{(\ccRefPage{ArrangementDcel})}\\ +\ccc{ArrangementDcelVertex}\lcTex{(\ccRefPage{ArrangementDcelVertex})}\\ +\ccc{ArrangementDcelHalfedge}\lcTex{(\ccRefPage{ArrangementDcelHalfedge})} + +\end{ccRefConcept} + +\ccRefPageEnd diff --git a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/General_polygon_set_2.tex b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/General_polygon_set_2.tex index a80cf08d8cf..97044e29777 100644 --- a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/General_polygon_set_2.tex +++ b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/General_polygon_set_2.tex @@ -1,6 +1,6 @@ \ccRefPageBegin -\begin{ccRefClass}{General_polygon_set_2} +\begin{ccRefClass}{General_polygon_set_2} \ccThree{General_polygon_set_2}{Polygon_2}{} \ccThreeToTwo @@ -27,13 +27,13 @@ the boundaries of the general polygons. The traits class supports geometric operations on the types above. We sometimes use the term {\em polygon} instead of general polygon for simplicity hereafter. -The \ccc{Dcel} template-parameter should be instantiated with a -model of the concept \ccc{GeneralPolygonSetDcel_2}. It is instantiated -by default with the type \ccc{Gps_dcel}. You can override this -default, with a {\sc Dcel} class you provide, typically an extension -of the \ccc{Gps_dcel} class template. Overriding the default is needed -only if you intend to obtain the undelying arrangement and process it -further. +The template parameter \ccc{Dcel} should be instantiated with a +model of the concept \ccc{GeneralPolygonSetDcel}. It is instantiated +by default with the type \ccc{Gps_default_dcel}. You can override +this default, with a different {\sc Dcel} class, typically an extension +of the \ccc{Gps_default_dcel} class template. Overriding the default is +necessary only if you intend to obtain the undelying internal arrangement +and process it further. The input and output of the Boolean set-operations methods consist of one or more general polygons, some of which may have holes. In particular, diff --git a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/Gps_default_dcel.tex b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/Gps_default_dcel.tex index 406ed06c38a..b63ac3237aa 100755 --- a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/Gps_default_dcel.tex +++ b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/Gps_default_dcel.tex @@ -4,9 +4,9 @@ \ccDefinition %============ -The class \ccRefName\ is the default \dcel\ class used by the -\ccc{General_polygon_set_2} (and \ccc{Polygon_set_2}) class-templates -to represent the undelying \ccc{Arrangement_2} data structure. +The class \ccRefName\ is the default \dcel{} class used by the +\ccc{General_polygon_set_2} and \ccc{Polygon_set_2} class-templates +to represent the undelying internal \ccc{Arrangement_2} data structure. \ccInclude{CGAL/Gps_default_dcel.h} @@ -25,9 +25,7 @@ to represent the undelying \ccc{Arrangement_2} data structure. \ccNestedType{template rebind} {allows the rebinding of the \dcel\ with a different traits class \ccc{T}.} -\ccSeeAlso - -\ccc{Arr_dcel_base}\lcTex{(\ccRefPage{CGAL::Arr_dcel_base})} +% \ccSeeAlso \end{ccRefClass} diff --git a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/Polygon_set_2.tex b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/Polygon_set_2.tex index e26c3262c56..f280bd96a83 100644 --- a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/Polygon_set_2.tex +++ b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/Polygon_set_2.tex @@ -1,18 +1,27 @@ \ccRefPageBegin -\begin{ccRefClass}{Polygon_set_2} +\begin{ccRefClass}{Polygon_set_2} -\ccThree{Polygon_set_2}{Polygon_2}{} +\ccThree{Polygon_set_2}{Polygon_2}{} \ccThreeToTwo \ccDefinition %============ -The class \ccRefName\ represents sets of linear polygons with holes. -It is parameterized with two types (\ccc{Kernel} and \ccc{Container}) that -are used to instantiate the type \ccc{CGAL::Polygon_2}. -The latter is used to represents the outer boundary and the boundary of the -holes of the set members. +The class \ccRefName{} represents sets of linear polygons with holes. +It is parameterized with three types. The types (\ccc{Kernel} and +\ccc{Container}) are used to instantiate the type +\ccc{CGAL::Polygon_2}. The type \ccc{Container} is used +to represents the outer boundary and the boundary of the holes of the set +members. + +The \ccc{Dcel} template-parameter should be instantiated with a +model of the concept \ccc{GeneralPolygonSetDcel}. It is instantiated +by default with the type \ccc{Gps_default_dcel}. You can override +this default, with a different {\sc Dcel} class, typically an extension +of the \ccc{Gps_default_dcel} class template. Overriding the default is +necessary only if you intend to obtain the undelying internal arrangement +and process it further. \ccInclude{CGAL/Polygon_set_2.h} diff --git a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/intro.tex b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/intro.tex index cc1b7445017..319ce721f6c 100644 --- a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/intro.tex +++ b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/intro.tex @@ -25,8 +25,9 @@ containment predicates. \ccRefConceptPage{GeneralPolygon_2}\\ \ccRefConceptPage{GeneralPolygonWithHoles_2}\\ \ccRefConceptPage{ArrangementDirectionalXMonotoneTraits_2}\\ -\ccRefConceptPage{GeneralPolygonSetTraits_2} -\ccRefConceptPage{GeneralPolygonSetDcel} +\ccRefConceptPage{GeneralPolygonSetTraits_2}\\ +\ccRefConceptPage{GeneralPolygonSetDcel}\\ +\ccRefConceptPage{GeneralPolygonSetDcelFace} \subsection*{Classes} diff --git a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/main.tex b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/main.tex index 4b34a69edd5..be2b57acb19 100644 --- a/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/main.tex +++ b/Boolean_set_operations_2/doc_tex/Boolean_set_operations_2_ref/main.tex @@ -32,6 +32,8 @@ \input{Boolean_set_operations_2_ref/Gps_circle_segment_traits_2.tex} \input{Boolean_set_operations_2_ref/Gps_traits_2.tex} \input{Boolean_set_operations_2_ref/Gps_default_dcel.tex} +\input{Boolean_set_operations_2_ref/GeneralPolygonSetDcel} +\input{Boolean_set_operations_2_ref/GeneralPolygonSetDcelFace} \input{Boolean_set_operations_2_ref/Bso_complement.tex} \input{Boolean_set_operations_2_ref/Bso_difference.tex} \input{Boolean_set_operations_2_ref/Bso_do_intersect.tex} diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_dcel.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_default_dcel.h similarity index 72% rename from Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_dcel.h rename to Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_default_dcel.h index e2da48ed3ff..9730e9e65a5 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_dcel.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_default_dcel.h @@ -16,18 +16,24 @@ // // // Author(s) : Baruch Zukerman +// Efi Fogel -#ifndef CGAL_GPS_DCEL_H -#define CGAL_GPS_DCEL_H +#ifndef CGAL_GPS_DEFAULT_DCEL_H +#define CGAL_GPS_DEFAULT_DCEL_H + +/*! \file + * This class is the default \dcel{} class used by the General_polygon_set_2 + * and Polygon_set_2} class-templates to represent the undelying internal + * Arrangement_2 data structure. + */ #include CGAL_BEGIN_NAMESPACE - -class Gps_face : public Arr_face_base +class Gps_face_base : public Arr_face_base { - protected: +protected: mutable char m_info; enum @@ -38,11 +44,10 @@ class Gps_face : public Arr_face_base public: - - //Constructor - Gps_face() : Arr_face_base(), - m_info(0) + Gps_face_base() : + Arr_face_base(), + m_info(0) {} /*! Assign from another face. */ @@ -50,7 +55,7 @@ public: { Arr_face_base::assign (f); - const Gps_face& ex_f = static_cast(f); + const Gps_face_base & ex_f = static_cast(f); m_info = ex_f.m_info; } @@ -61,7 +66,7 @@ public: void set_contained(bool b) { - if(b) + if (b) m_info |= CONTAINED; else m_info &= ~CONTAINED; @@ -74,7 +79,7 @@ public: void set_visited(bool b) const { - if(b) + if (b) m_info |= VISITED; else m_info &= ~VISITED; @@ -84,16 +89,14 @@ public: template -class Gps_dcel : +class Gps_default_dcel : public Arr_dcel_base, Arr_halfedge_base, - Gps_face> + Gps_face_base> { public: - /*! Default constructor. */ - Gps_dcel() - {} + Gps_default_dcel() {} }; diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_utils.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_utils.h index 1ee5e6efc34..380f1af0360 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_utils.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_utils.h @@ -16,6 +16,7 @@ // // // Author(s) : Baruch Zukerman +// Efi Fogel #ifndef CGAL_GPS_UTILS_H #define CGAL_GPS_UTILS_H @@ -25,8 +26,8 @@ #include #include #include -#include #include + #include template @@ -47,7 +48,7 @@ class Arr_bfs_scanner { public: typedef typename Arrangement::Traits_2 Gps_traits; - typedef typename Arrangement::Dcel My_gps_dcel; + typedef typename Arrangement::Dcel Gps_dcel; typedef typename Gps_traits::Polygon_2 Polygon_2; typedef typename Gps_traits::Polygon_with_holes_2 Polygon_with_holes_2; typedef typename Arrangement::Ccb_halfedge_const_circulator @@ -121,7 +122,7 @@ public: void scan_ccb(Ccb_halfedge_const_circulator ccb) { Polygon_2 pgn_boundary; - General_polygon_set_2:: + General_polygon_set_2:: construct_polygon(ccb, pgn_boundary, m_traits); Ccb_halfedge_const_circulator ccb_end = ccb; @@ -165,7 +166,7 @@ public: if (!f->contained()) { m_pgn_holes.push_back(Polygon_2()); - General_polygon_set_2:: + General_polygon_set_2:: construct_polygon(f->outer_ccb(), m_pgn_holes.back(), m_traits); m_holes_q.push(f); } @@ -199,7 +200,7 @@ public: CGAL_assertion(!he->twin()->face()->contained()); m_pgn_holes.push_back(Polygon_2()); - General_polygon_set_2:: + General_polygon_set_2:: construct_polygon(he->twin()->face()->outer_ccb(), m_pgn_holes.back(), m_traits); m_holes_q.push(he->twin()->face()); diff --git a/Boolean_set_operations_2/include/CGAL/General_polygon_set_2.h b/Boolean_set_operations_2/include/CGAL/General_polygon_set_2.h index 835f5a18024..0948eecee70 100644 --- a/Boolean_set_operations_2/include/CGAL/General_polygon_set_2.h +++ b/Boolean_set_operations_2/include/CGAL/General_polygon_set_2.h @@ -30,7 +30,7 @@ #include #include -#include +#include #include #include #include @@ -43,7 +43,7 @@ CGAL_BEGIN_NAMESPACE // General_polygon_set_2 -template > +template > class General_polygon_set_2 { public: diff --git a/Boolean_set_operations_2/include/CGAL/Polygon_set_2.h b/Boolean_set_operations_2/include/CGAL/Polygon_set_2.h index 8ac0a3d530c..847da727fdc 100644 --- a/Boolean_set_operations_2/include/CGAL/Polygon_set_2.h +++ b/Boolean_set_operations_2/include/CGAL/Polygon_set_2.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include @@ -32,7 +32,8 @@ CGAL_BEGIN_NAMESPACE template , - class Dcel_ = Gps_dcel > > + class Dcel_ = + Gps_default_dcel > > class Polygon_set_2 : public General_polygon_set_2, Dcel_> {