📄 acis_tutorials_(options).htm
字号:
<span class="kw6">API_BEGIN</span> merge_option = find_option <span class="br0">(</span><span class="st0">"merge"</span><span class="br0">)</span>; <span class="kw1">if</span> <span class="br0">(</span>merge_option != <span class="kw2">NULL</span><span class="br0">)</span> merge_option-><span class="me3">push</span><span class="br0">(</span><span class="kw2">FALSE</span><span class="br0">)</span>; <span class="co1">// Perform your algorithm</span> <span class="kw6">API_END</span> <span class="kw1">if</span> <span class="br0">(</span>merge_option != <span class="kw2">NULL</span><span class="br0">)</span> merge_option-><span class="me3">pop</span><span class="br0">(</span> <span class="br0">)</span>;</pre><p>The same behavior is demonstrated using set( ) in the following code snippet.</p><pre class="source-cpp"><span class="kw4">volatile</span> <span class="kw7">option_header</span> * merge_option = <span class="kw2">NULL</span>;<span class="kw4">volatile</span> <span class="kw5">logical</span> prev_merge_option_value; <span class="kw6">API_BEGIN</span> merge_option = find_option <span class="br0">(</span><span class="st0">"merge"</span><span class="br0">)</span>; <span class="kw1">if</span> <span class="br0">(</span>merge_option != <span class="kw2">NULL</span><span class="br0">)</span> <span class="br0">{</span> prev_merge_option_value = merge_option.<span class="me1">on</span><span class="br0">(</span> <span class="br0">)</span>; merge_option-><span class="me3">set</span><span class="br0">(</span><span class="kw2">FALSE</span><span class="br0">)</span>; <span class="br0">}</span> <span class="co1">// Perform your algorithm</span> <span class="kw6">API_END</span> <span class="kw1">if</span> <span class="br0">(</span>merge_option != <span class="kw2">NULL</span><span class="br0">)</span> merge_option-><span class="me3">set</span><span class="br0">(</span>prev_merge_option_value<span class="br0">)</span>;</pre><p>The style used in second example might be more useful if you were changing the value of an option multiple times and wanted to be sure that the option was always set back to the value it had before entering the API_BEGIN/API_END block. In other words if you were changing the value of an option multiple times and an exception occured, you might not know how many times to <i>pop</i> the value; therefore, you must <i>set</i> the value to it initial value. </p><blockquote class="templatequote"><div><p><i><b>Note:</b> If the initial value were not the default value, you could not reset the value using reset( ).</i></p></div></blockquote><p>The <tt><a href=/r18/qref/ACIS/html/classoption__header.html class="external text">option_header</a></tt> class is defined in <tt><a href=/r18/qref/ACIS/html/option_8hxx.html class="external text">option.hxx</a></tt>; however, specific instances of options are instantiated within the various components of ACIS. For example, the <code>merge</code> option described above is instantiated within the Boolean component. If an application were linked without the Boolean component it would not be able to reference the <code>merge</code> option. <br/> <br/> <br/> <br/></p><table cellspacing="0" cellpadding="0" align="center" style="width:100%; border:2px #a3b1bf solid; margin-top: 1em; font-size:85%"><tr><td id="totdhelp" colspan="2" style="width:100%; margin-top:0em; padding-top:1em; padding-left:1em; padding-right:1em; background:#f5faff;"><p>The <b>ACIS Tutorials</b> contain discussions and examples that will introduce you to ACIS concepts and terminology, and demonstrate how to successfully use ACIS. Each tutorial builds upon prior tutorials; therefore, we suggest that new users proceed through these tutorials sequentially. It is expected that new users will be familiar with programming in C++ and their development environment before beginning these tutorials. In addition it is expected that new users will have at least a basic understanding of topology and geometry. </p></td></tr></table><p><br /></p><div style="float:right; margin-top: 0.0em; margin-bottom:3px; background-color: #e3e5e7; padding: .2em .6em; font-size: 130%; border:1px solid #A3B1BF;"><b>Continue:</b> <b><a href="/r18/index.php/Tutorial:ACIS_Tutorials_%28Memory_Management%29" title="Tutorial:ACIS Tutorials (Memory Management)">Memory Management</a></b> <span style="font-size: larger; font-weight: bold;"></span><div style="clear:both"></div></div></div><p><br /></p><p><br /></p><!-- Tidy found serious XHTML errors --><!-- Pre-expand include size: 38487 bytesPost-expand include size: 48450 bytesTemplate argument size: 2564 bytesMaximum: 2097152 bytes--><!-- Saved in parser cache with key r18_docdb-r18doc_:pcache:idhash:429-0!1!0!!en!2!edit=0 and timestamp 20080623071803 --><div class="printfooter">Retrieved from "<a href="http://doc.spatial.com/r18/index.php/Tutorial:ACIS_Tutorials_%28Options%29">http://doc.spatial.com/r18/index.php/Tutorial:ACIS_Tutorials_%28Options%29</a>"</div> <div id="catlinks"><p class='catlinks'><a href="/r18/index.php/Special:Categories" title="Special:Categories">Categories</a>: <span dir='ltr'><a href="/r18/index.php/Category:ACIS_Tutorials" title="Category:ACIS Tutorials">ACIS Tutorials</a></span> | <span dir='ltr'><a href="/r18/index.php/Category:ACIS_Docs" title="Category:ACIS Docs">ACIS Docs</a></span> | <span dir='ltr'><a href="/r18/index.php/Category:ACIS_Getting_Started" title="Category:ACIS Getting Started">ACIS Getting Started</a></span></p></div> <!-- end content -->
<div class="visualClear"></div>
</div>
</div>
</div>
<div id="column-one">
<div id="p-cactions" class="portlet">
<h5>Views</h5>
<div class="pBody">
<ul>
<li id="ca-nstab-main" class="selected"><a href="/r18/index.php/Tutorial:ACIS_Tutorials_%28Options%29" title="View the content page [c]" accesskey="c">Article</a></li>
<li id="ca-talk" class="new"><a href="/r18/index.php?title=Talk:Tutorial:ACIS_Tutorials_%28Options%29&action=edit" title="Discussion about the content page [t]" accesskey="t">Discussion</a></li>
<li id="ca-viewsource"><a href="/r18/index.php?title=Tutorial:ACIS_Tutorials_%28Options%29&action=edit" title="This page is protected. You can view its source. [e]" accesskey="e">View source</a></li>
<li id="ca-history"><a href="/r18/index.php?title=Tutorial:ACIS_Tutorials_%28Options%29&action=history" title="Past versions of this page. [h]" accesskey="h">History</a></li>
</ul>
</div>
</div>
<div class="portlet" id="p-personal">
<h5>Personal tools</h5>
<div class="pBody">
<ul>
<li id="pt-login"><a href="/r18/index.php?title=Special:Userlogin&returnto=Tutorial:ACIS_Tutorials_(Options)" title="You are encouraged to log in, it is not mandatory however. [o]" accesskey="o">Log in / create account</a></li>
</ul>
</div>
</div>
<div class="portlet" id="p-logo">
<a style="background-image: url(/r18/images/SpatialCorpLogo.gif);" href="/r18/index.php/Main_Page" title="Visit the Main Page [z]" accesskey="z"></a>
</div>
<script type="text/javascript"> if (window.isMSIE55) fixalpha(); </script>
<div class='portlet' id='p-navigation'>
<h5>Navigation</h5>
<div class='pBody'>
<ul>
<li id="n--Home"><a href="http://doc.spatial.com/ "> Home</a></li>
<li id="n-mainpage"><a href="/r18/index.php/Main_Page" title="Visit the Main Page [z]" accesskey="z">Main Page</a></li>
<li id="n-recentchanges"><a href="/r18/index.php/Special:Recentchanges" title="The list of recent changes in the wiki. [r]" accesskey="r">Recent changes</a></li>
<li id="n-randompage"><a href="/r18/index.php/Special:Random" title="Load a random page [x]" accesskey="x">Random page</a></li>
<li id="n-help"><a href="/r18/index.php/Help:Contents" title="The place to find out.">Help</a></li>
</ul>
</div>
</div>
<div class='portlet' id='p-spatial_sites'>
<h5>spatial sites</h5>
<div class='pBody'>
<ul>
<li id="n--Spatial.com"><a href="http://www.spatial.com "> Spatial.com</a></li>
<li id="n---Online-Support-Center"><a href="http://spatial.custhelp.com/cgi-bin/spatial.cfg/php/enduser/acct_login.php?p_sid=tblNMDHh&p_lva=&p_sp=&p_li=&p_next_page=std_alp.php"> Online Support Center</a></li>
<li id="n--Community-Forum"><a href="http://forums.spatial.com/ "> Community Forum</a></li>
<li id="n--Downloads"><a href="http://www.spatial.com/products/download.html "> Downloads</a></li>
<li id="n--Feedback"><a href="mailto:docfeedback_spatial@3ds.com "> Feedback</a></li>
</ul>
</div>
</div>
<div class='portlet' id='p-products'>
<h5>products</h5>
<div class='pBody'>
<ul>
<li id="n-ACIS-Tutorials---Beta"><a href="/r18/index.php/Tutorial:ACIS_Tutorials">ACIS Tutorials - Beta</a></li>
<li id="n-InterOp"><a href="/r18/index.php/Portal:InterOp">InterOp</a></li>
</ul>
</div>
</div>
<div id="p-search" class="portlet">
<h5><label for="searchInput">Search</label></h5>
<div id="searchBody" class="pBody">
<form action="/r18/index.php/Special:Search" id="searchform"><div>
<input id="searchInput" name="search" type="text" title="Search DocR18 [f]" accesskey="f" value="" />
<input type='submit' name="go" class="searchButton" id="searchGoButton" value="Go" />
<input type='submit' name="fulltext" class="searchButton" id="mw-searchButton" value="Search" />
</div></form>
</div>
</div>
<div class="portlet" id="p-tb">
<h5>Toolbox</h5>
<div class="pBody">
<ul>
<li id="t-whatlinkshere"><a href="/r18/index.php/Special:Whatlinkshere/Tutorial:ACIS_Tutorials_%28Options%29" title="List of all wiki pages that link here [j]" accesskey="j">What links here</a></li>
<li id="t-recentchangeslinked"><a href="/r18/index.php/Special:Recentchangeslinked/Tutorial:ACIS_Tutorials_%28Options%29" title="Recent changes in pages linked from this page [k]" accesskey="k">Related changes</a></li>
<li id="t-specialpages"><a href="/r18/index.php/Special:Specialpages" title="List of all special pages [q]" accesskey="q">Special pages</a></li>
<li id="t-print"><a href="/r18/index.php?title=Tutorial:ACIS_Tutorials_%28Options%29&printable=yes" title="Printable version of this page [p]" accesskey="p">Printable version</a></li> <li id="t-permalink"><a href="/r18/index.php?title=Tutorial:ACIS_Tutorials_%28Options%29&oldid=1122" title="Permanent link to this version of the page">Permanent link</a></li> </ul>
</div>
</div>
</div><!-- end of the left (by default at least) column -->
<div class="visualClear"></div>
<div id="footer">
<div id="f-poweredbyico"><a href="http://www.mediawiki.org/"><img src="/r18/skins/common/images/poweredby_mediawiki_88x31.png" alt="Powered by MediaWiki" /></a></div>
<ul>
<li>© 1999-2008 Spatial Corp.</li>
<li> Please send feedback to <a href="mailto:docfeedback_spatial@3ds.com">docfeedback_spatial@3ds.com</a> or just <a href="../index.php?title=Special:Userlogin&returnto=Special:Userlogout">login</a> and start editing the comments page.</li>
</ul>
<ul id="f-list">
<li id="lastmod"> This page was last modified 15:57, 23 May 2008.</li>
<li id="viewcount">This page has been accessed 58 times.</li>
<li> <a href="../index.php/Project:Terms_of_Use">Terms of Use</a> </li>
<li> <a href="../index.php/Project:Privacy_policy">Privacy Policy</a> </li>
</ul>
</div>
<script type="text/javascript">if (window.runOnloadHook) runOnloadHook();</script> <script type='text/javascript' src='/r18/javascript_form/getXterlinks.js'></script> <script type='text/javascript'>getXterlinks()</script></div>
<!-- Served in 0.264 secs. --></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -