SilverScreen Solid Modeler



Previous topic Next topic  


Previous topic Next topic JavaScript is required for the print function  



int pick_primitive ( char *message, int p_type, char *buf )


char *message;       // prompt message

int   p_type;        // primitive type mask

char *buf;           // character buffer to receive primitive name




#include "silver.h"


The pick_primitive function displays message and then allows the user to pick a primitive, based on p_type .




message is a null-terminated string containing the prompt message. p_type is an integer value specifying which primitive types are to be considered for picking: BITS_ARC , BITS_BEZIER , BITS_CIRCLE , BITS_LINE , BITS_POLYGON , BITS_POLYLINE or BITS_SPLINE may be or'ed together to obtain p_type . buf is a character buffer that is to receive the full path name of the selected primitive.



Return Value

If a selection is successfully made, then 1 is returned and the path name of the selected primitive is copied into buf ; otherwise, 0 is returned.




If p_type is BITS_LINE or BITS_ARC , then pick_primitive selects only independent lines or arcs. That is, it does not select lines or arcs that are contained in polygons or polylines. In order to select lines and arcs that are contained within polygons or polylines, BITS_LINE or BITS_ARC must be combined with BITS_POLYGON and/or BITS_POLYLINE .


pick_primitive operates in pick mode. The function prompt_primitive operates in either pick or scan mode, while scan_primitive operates in scan mode.



See Also

prompt_primitive , scan_primitive




C / C++ Code


 char buf[100];


 pick_primitive ( "Select", BITS_POLYGON|BITS_LINE, buf );

 pick_primitive ( "Select", BITS_POLYLINE|P_PLINE|BITS_ARC, buf ) ;

 pick_primitive ( "Select", BITS_POLYLINE|BITS_POLYGON|BITS_ARC, buf );



The first call selects a line from the set of lines contained in polygons. The second call selects a line or an arc from those lines and arcs contained in polylines. The third call selects an arc from those arcs contained in either a polygon or a polyline.