|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
; x' {; c$ }* u3 o
4 n& F; [( U; Q3 n
- c* G3 \" o n6 F一种自定义颜色条的方法,直接可以用,可以作为CAE后处理
. S9 v/ _( h: s) y
3 A q( D8 @5 ~- j: b8 a
7 E3 ]+ t, q1 c3 n* j# O: \& b# X$ I( l& w. r/ x- d( r
" x2 N8 X) d9 {) V. [$ D
3 k% g$ c6 q: Q. U9 O
y" P8 X4 w8 u$ r/ T: |! N4 ?- J' s2 t; D/ X4 N" }: n
- void UI_ColorRangeUDB::UI_ShowColorMapBlocks()9 k0 E$ f2 B2 ~8 E0 {
- {
! r/ P; s/ S4 @7 _" I - int colorNum = integerColorNum->Value();! S0 w' H0 G. D0 H0 Y+ \' s" x# M
- vector<BlockStyler::UIBlock*> hiddenGroup;2 U4 n+ A4 q0 w4 b7 T" a
- hiddenGroup.clear();
$ v+ u2 l$ T9 ^( U- ? - vector<BlockStyler::UIBlock*> shownGroup;
* I9 d2 N+ @! H, o7 v2 | - shownGroup.clear();6 j. Q7 [3 a$ ^' ]
- string groupPreStr = "groupColorRange";
7 l: A3 j! i* r4 a1 b) |$ h - string doubleUPreStr = "doubleU";
; j3 \0 c& H" O' m1 r - string doubleLPreStr = "doubleL";
4 }9 C) i8 @0 F9 g% k - //get all the groups with the name str //groupColorRange6
; x2 L0 E! N ~' k - vector<BlockStyler::UIBlock*> allBlocks = theUserDefinedUIBlock->TopBlock()->GetBlocks();8 m5 N7 O$ o9 f: Z2 n
- //type: Group name : groupColorRange
( G* E" h1 @8 D0 [8 e2 g$ v - //type : Group name : groupColorRange1
) C% V7 D; a7 k9 l$ o8 P: c; l - //type : Group name : groupColorRange10( j9 x; e9 l* c, h4 M# G
- //type : Group name : groupColorRange11
$ c# P; c+ l& h# ~9 s - //type : Group name : groupColorRange12
8 B/ P* Y8 E# ]2 i - //type : Group name : groupColorRange2
2 E0 b' e( `9 g! C d# C+ R - //type : Group name : groupColorRange3
- M$ o/ ^4 \- l - //type : Group name : groupColorRange4
1 j! ]& o1 y8 n4 [) i+ q - //type : Group name : groupColorRange5
" V" Y2 y8 P4 l3 d- ^ - //type : Group name : groupColorRange6
. n, c0 W8 O" ~) t - //type : Group name : groupColorRange75 p+ V2 S- F- c2 K
- //type : Group name : groupColorRange8" @0 X) G' {3 F
- //type : Group name : groupColorRange9
& ]* O& @/ ?! t& n: Z i3 S1 w
G) I' ^' O$ i7 H2 ]) K- for (int i = 0; i < allBlocks.size(); i++)
/ s# Q6 |# o/ _7 q% t- F$ A) @ - {6 y( ^& _3 A' A0 y
- BlockStyler::UIBlock* tempBlock = allBlocks[i];. J8 I/ M$ X0 h/ {; V7 s4 n$ o
- if (isSameNXString("Group", tempBlock->Type().GetText()))3 ?) ^# i% O. n7 R& T$ C; f9 ^) Q
- {
) \1 V$ b8 J) k/ [. |0 b# r% s - string blockNameStr = tempBlock->Name().GetLocaleText();+ v" B, S2 \5 `
- size_t findIndex = blockNameStr.find("groupColorRange");1 D# c1 K: n6 s4 v; h" p
- if (findIndex != string::npos)
$ }# y6 Z2 S+ \ N - {+ i |) N! H$ E2 e
- string subStr = blockNameStr.substr(groupPreStr.length());
3 r' \& s; F% j0 u* u1 k' Z- i, c - // Echo("%s", subStr.c_str());% r( R* z( L' k$ k$ x( q3 q
- //Echo("%d -- %d", atoi(subStr.c_str()), colorNum);
; d: i, s" I1 ?# H3 d3 j) N( S - if (colorNum >= atoi(subStr.c_str()))' _8 b- C# L4 v
- {$ P8 l3 C( x( D+ _; d& ~- {, }" ]
- shownGroup.push_back(tempBlock);
4 _/ x; J2 q7 @* u! c) t - }1 z8 E! p5 i( |+ i
- else
& V$ I% ~( P: {% d4 I% z4 g1 U) c4 F) n - {
! g, n/ Q* s: K. o - hiddenGroup.push_back(tempBlock);: {: b% ]% U% @# X: w; u" F' Z I
- }, ~7 e; ]5 n2 i& ^$ X+ _
- }; k1 d% p$ h9 C# \5 m5 C/ M
- }% n" i. Z! O* D7 c$ ^7 \: f* Q
- }
: j7 ?1 B- O7 A - if (!shownGroup.empty())8 H! O$ i E h1 F% L+ W
- {
0 X9 c, T ~: D8 h& Z$ M( \ - for (auto a : shownGroup)* k+ @2 y7 L# J1 N/ S5 t/ L; |1 H S* q0 c
- {2 `" f( \$ \, |5 ^! k3 H/ w9 f
- a->SetShow(true);+ l- A# v" R- l( W3 D$ v ~
- 2 y z( S+ {$ H
- }
8 p. \! h4 z1 e9 Z3 s" m7 R- F - }
: K1 Q/ \! L' i - if (!hiddenGroup.empty())
/ ^# M/ W! l: ]( R( Z - {
5 J; U4 s: c, O9 F+ f! s0 H3 e - for (auto a : hiddenGroup)
5 y( A" H& Y6 ^, h - {4 x# r$ K, I/ p* X
- a->SetShow(false);6 f; ?: Z c4 g, v \2 U6 y
- }
: R. s; o* i6 X; k- b9 }. p - }, h1 M% u, f' W
- 1 t }1 N' _+ W, t `+ A
- //实时更新显示
% {8 M( O( T2 A- n+ m
* x. s0 t- ]! a- H( }- UI_UpdateDoubleRangeValue();
9 d# w# [8 g9 ^ ]" B) n7 c - }
复制代码
( e' O% D- \/ ?7 X2 [
, F8 C9 |5 s5 K- |: {
) [& l6 m/ B% H* ~; X. m; j: P, f* B+ T& f |
|