SilverScreen Solid Modeler

near_primitive2

near_primitive2

Previous topic Next topic  

near_primitive2

Previous topic Next topic JavaScript is required for the print function  

 

SilverScreenAPI

 

int near_primitive2(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_primitive2 function works like near_primitive1 except near_primitive2 will only pick primitives from the current p-group.

 

 

Parameters

p_type is a primitive-level bits flag value whose meaning is as follows:

 

Value

Meaning

BITS_LINE

Only line primitives are tested for nearness to x,y

BITS_POLYGON

Only polygon primitives are tested for nearness to x,y

BITS_CIRCLE

Only circle primitives are tested for nearness to x,y

BITS_SPLINE

Only spline primitives are tested for nearness to x,y

BITS_BEZIER

Only bezier primitives are tested for nearness to x,y

BITS_POLYLINE

Only polyline primitives are tested for nearness to x,y

BITS_POINT

Only point primitives are tested for nearness to x,y

BITS_ARC

Only arc primitives are tested for nearness to x,y

 

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_primitive2 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_primitive1, near_entity1, near_entity2, get_pgroup_item, pick_primitive