/*===============================================================*\
FUNCTION: UserConeAngDisp()
PURPOSE: Display the angle of the selected cone.
\*===============================================================*/
int UserConeAngDisp()
{
int sel_count;
double angle;
ProError status;
ProModelitem p_mdl_item;
ProFileName msgfile;
ProGeomitemdata *geom_data = NULL;
ProSurface surface;
ProSrftype surface_type;
ProSelection *psels = NULL;
/*------------------------------------------------*\
Prompt the user to select a cone.
\*-------------------------------------------------*/
ProStringToWstring (msgfile, "Message.txt");
status = ProMessageDisplay (msgfile,
"UG7 Select Cone to Evaluate:");
if ((ProSelect ("surface", 1, NULL, NULL, NULL, NULL, &psels,
&sel_count) != PRO_TK_NO_ERROR) || (sel_count < 1))
return ((int)PRO_TK_GENERAL_ERROR);
status = ProSelectionModelitemGet (psels[0], &p_mdl_item);
status = ProGeomitemToSurface (&p_mdl_item, &surface);
status = ProSurfaceTypeGet (surface, &surface_type);
if (surface_type != PRO_SRF_CONE)
{
ProMessageDisplay (msgfile,
"UG7 Surface selected is not a Cone");
return ((int)PRO_TK_GENERAL_ERROR);
}
status = ProGeomitemdataGet(&p_mdl_item,&geom_data);
angle =
fabs(geom_data->data.p_surface_data->srf_shape.cone.alpha*180.0/PI);
status = ProMessageDisplay (msgfile,
"UG7 Cone angle is %0f",&angle);
return ((int)status);
}