|  | ||
| 
 | 
 int near_primitive1(int p_type, int x, int y); 
 int p_type; // An integer primitive flag int x; // An integer x-coordinate int y; // An integer y-coordinate 
 | 
 | ||||||||||||||||||
| Synopsis | #include "silver.h" #include "ssnodes.h" 
 The near_primitive1 function builds a p-group of visible primitives 'near' the 2D screen coordinate defined by the values of x and y. p_type controls the type type of primitives considered. If no primitive satisfies the type requirements, or the screen coordinate is invalid, then the current p-group will become empty. 
 | 
 | ||||||||||||||||||
| Parameters | p_type is a primitive-level bits flag value whose meaning is as follows: 
 
 
 x is the x-coordinate of the 2D point used to select entities y is the y-coordinate of the 2D point used to select entities 
 | 
 | ||||||||||||||||||
| Return Value | near_primitive1 returns the number of items in the p-group that satisfied the selection conditions. If the screen position does not resolve to one candidate then all candidates are added to the p-group. 
 | 
 | ||||||||||||||||||
| Remarks | You may not treat p_type as a bit-flag in this function (values may not be Or'd). The reason is that all primitives in an primitive group (the p-group) must have the same type. 
 | 
 | ||||||||||||||||||
| See Also | near_entity1, near_entity2, get_pgroup_item, pick_primitive 
 | 
 | ||||||||||||||||||
| Example | The following code waits for a mouse-left press, then uses the 2D position of the cursor to place of the polygons near it into the p-group. Finally, it changes the edge and surface color of the p-group to light-red: 
 
 | 
 |