|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
( z- P3 A9 V' r# W) w* q: W- R& I
5 {2 N0 w: {% d3 e7 n+ F# B
& y0 r% ]& U5 E+ h. N3 M* I一种自定义颜色条的方法,直接可以用,可以作为CAE后处理
2 s/ b- T3 t/ i* p+ B" G k; J2 D) ^9 q! E2 n
; g& f5 Z5 j* _) x, ~/ Y, l7 _9 j/ s f: \" z' G
- / `: Y6 L6 U [5 w O& ?- R
- 6 }2 w3 R, T5 G. P* U) b. d
$ r4 ~' H+ T; h2 B0 N( O( h- % E* U9 S H# p
- void UI_ColorRangeUDB::UI_ShowColorMapBlocks()% [2 {! s& I6 E4 s9 u
- {
, ? B, ^0 X; X4 p- A9 F - int colorNum = integerColorNum->Value();
& L) \3 X2 C$ D, P+ } }+ E$ g - vector<BlockStyler::UIBlock*> hiddenGroup;
8 v2 D2 J+ s3 M8 r3 s. q - hiddenGroup.clear();
( ~+ N8 V% \8 R s/ t8 F/ \ - vector<BlockStyler::UIBlock*> shownGroup;' w& ~+ l4 t! o! q' X3 c1 L
- shownGroup.clear();: M! t% k6 T; P, p2 Z; @/ V
- string groupPreStr = "groupColorRange";9 D+ z7 ~( v& r4 t1 y
- string doubleUPreStr = "doubleU";% n0 k7 n7 C/ c$ y8 o4 }
- string doubleLPreStr = "doubleL";, M6 |2 X) c. g Y
- //get all the groups with the name str //groupColorRange6
" B; ]& M' e+ E6 x: Q4 B - vector<BlockStyler::UIBlock*> allBlocks = theUserDefinedUIBlock->TopBlock()->GetBlocks();& p R; I! j* w3 a
- //type: Group name : groupColorRange9 ~* h* {: v J/ M
- //type : Group name : groupColorRange16 [5 L* Z! ~0 O: h% `% d
- //type : Group name : groupColorRange10' O5 @& C# H/ a
- //type : Group name : groupColorRange11
+ r& `7 s3 z/ U+ f8 _. ^' d - //type : Group name : groupColorRange120 H7 n9 c4 Z& D; g- A/ Y4 t/ x) a
- //type : Group name : groupColorRange2
2 S) E- z! I2 x! R3 H# d - //type : Group name : groupColorRange3
# y7 t1 O, Y6 y* u - //type : Group name : groupColorRange4
+ w( r- n# n+ L0 |2 { - //type : Group name : groupColorRange5
) q: c, b' p8 C- N/ ~6 C! C - //type : Group name : groupColorRange6+ N) g- S( C( A, k3 g$ G& {1 l* m
- //type : Group name : groupColorRange7. J: Q7 x' ^$ J0 Z" S# g
- //type : Group name : groupColorRange8
" \, g% D/ o& T$ \2 h - //type : Group name : groupColorRange9& Z: \/ v# w- v) G3 l% g
- & T1 |" n. p8 T
- for (int i = 0; i < allBlocks.size(); i++)$ z. R% ^& t, w7 j5 Z; z
- {
P9 E3 f1 B, T; A3 \ - BlockStyler::UIBlock* tempBlock = allBlocks[i];
0 V4 z) N" Q/ r6 X" w' ?3 Z - if (isSameNXString("Group", tempBlock->Type().GetText())) X$ E4 t$ z1 u( h/ E* d& j! `8 j3 U
- {
/ ?0 y9 I# k% j7 Y - string blockNameStr = tempBlock->Name().GetLocaleText();
, F1 U1 [. a' D! F5 a$ b - size_t findIndex = blockNameStr.find("groupColorRange");0 n, \5 b$ P; R% o# c
- if (findIndex != string::npos)6 P1 b* ~' C& Q7 F5 S% @2 d2 V
- {
1 [$ C+ ^% g( V9 A0 L# o3 X+ E - string subStr = blockNameStr.substr(groupPreStr.length());
1 ] K4 o# e1 B - // Echo("%s", subStr.c_str());' I. O+ S% s( ? f+ U5 \! X
- //Echo("%d -- %d", atoi(subStr.c_str()), colorNum);
/ C; D- i$ |/ ^8 B - if (colorNum >= atoi(subStr.c_str()))" t0 h0 x2 U3 Z* P& [
- {
/ u+ w% f: R5 _% k; X - shownGroup.push_back(tempBlock);0 [7 y- J/ W8 h0 s
- }
v4 E L- x# C4 N8 ?1 s" R# M - else5 p: I* b2 j0 n1 U! g5 ]
- {8 t" \& F* O9 H. G/ G
- hiddenGroup.push_back(tempBlock);
! \* ~3 \. W& Z3 z. } - }; D8 S9 S; ^ X& g" {* F0 D, z' P
- }9 j& V+ ? H/ Z; Y8 `4 `; _
- }* ^+ k/ d( W, k5 M; j7 \
- }
; T8 ~! U9 h- A0 d% B+ B! S - if (!shownGroup.empty())
+ H0 K# s. |$ f3 @/ ^ - {
+ S. f% W; H' K& a( _( q - for (auto a : shownGroup)) g& {/ n- x6 c! d ]1 v
- {1 L6 F6 E) D* h( D$ ?
- a->SetShow(true);" q! v! a7 _! v X
8 V( g4 n9 e) |& Q2 E- }
7 N3 R& S X! Y$ u: i7 ]2 @ - }
8 Y% j& T4 M7 G" N2 \: k - if (!hiddenGroup.empty())
. U1 R4 m3 f+ \# { - {, s/ N# U$ R/ H5 B
- for (auto a : hiddenGroup)
0 T$ Y2 l5 E4 P1 I; [ - {
! k$ c* V2 t5 q! q+ H; a5 R - a->SetShow(false);
# \- d! T4 K1 }- @/ { - }& K: i! Z# e8 E, k: [
- }
l5 P" F7 q9 _+ a: q6 F/ g - ; U0 s0 @; [/ E& L. M" M9 [
- //实时更新显示# J# u7 F. T1 s% A0 ~3 K* D: C
" ~5 B6 z: {% g% R3 Q& d/ ~* f8 P- UI_UpdateDoubleRangeValue();
- W5 Y$ W1 | a; H/ x& R. y - }
复制代码
0 |2 }2 B$ j5 Q4 I* P4 g: {& i: @7 Q2 ~. {0 C' J
+ M& z' T+ }: M, { |
|