HowTo:Determine the type of a LOOP?

From DocR23

Jump to: navigation, search
Showdoc.png



To determine if a loop is a peripheral loop, a hole loop, or a separation loop, you can use the API function api_loop_type. For additional information on loop types, refer to Classification of Loops.

Contents

Signature

api_loop_type returns a loop_type enumeration that specifies the classification of the loop.

outcome api_loop_type ( LOOP* loop,  
                        loop_type & type,  
                        int  info[2] = NULL   
                       );

Header Files

#include "kernapi.hxx"

Example

LOOP* loop = some_loop;
API_BEGIN // api_loop_type can cause change bulletins
 
    loop_type this_loop_type = loop_unknown;
    api_loop_type( loop, this_loop_type );
 
    switch ( this_loop_type )
    {
    case loop_unknown:
        printf ("Unknown type of loop");
        break;
    case loop_periphery:
        printf ("Periphery loop");
        break;
    case loop_hole:
        printf ("Hole");
        break;
    case loop_separation:
        printf ("Separation loop");
        break;
    case loop_u_separation:
        printf ("Separation loop (U)");
        break;
    case loop_v_separation:
        printf ("Separation loop (V)");
        break;
    case loop_uv_separation:
        printf ("Separation loop (UV)");
        break;
    }
 
API_END

Scheme Commands

The Scheme extension loop:type will return a string specifying the type of the loop.

(define loop_type (loop:type loop))
Personal tools