Soft Selection

If you have implemented geometric classes, you might want to support the new soft selection feature introduced in V6.

In version 6 handle selection state is no longer a boolean. Handles may be say 50% selected. Correspondingly all the transformation tools will transfom such a points with 50% weight.

Geometric classes defining handles typically handle the R3PRIMM_TRANSFORM method as follows:

    for (i = 0; i < self->numpoints; i++)
    	if (self->selected[i])
	    R3PrimTransformPoint(&self->points[i], tr, mat, invmat);

To support soft selection change the above code to following:

    for (i = 0; i < self->numpoints; i++)
        R3PrimTransformPointSelected(&self->points[i], tr, mat, invmat, self->selected[i]);

The new R3PrimTransformPointSelected() will use the value of the self->selected[i] as weight. The value of 0 means the point is not selected and won't be touched. The value 255 means the point is fully selected and the transformation will be applied to it in its full extend.