\hypertarget{classOpenMesh_1_1Utils_1_1HeapT}{}\section{Open\+Mesh\+:\+:Utils\+:\+:HeapT$<$ Heap\+Entry, Heap\+Interface $>$ Class Template Reference}
\label{classOpenMesh_1_1Utils_1_1HeapT}\index{Open\+Mesh\+::\+Utils\+::\+Heap\+T$<$ Heap\+Entry, Heap\+Interface $>$@{Open\+Mesh\+::\+Utils\+::\+Heap\+T$<$ Heap\+Entry, Heap\+Interface $>$}}


{\ttfamily \#include $<$O\+S\+G/\+Utils/\+Heap\+T.\+hh$>$}

Inheritance diagram for Open\+Mesh\+:\+:Utils\+:\+:HeapT$<$ Heap\+Entry, Heap\+Interface $>$\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classOpenMesh_1_1Utils_1_1HeapT}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{classOpenMesh_1_1Utils_1_1HeapT_a24a2c62d488a9a9e73572ad7820a8e68}\label{classOpenMesh_1_1Utils_1_1HeapT_a24a2c62d488a9a9e73572ad7820a8e68}} 
\hyperlink{classOpenMesh_1_1Utils_1_1HeapT_a24a2c62d488a9a9e73572ad7820a8e68}{HeapT} ()
\begin{DoxyCompactList}\small\item\em Constructor. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classOpenMesh_1_1Utils_1_1HeapT_a03ec9a9ca32d9d6409e980b90d53f54b}\label{classOpenMesh_1_1Utils_1_1HeapT_a03ec9a9ca32d9d6409e980b90d53f54b}} 
\hyperlink{classOpenMesh_1_1Utils_1_1HeapT_a03ec9a9ca32d9d6409e980b90d53f54b}{HeapT} (const Heap\+Interface \&\+\_\+interface)
\begin{DoxyCompactList}\small\item\em Construct with a given {\ttfamily Heap\+Iterface}. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classOpenMesh_1_1Utils_1_1HeapT_a7e0a462d94cdd0c68aeeaaeadfa78d2d}\label{classOpenMesh_1_1Utils_1_1HeapT_a7e0a462d94cdd0c68aeeaaeadfa78d2d}} 
\hyperlink{classOpenMesh_1_1Utils_1_1HeapT_a7e0a462d94cdd0c68aeeaaeadfa78d2d}{$\sim$\+HeapT} ()
\begin{DoxyCompactList}\small\item\em Destructor. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classOpenMesh_1_1Utils_1_1HeapT_aba777f483777c18a4ce9d7a6a87993c8}\label{classOpenMesh_1_1Utils_1_1HeapT_aba777f483777c18a4ce9d7a6a87993c8}} 
Heap\+Interface \& {\bfseries get\+Interface} ()
\item 
\mbox{\Hypertarget{classOpenMesh_1_1Utils_1_1HeapT_ab1c146d6ec9a3460e077d63c759437eb}\label{classOpenMesh_1_1Utils_1_1HeapT_ab1c146d6ec9a3460e077d63c759437eb}} 
const Heap\+Interface \& {\bfseries get\+Interface} () const
\item 
\mbox{\Hypertarget{classOpenMesh_1_1Utils_1_1HeapT_afef1992d5a553b9e8d152af61b9e4fc2}\label{classOpenMesh_1_1Utils_1_1HeapT_afef1992d5a553b9e8d152af61b9e4fc2}} 
void \hyperlink{classOpenMesh_1_1Utils_1_1HeapT_afef1992d5a553b9e8d152af61b9e4fc2}{clear} ()
\begin{DoxyCompactList}\small\item\em clear the heap \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classOpenMesh_1_1Utils_1_1HeapT_a536a85f292f05b98593afbb682e54471}\label{classOpenMesh_1_1Utils_1_1HeapT_a536a85f292f05b98593afbb682e54471}} 
bool \hyperlink{classOpenMesh_1_1Utils_1_1HeapT_a536a85f292f05b98593afbb682e54471}{empty} () const
\begin{DoxyCompactList}\small\item\em is heap empty? \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classOpenMesh_1_1Utils_1_1HeapT_a2c81430f8b72e3aae305b025d83c3307}\label{classOpenMesh_1_1Utils_1_1HeapT_a2c81430f8b72e3aae305b025d83c3307}} 
size\+\_\+t \hyperlink{classOpenMesh_1_1Utils_1_1HeapT_a2c81430f8b72e3aae305b025d83c3307}{size} () const
\begin{DoxyCompactList}\small\item\em returns the size of heap \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classOpenMesh_1_1Utils_1_1HeapT_ab25df952eaf2a9195243759dab1c252e}\label{classOpenMesh_1_1Utils_1_1HeapT_ab25df952eaf2a9195243759dab1c252e}} 
void \hyperlink{classOpenMesh_1_1Utils_1_1HeapT_ab25df952eaf2a9195243759dab1c252e}{reserve} (size\+\_\+t \+\_\+n)
\begin{DoxyCompactList}\small\item\em reserve space for \+\_\+n entries \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classOpenMesh_1_1Utils_1_1HeapT_a35feb375cbcf48457e8e2d6307fe7fba}\label{classOpenMesh_1_1Utils_1_1HeapT_a35feb375cbcf48457e8e2d6307fe7fba}} 
void \hyperlink{classOpenMesh_1_1Utils_1_1HeapT_a35feb375cbcf48457e8e2d6307fe7fba}{reset\+\_\+heap\+\_\+position} (Heap\+Entry \+\_\+h)
\begin{DoxyCompactList}\small\item\em reset heap position to -\/1 (not in heap) \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classOpenMesh_1_1Utils_1_1HeapT_af286643ed54c1f7252989b2a525c0c07}\label{classOpenMesh_1_1Utils_1_1HeapT_af286643ed54c1f7252989b2a525c0c07}} 
bool \hyperlink{classOpenMesh_1_1Utils_1_1HeapT_af286643ed54c1f7252989b2a525c0c07}{is\+\_\+stored} (Heap\+Entry \+\_\+h)
\begin{DoxyCompactList}\small\item\em is an entry in the heap? \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classOpenMesh_1_1Utils_1_1HeapT_a986a09f8eef49ee033663b59fa068c22}\label{classOpenMesh_1_1Utils_1_1HeapT_a986a09f8eef49ee033663b59fa068c22}} 
void \hyperlink{classOpenMesh_1_1Utils_1_1HeapT_a986a09f8eef49ee033663b59fa068c22}{insert} (Heap\+Entry \+\_\+h)
\begin{DoxyCompactList}\small\item\em insert the entry \+\_\+h \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classOpenMesh_1_1Utils_1_1HeapT_a9a19c24235081b7e5fcdbc1ee59453c3}\label{classOpenMesh_1_1Utils_1_1HeapT_a9a19c24235081b7e5fcdbc1ee59453c3}} 
Heap\+Entry \hyperlink{classOpenMesh_1_1Utils_1_1HeapT_a9a19c24235081b7e5fcdbc1ee59453c3}{front} () const
\begin{DoxyCompactList}\small\item\em get the first entry \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classOpenMesh_1_1Utils_1_1HeapT_aa0f851857c3aee86ea1eb763a5980660}\label{classOpenMesh_1_1Utils_1_1HeapT_aa0f851857c3aee86ea1eb763a5980660}} 
void \hyperlink{classOpenMesh_1_1Utils_1_1HeapT_aa0f851857c3aee86ea1eb763a5980660}{pop\+\_\+front} ()
\begin{DoxyCompactList}\small\item\em delete the first entry \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classOpenMesh_1_1Utils_1_1HeapT_ac141346bca01e86f1f7d9e4f0f2a9d8c}\label{classOpenMesh_1_1Utils_1_1HeapT_ac141346bca01e86f1f7d9e4f0f2a9d8c}} 
void \hyperlink{classOpenMesh_1_1Utils_1_1HeapT_ac141346bca01e86f1f7d9e4f0f2a9d8c}{remove} (Heap\+Entry \+\_\+h)
\begin{DoxyCompactList}\small\item\em remove an entry \end{DoxyCompactList}\item 
void \hyperlink{classOpenMesh_1_1Utils_1_1HeapT_a5a4198bf734a87481ee5fedc46f2eebd}{update} (Heap\+Entry \+\_\+h)
\item 
\mbox{\Hypertarget{classOpenMesh_1_1Utils_1_1HeapT_a3acd94c1497f8b6afd9548ffd64e2318}\label{classOpenMesh_1_1Utils_1_1HeapT_a3acd94c1497f8b6afd9548ffd64e2318}} 
bool \hyperlink{classOpenMesh_1_1Utils_1_1HeapT_a3acd94c1497f8b6afd9548ffd64e2318}{check} ()
\begin{DoxyCompactList}\small\item\em check heap condition \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{classOpenMesh_1_1Utils_1_1HeapT_afb629f999cdff18c71780372ffa4a655}\label{classOpenMesh_1_1Utils_1_1HeapT_afb629f999cdff18c71780372ffa4a655}} 
Heap\+Interface \hyperlink{classOpenMesh_1_1Utils_1_1HeapT_afb629f999cdff18c71780372ffa4a655}{interface\+\_\+}
\begin{DoxyCompactList}\small\item\em Instance of Heap\+Interface. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Types}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{classOpenMesh_1_1Utils_1_1HeapT_a6a6ce0a9be43bc890a88dc17dec40429}\label{classOpenMesh_1_1Utils_1_1HeapT_a6a6ce0a9be43bc890a88dc17dec40429}} 
typedef std\+::vector$<$ Heap\+Entry $>$ {\bfseries Base}
\item 
\mbox{\Hypertarget{classOpenMesh_1_1Utils_1_1HeapT_a74bb768a5dde2fb600a95b1f87134882}\label{classOpenMesh_1_1Utils_1_1HeapT_a74bb768a5dde2fb600a95b1f87134882}} 
typedef std\+::vector$<$ Heap\+Entry $>$ {\bfseries Heap\+Vector}
\end{DoxyCompactItemize}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{classOpenMesh_1_1Utils_1_1HeapT_aa3b5a57251a46777558c9bea35013c03}\label{classOpenMesh_1_1Utils_1_1HeapT_aa3b5a57251a46777558c9bea35013c03}} 
void \hyperlink{classOpenMesh_1_1Utils_1_1HeapT_aa3b5a57251a46777558c9bea35013c03}{upheap} (size\+\_\+t \+\_\+idx)
\begin{DoxyCompactList}\small\item\em Upheap. Establish heap property. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classOpenMesh_1_1Utils_1_1HeapT_a38a9bd2d0ba146e4eac3f4e9cf96bdd5}\label{classOpenMesh_1_1Utils_1_1HeapT_a38a9bd2d0ba146e4eac3f4e9cf96bdd5}} 
void \hyperlink{classOpenMesh_1_1Utils_1_1HeapT_a38a9bd2d0ba146e4eac3f4e9cf96bdd5}{downheap} (size\+\_\+t \+\_\+idx)
\begin{DoxyCompactList}\small\item\em Downheap. Establish heap property. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classOpenMesh_1_1Utils_1_1HeapT_a9a39a5071efe36d6b74834bb115b4059}\label{classOpenMesh_1_1Utils_1_1HeapT_a9a39a5071efe36d6b74834bb115b4059}} 
Heap\+Entry \hyperlink{classOpenMesh_1_1Utils_1_1HeapT_a9a39a5071efe36d6b74834bb115b4059}{entry} (size\+\_\+t \+\_\+idx) const
\begin{DoxyCompactList}\small\item\em Get the entry at index \+\_\+idx. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classOpenMesh_1_1Utils_1_1HeapT_a4a9b4cb124b148fbe344540bf7e8c707}\label{classOpenMesh_1_1Utils_1_1HeapT_a4a9b4cb124b148fbe344540bf7e8c707}} 
void \hyperlink{classOpenMesh_1_1Utils_1_1HeapT_a4a9b4cb124b148fbe344540bf7e8c707}{entry} (size\+\_\+t \+\_\+idx, Heap\+Entry \+\_\+h)
\begin{DoxyCompactList}\small\item\em Set entry \+\_\+h to index \+\_\+idx and update \+\_\+h\textquotesingle{}s heap position. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classOpenMesh_1_1Utils_1_1HeapT_aab929c8e37990e56e7feb552c470616f}\label{classOpenMesh_1_1Utils_1_1HeapT_aab929c8e37990e56e7feb552c470616f}} 
size\+\_\+t \hyperlink{classOpenMesh_1_1Utils_1_1HeapT_aab929c8e37990e56e7feb552c470616f}{parent} (size\+\_\+t \+\_\+i)
\begin{DoxyCompactList}\small\item\em Get parent\textquotesingle{}s index. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classOpenMesh_1_1Utils_1_1HeapT_a1884c88581582231e82713ec2dcb83b4}\label{classOpenMesh_1_1Utils_1_1HeapT_a1884c88581582231e82713ec2dcb83b4}} 
size\+\_\+t \hyperlink{classOpenMesh_1_1Utils_1_1HeapT_a1884c88581582231e82713ec2dcb83b4}{left} (size\+\_\+t \+\_\+i)
\begin{DoxyCompactList}\small\item\em Get left child\textquotesingle{}s index. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classOpenMesh_1_1Utils_1_1HeapT_ac516abac46c46b480cec49702d903d7b}\label{classOpenMesh_1_1Utils_1_1HeapT_ac516abac46c46b480cec49702d903d7b}} 
size\+\_\+t \hyperlink{classOpenMesh_1_1Utils_1_1HeapT_ac516abac46c46b480cec49702d903d7b}{right} (size\+\_\+t \+\_\+i)
\begin{DoxyCompactList}\small\item\em Get right child\textquotesingle{}s index. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
\subsubsection*{template$<$class Heap\+Entry, class Heap\+Interface = Heap\+Entry$>$\newline
class Open\+Mesh\+::\+Utils\+::\+Heap\+T$<$ Heap\+Entry, Heap\+Interface $>$}

An efficient, highly customizable heap.

The main difference (and performance boost) of this heap compared to e.\+g. the heap of the S\+TL is that here the positions of the heap\textquotesingle{}s elements are accessible from the elements themself. Therefore if one changes the priority of an element one does not have to remove and re-\/insert this element, but can just call the \hyperlink{classOpenMesh_1_1Utils_1_1HeapT_a5a4198bf734a87481ee5fedc46f2eebd}{update(\+Heap\+Entry)} method.

This heap class is parameterized by two template arguments\+: \begin{DoxyItemize}
\item the class {\ttfamily Heap\+Entry}, that will be stored in the heap \item the Heap\+Interface telling the heap how to compare heap entries and how to store the heap positions in the heap entries.\end{DoxyItemize}
As an example how to use the class see declaration of class \hyperlink{classOpenMesh_1_1Decimater_1_1DecimaterT}{Decimater\+::\+DecimaterT}.

\begin{DoxySeeAlso}{See also}
\hyperlink{structOpenMesh_1_1Utils_1_1HeapInterfaceT}{Heap\+InterfaceT} 
\end{DoxySeeAlso}


Definition at line 138 of file Heap\+T.\+hh.



\subsection{Member Function Documentation}
\mbox{\Hypertarget{classOpenMesh_1_1Utils_1_1HeapT_a5a4198bf734a87481ee5fedc46f2eebd}\label{classOpenMesh_1_1Utils_1_1HeapT_a5a4198bf734a87481ee5fedc46f2eebd}} 
\index{Open\+Mesh\+::\+Utils\+::\+HeapT@{Open\+Mesh\+::\+Utils\+::\+HeapT}!update@{update}}
\index{update@{update}!Open\+Mesh\+::\+Utils\+::\+HeapT@{Open\+Mesh\+::\+Utils\+::\+HeapT}}
\subsubsection{\texorpdfstring{update()}{update()}}
{\footnotesize\ttfamily template$<$class Heap\+Entry , class Heap\+Interface  = Heap\+Entry$>$ \\
void \hyperlink{classOpenMesh_1_1Utils_1_1HeapT}{Open\+Mesh\+::\+Utils\+::\+HeapT}$<$ Heap\+Entry, Heap\+Interface $>$\+::update (\begin{DoxyParamCaption}\item[{Heap\+Entry}]{\+\_\+h }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}

update an entry\+: change the key and update the position to reestablish the heap property. 

Definition at line 248 of file Heap\+T.\+hh.



The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
Open\+Flipper/libs\+\_\+required/\+Open\+Mesh/src/\+Open\+Mesh/\+Tools/\+Utils/\hyperlink{OpenMesh_2src_2OpenMesh_2Tools_2Utils_2HeapT_8hh}{Heap\+T.\+hh}\end{DoxyCompactItemize}
