\section{lib/neatogen/poly.c File Reference}
\label{poly_8c}\index{lib/neatogen/poly.\-c@{lib/neatogen/poly.\-c}}
{\ttfamily \#include \char`\"{}neato.\-h\char`\"{}}\\*
{\ttfamily \#include $<$assert.\-h$>$}\\*
{\ttfamily \#include $<$string.\-h$>$}\\*
{\ttfamily \#include $<$math.\-h$>$}\\*
{\ttfamily \#include \char`\"{}poly.\-h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}geom.\-h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}mem.\-h\char`\"{}}\\*
Include dependency graph for poly.\-c\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{poly_8c__incl}
\end{center}
\end{figure}
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define {\bf B\-O\-X}~1
\item 
\#define {\bf I\-S\-B\-O\-X}(p)~((p)-\/$>$kind \& {\bf B\-O\-X})
\item 
\#define {\bf C\-I\-R\-C\-L\-E}~2
\item 
\#define {\bf I\-S\-C\-I\-R\-C\-L\-E}(p)~((p)-\/$>$kind \& {\bf C\-I\-R\-C\-L\-E})
\item 
\#define {\bf P\-U\-T\-P\-T}(P, X, Y)~((P).x=(X),(P).y=(Y))
\item 
\#define {\bf Pin}~1
\item 
\#define {\bf Qin}~2
\item 
\#define {\bf Unknown}~0
\item 
\#define {\bf advance}(A, B, N)~(B++, A = (A+1)\%N)
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void {\bf poly\-Free} ()
\item 
void {\bf break\-Poly} ({\bf Poly} $\ast$pp)
\item 
{\bf int} {\bf make\-Add\-Poly} ({\bf Poly} $\ast$pp, {\bf Agnode\-\_\-t} $\ast$n, float xmargin, float ymargin)
\item 
{\bf int} {\bf make\-Poly} ({\bf Poly} $\ast$pp, {\bf Agnode\-\_\-t} $\ast$n, float xmargin, float ymargin)
\item 
{\bf int} {\bf poly\-Overlap} ({\bf Point} p, {\bf Poly} $\ast$pp, {\bf Point} q, {\bf Poly} $\ast$qp)
\end{DoxyCompactItemize}


\subsection{Macro Definition Documentation}
\index{poly.\-c@{poly.\-c}!advance@{advance}}
\index{advance@{advance}!poly.c@{poly.\-c}}
\subsubsection[{advance}]{\setlength{\rightskip}{0pt plus 5cm}\#define advance(
\begin{DoxyParamCaption}
\item[{}]{A, }
\item[{}]{B, }
\item[{}]{N}
\end{DoxyParamCaption}
)~(B++, A = (A+1)\%N)}\label{poly_8c_a5342ec1213d785e18312d9f893bba074}


Definition at line 367 of file poly.\-c.

\index{poly.\-c@{poly.\-c}!B\-O\-X@{B\-O\-X}}
\index{B\-O\-X@{B\-O\-X}!poly.c@{poly.\-c}}
\subsubsection[{B\-O\-X}]{\setlength{\rightskip}{0pt plus 5cm}\#define B\-O\-X~1}\label{poly_8c_a23a390cc01279924f6190334c5fa97a0}


Definition at line 25 of file poly.\-c.



Referenced by make\-Add\-Poly(), and make\-Poly().

\index{poly.\-c@{poly.\-c}!C\-I\-R\-C\-L\-E@{C\-I\-R\-C\-L\-E}}
\index{C\-I\-R\-C\-L\-E@{C\-I\-R\-C\-L\-E}!poly.c@{poly.\-c}}
\subsubsection[{C\-I\-R\-C\-L\-E}]{\setlength{\rightskip}{0pt plus 5cm}\#define C\-I\-R\-C\-L\-E~2}\label{poly_8c_a4a49761654ff508d856c6c1b4d132442}


Definition at line 27 of file poly.\-c.



Referenced by make\-Add\-Poly(), and make\-Poly().

\index{poly.\-c@{poly.\-c}!I\-S\-B\-O\-X@{I\-S\-B\-O\-X}}
\index{I\-S\-B\-O\-X@{I\-S\-B\-O\-X}!poly.c@{poly.\-c}}
\subsubsection[{I\-S\-B\-O\-X}]{\setlength{\rightskip}{0pt plus 5cm}\#define I\-S\-B\-O\-X(
\begin{DoxyParamCaption}
\item[{}]{p}
\end{DoxyParamCaption}
)~((p)-\/$>$kind \& {\bf B\-O\-X})}\label{poly_8c_ab4d92647339883c55bf7d5e3bae69240}


Definition at line 26 of file poly.\-c.



Referenced by poly\-Overlap().

\index{poly.\-c@{poly.\-c}!I\-S\-C\-I\-R\-C\-L\-E@{I\-S\-C\-I\-R\-C\-L\-E}}
\index{I\-S\-C\-I\-R\-C\-L\-E@{I\-S\-C\-I\-R\-C\-L\-E}!poly.c@{poly.\-c}}
\subsubsection[{I\-S\-C\-I\-R\-C\-L\-E}]{\setlength{\rightskip}{0pt plus 5cm}\#define I\-S\-C\-I\-R\-C\-L\-E(
\begin{DoxyParamCaption}
\item[{}]{p}
\end{DoxyParamCaption}
)~((p)-\/$>$kind \& {\bf C\-I\-R\-C\-L\-E})}\label{poly_8c_aeb315db50564168ecf675037cc9c8638}


Definition at line 28 of file poly.\-c.



Referenced by poly\-Overlap().

\index{poly.\-c@{poly.\-c}!Pin@{Pin}}
\index{Pin@{Pin}!poly.c@{poly.\-c}}
\subsubsection[{Pin}]{\setlength{\rightskip}{0pt plus 5cm}\#define Pin~1}\label{poly_8c_a1cf6cd3d4f7a0add79fca40f86db4164}


Definition at line 363 of file poly.\-c.

\index{poly.\-c@{poly.\-c}!P\-U\-T\-P\-T@{P\-U\-T\-P\-T}}
\index{P\-U\-T\-P\-T@{P\-U\-T\-P\-T}!poly.c@{poly.\-c}}
\subsubsection[{P\-U\-T\-P\-T}]{\setlength{\rightskip}{0pt plus 5cm}\#define P\-U\-T\-P\-T(
\begin{DoxyParamCaption}
\item[{}]{P, }
\item[{}]{X, }
\item[{}]{Y}
\end{DoxyParamCaption}
)~((P).x=(X),(P).y=(Y))}\label{poly_8c_a56e2942c28dc72cb0391f64e2c04e83f}


Definition at line 181 of file poly.\-c.



Referenced by make\-Add\-Poly(), and make\-Poly().

\index{poly.\-c@{poly.\-c}!Qin@{Qin}}
\index{Qin@{Qin}!poly.c@{poly.\-c}}
\subsubsection[{Qin}]{\setlength{\rightskip}{0pt plus 5cm}\#define Qin~2}\label{poly_8c_ad7434d1e4e3df7186fa4c8c46b56f112}


Definition at line 364 of file poly.\-c.

\index{poly.\-c@{poly.\-c}!Unknown@{Unknown}}
\index{Unknown@{Unknown}!poly.c@{poly.\-c}}
\subsubsection[{Unknown}]{\setlength{\rightskip}{0pt plus 5cm}\#define Unknown~0}\label{poly_8c_a7e6303e8977dbf828f5cda185b0558a2}


Definition at line 365 of file poly.\-c.



\subsection{Function Documentation}
\index{poly.\-c@{poly.\-c}!break\-Poly@{break\-Poly}}
\index{break\-Poly@{break\-Poly}!poly.c@{poly.\-c}}
\subsubsection[{break\-Poly}]{\setlength{\rightskip}{0pt plus 5cm}void break\-Poly (
\begin{DoxyParamCaption}
\item[{{\bf Poly} $\ast$}]{pp}
\end{DoxyParamCaption}
)}\label{poly_8c_a462231a12e278f07895cb823a736b06c}


Definition at line 46 of file poly.\-c.



References Poly\-::verts.

\index{poly.\-c@{poly.\-c}!make\-Add\-Poly@{make\-Add\-Poly}}
\index{make\-Add\-Poly@{make\-Add\-Poly}!poly.c@{poly.\-c}}
\subsubsection[{make\-Add\-Poly}]{\setlength{\rightskip}{0pt plus 5cm}{\bf int} make\-Add\-Poly (
\begin{DoxyParamCaption}
\item[{{\bf Poly} $\ast$}]{pp, }
\item[{{\bf Agnode\-\_\-t} $\ast$}]{n, }
\item[{float}]{xmargin, }
\item[{float}]{ymargin}
\end{DoxyParamCaption}
)}\label{poly_8c_a18ba22d4c367e3a742d90be823101aee}


Definition at line 183 of file poly.\-c.



References agerr(), A\-G\-E\-R\-R, B\-O\-X, C\-I\-R\-C\-L\-E, Poly\-::corner, if(), Poly\-::kind, L\-E\-N, boxf\-::\-L\-L, N\-\_\-\-G\-N\-E\-W, N\-D\-\_\-clust, N\-D\-\_\-height, N\-D\-\_\-shape, N\-D\-\_\-shape\-\_\-info, N\-D\-\_\-width, Poly\-::nverts, Poly\-::origin, P\-S2\-I\-N\-C\-H, P\-U\-T\-P\-T, polygon\-\_\-t\-::regular, S\-H\-\_\-\-P\-O\-I\-N\-T, S\-H\-\_\-\-P\-O\-L\-Y, S\-H\-\_\-\-R\-E\-C\-O\-R\-D, shape\-Of(), polygon\-\_\-t\-::sides, streq, boxf\-::\-U\-R, polygon\-\_\-t\-::vertices, Poly\-::verts, Point\-::x, pointf\-\_\-s\-::x, Point\-::y, and pointf\-\_\-s\-::y.

\index{poly.\-c@{poly.\-c}!make\-Poly@{make\-Poly}}
\index{make\-Poly@{make\-Poly}!poly.c@{poly.\-c}}
\subsubsection[{make\-Poly}]{\setlength{\rightskip}{0pt plus 5cm}{\bf int} make\-Poly (
\begin{DoxyParamCaption}
\item[{{\bf Poly} $\ast$}]{pp, }
\item[{{\bf Agnode\-\_\-t} $\ast$}]{n, }
\item[{float}]{xmargin, }
\item[{float}]{ymargin}
\end{DoxyParamCaption}
)}\label{poly_8c_aa2a3f14c6c9e512a507a87b6cd6700e6}


Definition at line 275 of file poly.\-c.



References agerr(), A\-G\-E\-R\-R, B\-O\-X, C\-I\-R\-C\-L\-E, Poly\-::corner, Poly\-::kind, boxf\-::\-L\-L, N\-\_\-\-G\-N\-E\-W, N\-D\-\_\-clust, N\-D\-\_\-height, N\-D\-\_\-shape, N\-D\-\_\-shape\-\_\-info, N\-D\-\_\-width, Poly\-::nverts, Poly\-::origin, P\-S2\-I\-N\-C\-H, P\-U\-T\-P\-T, polygon\-\_\-t\-::regular, S\-H\-\_\-\-P\-O\-I\-N\-T, S\-H\-\_\-\-P\-O\-L\-Y, S\-H\-\_\-\-R\-E\-C\-O\-R\-D, shape\-Of(), polygon\-\_\-t\-::sides, streq, boxf\-::\-U\-R, polygon\-\_\-t\-::vertices, Poly\-::verts, Point\-::x, pointf\-\_\-s\-::x, Point\-::y, and pointf\-\_\-s\-::y.

\index{poly.\-c@{poly.\-c}!poly\-Free@{poly\-Free}}
\index{poly\-Free@{poly\-Free}!poly.c@{poly.\-c}}
\subsubsection[{poly\-Free}]{\setlength{\rightskip}{0pt plus 5cm}void poly\-Free (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{poly_8c_adce0b491559724521ed95d3b6a7f1eb6}


Definition at line 35 of file poly.\-c.



References N\-U\-L\-L.

\index{poly.\-c@{poly.\-c}!poly\-Overlap@{poly\-Overlap}}
\index{poly\-Overlap@{poly\-Overlap}!poly.c@{poly.\-c}}
\subsubsection[{poly\-Overlap}]{\setlength{\rightskip}{0pt plus 5cm}{\bf int} poly\-Overlap (
\begin{DoxyParamCaption}
\item[{{\bf Point}}]{p, }
\item[{{\bf Poly} $\ast$}]{pp, }
\item[{{\bf Point}}]{q, }
\item[{{\bf Poly} $\ast$}]{qp}
\end{DoxyParamCaption}
)}\label{poly_8c_a0a2849a60eb7dde5b6dc2f89e7d64125}


Definition at line 504 of file poly.\-c.



References addpt(), Poly\-::corner, I\-S\-B\-O\-X, I\-S\-C\-I\-R\-C\-L\-E, N\-\_\-\-G\-N\-E\-W, N\-U\-L\-L, Poly\-::nverts, Poly\-::origin, Poly\-::verts, Point\-::x, and Point\-::y.

