Files
opennurbs/6/d8/d13/class_o_n___progress_reporter.html
Bozo db96b72945 Publish!
Generated from v6.0.11315.11111-test12
2018-01-31 14:46:11 -08:00

341 lines
20 KiB
HTML

<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>openNURBS SDK Help: ON_ProgressReporter Class Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<!-- <script type="text/javascript" src="../../jquery.js"></script> -->
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
<link href="../../customdoxygen.css" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<!-- smartmenus -->
<link href="../../jquery.smartmenus.bootstrap.css" rel="stylesheet">
<script type="text/javascript" src="../../jquery.smartmenus.js"></script>
<script type="text/javascript" src="../../jquery.smartmenus.bootstrap.js"></script>
</head>
<body>
<!-- navbar -->
<div class="navbar navbar-default navbar-static top" role="navigation">
<div class="navbar-header">
<a class="navbar-brand">openNURBS SDK Help 6.0</a>
</div>
</div>
<div class="container">
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div class="page-content">
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('../../',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="../../d0/d5f/class_o_n___progress_reporter-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">ON_ProgressReporter Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p><code>#include &lt;<a class="el" href="../../d5/d6c/opennurbs__progress__reporter_8h_source.html">opennurbs_progress_reporter.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a8f262c3526a41ec2be515435b9e4cbec"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d8/d13/class_o_n___progress_reporter.html#a8f262c3526a41ec2be515435b9e4cbec">ON_ProgressReporter</a> ()</td></tr>
<tr class="separator:a8f262c3526a41ec2be515435b9e4cbec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aad7920048a1d2c5f6894824c81edbf98"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d8/d13/class_o_n___progress_reporter.html#aad7920048a1d2c5f6894824c81edbf98">~ON_ProgressReporter</a> ()</td></tr>
<tr class="separator:aad7920048a1d2c5f6894824c81edbf98"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae121a10fbcd1d3f17b8ce169d0384d6d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d8/d13/class_o_n___progress_reporter.html#ae121a10fbcd1d3f17b8ce169d0384d6d">SetSynchronousProgressCallbackFunction</a> (void(*callback_function)(ON__UINT_PTR context, double fraction_complete), ON__UINT_PTR callback_context)</td></tr>
<tr class="separator:ae121a10fbcd1d3f17b8ce169d0384d6d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a6020b6202bcd94a27ed458a7404ab81e"><td class="memItemLeft" align="right" valign="top">static double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d8/d13/class_o_n___progress_reporter.html#a6020b6202bcd94a27ed458a7404ab81e">FractionComplete</a> (<a class="el" href="../../d8/d13/class_o_n___progress_reporter.html">ON_ProgressReporter</a> *progress_reporter)</td></tr>
<tr class="separator:a6020b6202bcd94a27ed458a7404ab81e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab9f89acab0ff9a81c3cabb4d7ce5935e"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d8/d13/class_o_n___progress_reporter.html#ab9f89acab0ff9a81c3cabb4d7ce5935e">ReportProgress</a> (<a class="el" href="../../d8/d13/class_o_n___progress_reporter.html">ON_ProgressReporter</a> *progress_reporter, double fraction_complete)</td></tr>
<tr class="separator:ab9f89acab0ff9a81c3cabb4d7ce5935e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa5de9621156b60cf94b9e254b441c45c"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d8/d13/class_o_n___progress_reporter.html#aa5de9621156b60cf94b9e254b441c45c">ReportProgress</a> (<a class="el" href="../../d8/d13/class_o_n___progress_reporter.html">ON_ProgressReporter</a> *progress_reporter, int i, int max_i)</td></tr>
<tr class="separator:aa5de9621156b60cf94b9e254b441c45c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2085229a43ee82b28179423b87d2a6d7"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d8/d13/class_o_n___progress_reporter.html#a2085229a43ee82b28179423b87d2a6d7">ReportProgress</a> (<a class="el" href="../../d8/d13/class_o_n___progress_reporter.html">ON_ProgressReporter</a> *progress_reporter, unsigned int i, unsigned int max_i)</td></tr>
<tr class="separator:a2085229a43ee82b28179423b87d2a6d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><dl class="section rcs"><dt>NoKeywords</dt><dd></dd></dl>
<p>/ / Copyright (c) 1993-2013 Robert McNeel &amp; Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel &amp; Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see <a href="http://www.opennurbs.org">http://www.opennurbs.org</a>. / //////////////////////////////////////////////////////////////</p>
<p>Calculation use <a class="el" href="../../d8/d13/class_o_n___progress_reporter.html">ON_ProgressReporter</a> to report progress to the calling code. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a8f262c3526a41ec2be515435b9e4cbec"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8f262c3526a41ec2be515435b9e4cbec">&#9670;&nbsp;</a></span>ON_ProgressReporter()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ON_ProgressReporter::ON_ProgressReporter </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="aad7920048a1d2c5f6894824c81edbf98"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aad7920048a1d2c5f6894824c81edbf98">&#9670;&nbsp;</a></span>~ON_ProgressReporter()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ON_ProgressReporter::~ON_ProgressReporter </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a6020b6202bcd94a27ed458a7404ab81e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6020b6202bcd94a27ed458a7404ab81e">&#9670;&nbsp;</a></span>FractionComplete()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static double ON_ProgressReporter::FractionComplete </td>
<td>(</td>
<td class="paramtype"><a class="el" href="../../d8/d13/class_o_n___progress_reporter.html">ON_ProgressReporter</a> *&#160;</td>
<td class="paramname"><em>progress_reporter</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Description: The calculation may call <a class="el" href="../../d8/d13/class_o_n___progress_reporter.html#a6020b6202bcd94a27ed458a7404ab81e">ON_ProgressReporter::FractionComplete</a> to get the current fraction completed. Parameters: progress_reporter - [in] A pointer to an <a class="el" href="../../d8/d13/class_o_n___progress_reporter.html">ON_ProgressReporter</a> or null pointer. Returns: ON_UNSET_VALUE is returned when progress_reporter is nullptr. Otherwise, a value between 0.0 and 1.0 is returned where 0.0 indicates the calcuation is beginning and 1.0 indicates the calculation is complete. </p>
</div>
</div>
<a id="ab9f89acab0ff9a81c3cabb4d7ce5935e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab9f89acab0ff9a81c3cabb4d7ce5935e">&#9670;&nbsp;</a></span>ReportProgress() <span class="overload">[1/3]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static void ON_ProgressReporter::ReportProgress </td>
<td>(</td>
<td class="paramtype"><a class="el" href="../../d8/d13/class_o_n___progress_reporter.html">ON_ProgressReporter</a> *&#160;</td>
<td class="paramname"><em>progress_reporter</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double&#160;</td>
<td class="paramname"><em>fraction_complete</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Description: The caclulation calls <a class="el" href="../../d8/d13/class_o_n___progress_reporter.html#ab9f89acab0ff9a81c3cabb4d7ce5935e">ON_ProgressReporter::ReportProgress</a> to report its current progress. If it is the first call to ReportProgress, or the faction_complete is 1.0, or the fraction_complete has increased a reasonable amount, then the callback function is called. Parameters: progress_reporter - [in] A pointer to an <a class="el" href="../../d8/d13/class_o_n___progress_reporter.html">ON_ProgressReporter</a> or null pointer. fraction_complete - [in] a value between 0.0 and 1.0 where 0.0 indicates the calcuation is beginning and 1.0 indicates the calculation is complete. Example: void MyLongCalculation( ..., ON_ProgressReporter* pr, ...) { ... for ( i = 0; i &lt; count; i++ ) { <a class="el" href="../../d8/d13/class_o_n___progress_reporter.html#ab9f89acab0ff9a81c3cabb4d7ce5935e">ON_ProgressReporter::ReportProgress</a>(pr,i/((double)count)); ... } <a class="el" href="../../d8/d13/class_o_n___progress_reporter.html#ab9f89acab0ff9a81c3cabb4d7ce5935e">ON_ProgressReporter::ReportProgress</a>(pr,1.0); ///&lt; finished ... } </p>
</div>
</div>
<a id="aa5de9621156b60cf94b9e254b441c45c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa5de9621156b60cf94b9e254b441c45c">&#9670;&nbsp;</a></span>ReportProgress() <span class="overload">[2/3]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static void ON_ProgressReporter::ReportProgress </td>
<td>(</td>
<td class="paramtype"><a class="el" href="../../d8/d13/class_o_n___progress_reporter.html">ON_ProgressReporter</a> *&#160;</td>
<td class="paramname"><em>progress_reporter</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>i</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>max_i</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Description: The caclulation calls <a class="el" href="../../d8/d13/class_o_n___progress_reporter.html#ab9f89acab0ff9a81c3cabb4d7ce5935e">ON_ProgressReporter::ReportProgress</a> to report its current progress. If it is the first call to ReportProgress, or the faction_complete is 1.0, or the fraction_complete has increased a reasonable amount, then the callback function is called. Parameters: progress_reporter - [in] A pointer to an <a class="el" href="../../d8/d13/class_o_n___progress_reporter.html">ON_ProgressReporter</a> or null pointer. fraction_complete - [in] a value between 0.0 and 1.0 where 0.0 indicates the calcuation is beginning and 1.0 indicates the calculation is complete. Example: void MyLongCalculation( ..., ON_ProgressReporter* pr, ...) { ... for ( i = 0; i &lt; count; i++ ) { ON_ProgressReporter::ReportProgress(pr,i,count); ... } <a class="el" href="../../d8/d13/class_o_n___progress_reporter.html#ab9f89acab0ff9a81c3cabb4d7ce5935e">ON_ProgressReporter::ReportProgress</a>(pr,1.0); ///&lt; finished ... } </p>
</div>
</div>
<a id="a2085229a43ee82b28179423b87d2a6d7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2085229a43ee82b28179423b87d2a6d7">&#9670;&nbsp;</a></span>ReportProgress() <span class="overload">[3/3]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static void ON_ProgressReporter::ReportProgress </td>
<td>(</td>
<td class="paramtype"><a class="el" href="../../d8/d13/class_o_n___progress_reporter.html">ON_ProgressReporter</a> *&#160;</td>
<td class="paramname"><em>progress_reporter</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned int&#160;</td>
<td class="paramname"><em>i</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned int&#160;</td>
<td class="paramname"><em>max_i</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Description: The caclulation calls <a class="el" href="../../d8/d13/class_o_n___progress_reporter.html#ab9f89acab0ff9a81c3cabb4d7ce5935e">ON_ProgressReporter::ReportProgress</a> to report its current progress. If it is the first call to ReportProgress, or the faction_complete is 1.0, or the fraction_complete has increased a reasonable amount, then the callback function is called. Parameters: progress_reporter - [in] A pointer to an <a class="el" href="../../d8/d13/class_o_n___progress_reporter.html">ON_ProgressReporter</a> or null pointer. fraction_complete - [in] a value between 0.0 and 1.0 where 0.0 indicates the calcuation is beginning and 1.0 indicates the calculation is complete. Example: void MyLongCalculation( ..., ON_ProgressReporter* pr, ...) { ... for ( i = 0; i &lt; count; i++ ) { ON_ProgressReporter::ReportProgress(pr,i,count); ... } <a class="el" href="../../d8/d13/class_o_n___progress_reporter.html#ab9f89acab0ff9a81c3cabb4d7ce5935e">ON_ProgressReporter::ReportProgress</a>(pr,1.0); ///&lt; finished ... } </p>
</div>
</div>
<a id="ae121a10fbcd1d3f17b8ce169d0384d6d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae121a10fbcd1d3f17b8ce169d0384d6d">&#9670;&nbsp;</a></span>SetSynchronousProgressCallbackFunction()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void ON_ProgressReporter::SetSynchronousProgressCallbackFunction </td>
<td>(</td>
<td class="paramtype">void(*)(ON__UINT_PTR context, double fraction_complete)&#160;</td>
<td class="paramname"><em>callback_function</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">ON__UINT_PTR&#160;</td>
<td class="paramname"><em>callback_context</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Description: Set the function that is called when a calculation calls <a class="el" href="../../d8/d13/class_o_n___progress_reporter.html#ab9f89acab0ff9a81c3cabb4d7ce5935e">ReportProgress()</a>. Parameters: callback_function - [in] This function is called when the calculation reports progress. The calculation thread calls in this callback function. The callback function should do something that is fast and simple, like post a message to a user interface control and return immediately. Paramters passed to the callback function: context - [in] the value of callback_context. fraction_complete - [in] A value between 0.0 and 1.0 indicating how much of the calculation is compete. Example: </p><pre class="fragment"> struct MyWindowsMessage
{
HWND m_hWnd;
UINT m_Msg,
WPARAM m_wParam
};
...
void MyProgressCallback(
ON__UINT_PTR context,
double fraction_complete
)
{
if ( 0 != context )
{
MyWindowsMessage* msg = (MyWindowsMessage*)context;
LPARAM lParam = (UINT)ceil(100.0*fraction_complete); ///&lt; 0 to 100.
PostWindowsMessage(msg.m_hWnd,msg.m_Msg,msg.m_wParam,lParam);
}
}
...
struct MyWindowsMessage my_msg;
my_msg.m_hWnd = my progress bar window
my_msg.m_Msg = RegisterWindowMessage(L"MyProgressBarWindowsMessage");
my_msg.m_wParam = ...;
ON_ProgressReporter pr;
pr.SetSynchronousProgressCallbackFunction(MyProgressCallback,&amp;my_msg);
...
Pass &amp;pr to a calculation function. The calcuation will generally be running
in a different thread or allowing Windows messages to be pumped.</pre>
</div>
</div>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.13-->
<!-- start footer part -->
</div> <!-- page-content -->
</div> <!-- container -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 31 2018 14:45:41 for openNURBS SDK Help by <a href="http://www.doxygen.org/index.html">
<!-- <img class="footer" src="../../doxygen.png" alt="doxygen"/> -->
Doxygen
</a> 1.8.13
</small></address>
<script type="text/javascript" src="../../doxy-boot.js"></script>
</body>
</html>