Brief Index      Full Index      I.M. Reference

Show_Trim_Count


Functions

void Show_Trim_Count (int *count)

Function Documentation

void Show_Trim_Count ( int *  count  ) 

Returns the number of objects in the trim list of the currently open NURBS surface or trim collection.

Parameters:
count - Returned to user. Passed by reference always.

DETAILS

Show_Trim_Count() Shows the number of trim objects in the current trim list. If the most recent open was an Open_Geometry() on a NURBS surface, it is the number of independent closed trim regions defined for the surface. If the most recent open was an Open_Trim() on a trim collection, it is the number of sections that together describe the single piecewise trim region. In the former, trim collections count as one. In the latter, trim collections are illegal and will thus not be present (no collections of collections are allowed).

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 the open item is a trim collection that has been opened with 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.

For example, the following snippett would calculate the number of trim curve objects that exist, either in the nurbs surface or in collections.


	curve_count = 0;
	Open_Geometry( nurbs_surface_key );
	count = Show_Trim_Count();
	for( i = 0 ; i < count ; i++ ) {
		Show_Trim_Type( i, tempstr );
		if( !strcmp( tempstr, "trim curve" ) {
			curve_count++;
		}
		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 curve" ) {
						curve_count++;
					}
				}
			Close_Trim();
		}
	}
	Close_Geometry();

NOTES

This function should not be confused with Show_Trim_Curve_Count() or Show_Trim_Poly_Count() , which show the number of vertices, not the number of trim objects.

RESTRICTIONS

See also:
Insert_NURBS_Surface, Open_Geometry, Create_Trim_Collection, Open_Trim, Show_Trim_Poly_Count, Show_Trim_Curve_Count

Main Index
Brief Index      Full Index      I.M. Functions