\hypertarget{a01331}{\section{A\+C\+G\+:\+:Triangulator Class Reference}
\label{a01331}\index{A\+C\+G\+::\+Triangulator@{A\+C\+G\+::\+Triangulator}}
}
\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{a01121}{Ring\+Vertex}
\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{a01331_a505a920d3a9eb73f41ef5c1326866e01}{Triangulator} (const std\+::vector$<$ \hyperlink{a03336_a86c28120e8596ee7d03e58b7300f59bc}{Vec3f} $>$ \&\+\_\+pos)
\begin{DoxyCompactList}\small\item\em Execute the triangulation algorithm on a polygon. \end{DoxyCompactList}\item 
\hypertarget{a01331_a7adb82e429e9fbafb5848ce4c7814964}{virtual \hyperlink{a01331_a7adb82e429e9fbafb5848ce4c7814964}{$\sim$\+Triangulator} ()}\label{a01331_a7adb82e429e9fbafb5848ce4c7814964}

\begin{DoxyCompactList}\small\item\em Destructor. \end{DoxyCompactList}\item 
int \hyperlink{a01331_a7f4736cede3c8a3df904b288c0d3ec1a}{num\+Triangles} () const 
\begin{DoxyCompactList}\small\item\em Get number of triangles. \end{DoxyCompactList}\item 
int \hyperlink{a01331_aa402b00ade39f419734560e22d348971}{index} (int \+\_\+i) const 
\begin{DoxyCompactList}\small\item\em Get local vertex index. \end{DoxyCompactList}\item 
const std\+::vector$<$ int $>$ \& \hyperlink{a01331_a53a32644c3a4982311c3e3560e205885}{indices} () const 
\begin{DoxyCompactList}\small\item\em Get local index buffer. \end{DoxyCompactList}\item 
bool \hyperlink{a01331_aa79a5ba61d38592d545e33b9433b80cf}{convex} () const 
\begin{DoxyCompactList}\small\item\em Is the polygon convex? \end{DoxyCompactList}\item 
int \hyperlink{a01331_acc837d99c498e0a2399fe91a95d0f137}{num\+Reflex\+Vertices} () const 
\begin{DoxyCompactList}\small\item\em Get number of reflex vertices. \end{DoxyCompactList}\item 
bool \hyperlink{a01331_a8c60eb6753d7132959cde3706222574e}{is\+Reflex\+Vertex} (int \+\_\+i) const 
\begin{DoxyCompactList}\small\item\em Check if a vertex is reflex. \end{DoxyCompactList}\item 
bool \hyperlink{a01331_a20f15b00fd8d0fc3b03349b41ee5f2b1}{success} () const 
\begin{DoxyCompactList}\small\item\em Check if the triangulation was successful. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{a01331_a502fb63b254c14d691b5c97cbab8783e}{void {\bfseries init\+Vertex\+List} ()}\label{a01331_a502fb63b254c14d691b5c97cbab8783e}

\item 
\hypertarget{a01331_a9516596e3e6b89839b70db25874787ee}{int {\bfseries ear\+Clipping\+N2} ()}\label{a01331_a9516596e3e6b89839b70db25874787ee}

\item 
\hypertarget{a01331_aa215f69c36b6eb2bcad304ad2ab335a3}{int {\bfseries ear\+Clipping\+N3} ()}\label{a01331_aa215f69c36b6eb2bcad304ad2ab335a3}

\item 
\hypertarget{a01331_a235dd6713ce754a5c31c2ee188d08d22}{\hyperlink{a01331}{Triangulator} \& {\bfseries operator=} (const \hyperlink{a01331}{Triangulator} \&)}\label{a01331_a235dd6713ce754a5c31c2ee188d08d22}

\item 
\hypertarget{a01331_af58a91f87eeadac8980a89985a296ae7}{float {\bfseries triangle\+Area\+Sign} (const \hyperlink{a03336_a8b858737aebd55e312149cf208a0b3f3}{Vec2f} \&v0, const \hyperlink{a03336_a8b858737aebd55e312149cf208a0b3f3}{Vec2f} \&v1, const \hyperlink{a03336_a8b858737aebd55e312149cf208a0b3f3}{Vec2f} \&v2) const }\label{a01331_af58a91f87eeadac8980a89985a296ae7}

\item 
\hypertarget{a01331_a3067491cc232de9f3c07af2f97c7ea98}{float {\bfseries distance\+Point\+To\+Segment\+Sq} (const \hyperlink{a03336_a8b858737aebd55e312149cf208a0b3f3}{Vec2f} \&v0, const \hyperlink{a03336_a8b858737aebd55e312149cf208a0b3f3}{Vec2f} \&v1, const \hyperlink{a03336_a8b858737aebd55e312149cf208a0b3f3}{Vec2f} \&pt) const }\label{a01331_a3067491cc232de9f3c07af2f97c7ea98}

\item 
\hypertarget{a01331_a8a48757098cb5ea0c551de2e2ca93955}{bool {\bfseries is\+Reflex\+Vertex} (const \hyperlink{a03336_a8b858737aebd55e312149cf208a0b3f3}{Vec2f} \&v0, const \hyperlink{a03336_a8b858737aebd55e312149cf208a0b3f3}{Vec2f} \&v1, const \hyperlink{a03336_a8b858737aebd55e312149cf208a0b3f3}{Vec2f} \&v2) const }\label{a01331_a8a48757098cb5ea0c551de2e2ca93955}

\item 
\hypertarget{a01331_a9b2d37ff3523e068d10361dddbef3332}{bool {\bfseries point\+In\+Triangle} (const \hyperlink{a03336_a8b858737aebd55e312149cf208a0b3f3}{Vec2f} \&v0, const \hyperlink{a03336_a8b858737aebd55e312149cf208a0b3f3}{Vec2f} \&v1, const \hyperlink{a03336_a8b858737aebd55e312149cf208a0b3f3}{Vec2f} \&v2, const \hyperlink{a03336_a8b858737aebd55e312149cf208a0b3f3}{Vec2f} \&pt) const }\label{a01331_a9b2d37ff3523e068d10361dddbef3332}

\item 
\hypertarget{a01331_a32043af46b01fa884eee38deb202fa1e}{bool {\bfseries update\+Reflex\+Vertex} (\hyperlink{a01121}{Ring\+Vertex} $\ast$v)}\label{a01331_a32043af46b01fa884eee38deb202fa1e}

\item 
\hypertarget{a01331_af3bf49144dc31a1988d061317954a9ee}{void {\bfseries add\+Ear} (\hyperlink{a01121}{Ring\+Vertex} $\ast$\+\_\+ear\+Tip)}\label{a01331_af3bf49144dc31a1988d061317954a9ee}

\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{a01331_a3e6b6e7340166f855f3eb57bcf029f16}{const int {\bfseries poly\+Size\+\_\+}}\label{a01331_a3e6b6e7340166f855f3eb57bcf029f16}

\item 
\hypertarget{a01331_a073f414ce5c216670288d2f3fcf9044e}{int {\bfseries num\+Remaning\+Vertices\+\_\+}}\label{a01331_a073f414ce5c216670288d2f3fcf9044e}

\item 
\hypertarget{a01331_a2f0659a5520d301a19b6d402a163059a}{int {\bfseries num\+Tris\+\_\+}}\label{a01331_a2f0659a5520d301a19b6d402a163059a}

\item 
\hypertarget{a01331_a747b22a8f7ea6883667d0d32e3e828bc}{int {\bfseries num\+Reflex\+Vertices\+\_\+}}\label{a01331_a747b22a8f7ea6883667d0d32e3e828bc}

\item 
\hypertarget{a01331_a6e7bcfedac9b9aa88456e8efe6b82f0d}{int {\bfseries status\+\_\+}}\label{a01331_a6e7bcfedac9b9aa88456e8efe6b82f0d}

\item 
\hypertarget{a01331_a0fca392e2d2d82291b41624ec31d303b}{bool {\bfseries convex\+\_\+}}\label{a01331_a0fca392e2d2d82291b41624ec31d303b}

\item 
\hypertarget{a01331_a5f6d043d62ba8a37600fc2c3ad848698}{std\+::vector$<$ \hyperlink{a03336_a8b858737aebd55e312149cf208a0b3f3}{Vec2f} $>$ {\bfseries pos\+\_\+}}\label{a01331_a5f6d043d62ba8a37600fc2c3ad848698}

\item 
\hypertarget{a01331_adf28610eaf3b0614cc024bda72b0fb7b}{std\+::vector$<$ \hyperlink{a01121}{Ring\+Vertex} $>$ {\bfseries vertices\+\_\+}}\label{a01331_adf28610eaf3b0614cc024bda72b0fb7b}

\item 
\hypertarget{a01331_a4252968b227bc8358429a2c1dc25c181}{std\+::list$<$ \hyperlink{a01121}{Ring\+Vertex} $\ast$ $>$ {\bfseries reflex\+Vertices\+\_\+}}\label{a01331_a4252968b227bc8358429a2c1dc25c181}

\item 
\hypertarget{a01331_a86d61d1e8fa1de6fdb3107f0e506a85e}{std\+::vector$<$ int $>$ {\bfseries tris\+\_\+}}\label{a01331_a86d61d1e8fa1de6fdb3107f0e506a85e}

\end{DoxyCompactItemize}


\subsection{Detailed Description}


Definition at line 67 of file Triangulator.\+hh.



\subsection{Constructor \& Destructor Documentation}
\hypertarget{a01331_a505a920d3a9eb73f41ef5c1326866e01}{\index{A\+C\+G\+::\+Triangulator@{A\+C\+G\+::\+Triangulator}!Triangulator@{Triangulator}}
\index{Triangulator@{Triangulator}!A\+C\+G\+::\+Triangulator@{A\+C\+G\+::\+Triangulator}}
\subsubsection[{Triangulator}]{\setlength{\rightskip}{0pt plus 5cm}A\+C\+G\+::\+Triangulator\+::\+Triangulator (
\begin{DoxyParamCaption}
\item[{const std\+::vector$<$ {\bf Vec3f} $>$ \&}]{\+\_\+pos}
\end{DoxyParamCaption}
)}}\label{a01331_a505a920d3a9eb73f41ef5c1326866e01}


Execute the triangulation algorithm on a polygon. 


\begin{DoxyParams}{Parameters}
{\em \+\_\+pos} & polygon vertex positions (ccw) \\
\hline
\end{DoxyParams}


Definition at line 61 of file Triangulator.\+cc.



\subsection{Member Function Documentation}
\hypertarget{a01331_aa79a5ba61d38592d545e33b9433b80cf}{\index{A\+C\+G\+::\+Triangulator@{A\+C\+G\+::\+Triangulator}!convex@{convex}}
\index{convex@{convex}!A\+C\+G\+::\+Triangulator@{A\+C\+G\+::\+Triangulator}}
\subsubsection[{convex}]{\setlength{\rightskip}{0pt plus 5cm}bool A\+C\+G\+::\+Triangulator\+::convex (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}}\label{a01331_aa79a5ba61d38592d545e33b9433b80cf}


Is the polygon convex? 

\begin{DoxyReturn}{Returns}
convex true or false 
\end{DoxyReturn}


Definition at line 102 of file Triangulator.\+hh.

\hypertarget{a01331_aa402b00ade39f419734560e22d348971}{\index{A\+C\+G\+::\+Triangulator@{A\+C\+G\+::\+Triangulator}!index@{index}}
\index{index@{index}!A\+C\+G\+::\+Triangulator@{A\+C\+G\+::\+Triangulator}}
\subsubsection[{index}]{\setlength{\rightskip}{0pt plus 5cm}int A\+C\+G\+::\+Triangulator\+::index (
\begin{DoxyParamCaption}
\item[{int}]{\+\_\+i}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}}\label{a01331_aa402b00ade39f419734560e22d348971}


Get local vertex index. 


\begin{DoxyParams}{Parameters}
{\em \+\_\+i} & index to index buffer in range \mbox{[}0, .., num\+Tris$\ast$3 -\/ 1\mbox{]} \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
vertex index in range \mbox{[}0, .., \+\_\+pos.\+size()-\/1\mbox{]}, where \+\_\+pos is the input vector of positions as passed to the constructor 
\end{DoxyReturn}


Definition at line 90 of file Triangulator.\+hh.

\hypertarget{a01331_a53a32644c3a4982311c3e3560e205885}{\index{A\+C\+G\+::\+Triangulator@{A\+C\+G\+::\+Triangulator}!indices@{indices}}
\index{indices@{indices}!A\+C\+G\+::\+Triangulator@{A\+C\+G\+::\+Triangulator}}
\subsubsection[{indices}]{\setlength{\rightskip}{0pt plus 5cm}const std\+::vector$<$int$>$\& A\+C\+G\+::\+Triangulator\+::indices (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}}\label{a01331_a53a32644c3a4982311c3e3560e205885}


Get local index buffer. 

\begin{DoxyReturn}{Returns}
index buffer 
\end{DoxyReturn}


Definition at line 96 of file Triangulator.\+hh.

\hypertarget{a01331_a8c60eb6753d7132959cde3706222574e}{\index{A\+C\+G\+::\+Triangulator@{A\+C\+G\+::\+Triangulator}!is\+Reflex\+Vertex@{is\+Reflex\+Vertex}}
\index{is\+Reflex\+Vertex@{is\+Reflex\+Vertex}!A\+C\+G\+::\+Triangulator@{A\+C\+G\+::\+Triangulator}}
\subsubsection[{is\+Reflex\+Vertex}]{\setlength{\rightskip}{0pt plus 5cm}bool A\+C\+G\+::\+Triangulator\+::is\+Reflex\+Vertex (
\begin{DoxyParamCaption}
\item[{int}]{\+\_\+i}
\end{DoxyParamCaption}
) const}}\label{a01331_a8c60eb6753d7132959cde3706222574e}


Check if a vertex is reflex. 

A reflex vertex is a vertex with an inner angle larger than 180 deg. 
\begin{DoxyParams}{Parameters}
{\em \+\_\+i} & local vertex index in range \mbox{[}0, .., \+\_\+pos.\+size()-\/1\mbox{]} \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
reflex vertex true or false 
\end{DoxyReturn}


Definition at line 197 of file Triangulator.\+cc.

\hypertarget{a01331_acc837d99c498e0a2399fe91a95d0f137}{\index{A\+C\+G\+::\+Triangulator@{A\+C\+G\+::\+Triangulator}!num\+Reflex\+Vertices@{num\+Reflex\+Vertices}}
\index{num\+Reflex\+Vertices@{num\+Reflex\+Vertices}!A\+C\+G\+::\+Triangulator@{A\+C\+G\+::\+Triangulator}}
\subsubsection[{num\+Reflex\+Vertices}]{\setlength{\rightskip}{0pt plus 5cm}int A\+C\+G\+::\+Triangulator\+::num\+Reflex\+Vertices (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}}\label{a01331_acc837d99c498e0a2399fe91a95d0f137}


Get number of reflex vertices. 

A reflex vertex is a vertex with an inner angle larger than 180 deg. \begin{DoxyReturn}{Returns}
number of reflex vertices 
\end{DoxyReturn}


Definition at line 109 of file Triangulator.\+hh.

\hypertarget{a01331_a7f4736cede3c8a3df904b288c0d3ec1a}{\index{A\+C\+G\+::\+Triangulator@{A\+C\+G\+::\+Triangulator}!num\+Triangles@{num\+Triangles}}
\index{num\+Triangles@{num\+Triangles}!A\+C\+G\+::\+Triangulator@{A\+C\+G\+::\+Triangulator}}
\subsubsection[{num\+Triangles}]{\setlength{\rightskip}{0pt plus 5cm}int A\+C\+G\+::\+Triangulator\+::num\+Triangles (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}}\label{a01331_a7f4736cede3c8a3df904b288c0d3ec1a}


Get number of triangles. 

\begin{DoxyReturn}{Returns}
number of triangles after triangulation 
\end{DoxyReturn}


Definition at line 83 of file Triangulator.\+hh.

\hypertarget{a01331_a20f15b00fd8d0fc3b03349b41ee5f2b1}{\index{A\+C\+G\+::\+Triangulator@{A\+C\+G\+::\+Triangulator}!success@{success}}
\index{success@{success}!A\+C\+G\+::\+Triangulator@{A\+C\+G\+::\+Triangulator}}
\subsubsection[{success}]{\setlength{\rightskip}{0pt plus 5cm}bool A\+C\+G\+::\+Triangulator\+::success (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}}\label{a01331_a20f15b00fd8d0fc3b03349b41ee5f2b1}


Check if the triangulation was successful. 

\begin{DoxyReturn}{Returns}
success true or false 
\end{DoxyReturn}


Definition at line 123 of file Triangulator.\+hh.



The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item 
A\+C\+G/\+Geometry/Triangulator.\+hh\item 
A\+C\+G/\+Geometry/Triangulator.\+cc\end{DoxyCompactItemize}
