%PDF- %PDF-
Direktori : /usr/share/doc/imath-devel/html/functions/ |
Current File : //usr/share/doc/imath-devel/html/functions/box.html |
<!doctype html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Box Functions — Imath Documentation</title> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../_static/bizstyle.css" type="text/css" /> <script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> <script src="../_static/jquery.js"></script> <script src="../_static/underscore.js"></script> <script src="../_static/doctools.js"></script> <script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> <script src="../_static/bizstyle.js"></script> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="Color Functions" href="color.html" /> <link rel="prev" title="Vec4" href="../classes/Vec4.html" /> <meta name="viewport" content="width=device-width,initial-scale=1.0" /> <!--[if lt IE 9]> <script src="_static/css3-mediaqueries.js"></script> <![endif]--> </head><body> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="color.html" title="Color Functions" accesskey="N">next</a> |</li> <li class="right" > <a href="../classes/Vec4.html" title="Vec4" accesskey="P">previous</a> |</li> <li class="nav-item nav-item-0"><a href="../index.html">Imath</a> »</li> <li class="nav-item nav-item-this"><a href="">Box Functions</a></li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body" role="main"> <div class="section" id="box-functions"> <span id="id1"></span><h1>Box Functions<a class="headerlink" href="#box-functions" title="Permalink to this headline">¶</a></h1> <p>Functions that operate on bounding boxes.</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1">#include <Imath/ImathBoxAlgo.h></span> </pre></div> </div> <dl class="cpp function"> <dt id="_CPPv4I0EN5Imath4clipE1TRK1TRK3BoxI1TE"> <span id="_CPPv3I0EN5Imath4clipERK1TRK3BoxI1TE"></span><span id="_CPPv2I0EN5Imath4clipERK1TRK3BoxI1TE"></span>template<class <code class="sig-name descname">T</code>><br /><span class="target" id="_imath_box_algo_8h_1a2465fca8fa2089b03bf3305c19965c6c"></span><em class="property">inline</em> <em class="property">constexpr</em> <a class="reference internal" href="#_CPPv4I0EN5Imath4clipE1TRK1TRK3BoxI1TE" title="Imath::clip::T">T</a> <code class="sig-prename descclassname">Imath<code class="sig-prename descclassname">::</code></code><code class="sig-name descname">clip</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv4I0EN5Imath4clipE1TRK1TRK3BoxI1TE" title="Imath::clip::T">T</a> &<em>p</em>, <em class="property">const</em> <a class="reference internal" href="../classes/Box.html#_CPPv4I0EN5Imath3BoxE" title="Imath::Box">Box</a><<a class="reference internal" href="#_CPPv4I0EN5Imath4clipE1TRK1TRK3BoxI1TE" title="Imath::clip::T">T</a>> &<em>box</em><span class="sig-paren">)</span> <em class="property">noexcept</em><a class="headerlink" href="#_CPPv4I0EN5Imath4clipE1TRK1TRK3BoxI1TE" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Clip the coordinates of a point, <code class="docutils literal notranslate"><span class="pre">p</span></code>, against a <code class="docutils literal notranslate"><a class="reference internal" href="../classes/Box.html#class_imath_1_1_box"><span class="std std-ref"><span class="pre">Box</span></span></a><span class="pre"><T></span></code>, <code class="docutils literal notranslate"><span class="pre">box</span></code>. </p> <p>Return the closest point to <code class="docutils literal notranslate"><span class="pre">p</span></code> that is inside the box. </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4I0EN5Imath17closestPointInBoxE1TRK1TRK3BoxI1TE"> <span id="_CPPv3I0EN5Imath17closestPointInBoxERK1TRK3BoxI1TE"></span><span id="_CPPv2I0EN5Imath17closestPointInBoxERK1TRK3BoxI1TE"></span>template<class <code class="sig-name descname">T</code>><br /><span class="target" id="_imath_box_algo_8h_1af4c82195b731fc88b33c74175b886e8d"></span><em class="property">inline</em> <em class="property">constexpr</em> <a class="reference internal" href="#_CPPv4I0EN5Imath17closestPointInBoxE1TRK1TRK3BoxI1TE" title="Imath::closestPointInBox::T">T</a> <code class="sig-prename descclassname">Imath<code class="sig-prename descclassname">::</code></code><code class="sig-name descname">closestPointInBox</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv4I0EN5Imath17closestPointInBoxE1TRK1TRK3BoxI1TE" title="Imath::closestPointInBox::T">T</a> &<em>p</em>, <em class="property">const</em> <a class="reference internal" href="../classes/Box.html#_CPPv4I0EN5Imath3BoxE" title="Imath::Box">Box</a><<a class="reference internal" href="#_CPPv4I0EN5Imath17closestPointInBoxE1TRK1TRK3BoxI1TE" title="Imath::closestPointInBox::T">T</a>> &<em>box</em><span class="sig-paren">)</span> <em class="property">noexcept</em><a class="headerlink" href="#_CPPv4I0EN5Imath17closestPointInBoxE1TRK1TRK3BoxI1TE" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Return the point in or on the <code class="docutils literal notranslate"><a class="reference internal" href="../classes/Box.html#class_imath_1_1_box"><span class="std std-ref"><span class="pre">Box</span></span></a><span class="pre"><T></span></code>, <code class="docutils literal notranslate"><span class="pre">box</span></code>, that is closesest to the point, <code class="docutils literal notranslate"><span class="pre">p</span></code>. </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4I00EN5Imath9transformE3BoxI4Vec3I1SEERK3BoxI4Vec3I1SEERK8Matrix44I1TE"> <span id="_CPPv3I00EN5Imath9transformERK3BoxI4Vec3I1SEERK8Matrix44I1TE"></span><span id="_CPPv2I00EN5Imath9transformERK3BoxI4Vec3I1SEERK8Matrix44I1TE"></span>template<class <code class="sig-name descname">S</code>, class <code class="sig-name descname">T</code>><br /><span class="target" id="_imath_box_algo_8h_1ab35f1a3560a36eec50acff085a945b43"></span><a class="reference internal" href="../classes/Box.html#_CPPv4I0EN5Imath3BoxE" title="Imath::Box">Box</a><<a class="reference internal" href="../classes/Vec3.html#_CPPv4I0EN5Imath4Vec3E" title="Imath::Vec3">Vec3</a><<a class="reference internal" href="#_CPPv4I00EN5Imath9transformE3BoxI4Vec3I1SEERK3BoxI4Vec3I1SEERK8Matrix44I1TE" title="Imath::transform::S">S</a>>> <code class="sig-prename descclassname">Imath<code class="sig-prename descclassname">::</code></code><code class="sig-name descname">transform</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../classes/Box.html#_CPPv4I0EN5Imath3BoxE" title="Imath::Box">Box</a><<a class="reference internal" href="../classes/Vec3.html#_CPPv4I0EN5Imath4Vec3E" title="Imath::Vec3">Vec3</a><<a class="reference internal" href="#_CPPv4I00EN5Imath9transformE3BoxI4Vec3I1SEERK3BoxI4Vec3I1SEERK8Matrix44I1TE" title="Imath::transform::S">S</a>>> &<em>box</em>, <em class="property">const</em> <a class="reference internal" href="../classes/Matrix44.html#_CPPv4I0EN5Imath8Matrix44E" title="Imath::Matrix44">Matrix44</a><<a class="reference internal" href="#_CPPv4I00EN5Imath9transformE3BoxI4Vec3I1SEERK3BoxI4Vec3I1SEERK8Matrix44I1TE" title="Imath::transform::T">T</a>> &<em>m</em><span class="sig-paren">)</span> <em class="property">noexcept</em><a class="headerlink" href="#_CPPv4I00EN5Imath9transformE3BoxI4Vec3I1SEERK3BoxI4Vec3I1SEERK8Matrix44I1TE" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Transform a 3D box by a matrix, and compute a new box that tightly encloses the transformed box. </p> <p>Return the transformed box.</p> <p>If <code class="docutils literal notranslate"><span class="pre">m</span></code> is an affine transform, then we use James Arvo’s fast method as described in “Graphics Gems”, Academic Press, 1990, pp. 548-550.</p> <p>A transformed empty box is still empty, and a transformed infinite box is still infinite. </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4I00EN5Imath15affineTransformE3BoxI4Vec3I1SEERK3BoxI4Vec3I1SEERK8Matrix44I1TE"> <span id="_CPPv3I00EN5Imath15affineTransformERK3BoxI4Vec3I1SEERK8Matrix44I1TE"></span><span id="_CPPv2I00EN5Imath15affineTransformERK3BoxI4Vec3I1SEERK8Matrix44I1TE"></span>template<class <code class="sig-name descname">S</code>, class <code class="sig-name descname">T</code>><br /><span class="target" id="_imath_box_algo_8h_1a59d7dab95dbf38d7fd89e681d224317f"></span><a class="reference internal" href="../classes/Box.html#_CPPv4I0EN5Imath3BoxE" title="Imath::Box">Box</a><<a class="reference internal" href="../classes/Vec3.html#_CPPv4I0EN5Imath4Vec3E" title="Imath::Vec3">Vec3</a><<a class="reference internal" href="#_CPPv4I00EN5Imath15affineTransformE3BoxI4Vec3I1SEERK3BoxI4Vec3I1SEERK8Matrix44I1TE" title="Imath::affineTransform::S">S</a>>> <code class="sig-prename descclassname">Imath<code class="sig-prename descclassname">::</code></code><code class="sig-name descname">affineTransform</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../classes/Box.html#_CPPv4I0EN5Imath3BoxE" title="Imath::Box">Box</a><<a class="reference internal" href="../classes/Vec3.html#_CPPv4I0EN5Imath4Vec3E" title="Imath::Vec3">Vec3</a><<a class="reference internal" href="#_CPPv4I00EN5Imath15affineTransformE3BoxI4Vec3I1SEERK3BoxI4Vec3I1SEERK8Matrix44I1TE" title="Imath::affineTransform::S">S</a>>> &<em>box</em>, <em class="property">const</em> <a class="reference internal" href="../classes/Matrix44.html#_CPPv4I0EN5Imath8Matrix44E" title="Imath::Matrix44">Matrix44</a><<a class="reference internal" href="#_CPPv4I00EN5Imath15affineTransformE3BoxI4Vec3I1SEERK3BoxI4Vec3I1SEERK8Matrix44I1TE" title="Imath::affineTransform::T">T</a>> &<em>m</em><span class="sig-paren">)</span> <em class="property">noexcept</em><a class="headerlink" href="#_CPPv4I00EN5Imath15affineTransformE3BoxI4Vec3I1SEERK3BoxI4Vec3I1SEERK8Matrix44I1TE" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Transform a 3D box by a matrix whose rightmost column <code class="docutils literal notranslate"><span class="pre">(0</span> <span class="pre">0</span> <span class="pre">0</span> <span class="pre">1)</span></code>, and compute a new box that tightly encloses the transformed box. </p> <p>Return the transformed box.</p> <p>As in the transform() function, use James Arvo’s fast method if possible.</p> <p>A transformed empty or infinite box is still empty or infinite. </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4I0EN5Imath22findEntryAndExitPointsEbRK5Line3I1TERK3BoxI4Vec3I1TEER4Vec3I1TER4Vec3I1TE"> <span id="_CPPv3I0EN5Imath22findEntryAndExitPointsERK5Line3I1TERK3BoxI4Vec3I1TEER4Vec3I1TER4Vec3I1TE"></span><span id="_CPPv2I0EN5Imath22findEntryAndExitPointsERK5Line3I1TERK3BoxI4Vec3I1TEER4Vec3I1TER4Vec3I1TE"></span>template<class <code class="sig-name descname">T</code>><br /><span class="target" id="_imath_box_algo_8h_1a13f134d6c17e6be64b50b9f4990b1e82"></span><em class="property">constexpr</em> bool <code class="sig-prename descclassname">Imath<code class="sig-prename descclassname">::</code></code><code class="sig-name descname">findEntryAndExitPoints</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../classes/Line3.html#_CPPv4I0EN5Imath5Line3E" title="Imath::Line3">Line3</a><<a class="reference internal" href="#_CPPv4I0EN5Imath22findEntryAndExitPointsEbRK5Line3I1TERK3BoxI4Vec3I1TEER4Vec3I1TER4Vec3I1TE" title="Imath::findEntryAndExitPoints::T">T</a>> &<em>r</em>, <em class="property">const</em> <a class="reference internal" href="../classes/Box.html#_CPPv4I0EN5Imath3BoxE" title="Imath::Box">Box</a><<a class="reference internal" href="../classes/Vec3.html#_CPPv4I0EN5Imath4Vec3E" title="Imath::Vec3">Vec3</a><<a class="reference internal" href="#_CPPv4I0EN5Imath22findEntryAndExitPointsEbRK5Line3I1TERK3BoxI4Vec3I1TEER4Vec3I1TER4Vec3I1TE" title="Imath::findEntryAndExitPoints::T">T</a>>> &<em>b</em>, <a class="reference internal" href="../classes/Vec3.html#_CPPv4I0EN5Imath4Vec3E" title="Imath::Vec3">Vec3</a><<a class="reference internal" href="#_CPPv4I0EN5Imath22findEntryAndExitPointsEbRK5Line3I1TERK3BoxI4Vec3I1TEER4Vec3I1TER4Vec3I1TE" title="Imath::findEntryAndExitPoints::T">T</a>> &<em>entry</em>, <a class="reference internal" href="../classes/Vec3.html#_CPPv4I0EN5Imath4Vec3E" title="Imath::Vec3">Vec3</a><<a class="reference internal" href="#_CPPv4I0EN5Imath22findEntryAndExitPointsEbRK5Line3I1TERK3BoxI4Vec3I1TEER4Vec3I1TER4Vec3I1TE" title="Imath::findEntryAndExitPoints::T">T</a>> &<em>exit</em><span class="sig-paren">)</span> <em class="property">noexcept</em><a class="headerlink" href="#_CPPv4I0EN5Imath22findEntryAndExitPointsEbRK5Line3I1TERK3BoxI4Vec3I1TEER4Vec3I1TER4Vec3I1TE" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Compute the points where a ray, <code class="docutils literal notranslate"><span class="pre">r</span></code>, enters and exits a 3D box, <code class="docutils literal notranslate"><span class="pre">b</span></code>: </p> <p>Return true if the ray starts inside the box or if the ray starts outside and intersects the box, or return false otherwise (that is, if the ray does not intersect the box).</p> <p>The entry and exit points are the points on two of the faces of the box when the function returns true (the entry end exit points may be on either side of the ray’s origin), or undefined if the the function returns false. </p> </dd></dl> <dl class="cpp function"> <dt id="_CPPv4I0EN5Imath10intersectsEbRK3BoxI4Vec3I1TEERK5Line3I1TER4Vec3I1TE"> <span id="_CPPv3I0EN5Imath10intersectsERK3BoxI4Vec3I1TEERK5Line3I1TER4Vec3I1TE"></span><span id="_CPPv2I0EN5Imath10intersectsERK3BoxI4Vec3I1TEERK5Line3I1TER4Vec3I1TE"></span>template<class <code class="sig-name descname">T</code>><br /><span class="target" id="_imath_box_algo_8h_1ad0f7c366736275e6158a930a41799559"></span><em class="property">constexpr</em> bool <code class="sig-prename descclassname">Imath<code class="sig-prename descclassname">::</code></code><code class="sig-name descname">intersects</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../classes/Box.html#_CPPv4I0EN5Imath3BoxE" title="Imath::Box">Box</a><<a class="reference internal" href="../classes/Vec3.html#_CPPv4I0EN5Imath4Vec3E" title="Imath::Vec3">Vec3</a><<a class="reference internal" href="#_CPPv4I0EN5Imath10intersectsEbRK3BoxI4Vec3I1TEERK5Line3I1TER4Vec3I1TE" title="Imath::intersects::T">T</a>>> &<em>b</em>, <em class="property">const</em> <a class="reference internal" href="../classes/Line3.html#_CPPv4I0EN5Imath5Line3E" title="Imath::Line3">Line3</a><<a class="reference internal" href="#_CPPv4I0EN5Imath10intersectsEbRK3BoxI4Vec3I1TEERK5Line3I1TER4Vec3I1TE" title="Imath::intersects::T">T</a>> &<em>r</em>, <a class="reference internal" href="../classes/Vec3.html#_CPPv4I0EN5Imath4Vec3E" title="Imath::Vec3">Vec3</a><<a class="reference internal" href="#_CPPv4I0EN5Imath10intersectsEbRK3BoxI4Vec3I1TEERK5Line3I1TER4Vec3I1TE" title="Imath::intersects::T">T</a>> &<em>ip</em><span class="sig-paren">)</span> <em class="property">noexcept</em><a class="headerlink" href="#_CPPv4I0EN5Imath10intersectsEbRK3BoxI4Vec3I1TEERK5Line3I1TER4Vec3I1TE" title="Permalink to this definition">¶</a><br /></dt> <dd><p>Intersect a ray, <code class="docutils literal notranslate"><span class="pre">r</span></code>, with a 3D box, <code class="docutils literal notranslate"><span class="pre">b,</span> <span class="pre">and</span> <span class="pre">compute</span> <span class="pre">the</span> <span class="pre">intersection</span> <span class="pre">point,</span> <span class="pre">returned</span> <span class="pre">in</span></code>ip`. </p> <p>The intersection point is<ul class="simple"> <li><p>the ray’s origin if the ray starts inside the box</p></li> <li><p>a point on one of the faces of the box if the ray starts outside the box</p></li> <li><p>undefined when intersect() returns false</p></li> </ul> </p> <p><dl class="simple"> <dt><strong>Return</strong></dt><dd><p><ul class="simple"> <li><p>true if the ray starts inside the box or if the ray starts outside and intersects the box</p></li> <li><p>false if the ray starts outside the box and intersects it, but the intersection is behind the ray’s origin.</p></li> <li><p>false if the ray starts outside and does not intersect it </p></li> </ul> </p> </dd> </dl> </p> </dd></dl> </div> <div class="clearer"></div> </div> </div> </div> <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> <div class="sphinxsidebarwrapper"> <p class="logo"><a href="../index.html"> <img class="logo" src="../_static/imath-logo-blue.png" alt="Logo"/> </a></p> <h4>Previous topic</h4> <p class="topless"><a href="../classes/Vec4.html" title="previous chapter">Vec4</a></p> <h4>Next topic</h4> <p class="topless"><a href="color.html" title="next chapter">Color Functions</a></p> <div role="note" aria-label="source link"> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../_sources/functions/box.rst.txt" rel="nofollow">Show Source</a></li> </ul> </div> <div id="searchbox" style="display: none" role="search"> <h3 id="searchlabel">Quick search</h3> <div class="searchformwrapper"> <form class="search" action="../search.html" method="get"> <input type="text" name="q" aria-labelledby="searchlabel" /> <input type="submit" value="Go" /> </form> </div> </div> <script>$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="color.html" title="Color Functions" >next</a> |</li> <li class="right" > <a href="../classes/Vec4.html" title="Vec4" >previous</a> |</li> <li class="nav-item nav-item-0"><a href="../index.html">Imath</a> »</li> <li class="nav-item nav-item-this"><a href="">Box Functions</a></li> </ul> </div> <div class="footer" role="contentinfo"> © Copyright 2021, Contributors to the OpenEXR Project. Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.4.3. </div> </body> </html>