From f31ce396f543a8bca34c148b02437909cfb8c900 Mon Sep 17 00:00:00 2001 From: Monique Teillaud Date: Thu, 14 Oct 1999 14:15:34 +0000 Subject: [PATCH] flips added + some errors corrected --- .../doc_tex/Triangulation_3/TDS3.tex | 88 ++++++++++++++++++- .../Triangulation_3/Triangulation3.tex | 65 +++++++++++++- .../doc_tex/Triangulation_3/htmlfiles | 1 + .../doc_tex/Triangulation_3/wrapper.tex | 2 +- .../doc_tex/basic/Triangulation_3/TDS3.tex | 88 ++++++++++++++++++- .../basic/Triangulation_3/Triangulation3.tex | 65 +++++++++++++- .../doc_tex/basic/Triangulation_3/htmlfiles | 1 + .../doc_tex/basic/Triangulation_3/wrapper.tex | 2 +- 8 files changed, 302 insertions(+), 10 deletions(-) diff --git a/Packages/Triangulation_3/doc_tex/Triangulation_3/TDS3.tex b/Packages/Triangulation_3/doc_tex/Triangulation_3/TDS3.tex index 6e2a34576a9..2f741c06ef7 100644 --- a/Packages/Triangulation_3/doc_tex/Triangulation_3/TDS3.tex +++ b/Packages/Triangulation_3/doc_tex/Triangulation_3/TDS3.tex @@ -500,12 +500,20 @@ infinite vertex is a standard vertex and is thus also counted.} \ccMethod{bool is_vertex(Vertex* v) const;} {Tests whether \ccc{v} is a vertex of \ccVar.} + +\ccMethod{bool is_edge(Cell* c, int i, int j) const;} +{Tests whether \ccc{(c,i,j)} is an edge of \ccVar. Answers \ccc{false} when +\ccc{dimension()} $<1$ .} \ccGlue \ccMethod{bool is_edge(Vertex* u, Vertex* v, Cell* & c, int & i, int & j) const;} {Tests whether \ccc{(u,v)} is an edge of \ccVar. If the edge is found, it computes a cell \ccc{c} having this edge and the indices \ccc{i} and \ccc{j} of the vertices \ccc{u} and \ccc{v}, in this order.} + +\ccMethod{ bool is_facet(Cell* c, int i) const;} +{Tests whether \ccc{(c,i)} is a facet of \ccVar. Answers \ccc{false} when +\ccc{dimension()} $<2$ .} \ccGlue \ccMethod{bool is_facet(Vertex* u, Vertex* v, Vertex* w, Cell* & c, int & i, int & j, int & k) const;} @@ -513,7 +521,10 @@ and \ccc{j} of the vertices \ccc{u} and \ccc{v}, in this order.} it computes a cell \ccc{c} having this facet and the indices \ccc{i}, \ccc{j} and \ccc{k} of the vertices \ccc{u}, \ccc{v} and \ccc{w}, in this order.} -\ccGlue + +\ccMethod{bool is_cell(Cell* c) const;} +{Tests whether \ccc{c} is a cell of \ccVar. Answers \ccc{false} when +\ccc{dimension()} $<3$ .} \ccMethod{bool is_cell(Vertex* u, Vertex* v, Vertex* w, Vertex* t, Cell* & c, int & i, int & j, int & k, int & l) const;} {Tests whether \ccc{(u,v,w,t)} is a cell of \ccVar. If the cell @@ -521,7 +532,67 @@ this order.} and \ccc{l} of the vertices \ccc{u}, \ccc{v}, \ccc{w} and \ccc{t} in \ccc{c}, in this order.} -\ccModifiers +\ccHeading{Flips} + +Two kinds of flips exist for a three-dimensional triangulation. They +are reciprocal. To be flipped, an edge must be incident to three +tetrahedra. During the flip, these three tetrahedra disappear and two +tetrahedra appear. Figure~\ref{TDS3-fig-flips}(left) shows the +edge that is flipped as bold dashed, and one of its three incident +facets is shaded. On the right, the facet shared by the two new +tetrahedra is dashed. + +Flips are possible only if the tetrahedra to be created do not already +exist. + +\begin{ccTexOnly} +\begin{figure} +\begin{center} +\includegraphics{flips.eps} +\end{center} +\caption{Flips \label{TDS3-fig-flips}} +\end{figure} +\end{ccTexOnly} + +\begin{ccHtmlOnly} + +\end{ccHtmlOnly} + +The following methods guarantee the validity of the resulting 3D +combinatorial triangulation. + +\textit{Flips for a 2d triangulation are not implemented yet} + +\ccMethod{bool flip(Edge e);} +\ccGlue +\ccMethod{bool flip(Cell* c, int i, int j);} +{Before flipping, these methods check that edge \ccc{e=(c,i,j)} is +flippable (which is quite expensive). They return \ccc{false} or +\ccc{true} according to this test.} + +\ccMethod{void flip_flippable(Edge e);} +\ccGlue +\ccMethod{void flip_flippable(Cell* c, int i, int j);} +{Should be preferred to the previous methods when the edge is +known to be flippable. +\ccPrecond{The edge is flippable.}} + +\ccMethod{bool flip(Facet f);} +\ccGlue +\ccMethod{bool flip(Cell* c, int i);} +{Before flipping, these methods check that facet \ccc{f=(c,i)} is +flippable (which is quite expensive). They return \ccc{false} or +\ccc{true} according to this test.} + +\ccMethod{void flip_flippable(Facet f);} +\ccGlue +\ccMethod{void flip_flippable(Cell* c, int i);} +{Should be preferred to the previous methods when the facet is +known to be flippable. +\ccPrecond{The facet is flippable.}} + +\ccHeading{Insertions} The following modifier member functions guarantee the combinatorial validity of the resulting triangulation. @@ -647,6 +718,10 @@ being initialized with \ccc{NULL}.} {Creates a cell, initializes its vertices and neighbors, and adds it into the triangulation data structure.} +\ccMethod{void delete_cell( Cell* c );} +{Removes the cell from the triangulation data structure and deletes it. +\ccPrecond{The cell is a cell of \ccVar.}} + \end{ccAdvanced} \ccHeading{Traversing the triangulation} @@ -921,6 +996,13 @@ computes its index \ccc{i} in \ccVar.} {Returns \ccc{true} if \ccc{n} is a neighbor of \ccVar, and computes its index \ccc{i} in \ccVar.} +\ccMethod{Vertex* mirror_vertex(int i) const;} +{Returns the vertex of the neighbor of \ccVar that is opposite to \ccVar. +\ccPrecond{$i \in \{0, 1, 2, 3\}$.}} +\ccMethod{int mirror_index(int i) const;} +{Returns the index of \ccVar in its \ccc{i^{\rm th}} neighbor. +\ccPrecond{$i \in \{0, 1, 2, 3\}$.}} + \ccHeading{Setting} \ccMethod{void set_vertex(int i, Vertex* v);} @@ -1049,7 +1131,7 @@ structure alone.}}} {Sets the incident cell.} \ccHeading{Checking} -\ccMethod{bool is_valid() const;} +\ccMethod{bool is_valid(bool verbose=false) const;} {Performs any desired geometric test on a vertex. Checks that the pointer to an incident cell is not \ccc{NULL}.} diff --git a/Packages/Triangulation_3/doc_tex/Triangulation_3/Triangulation3.tex b/Packages/Triangulation_3/doc_tex/Triangulation_3/Triangulation3.tex index 052e935a3f5..59d6c9902af 100644 --- a/Packages/Triangulation_3/doc_tex/Triangulation_3/Triangulation3.tex +++ b/Packages/Triangulation_3/doc_tex/Triangulation_3/Triangulation3.tex @@ -736,7 +736,70 @@ with the points of the triangulation. \ccc{e.first} $=0$ and Locate_type & lt, int & li) const;} {Same as the previous method for edge $(c,0,1)$.} -\ccHeading{Insertion} +\ccHeading{Flips} + +Two kinds of flips exist for a three-dimensional triangulation. They +are reciprocal. To be flipped, an edge must be incident to three +tetrahedra. During the flip, these three tetrahedra disappear and two +tetrahedra appear. Figure~\ref{Triangulation3-fig-flips}(left) shows the +edge that is flipped as bold dashed, and one of its three incident +facets is shaded. On the right, the facet shared by the two new +tetrahedra is dashed. + +Flips are possible only under the following conditions:\\ +- the edge or facet to be flipped is not on the boundary of the convex +hull of the triangulation +- the points that will be vertices of the tetrahedra to be created are +in convex position. + +\begin{ccTexOnly} +\begin{figure} +\begin{center} +\includegraphics{flips.eps} +\end{center} +\caption{Flips \label{Triangulation3-fig-flips}} +\end{figure} +\end{ccTexOnly} + +\begin{ccHtmlOnly} + +\end{ccHtmlOnly} + +The following methods guarantee the validity of the resulting 3D +triangulation. + +\textit{Flips for a 2d triangulation are not implemented yet} + +\ccMethod{bool flip(Edge e);} +\ccGlue +\ccMethod{bool flip(Cell_handle c, int i, int j);} +{Before flipping, these methods check that edge \ccc{e=(c,i,j)} is +flippable (which is quite expensive). They return \ccc{false} or +\ccc{true} according to this test.} + +\ccMethod{void flip_flippable(Edge e);} +\ccGlue +\ccMethod{void flip_flippable(Cell_handle c, int i, int j);} +{Should be preferred to the previous methods when the edge is +known to be flippable. +\ccPrecond{The edge is flippable.}} + +\ccMethod{bool flip(Facet f);} +\ccGlue +\ccMethod{bool flip(Cell_handle c, int i);} +{Before flipping, these methods check that facet \ccc{f=(c,i)} is +flippable (which is quite expensive). They return \ccc{false} or +\ccc{true} according to this test.} + +\ccMethod{void flip_flippable(Facet f);} +\ccGlue +\ccMethod{void flip_flippable(Cell_handle c, int i);} +{Should be preferred to the previous methods when the facet is +known to be flippable. +\ccPrecond{The facet is flippable.}} + +\ccHeading{Insertions} The following operations are guaranteed to lead to a valid triangulation when they are applied on a valid triangulation. diff --git a/Packages/Triangulation_3/doc_tex/Triangulation_3/htmlfiles b/Packages/Triangulation_3/doc_tex/Triangulation_3/htmlfiles index 6749aae1625..627d660d61a 100644 --- a/Packages/Triangulation_3/doc_tex/Triangulation_3/htmlfiles +++ b/Packages/Triangulation_3/doc_tex/Triangulation_3/htmlfiles @@ -1,5 +1,6 @@ comborient.gif design.gif +flips.gif insert_outside_affine_hull.gif insert_outside_convex_hull.gif orient.gif diff --git a/Packages/Triangulation_3/doc_tex/Triangulation_3/wrapper.tex b/Packages/Triangulation_3/doc_tex/Triangulation_3/wrapper.tex index cf42a30cffc..3ee09d00c1d 100644 --- a/Packages/Triangulation_3/doc_tex/Triangulation_3/wrapper.tex +++ b/Packages/Triangulation_3/doc_tex/Triangulation_3/wrapper.tex @@ -7,7 +7,7 @@ \documentclass{book} \usepackage{cprog} -\usepackage{cc_manual} +\usepackage{cc_manual.old} \usepackage{amssymb} \usepackage{graphicx} \usepackage{path} diff --git a/Packages/Triangulation_3/doc_tex/basic/Triangulation_3/TDS3.tex b/Packages/Triangulation_3/doc_tex/basic/Triangulation_3/TDS3.tex index 6e2a34576a9..2f741c06ef7 100644 --- a/Packages/Triangulation_3/doc_tex/basic/Triangulation_3/TDS3.tex +++ b/Packages/Triangulation_3/doc_tex/basic/Triangulation_3/TDS3.tex @@ -500,12 +500,20 @@ infinite vertex is a standard vertex and is thus also counted.} \ccMethod{bool is_vertex(Vertex* v) const;} {Tests whether \ccc{v} is a vertex of \ccVar.} + +\ccMethod{bool is_edge(Cell* c, int i, int j) const;} +{Tests whether \ccc{(c,i,j)} is an edge of \ccVar. Answers \ccc{false} when +\ccc{dimension()} $<1$ .} \ccGlue \ccMethod{bool is_edge(Vertex* u, Vertex* v, Cell* & c, int & i, int & j) const;} {Tests whether \ccc{(u,v)} is an edge of \ccVar. If the edge is found, it computes a cell \ccc{c} having this edge and the indices \ccc{i} and \ccc{j} of the vertices \ccc{u} and \ccc{v}, in this order.} + +\ccMethod{ bool is_facet(Cell* c, int i) const;} +{Tests whether \ccc{(c,i)} is a facet of \ccVar. Answers \ccc{false} when +\ccc{dimension()} $<2$ .} \ccGlue \ccMethod{bool is_facet(Vertex* u, Vertex* v, Vertex* w, Cell* & c, int & i, int & j, int & k) const;} @@ -513,7 +521,10 @@ and \ccc{j} of the vertices \ccc{u} and \ccc{v}, in this order.} it computes a cell \ccc{c} having this facet and the indices \ccc{i}, \ccc{j} and \ccc{k} of the vertices \ccc{u}, \ccc{v} and \ccc{w}, in this order.} -\ccGlue + +\ccMethod{bool is_cell(Cell* c) const;} +{Tests whether \ccc{c} is a cell of \ccVar. Answers \ccc{false} when +\ccc{dimension()} $<3$ .} \ccMethod{bool is_cell(Vertex* u, Vertex* v, Vertex* w, Vertex* t, Cell* & c, int & i, int & j, int & k, int & l) const;} {Tests whether \ccc{(u,v,w,t)} is a cell of \ccVar. If the cell @@ -521,7 +532,67 @@ this order.} and \ccc{l} of the vertices \ccc{u}, \ccc{v}, \ccc{w} and \ccc{t} in \ccc{c}, in this order.} -\ccModifiers +\ccHeading{Flips} + +Two kinds of flips exist for a three-dimensional triangulation. They +are reciprocal. To be flipped, an edge must be incident to three +tetrahedra. During the flip, these three tetrahedra disappear and two +tetrahedra appear. Figure~\ref{TDS3-fig-flips}(left) shows the +edge that is flipped as bold dashed, and one of its three incident +facets is shaded. On the right, the facet shared by the two new +tetrahedra is dashed. + +Flips are possible only if the tetrahedra to be created do not already +exist. + +\begin{ccTexOnly} +\begin{figure} +\begin{center} +\includegraphics{flips.eps} +\end{center} +\caption{Flips \label{TDS3-fig-flips}} +\end{figure} +\end{ccTexOnly} + +\begin{ccHtmlOnly} + +\end{ccHtmlOnly} + +The following methods guarantee the validity of the resulting 3D +combinatorial triangulation. + +\textit{Flips for a 2d triangulation are not implemented yet} + +\ccMethod{bool flip(Edge e);} +\ccGlue +\ccMethod{bool flip(Cell* c, int i, int j);} +{Before flipping, these methods check that edge \ccc{e=(c,i,j)} is +flippable (which is quite expensive). They return \ccc{false} or +\ccc{true} according to this test.} + +\ccMethod{void flip_flippable(Edge e);} +\ccGlue +\ccMethod{void flip_flippable(Cell* c, int i, int j);} +{Should be preferred to the previous methods when the edge is +known to be flippable. +\ccPrecond{The edge is flippable.}} + +\ccMethod{bool flip(Facet f);} +\ccGlue +\ccMethod{bool flip(Cell* c, int i);} +{Before flipping, these methods check that facet \ccc{f=(c,i)} is +flippable (which is quite expensive). They return \ccc{false} or +\ccc{true} according to this test.} + +\ccMethod{void flip_flippable(Facet f);} +\ccGlue +\ccMethod{void flip_flippable(Cell* c, int i);} +{Should be preferred to the previous methods when the facet is +known to be flippable. +\ccPrecond{The facet is flippable.}} + +\ccHeading{Insertions} The following modifier member functions guarantee the combinatorial validity of the resulting triangulation. @@ -647,6 +718,10 @@ being initialized with \ccc{NULL}.} {Creates a cell, initializes its vertices and neighbors, and adds it into the triangulation data structure.} +\ccMethod{void delete_cell( Cell* c );} +{Removes the cell from the triangulation data structure and deletes it. +\ccPrecond{The cell is a cell of \ccVar.}} + \end{ccAdvanced} \ccHeading{Traversing the triangulation} @@ -921,6 +996,13 @@ computes its index \ccc{i} in \ccVar.} {Returns \ccc{true} if \ccc{n} is a neighbor of \ccVar, and computes its index \ccc{i} in \ccVar.} +\ccMethod{Vertex* mirror_vertex(int i) const;} +{Returns the vertex of the neighbor of \ccVar that is opposite to \ccVar. +\ccPrecond{$i \in \{0, 1, 2, 3\}$.}} +\ccMethod{int mirror_index(int i) const;} +{Returns the index of \ccVar in its \ccc{i^{\rm th}} neighbor. +\ccPrecond{$i \in \{0, 1, 2, 3\}$.}} + \ccHeading{Setting} \ccMethod{void set_vertex(int i, Vertex* v);} @@ -1049,7 +1131,7 @@ structure alone.}}} {Sets the incident cell.} \ccHeading{Checking} -\ccMethod{bool is_valid() const;} +\ccMethod{bool is_valid(bool verbose=false) const;} {Performs any desired geometric test on a vertex. Checks that the pointer to an incident cell is not \ccc{NULL}.} diff --git a/Packages/Triangulation_3/doc_tex/basic/Triangulation_3/Triangulation3.tex b/Packages/Triangulation_3/doc_tex/basic/Triangulation_3/Triangulation3.tex index 052e935a3f5..59d6c9902af 100644 --- a/Packages/Triangulation_3/doc_tex/basic/Triangulation_3/Triangulation3.tex +++ b/Packages/Triangulation_3/doc_tex/basic/Triangulation_3/Triangulation3.tex @@ -736,7 +736,70 @@ with the points of the triangulation. \ccc{e.first} $=0$ and Locate_type & lt, int & li) const;} {Same as the previous method for edge $(c,0,1)$.} -\ccHeading{Insertion} +\ccHeading{Flips} + +Two kinds of flips exist for a three-dimensional triangulation. They +are reciprocal. To be flipped, an edge must be incident to three +tetrahedra. During the flip, these three tetrahedra disappear and two +tetrahedra appear. Figure~\ref{Triangulation3-fig-flips}(left) shows the +edge that is flipped as bold dashed, and one of its three incident +facets is shaded. On the right, the facet shared by the two new +tetrahedra is dashed. + +Flips are possible only under the following conditions:\\ +- the edge or facet to be flipped is not on the boundary of the convex +hull of the triangulation +- the points that will be vertices of the tetrahedra to be created are +in convex position. + +\begin{ccTexOnly} +\begin{figure} +\begin{center} +\includegraphics{flips.eps} +\end{center} +\caption{Flips \label{Triangulation3-fig-flips}} +\end{figure} +\end{ccTexOnly} + +\begin{ccHtmlOnly} + +\end{ccHtmlOnly} + +The following methods guarantee the validity of the resulting 3D +triangulation. + +\textit{Flips for a 2d triangulation are not implemented yet} + +\ccMethod{bool flip(Edge e);} +\ccGlue +\ccMethod{bool flip(Cell_handle c, int i, int j);} +{Before flipping, these methods check that edge \ccc{e=(c,i,j)} is +flippable (which is quite expensive). They return \ccc{false} or +\ccc{true} according to this test.} + +\ccMethod{void flip_flippable(Edge e);} +\ccGlue +\ccMethod{void flip_flippable(Cell_handle c, int i, int j);} +{Should be preferred to the previous methods when the edge is +known to be flippable. +\ccPrecond{The edge is flippable.}} + +\ccMethod{bool flip(Facet f);} +\ccGlue +\ccMethod{bool flip(Cell_handle c, int i);} +{Before flipping, these methods check that facet \ccc{f=(c,i)} is +flippable (which is quite expensive). They return \ccc{false} or +\ccc{true} according to this test.} + +\ccMethod{void flip_flippable(Facet f);} +\ccGlue +\ccMethod{void flip_flippable(Cell_handle c, int i);} +{Should be preferred to the previous methods when the facet is +known to be flippable. +\ccPrecond{The facet is flippable.}} + +\ccHeading{Insertions} The following operations are guaranteed to lead to a valid triangulation when they are applied on a valid triangulation. diff --git a/Packages/Triangulation_3/doc_tex/basic/Triangulation_3/htmlfiles b/Packages/Triangulation_3/doc_tex/basic/Triangulation_3/htmlfiles index 6749aae1625..627d660d61a 100644 --- a/Packages/Triangulation_3/doc_tex/basic/Triangulation_3/htmlfiles +++ b/Packages/Triangulation_3/doc_tex/basic/Triangulation_3/htmlfiles @@ -1,5 +1,6 @@ comborient.gif design.gif +flips.gif insert_outside_affine_hull.gif insert_outside_convex_hull.gif orient.gif diff --git a/Packages/Triangulation_3/doc_tex/basic/Triangulation_3/wrapper.tex b/Packages/Triangulation_3/doc_tex/basic/Triangulation_3/wrapper.tex index cf42a30cffc..3ee09d00c1d 100644 --- a/Packages/Triangulation_3/doc_tex/basic/Triangulation_3/wrapper.tex +++ b/Packages/Triangulation_3/doc_tex/basic/Triangulation_3/wrapper.tex @@ -7,7 +7,7 @@ \documentclass{book} \usepackage{cprog} -\usepackage{cc_manual} +\usepackage{cc_manual.old} \usepackage{amssymb} \usepackage{graphicx} \usepackage{path}