|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
0 g: {, r5 V: Z; b& }5 h5 m+ V0 ^- _
7 K! o9 y3 w8 a/ R
一种自定义颜色条的方法,直接可以用,可以作为CAE后处理
* b1 |' Z% }/ d% T/ W' L7 @9 ?+ A" V- M" C) |1 U7 y" t
) J9 i" p. q: A' `& G7 B
4 s. f" a7 w% {* b2 w. D7 ^, _
- , u* M- ^7 a7 i! Z
- / Q/ |/ B1 L( l
- ) h6 Y8 p3 u7 r/ N$ U+ @
- & b$ k# C. E- b3 m; y- `0 o
- void UI_ColorRangeUDB::UI_ShowColorMapBlocks(): F/ t( Z4 \! T, q: _7 S& i- o
- {
8 M3 w5 W) u$ Z: f# [- t( t' _ - int colorNum = integerColorNum->Value();4 l8 w" l8 z6 K1 C+ R
- vector<BlockStyler::UIBlock*> hiddenGroup;8 ^1 k3 U8 Z; D1 s+ F0 x
- hiddenGroup.clear();+ ?5 h0 `+ l6 V0 `
- vector<BlockStyler::UIBlock*> shownGroup;
, x, F$ z9 u& I4 y" W - shownGroup.clear();
* O6 E4 i% p/ c - string groupPreStr = "groupColorRange";
9 X# A) ?. C- S' E6 ` - string doubleUPreStr = "doubleU";
8 P+ r2 a$ M; e @ - string doubleLPreStr = "doubleL";
# \+ x7 C7 a& ]" [! p2 q/ Q - //get all the groups with the name str //groupColorRange68 k' G" P4 Q$ g+ Q3 ?- J
- vector<BlockStyler::UIBlock*> allBlocks = theUserDefinedUIBlock->TopBlock()->GetBlocks();
8 e1 m! \" O% ]+ _ - //type: Group name : groupColorRange
) g( ^! m8 X# d; S; X% h9 \ - //type : Group name : groupColorRange1( J! j6 Z: b& G
- //type : Group name : groupColorRange10' j, W. h% @0 Y k8 W; c9 K/ p- U
- //type : Group name : groupColorRange116 w4 O, j0 c) _4 R/ G
- //type : Group name : groupColorRange125 r' B) i" ~: ~$ h7 x
- //type : Group name : groupColorRange2
$ T% K0 _3 P5 \. F* u - //type : Group name : groupColorRange3
; w9 _$ C4 |1 a2 F - //type : Group name : groupColorRange4, _0 P! f- t9 `4 J
- //type : Group name : groupColorRange51 r4 A# c6 E! h; F$ ]4 z3 r
- //type : Group name : groupColorRange6 r4 l1 R' p& }! A
- //type : Group name : groupColorRange7
9 L5 L% ~0 `; y. O - //type : Group name : groupColorRange8$ z" m/ O7 ^( d0 x/ {7 W) R
- //type : Group name : groupColorRange9
0 ^" ]( b# Q" l- e$ \5 y - 9 w: F$ @; i! [8 @" |% _( m# Y
- for (int i = 0; i < allBlocks.size(); i++)
+ p* K i. s' p5 v8 C+ d2 O - {7 _- N: r2 n# f% j: U* `
- BlockStyler::UIBlock* tempBlock = allBlocks[i];
: t0 ]- V) A) P - if (isSameNXString("Group", tempBlock->Type().GetText()))# F: p* ?1 L5 F9 j/ m
- {9 B* o( Z/ f# H8 n/ q0 t
- string blockNameStr = tempBlock->Name().GetLocaleText();
( p9 e( w* w) Y+ I* g9 v" g* ] - size_t findIndex = blockNameStr.find("groupColorRange");4 K, P. Q1 K/ ~9 I
- if (findIndex != string::npos)- d# o1 z8 k* t( E3 q) m
- {
* k% J$ I) M7 D; Z2 o+ m - string subStr = blockNameStr.substr(groupPreStr.length());( V7 t8 r7 e) Z! i
- // Echo("%s", subStr.c_str());1 m! ~1 [/ @# l) {% ]) T/ o
- //Echo("%d -- %d", atoi(subStr.c_str()), colorNum);
$ {6 v, D1 n3 ]; O - if (colorNum >= atoi(subStr.c_str()))
* x, w k& s$ a1 c. n - {
1 z" X2 `; y& ^) y4 t+ u - shownGroup.push_back(tempBlock);
% k0 \1 d6 D! E2 v6 Z - }
. n- T6 o/ D1 ]; `8 \8 O - else/ C6 @: [% t2 H3 T* R! U2 b
- {
) ]' o* h. f9 c+ F - hiddenGroup.push_back(tempBlock);
5 S( A6 J: r) } - }" P- G# J2 R3 c+ R) l2 \
- }
( Q- n; Y; W8 l4 Y5 } - }% ~* L! Y" O& U4 V8 B' r
- }! M: t. A, e" m& s# u$ {" M
- if (!shownGroup.empty())( i2 T+ V, w* j
- {
; W. l$ C+ W% ?; w - for (auto a : shownGroup)
1 o, u/ n1 }5 ?* Q4 m1 Z- b5 N* b& @ - {
: c: K d _; @, E8 y - a->SetShow(true);9 S% T6 l8 H2 y
! q D! y- |4 F- }/ @' t0 j" Y. X9 Y2 i) \; D
- }
1 b) p0 t& E/ k& K6 h- {+ u; u - if (!hiddenGroup.empty())- N/ a" Y& D: f+ v7 c" u) o
- {' Q2 A, i5 v. ]0 D
- for (auto a : hiddenGroup)
( o. t4 U6 G( c" V$ r7 I+ j8 T. A% F - {
; p$ O. I8 M% Q$ J/ a& C5 L - a->SetShow(false);
/ H7 K6 n* e8 ~0 j - }
5 y: _! l% F- Z6 }9 t - }" q: `, Y) L3 ^ g' s$ O! `9 L1 |- w( J
- i' o9 ^' R4 ?- ]+ q% W k* G3 r
- //实时更新显示% Y( [8 u! K: }, z4 Z( H- h
- # r& [7 X- w/ Z7 Q
- UI_UpdateDoubleRangeValue();$ q+ X6 w' L- X: N. S7 _8 J
- }
复制代码
: Z9 t/ H3 M3 ^7 d* b) C
, P" Z/ z3 e% P% @' t
/ C3 f; p0 _0 d; d: ^ |
|