
Functions | |
| void | Show_Trim_Type (int index, char *trim_type) |
| Returns the type of an object on the trim list of the currently open NURBS surface or trim collection. More... | |
| void Show_Trim_Type | ( | int | index, |
| char * | trim_type | ||
| ) |
Returns the type of an object on the trim list of the currently open NURBS surface or trim collection.
| index | - Index of the particular object in the trim list. |
| trim_type | - Type of trim object, either "trim poly", "trim curve", or "trim collection". Returned to user. Passed by reference always. |
NURBS surfaces are trimmed by either keeping or removing closed trim regions. These trim regions can be described in one of three ways: by poly, by curve, or by collection. This function returns a string that indicates how the closed region was specified. How trim objects were originally specified dictates how they should be queried. For example, it is not legal to call Show_Trim_Poly(i) if Show_Trim_Type() returns "trim collection".
For example, the following code would show all of the trims attached to a NURBS surface or any of the collections that it contained (but to be truly correct should really be allocating space according to the values returned by Show_Trim_Poly_Count() and Show_Trim_Curve_Count() ):
Open_Geometry( nurbs_surface_key );
{
int i, j;
int count, count2;
int outsize, degree;
float out[128];
char tempstr[128];
Show_Trim_Count( &count );
for( i = 0 ; i < count ; i++ ) {
Show_Trim_Type( i, tempstr );
if( !strcmp( tempstr, "trim poly" )) {
Show_Trim_Poly_Count( i, &outsize );
Show_Trim_Poly( i, &outsize, out );
}
else if( !strcmp( tempstr, "trim curve" )) {
Show_Trim_Curve_Count( i, °ree, &outsize, NULL, NULL, NULL, NULL );
Show_Trim_Curve( i, °ree, &outsize, out, NULL, NULL, NULL, NULL );
}
else if( !strcmp( tempstr, "trim collection" )) {
Open_Trim( i );
count2 = Show_Trim_Count();
for( j = 0 ; j < count2 ; j++ ) {
Show_Trim_Type( j, tempstr )
if( !strcmp( tempstr, "trim poly" )) {
Show_Trim_Poly_Count( j, &outsize );
Show_Trim_Poly( j, &outsize, out );
}
else if( !strcmp( tempstr, "trim curve" )) {
Show_Trim_Curve_Count( j, °ree, &outsize, NULL, NULL, NULL, NULL );
Show_Trim_Curve( j, °ree, &outsize, out, NULL, NULL, NULL, NULL );
}
}
Close_Trim();
}
}
}
Close_Geometry();
This call is not legal except when there is a valid NURBS surface that has been opened with a call to Open_Geometry() , or if a trim collection was opened with an Open_Trim() .
Offsets of trimming objects are zero-based. Offset 0 corresponds to the head of the list. Trimming objects are prepended to the head of the list, meaning that offset 0 is the most recently created.