|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
×
" ^3 |% B! x+ u, D2 d- l7 G, p) R, V0 k" k
& b6 m; h$ A9 H- m( f1 q8 U6 E( P9 B一种自定义颜色条的方法,直接可以用,可以作为CAE后处理
o/ a2 |1 u- [) Z/ T- k$ A1 L* l3 t7 e) M
3 h$ e2 g2 y5 [& z
& h: H7 s/ z6 b) n h
; N& C4 g; s! D" h# t- ; H4 f1 G- i2 o" a! C* u
- % b& }! u, D+ d" G
- 8 Q2 M5 `/ @$ f2 Z1 [& g' D
- void UI_ColorRangeUDB::UI_ShowColorMapBlocks()3 p/ J) k( u" E; w1 e+ a
- {% O# {: o- C3 {4 \7 {* t
- int colorNum = integerColorNum->Value();3 {5 ] a/ D9 `- z6 a% |* a( m
- vector<BlockStyler::UIBlock*> hiddenGroup;/ ~8 {, a# Q7 I4 `
- hiddenGroup.clear();% A3 U6 ?$ ]% T# p! B3 O7 l
- vector<BlockStyler::UIBlock*> shownGroup;7 A" w3 X1 _( ^' x% g
- shownGroup.clear();
3 Q m, Y' U. Q; u. h, s L: p4 p - string groupPreStr = "groupColorRange";
# W" n, R1 z2 L/ ~ - string doubleUPreStr = "doubleU";) I3 @" o7 y8 M
- string doubleLPreStr = "doubleL";( b) T/ o+ J* x/ S9 K
- //get all the groups with the name str //groupColorRange6
4 V9 k) i- l; x - vector<BlockStyler::UIBlock*> allBlocks = theUserDefinedUIBlock->TopBlock()->GetBlocks();7 H* [. x9 Z6 e( R, b0 h
- //type: Group name : groupColorRange, _1 a& d3 S8 t/ b( @/ r: B
- //type : Group name : groupColorRange1; |0 L- `. i2 @
- //type : Group name : groupColorRange108 K9 R! V) { n3 ?/ {; y' d
- //type : Group name : groupColorRange118 Y/ I) M; `8 b7 s0 B1 R0 u6 M
- //type : Group name : groupColorRange12
' m0 j9 o* ?7 O( s- u% d) D - //type : Group name : groupColorRange2: R( I$ Z" A' n" j
- //type : Group name : groupColorRange3
2 L9 `, ]. n: ^" Y( ^ - //type : Group name : groupColorRange4. s0 G e9 N! [1 S9 w
- //type : Group name : groupColorRange50 A I; F( Y; D+ n9 l2 B5 g
- //type : Group name : groupColorRange6
# g5 ~. y5 M ]& q( o; z - //type : Group name : groupColorRange7
9 s/ [$ m4 G; q+ t/ L2 h9 f8 d - //type : Group name : groupColorRange85 G3 L* H, b9 A, e
- //type : Group name : groupColorRange9
) T/ U7 F7 b0 g: u y; _) ~ - + z+ k& i6 x- f/ B# H* @2 J
- for (int i = 0; i < allBlocks.size(); i++)' k1 k4 Y+ Z \$ W3 o7 `" T2 s
- {* W/ _* t1 ~7 x5 G
- BlockStyler::UIBlock* tempBlock = allBlocks[i];
( J# [3 h0 L2 ?4 g+ J2 b* w+ V - if (isSameNXString("Group", tempBlock->Type().GetText())), C9 U6 y& n$ A) z
- {" p" X9 |/ X1 S% w
- string blockNameStr = tempBlock->Name().GetLocaleText();
4 N2 |- h3 \: J - size_t findIndex = blockNameStr.find("groupColorRange");
0 @' I( `& F. W* P& ] - if (findIndex != string::npos)$ @7 `( e) O% B' u. E: q
- {# b0 \% t/ g) I: D! R ~
- string subStr = blockNameStr.substr(groupPreStr.length());3 k Y4 Q( ~: W6 o
- // Echo("%s", subStr.c_str());$ F& N: x" f, H
- //Echo("%d -- %d", atoi(subStr.c_str()), colorNum);
! r' z: O- D7 c9 b - if (colorNum >= atoi(subStr.c_str()))
# ]0 R. \" E; d$ N( |: c - {
. s5 u6 _# t7 J# c: L; f: p, I% P - shownGroup.push_back(tempBlock);
; a! I8 ?0 I1 _; q! e! y& U - }
+ `2 f& y9 r+ H$ `; L - else
$ h6 i/ O/ E, k- n6 v! c$ d - {& F, s3 `3 c+ ]$ p+ i! a* k0 @$ F3 U
- hiddenGroup.push_back(tempBlock);
/ _+ ]( s7 A% K+ u - }
1 h2 l3 L% f; m h! n% {' p0 v ?$ R - }3 `' w4 z5 p/ ]2 E
- }+ g( D$ _+ X+ a
- }
; Y/ I- E' i4 ]* Y H Y - if (!shownGroup.empty())) o9 R& i; q9 [1 w# G/ M
- {. N# W U% s7 f, p
- for (auto a : shownGroup)
7 i, ^$ ~! z/ Q' Y - {6 ^8 r, L+ Z# f0 z, i+ O' y) _
- a->SetShow(true);
7 z0 i$ ?5 z1 k2 j# l [+ j
# }5 s4 w5 [& p4 F- }
9 |% @! i, k# b/ \5 I1 j# a - }4 z2 E* G* V6 e' P# n2 A
- if (!hiddenGroup.empty())
" [# ^/ P' q% D8 W - {
0 F: M9 s: b0 r$ R7 |, {2 z: i - for (auto a : hiddenGroup), |7 e0 ^, Y0 y
- {
$ C) j6 i, s* {3 n, R( i( } - a->SetShow(false);- W3 Z: ?! k3 \* N" `5 B7 d
- }
2 k' o* K2 d; q/ X - }8 G! g9 w6 n" S, @/ j
/ S' m" R b+ l8 { O; i- //实时更新显示: E9 u+ v- r. ]
- : a. S, t$ H' O* v* [9 [. K- X
- UI_UpdateDoubleRangeValue();/ y3 J# Y& e/ {& @ m q
- }
复制代码
1 M3 s0 s" |7 M& B! x. _, C- S/ f O' t
' B5 t/ \6 \& {4 _
|
|