⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 _understanding_and_traversing_acis_topology_(part_iii).htm

📁 acis说明文档
💻 HTM
📖 第 1 页 / 共 3 页
字号:
</td><td> returns a pointer to the first WIRE owned directly by this SUBSHELL; i.e., it takes subshells into account.</td></tr><tr><th> WIRE method</th><th> Description</th></tr><tr><td> WIRE::shell( )</td><td> returns a pointer to the owning SHELL, if it is directly owned by one.</td></tr><tr><td> WIRE::subshell( )</td><td> returns a pointer to the owning SUBSHELL, if there is one.</td></tr><tr><td> WIRE::owner( )</td><td> returns a pointer to the SHELL or SUBSHELL owning this WIRE, if there is one.</td></tr><tr><td> WIRE::next( )</td><td> returns a pointer to the next WIRE in a complete list of all WIRES owned by its SHELL; i.e., it pretends no subshells exist.</td></tr><tr><td> WIRE::next_in_list( )</td><td> returns a pointer to the next WIRE owned directly by its SHELL or SUBSHELL; i.e., it takes subshells into account.</td></tr><tr><td> WIRE::coedge( )</td><td> returns a pointer to a COEDGE in the WIRE.</td></tr><tr><th> FACE method</th><th> Description</th></tr><tr><td> FACE::SHELL( )</td><td> returns a pointer to the owning SHELL, regardless of whether or not it is directly owned by a SHELL.</td></tr><tr><td> FACE::SUBSHELL( )</td><td> returns a pointer to the owning SHELL, if there is one.</td></tr><tr><td> FACE::owner( )</td><td> returns a pointer to the SHELL owning this FACE, if there is one; i.e., it pretends no subshells exist.</td></tr><tr><td> FACE::next( )</td><td> returns a pointer to the next FACE in a complete list of all FACES owned by its SHELL; i.e., it pretends no subshells exist.</td></tr><tr><td> FACE::next_in_list( )</td><td> returns a pointer to the next FACE owned directly by its SHELL or SUBSHELL; i.e., it takes subshells into account.</td></tr><tr><td> FACE::loop( )</td><td> returns a pointer to a LOOP in the FACE, if there is one.</td></tr><tr><th> LOOP method</th><th> Description</th></tr><tr><td> LOOP::face( )</td><td> returns a pointer to the owning FACE, if there is one.</td></tr><tr><td> LOOP::owner( )</td><td> returns a pointer to the owning FACE, if there is one.</td></tr><tr><td> LOOP::next( )</td><td> returns a pointer to the next LOOP of the owning FACE, if there is one.</td></tr><tr><td> LOOP::start( )</td><td> returns a pointer to a COEDGE of the LOOP.</td></tr><tr><th> COEDGE method</th><th> Description</th></tr><tr><td> COEDGE::loop( )</td><td> returns a pointer to the owning LOOP, if there is one.</td></tr><tr><td> COEDGE::wire( )</td><td> returns a pointer to the owning WIRE, if there is one.</td></tr><tr><td> COEDGE::owner( )</td><td> returns a pointer to the owning LOOP or WIRE, if there is one.</td></tr><tr><td> COEDGE::next( )</td><td> returns a pointer to the next COEDGE in the LOOP or WIRE.</td></tr><tr><td> COEDGE::previous( )</td><td> returns a pointer to the previous COEDGE in the LOOP or WIRE.</td></tr><tr><td> COEDGE::partner( )</td><td> returns a pointer to the next COEDGE of the EDGE, if there is one.</td></tr><tr><td> COEDGE::edge( )</td><td> returns a pointer to the EDGE of the COEDGE.</td></tr><tr><th> EDGE method</th><th> Description</th></tr><tr><td> EDGE::coedge( )</td><td> returns a pointer to the owning COEDGE, if there is one.</td></tr><tr><td> EDGE::owner( )</td><td> returns a pointer to the owning COEDGE, if there is one.</td></tr><tr><td> EDGE::end( )</td><td> returns a pointer to the end VERTEX of this EDGE.</td></tr><tr><td> EDGE::start( )</td><td> returns a pointer to the start VERTEX of this EDGE.</td></tr><tr><th> VERTEX method</th><th> Description</th></tr><tr><td> VERTEX::count_edges( )</td><td> returns the number of EDGES pointed to by this VERTEX (i.e., the number of separation surfaces at this VERTEX.)</td></tr><tr><td> VERTEX::edge( )</td><td> returns an owning EDGE, if the VERTEX is manifold.  If it is non-manifold, it returns NULL.</td></tr><tr><td> VERTEX::edge(int)</td><td> returns the i<sup>th</sup> EDGE pointed to by this VERTEX.  (Remember a VERTEX points to one EDGE on each separation surface.)</td></tr><tr><td> VERTEX::owner( )</td><td> returns a pointer to an owning EDGE.</td></tr></table><p>Unless you specifically want to use SUBSHELLS in your algorithms, you probably will never call any of the SUBSHELL methods, SHELL::face_list( ), SHELL::wire_list( ), FACE::next_in_list( ), or WIRE::next_in_list( ).  If we omit these SUBSHELL related methods, and the owner( ) methods which duplicate more specific methods, the most commonly used methods are summarized in the figure below.</p><div class="center"><div class="floatnone"><span><a href="/r18/index.php/Image:Tutorial3_Relations.jpg" class="image" title="Tutorial3 Relations.jpg"><img alt="" src="/r18/images/4/4e/Tutorial3_Relations.jpg" width="322" height="453" border="0" /></a></span></div></div><a name="Example:_How_would_you_find_the_BODY_containing_a_given_topological_ENTITY.3F"></a><h3> <span class="mw-headline"> Example: How would you find the BODY containing a given topological ENTITY? </span></h3><p>All classes defined from the ENTITY class have an is_&lt;class_name&gt; (const ENTITY *) function, which returns whether or not a given ENTITY of is of that type or not. For instance, the is_BODY(const ENTITY *) function returns whether or not an ENTITY is a BODY. Given this function and the above described owner( ) methods, you could do something similar to the following:</p><pre class="source-cpp"><span class="kw7">ENTITY</span> <span class="kw4">const</span> *owner_ptr = ent;<span class="kw1">while</span> <span class="br0">&#40;</span>&nbsp;!is_BODY<span class="br0">&#40;</span>owner_ptr<span class="br0">&#41;</span> <span class="br0">&#41;</span>	owner_ptr = owner_ptr-&gt;<span class="me3">owner</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</pre><p>This will iteratively search up the topological structure until it finds either a BODY or a NULL ENTITY (i.e., an ENTITY did not have an upper topological ENTITY.)  This does not work for SUBSHELLS.  Top level SUBSHELLS do not contain a pointer to their owning SHELLS.</p><a name="What_are_the_commonly_used_global_functions_for_traversing_the_topology.3F"></a><h3> <span class="mw-headline"> What are the commonly used global functions for traversing the topology? </span></h3><p>There are two sets of functions: direct interface functions and API functions.  These function scan upward or downward for entities, finding entities containing or contained by the given entity.  They do not scan horizontally; i.e., they will not find adjacent entities of the same type. As you may notice there is an API function for each direct interface function, and vice versa.  How do you choose between the API function and the direct interface function?  In general, if you are programming at a low level using other direct interface functions, you might as well use the slightly more efficient direct interface function.  If you are programming at a higher level using only API functions, you should use the API function.  </p><p>The direct interface functions are declared in get_top.hxx.  The corresponding API functions are declared in kernapi.hxx.</p><table class="wikitable"><tr><th> Direct Interface Functions</th><th> API Functions</th></tr><tr><td> void get_lumps( ENTITY*, ENTITY_LIST&amp;, ... );</td><td> void api_get_lumps( ENTITY*, ENTITY_LIST&amp;, ... );</td></tr><tr><td> void get_wires( ENTITY*, ENTITY_LIST&amp;, ... );</td><td> void api_get_wires( ENTITY*, ENTITY_LIST&amp;, ... );</td></tr><tr><td> void get_shells( ENTITY*, ENTITY_LIST&amp;, ... );</td><td> void api_get_shells( ENTITY*, ENTITY_LIST&amp;, ... );</td></tr><tr><td> void get_faces( ENTITY*, ENTITY_LIST&amp;, ... );</td><td> void api_get_faces( ENTITY*, ENTITY_LIST&amp;, ... );</td></tr><tr><td> void get_loops( ENTITY*, ENTITY_LIST&amp;, ... );</td><td> void api_get_loops( ENTITY*, ENTITY_LIST&amp;, ... );</td></tr><tr><td> void get_edges( ENTITY*, ENTITY_LIST&amp;, ... );</td><td> void api_get_edges( ENTITY*, ENTITY_LIST&amp;, ... );</td></tr><tr><td> void get_coedges( ENTITY*, ENTITY_LIST&amp;, ... );</td><td> void api_get_coedges( ENTITY*, ENTITY_LIST&amp;, ... );</td></tr><tr><td> void get_vertices( ENTITY*, ENTITY_LIST&amp;, ...  );</td><td> void api_get_vertices( ENTITY*, ENTITY_LIST&amp;, ...  );</td></tr><tr><td> void get_tedges( ENTITY*, ENTITY_LIST&amp;, ... );</td><td> void api_get_tedges( ENTITY*, ENTITY_LIST&amp;, ... );</td></tr><tr><td> void get_tcoedges( ENTITY*, ENTITY_LIST&amp;, ... );</td><td> void api_get_tcoedges( ENTITY*, ENTITY_LIST&amp;, ... );</td></tr><tr><td> void get_tvertices( ENTITY*, ENTITY_LIST&amp;, ... );</td><td> void api_get_tvertices( ENTITY*, ENTITY_LIST&amp;, ... );</td></tr></table><p><br />  If you look at the lists of direct interface functions and the API functions you will notice that there are no get_bodies( ) or api_get_bodies( ) functions.  Why is that???  Probably because there is at most one body above any topological entity and it is relatively easy to find the body as we demonstrated in the previous section.</p><p>In all cases the first argument is the given topological ENTITY and the second argument is the returned list of ENTITIES.  For example, if we call get_edges ( ) and pass in a FACE* as the first argument, the function will return a list containing all the edges of the given face.  </p><p>The last three rows of the table above reflect classes we have not discussed previously: TEDGES, TCOEDGES, and TVERTICES.  These are tolerant edges, tolerant coedges, and tolerant vertices.  Tolerant entities will be discussed in <a href="/r18/index.php/Tutorial:ACIS_Tutorials_%28ACIS_Tolerances%29" title="Tutorial:ACIS Tutorials (ACIS Tolerances)">Tutorials (ACIS Tolerances)</a>.</p><p><b>The ENTITY_LIST class</b></p><p>The second argument of each of these functions is a reference to an ENTITY_LIST. The ENTITY_LIST class is defined in lists.hxx.  An ENTITY_LIST is a container class.  It maintains a list of ENTITIES.  The data structures and algorithms associated with the ENTITY_LIST class have been optimized for efficiency.  It is not simply a linked list.  The table below contains some of the more useful methods of the ENTITY_LIST class.</p><table class="wikitable"><tr><th> ENTITY_LIST method

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -