|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
* U$ w) H7 c8 q' b1 v9 F! F6 n8 y, J& |: l
* U# F5 E7 e( i9 F* a4 D* ]3 z) ~一种自定义颜色条的方法,直接可以用,可以作为CAE后处理
: u- _% E, ^. @+ d2 A; O
$ \" `+ @3 ^" `8 J( V, v
! v$ f4 ?& R0 K
. \' z! m# S8 I% ]' g- ) i& C0 @1 v1 I- O7 n
- - R; j" S0 Y2 t6 ?8 W0 g( ?, n
) H. d# ]4 D" u3 s: f0 u, h- ( C: T. l5 A( M) [! U- t
- void UI_ColorRangeUDB::UI_ShowColorMapBlocks()/ l7 R7 [+ f0 O; H' C6 `' N0 c$ l
- {
( s1 O$ H* v8 K7 z - int colorNum = integerColorNum->Value();$ `% Q* r. ~4 X% @* K( D& R
- vector<BlockStyler::UIBlock*> hiddenGroup;
+ x# m* x2 _& v6 c6 h - hiddenGroup.clear();
+ b; b$ z' K; v9 H - vector<BlockStyler::UIBlock*> shownGroup;
7 S: L8 S' o$ Z ?$ ?. R) n" Q - shownGroup.clear();
- i1 j3 t6 Y' b% z. G9 |" o+ a W - string groupPreStr = "groupColorRange";
# P/ v9 _, e/ a" f - string doubleUPreStr = "doubleU";
" y" p5 A' m' s' q - string doubleLPreStr = "doubleL";! f& p0 N( ]: w& m, M
- //get all the groups with the name str //groupColorRange6
3 j5 k* G! y, f9 { - vector<BlockStyler::UIBlock*> allBlocks = theUserDefinedUIBlock->TopBlock()->GetBlocks();6 W$ Q6 E& w1 @5 O
- //type: Group name : groupColorRange: ?3 l o3 ~3 H) ~
- //type : Group name : groupColorRange1
( e+ u/ Z% o' h) ^ - //type : Group name : groupColorRange10$ o. R6 g; B5 B
- //type : Group name : groupColorRange113 c# ]* E. \/ r1 g$ P ]1 T, F1 J
- //type : Group name : groupColorRange12( R% ^/ l9 x/ F6 s& T6 ~
- //type : Group name : groupColorRange2
5 k* I0 C' R1 u& u - //type : Group name : groupColorRange30 H4 j1 _( D. W& H
- //type : Group name : groupColorRange4
/ ~ t$ l$ B0 u L* k' { - //type : Group name : groupColorRange5/ Z" `. K1 J) j& K* |4 b0 j
- //type : Group name : groupColorRange6
! |$ x! ? @2 Z p+ F - //type : Group name : groupColorRange7* n9 x0 w% Y* ^ E6 `
- //type : Group name : groupColorRange8; j0 M4 Y8 y/ e. `1 F6 J
- //type : Group name : groupColorRange99 f/ z: G {! f; \- |
- / s/ r, _( r% ]( I$ c. v
- for (int i = 0; i < allBlocks.size(); i++)0 [) B H% q* f( I& b* |
- {
$ V- k1 }* A, G7 b" | |4 [9 \" i - BlockStyler::UIBlock* tempBlock = allBlocks[i];3 _! M) G- t$ S9 }
- if (isSameNXString("Group", tempBlock->Type().GetText())), d- h# w( U% M7 {9 h) t$ r4 C8 G
- {/ w+ [( s' r' Y# J
- string blockNameStr = tempBlock->Name().GetLocaleText();
' I9 {7 W& Z% M( E. I0 J' r' V - size_t findIndex = blockNameStr.find("groupColorRange");* _0 F) \: n9 ]. ~& b# Y
- if (findIndex != string::npos)
3 f+ z! m3 I, P8 s0 Y& V; s$ g - {& W ]5 T' h/ a- u4 Q6 J
- string subStr = blockNameStr.substr(groupPreStr.length());1 a) u2 c' A5 g# B, c. g" ]
- // Echo("%s", subStr.c_str());
) e# X0 m4 X- v" V - //Echo("%d -- %d", atoi(subStr.c_str()), colorNum);/ P z. }1 i: @
- if (colorNum >= atoi(subStr.c_str())). E. E' ^# \: w# d
- {
6 `% e2 T% C8 a0 ^, c5 P3 [ - shownGroup.push_back(tempBlock);
$ J5 K2 ?& k1 ~7 @ - }- P. K0 k9 T4 H4 `5 I# r( X/ F
- else m; e$ h- v* j+ v5 V, V
- {
$ N; n% e/ Z8 H0 m5 l3 r4 Y - hiddenGroup.push_back(tempBlock);
9 S& |! E \3 H1 ~ - }
J: T' r+ \; F1 h9 z - }, d O) _4 S& h; C. V3 b0 v2 K o
- }
; I5 {# P) ?7 Y/ j. H, N) Y - }! i. O F) ~1 _# F; ?
- if (!shownGroup.empty()). X; N# o0 N3 p
- {
& ?1 a9 x0 w( `+ P4 d - for (auto a : shownGroup)
: H* t7 W0 ]5 X) t - {
% S+ I7 k/ z/ j- l+ g - a->SetShow(true);
# d9 t* u( a8 i& Y s, J% h - # t" m* E) e4 ?- u% P1 {, K
- }% t1 |9 [8 ]1 k- c8 [/ M
- }: O7 `8 R1 k: P( P2 f4 r% v; K
- if (!hiddenGroup.empty())) Z/ M1 @ E6 _& B6 i* o$ t
- {
' }; @ p N8 `$ v* a - for (auto a : hiddenGroup)' R5 U7 L h- k) n2 w$ o
- {- V. W: Q I8 Y! P3 {# _8 o+ D; M, M
- a->SetShow(false);6 G" k: W3 F5 \) b+ `
- }- U: i0 m* A) Y" c
- }/ @8 i/ F1 E. I/ h
3 x* r5 z( ~% k2 q4 y- //实时更新显示7 V" }0 X7 I; t, p9 f
) r8 U! ]4 y( S7 m# z `- UI_UpdateDoubleRangeValue();
, E* u. H$ y7 a3 r# Y3 }* H1 r - }
复制代码
: v( @1 Q( C9 i% x! D' m( N
) w- b, v; b9 |3 k( L1 C( i1 A# O3 C6 V- |
|
|