\hypertarget{a07252}{}\section{A\+CG\+:\+:Triangulator Class Reference}
\label{a07252}\index{A\+C\+G\+::\+Triangulator@{A\+C\+G\+::\+Triangulator}}
\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{a07256}{Ring\+Vertex}
\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{a07252_a505a920d3a9eb73f41ef5c1326866e01}{Triangulator} (const std\+::vector$<$ \hyperlink{a06176_a86c28120e8596ee7d03e58b7300f59bc}{Vec3f} $>$ \&\+\_\+pos)
\begin{DoxyCompactList}\small\item\em Execute the triangulation algorithm on a polygon. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{a07252_a7adb82e429e9fbafb5848ce4c7814964}\label{a07252_a7adb82e429e9fbafb5848ce4c7814964}} 
virtual \hyperlink{a07252_a7adb82e429e9fbafb5848ce4c7814964}{$\sim$\+Triangulator} ()
\begin{DoxyCompactList}\small\item\em Destructor. \end{DoxyCompactList}\item 
size\+\_\+t \hyperlink{a07252_a0c86fe758339260ca626cdf85947150f}{num\+Triangles} () const
\begin{DoxyCompactList}\small\item\em Get number of triangles. \end{DoxyCompactList}\item 
int \hyperlink{a07252_a5114694ab05b7c503df63af4fe62bd36}{index} (int \+\_\+i) const
\begin{DoxyCompactList}\small\item\em Get local vertex index. \end{DoxyCompactList}\item 
const std\+::vector$<$ int $>$ \& \hyperlink{a07252_a663545999e481105db2be372e69d57d6}{indices} () const
\begin{DoxyCompactList}\small\item\em Get local index buffer. \end{DoxyCompactList}\item 
bool \hyperlink{a07252_a8c9e993125d0790d42c941bd6afdaa47}{convex} () const
\begin{DoxyCompactList}\small\item\em Is the polygon convex? \end{DoxyCompactList}\item 
size\+\_\+t \hyperlink{a07252_a8964830a600adf49a31cfb3ec3632264}{num\+Reflex\+Vertices} () const
\begin{DoxyCompactList}\small\item\em Get number of reflex vertices. \end{DoxyCompactList}\item 
bool \hyperlink{a07252_abbe234177518e2349d285a9ec7e9ac88}{is\+Reflex\+Vertex} (int \+\_\+i) const
\begin{DoxyCompactList}\small\item\em Check if a vertex is reflex. \end{DoxyCompactList}\item 
bool \hyperlink{a07252_a36591579345463aff55590d766c903f0}{success} () const
\begin{DoxyCompactList}\small\item\em Check if the triangulation was successful. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{a07252_a502fb63b254c14d691b5c97cbab8783e}\label{a07252_a502fb63b254c14d691b5c97cbab8783e}} 
void {\bfseries init\+Vertex\+List} ()
\item 
\mbox{\Hypertarget{a07252_a9516596e3e6b89839b70db25874787ee}\label{a07252_a9516596e3e6b89839b70db25874787ee}} 
int {\bfseries ear\+Clipping\+N2} ()
\item 
\mbox{\Hypertarget{a07252_aa215f69c36b6eb2bcad304ad2ab335a3}\label{a07252_aa215f69c36b6eb2bcad304ad2ab335a3}} 
int {\bfseries ear\+Clipping\+N3} ()
\item 
\mbox{\Hypertarget{a07252_adc5d85fe51da6b68be7f9ba9d6596394}\label{a07252_adc5d85fe51da6b68be7f9ba9d6596394}} 
\hyperlink{a07252}{Triangulator} \& {\bfseries operator=} (const \hyperlink{a07252}{Triangulator} \&)=delete
\item 
\mbox{\Hypertarget{a07252_a7e955ac6e79ba69b29a0c4edd43df55e}\label{a07252_a7e955ac6e79ba69b29a0c4edd43df55e}} 
float {\bfseries triangle\+Area\+Sign} (const \hyperlink{a06176_a8b858737aebd55e312149cf208a0b3f3}{Vec2f} \&v0, const \hyperlink{a06176_a8b858737aebd55e312149cf208a0b3f3}{Vec2f} \&v1, const \hyperlink{a06176_a8b858737aebd55e312149cf208a0b3f3}{Vec2f} \&v2) const
\item 
\mbox{\Hypertarget{a07252_a5702d67d8d9f84d60a88f6ff20e19e20}\label{a07252_a5702d67d8d9f84d60a88f6ff20e19e20}} 
float {\bfseries distance\+Point\+To\+Segment\+Sq} (const \hyperlink{a06176_a8b858737aebd55e312149cf208a0b3f3}{Vec2f} \&v0, const \hyperlink{a06176_a8b858737aebd55e312149cf208a0b3f3}{Vec2f} \&v1, const \hyperlink{a06176_a8b858737aebd55e312149cf208a0b3f3}{Vec2f} \&pt) const
\item 
\mbox{\Hypertarget{a07252_ab3ffe5dd32b7c45d0ea6e57a78998238}\label{a07252_ab3ffe5dd32b7c45d0ea6e57a78998238}} 
bool {\bfseries is\+Reflex\+Vertex} (const \hyperlink{a06176_a8b858737aebd55e312149cf208a0b3f3}{Vec2f} \&v0, const \hyperlink{a06176_a8b858737aebd55e312149cf208a0b3f3}{Vec2f} \&v1, const \hyperlink{a06176_a8b858737aebd55e312149cf208a0b3f3}{Vec2f} \&v2) const
\item 
\mbox{\Hypertarget{a07252_a1f524534f51f67ff2c8fa16843d7a1d4}\label{a07252_a1f524534f51f67ff2c8fa16843d7a1d4}} 
bool {\bfseries point\+In\+Triangle} (const \hyperlink{a06176_a8b858737aebd55e312149cf208a0b3f3}{Vec2f} \&v0, const \hyperlink{a06176_a8b858737aebd55e312149cf208a0b3f3}{Vec2f} \&v1, const \hyperlink{a06176_a8b858737aebd55e312149cf208a0b3f3}{Vec2f} \&v2, const \hyperlink{a06176_a8b858737aebd55e312149cf208a0b3f3}{Vec2f} \&pt) const
\item 
\mbox{\Hypertarget{a07252_a32043af46b01fa884eee38deb202fa1e}\label{a07252_a32043af46b01fa884eee38deb202fa1e}} 
bool {\bfseries update\+Reflex\+Vertex} (\hyperlink{a07256}{Ring\+Vertex} $\ast$v)
\item 
\mbox{\Hypertarget{a07252_af3bf49144dc31a1988d061317954a9ee}\label{a07252_af3bf49144dc31a1988d061317954a9ee}} 
void {\bfseries add\+Ear} (\hyperlink{a07256}{Ring\+Vertex} $\ast$\+\_\+ear\+Tip)
\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{a07252_a6406995f061af856c7f0f6301da2e481}\label{a07252_a6406995f061af856c7f0f6301da2e481}} 
const size\+\_\+t {\bfseries poly\+Size\+\_\+}
\item 
\mbox{\Hypertarget{a07252_a59caefdc2bc52cea0bd61a1833df59d1}\label{a07252_a59caefdc2bc52cea0bd61a1833df59d1}} 
size\+\_\+t {\bfseries num\+Remaning\+Vertices\+\_\+}
\item 
\mbox{\Hypertarget{a07252_a17d85bde2e7601260b74cdcd0c50a05c}\label{a07252_a17d85bde2e7601260b74cdcd0c50a05c}} 
size\+\_\+t {\bfseries num\+Tris\+\_\+}
\item 
\mbox{\Hypertarget{a07252_a32d605fd5b52ccffa7572723864f78f2}\label{a07252_a32d605fd5b52ccffa7572723864f78f2}} 
size\+\_\+t {\bfseries num\+Reflex\+Vertices\+\_\+}
\item 
\mbox{\Hypertarget{a07252_ab5315b803b33d35d4eb19817122a0946}\label{a07252_ab5315b803b33d35d4eb19817122a0946}} 
bool {\bfseries ok\+\_\+}
\item 
\mbox{\Hypertarget{a07252_a0fca392e2d2d82291b41624ec31d303b}\label{a07252_a0fca392e2d2d82291b41624ec31d303b}} 
bool {\bfseries convex\+\_\+}
\item 
\mbox{\Hypertarget{a07252_a5f6d043d62ba8a37600fc2c3ad848698}\label{a07252_a5f6d043d62ba8a37600fc2c3ad848698}} 
std\+::vector$<$ \hyperlink{a06176_a8b858737aebd55e312149cf208a0b3f3}{Vec2f} $>$ {\bfseries pos\+\_\+}
\item 
\mbox{\Hypertarget{a07252_adf28610eaf3b0614cc024bda72b0fb7b}\label{a07252_adf28610eaf3b0614cc024bda72b0fb7b}} 
std\+::vector$<$ \hyperlink{a07256}{Ring\+Vertex} $>$ {\bfseries vertices\+\_\+}
\item 
\mbox{\Hypertarget{a07252_a4252968b227bc8358429a2c1dc25c181}\label{a07252_a4252968b227bc8358429a2c1dc25c181}} 
std\+::list$<$ \hyperlink{a07256}{Ring\+Vertex} $\ast$ $>$ {\bfseries reflex\+Vertices\+\_\+}
\item 
\mbox{\Hypertarget{a07252_a86d61d1e8fa1de6fdb3107f0e506a85e}\label{a07252_a86d61d1e8fa1de6fdb3107f0e506a85e}} 
std\+::vector$<$ int $>$ {\bfseries tris\+\_\+}
\end{DoxyCompactItemize}


\subsection{Detailed Description}


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



\subsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{a07252_a505a920d3a9eb73f41ef5c1326866e01}\label{a07252_a505a920d3a9eb73f41ef5c1326866e01}} 
\index{A\+C\+G\+::\+Triangulator@{A\+C\+G\+::\+Triangulator}!Triangulator@{Triangulator}}
\index{Triangulator@{Triangulator}!A\+C\+G\+::\+Triangulator@{A\+C\+G\+::\+Triangulator}}
\subsubsection{\texorpdfstring{Triangulator()}{Triangulator()}}
{\footnotesize\ttfamily A\+C\+G\+::\+Triangulator\+::\+Triangulator (\begin{DoxyParamCaption}\item[{const std\+::vector$<$ \hyperlink{a06176_a86c28120e8596ee7d03e58b7300f59bc}{Vec3f} $>$ \&}]{\+\_\+pos }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [explicit]}}



Execute the triangulation algorithm on a polygon. 


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


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



\subsection{Member Function Documentation}
\mbox{\Hypertarget{a07252_a8c9e993125d0790d42c941bd6afdaa47}\label{a07252_a8c9e993125d0790d42c941bd6afdaa47}} 
\index{A\+C\+G\+::\+Triangulator@{A\+C\+G\+::\+Triangulator}!convex@{convex}}
\index{convex@{convex}!A\+C\+G\+::\+Triangulator@{A\+C\+G\+::\+Triangulator}}
\subsubsection{\texorpdfstring{convex()}{convex()}}
{\footnotesize\ttfamily bool A\+C\+G\+::\+Triangulator\+::convex (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Is the polygon convex? 

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


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

\mbox{\Hypertarget{a07252_a5114694ab05b7c503df63af4fe62bd36}\label{a07252_a5114694ab05b7c503df63af4fe62bd36}} 
\index{A\+C\+G\+::\+Triangulator@{A\+C\+G\+::\+Triangulator}!index@{index}}
\index{index@{index}!A\+C\+G\+::\+Triangulator@{A\+C\+G\+::\+Triangulator}}
\subsubsection{\texorpdfstring{index()}{index()}}
{\footnotesize\ttfamily int A\+C\+G\+::\+Triangulator\+::index (\begin{DoxyParamCaption}\item[{int}]{\+\_\+i }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



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 81 of file Triangulator.\+hh.

\mbox{\Hypertarget{a07252_a663545999e481105db2be372e69d57d6}\label{a07252_a663545999e481105db2be372e69d57d6}} 
\index{A\+C\+G\+::\+Triangulator@{A\+C\+G\+::\+Triangulator}!indices@{indices}}
\index{indices@{indices}!A\+C\+G\+::\+Triangulator@{A\+C\+G\+::\+Triangulator}}
\subsubsection{\texorpdfstring{indices()}{indices()}}
{\footnotesize\ttfamily const std\+::vector$<$int$>$\& A\+C\+G\+::\+Triangulator\+::indices (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get local index buffer. 

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


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

\mbox{\Hypertarget{a07252_abbe234177518e2349d285a9ec7e9ac88}\label{a07252_abbe234177518e2349d285a9ec7e9ac88}} 
\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{\texorpdfstring{is\+Reflex\+Vertex()}{isReflexVertex()}}
{\footnotesize\ttfamily bool A\+C\+G\+::\+Triangulator\+::is\+Reflex\+Vertex (\begin{DoxyParamCaption}\item[{int}]{\+\_\+i }\end{DoxyParamCaption}) const}



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 188 of file Triangulator.\+cc.

\mbox{\Hypertarget{a07252_a8964830a600adf49a31cfb3ec3632264}\label{a07252_a8964830a600adf49a31cfb3ec3632264}} 
\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{\texorpdfstring{num\+Reflex\+Vertices()}{numReflexVertices()}}
{\footnotesize\ttfamily size\+\_\+t A\+C\+G\+::\+Triangulator\+::num\+Reflex\+Vertices (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



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 100 of file Triangulator.\+hh.

\mbox{\Hypertarget{a07252_a0c86fe758339260ca626cdf85947150f}\label{a07252_a0c86fe758339260ca626cdf85947150f}} 
\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{\texorpdfstring{num\+Triangles()}{numTriangles()}}
{\footnotesize\ttfamily size\+\_\+t A\+C\+G\+::\+Triangulator\+::num\+Triangles (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get number of triangles. 

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


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

\mbox{\Hypertarget{a07252_a36591579345463aff55590d766c903f0}\label{a07252_a36591579345463aff55590d766c903f0}} 
\index{A\+C\+G\+::\+Triangulator@{A\+C\+G\+::\+Triangulator}!success@{success}}
\index{success@{success}!A\+C\+G\+::\+Triangulator@{A\+C\+G\+::\+Triangulator}}
\subsubsection{\texorpdfstring{success()}{success()}}
{\footnotesize\ttfamily bool A\+C\+G\+::\+Triangulator\+::success (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Check if the triangulation was successful. 

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


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



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