找回密码
 注册
Simdroid-非首页
查看: 59|回复: 2

[二次开发] 求助,有关视图设置问题

[复制链接]
发表于 2010-8-20 16:34:23 | 显示全部楼层 |阅读模式 来自 广东东莞
这个是帮助里面的例子,但运行后发现只能对末更新的视图进行设置,
不能对己更新好的视图进行设置,不知道那位知道否!多谢

/*
* 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)
    {
        /* LWAYS retrieve the view's current display parameter
           settings before changing them.A
        */
        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.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();
}

评分

1

查看全部评分

发表于 2010-8-26 20:13:44 | 显示全部楼层 来自 北京
Simdroid开发平台
DRF类应该有函数可以实现此功能,查找一下函数帮助文件。
回复 不支持

使用道具 举报

 楼主| 发表于 2010-9-2 15:03:21 | 显示全部楼层 来自 广东东莞
多谢问题解决,,应先UF_VIEW_ask_tag_of_view_name (view_name,&view_tag);
问到地址再设置

评分

1

查看全部评分

回复 不支持

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Simapps系列直播

Archiver|小黑屋|联系我们|仿真互动网 ( 京ICP备15048925号-7 )

GMT+8, 2024-9-23 00:39 , Processed in 0.048956 second(s), 13 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表