|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
+ g. E2 Z2 n5 M1 X. N7 S K, n8 b8 x( T' ?
NX二次开发源码分享: 高亮镜像Wave linked的面
9 c$ C) m; x9 f2 C
5 ~$ p5 f( c' v4 i$ wstatic void highlight_mirrored_face(tag_t face)' ]& Y, i% r3 x, q
{$ J5 ^5 s# @( F& C ]9 m% ]+ A
int
. e1 P- R( Y- l, a/ i. E( F ii,/ K- v8 s: r' c5 ?( ~( X2 `
jj,# |1 ^( W# H) o1 n1 A
n_feats,
7 a6 l7 T9 L% d) z! U7 n6 Q; n2 D1 P n_items;
6 I, f* U/ d5 g8 _ char
+ h2 K8 s- [% m! h& F *feat_type;
4 R8 x( W, X, a tag_t0 H2 j2 b' o" R9 R( C+ S
*feats,
4 v; h+ s) r6 @' A2 c mirror,- \% n9 K0 x- ~$ N5 W/ Z
*results,+ L5 P( B0 \ v1 Y5 L
*sources;
' W% l6 j: p) `( e3 K. \
/ i/ L: w s p1 ~/ V) v n_feats = ask_face_feats(face, &feats);8 x: U2 g* M! O/ u9 j6 V9 i
/ n9 ?% {5 x6 h, q, Y9 Y. V7 y for (ii = 0; ii < n_feats; ii++)
: p2 y7 L: X0 w* t& A- H {
, s1 p; Y4 G! b UF_CALL(UF_MODL_ask_feat_type(feats[ii], &feat_type));
& Q2 r* z: H8 H c& s8 d4 w if ((!strcmp(feat_type, "MIRROR")) &&1 s( S# R u$ u( z
! UF_CALL(UF_WAVE_map_link_geom_to_source(feats[ii], face, TRUE,
& m4 K6 \7 K; o d" a/ L( ` &mirror)))
6 P0 q8 c7 S& @- f/ G; e {4 M3 R; G$ f% ]
, @) X! v0 N/ R _0 ~6 [ /* Begin work around to PR 4244233 */
9 j- S+ p: V2 _5 ~ if (mirror == NULL_TAG)! l; {8 D% `9 }6 j% L1 B4 A, @3 R
{* U) w5 ?; d) C7 n# E( E
UF_CALL(UF_WAVE_ask_linked_feature_map(feats[ii], TRUE,
9 d2 \* r$ K# j: R7 S5 s+ p1 { &n_items, &sources, &results));
2 `" \) b( e' `+ {, B6 | for (jj = 0; jj < n_items; jj++)' S, z2 q; B! ^9 U( o m& D
{
! j1 J& Z+ d1 K. E2 `- ^ if (results[jj] == face)
$ _7 [. @* o _2 W {: m+ h* @) {# E8 U1 a
mirror = sources[jj];
' W) }1 ~& k5 P break;& U: `, d! b& s! N
}0 l3 u& X" r8 P9 G+ ^) c
}
i b$ x: W/ n5 b9 \3 d if (n_items > 0)
3 ?' c% c ]% r% B {) s& N7 [7 B2 d* \
UF_free(sources);
; f, A5 i9 K2 O4 O' t2 ^ UF_free(results);
& s5 V( P" E$ f3 H! E; k3 ~ }
. u# `/ j% o B2 r }7 T$ N. K0 K1 ~
/* End work around to PR 4244233 */8 E) u* A1 W, K, S6 M
$ d% g5 \( g% T) }6 P' z UF_DISP_set_highlight(face, TRUE);4 u6 K! d& r3 p7 k5 m9 v
UF_DISP_set_highlight(mirror, TRUE);
8 g5 r! V3 E1 I. [ uc1601("Mirrored face highlighted", TRUE);2 ^' }9 a0 h# p7 V
UF_DISP_set_highlight(face, FALSE);
1 _ T1 K0 i- ^/ m' ^/ w8 p UF_DISP_set_highlight(mirror, FALSE);. Z* F) f/ ]: C4 `
}
, {! I, r" F8 n& I- P6 ?- ]* _: ` UF_free(feat_type);
. E! E" A& j2 h. W0 z! k8 [- J }5 S2 a& ?6 s% b2 s
# Y7 {) G5 J! f. `" f% M
if (n_feats > 0) UF_free(feats);
- U/ ~* @& U2 n! Y+ l) B l: p' W}9 Z M% n* l0 y4 {1 n2 ?
4 O7 {* i) r4 j& `0 U |
|