/*
 * The code in the following example sets the view display preference for
 * the member view in the drawing. For simplicity, it assumes that the
 * drawing units are English.
*/
#include <stdio.h>
#include <uf.h>
#include <uf_draw.h>
#include <uf_draw_types.h>
#include <uf_obj.h>
#include <uf_view.h>
void ufusr(char *param, int *retcod, int param_len)
{
    char                drawing_name [30] = "";
    char                view_name [30] = "";
    char                error_message[133] = "";
    tag_t               view_tag = NULL_TAG;
    int                 ifail = 0;
    UF_DRAW_view_prfs_t view_display_parms;
    ifail = UF_initialize();
    if (!ifail)
    {
        /* get the name of the first drawing. */
        ifail = uc6492 (drawing_name);
    }
    if (!ifail)
    {
        /* get the name of the drawing's first view. */
        ifail = uc6499 (drawing_name, view_name);
    }
    if (!ifail)
    {
        /* get the view's tag. */
        ifail = UF_VIEW_ask_tag_of_view_name (view_name,
                &view_tag);
    }
    if (!ifail)
    {
        /* ALWAYS retrieve the view's current display parameter
           settings before changing them.
        */
        ifail = UF_DRAW_ask_view_display (view_tag,
                                          &view_display_parms);
    }
    if (!ifail)
    {
        /* change the view's display parameters */
        view_display_parms.hidden_line =
           UF_DRAW_hidden_line_removal_off;
        view_display_parms.hidden_line_color = UF_OBJ_BLUE;
        view_display_parms.hidden_line_font = UF_OBJ_FONT_DOTTED;
        view_display_parms.hidden_line_width =
           UF_OBJ_WIDTH_NORMAL;
        view_display_parms.edge_hiding_edge =
           UF_DRAW_edge_hiding_edge_off;
        view_display_parms.silhouettes = UF_DRAW_silhouettes_on;
        view_display_parms.uvhatch = UF_DRAW_uvhatch_off;
        view_display_parms.smooth = UF_DRAW_smooth_on;
        view_display_parms.smooth_edge_color = UF_OBJ_BLUE
        view_display_parms.smooth_edge_font = UF_OBJ_FONT_DASHED;
        view_display_parms.smooth_edge_width =
         UF_OBJ_WIDTH_NORMAL;
        view_display_parms.smooth_edge_gap = UF_DRAW_gap_on;
        view_display_parms.smooth_edge_gap_size = 0.1;
        view_display_parms.virtual_intersect =
         UF_DRAW_virtual_intersect_on;
        view_display_parms.virtual_intersect_color = UF_OBJ_CYAN;
        view_display_parms.virtual_intersect_font =
         UF_OBJ_FONT_DASHED;
        view_display_parms.virtual_intersect_width =
         UF_OBJ_WIDTH_NORMAL;
        view_display_parms.vitural_intersect_gap =
         UF_DRAW_gap_on;
        view_display_parms.virutal_intersect_gap_size = 0.15;
        view_display_parms.tolerance = 0.0001;
        ifail = UF_DRAW_set_view_display (view_tag,
                &view_display_parms);
    }
    printf ("UF_DRAW_set_view_display sample ");
    if (ifail)
    {
        ifail = UF_get_fail_message( ifail, error_message );
        printf( "fails.\nError is: %s\n", error_message );
    }
    else
        printf( "is successful.\n" );
    UF_terminate();
}

