|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
" ` L1 H( D. M2 H
* ?7 x1 ?3 [ B6 S( N
0 ^$ l* H+ i, [3 z/ @' H/ @一种自定义颜色条的方法,直接可以用,可以作为CAE后处理: n1 w$ I5 F8 T, h6 A, x
: K) M3 a. A' K6 w1 C1 n% Y
0 A6 i- W$ A7 y5 u( G& |
% x; {6 e8 a3 C
n0 a: M" j% S( r s- ! J1 k* m3 P( x, S4 }7 s
- v% K8 B: d6 h- + Z% z6 F+ b8 b- H
- void UI_ColorRangeUDB::UI_ShowColorMapBlocks()
, ~. a3 V8 N7 i% T; j - {
3 R4 @# U# u; ~, I- W - int colorNum = integerColorNum->Value();
( m/ ~5 |# E" B2 o; ~ - vector<BlockStyler::UIBlock*> hiddenGroup;. ], k" z$ _# u% j# J
- hiddenGroup.clear();
& J3 d8 U6 N; |7 X$ O - vector<BlockStyler::UIBlock*> shownGroup;; D" N5 |. \/ T+ U2 X9 P* K
- shownGroup.clear();; J( y* \9 g/ v1 n0 G
- string groupPreStr = "groupColorRange";
: U5 T0 d, ]6 x- s7 s1 S1 T - string doubleUPreStr = "doubleU";
( D: f. ^' g- |( J- |9 m- u m7 O - string doubleLPreStr = "doubleL";" @1 c7 z' z( e2 B3 a) W
- //get all the groups with the name str //groupColorRange6. _+ J1 {% i4 x" K
- vector<BlockStyler::UIBlock*> allBlocks = theUserDefinedUIBlock->TopBlock()->GetBlocks();3 e8 q. t, I% a! }$ O, S6 t$ C6 ~8 A* g
- //type: Group name : groupColorRange4 K" K( h3 W1 c( d2 d
- //type : Group name : groupColorRange1+ |* X; }: i* d6 m: @2 }$ Y; e% W
- //type : Group name : groupColorRange105 k3 y& c! D$ G5 W0 C0 @0 @
- //type : Group name : groupColorRange11
8 Q) a( U. v2 q - //type : Group name : groupColorRange12
: g+ q& s& a- g/ m3 j* |6 b - //type : Group name : groupColorRange25 [$ m7 |1 K8 ?- j( U, S; ~) `" r
- //type : Group name : groupColorRange3
$ }# Z* a# P* j5 _& Y( l$ _ - //type : Group name : groupColorRange4
5 v7 Y% o* p1 L5 a+ B. X/ f/ m - //type : Group name : groupColorRange5
& Q' [9 ~- {' v4 L/ m! m7 t% g - //type : Group name : groupColorRange6
+ H: I& z l+ a9 M - //type : Group name : groupColorRange7
! `% P& `4 S* }0 z9 K3 l2 s - //type : Group name : groupColorRange8
% V' C5 r3 J, @! Q - //type : Group name : groupColorRange9% N& V* n/ N% U3 F" r" f; D4 \+ I( y
: N# W7 a0 v" u4 Z3 \" b4 V5 X- for (int i = 0; i < allBlocks.size(); i++)
1 v+ p8 t2 x( @% T - {) O) f4 R$ O% ]" E) w: r
- BlockStyler::UIBlock* tempBlock = allBlocks[i];
- o/ i- N$ S, u! M( z - if (isSameNXString("Group", tempBlock->Type().GetText()))
& g3 B# f- o" B Z; z% i" q - {& f6 m1 z4 t5 \# \6 ]
- string blockNameStr = tempBlock->Name().GetLocaleText();
9 |6 _* {: A- s - size_t findIndex = blockNameStr.find("groupColorRange");( b+ g; x0 K9 f5 ?8 {
- if (findIndex != string::npos): i& i/ ?$ H9 ~
- {) n5 J' ?5 m& }, X+ u5 ~
- string subStr = blockNameStr.substr(groupPreStr.length());
. j6 s/ m# N/ z5 q1 c9 @ - // Echo("%s", subStr.c_str());" b: `: g8 Z) \7 M! u
- //Echo("%d -- %d", atoi(subStr.c_str()), colorNum);" y$ O1 s. _% j7 d4 f. T6 @4 F
- if (colorNum >= atoi(subStr.c_str()))
* n, g( t0 t& T - {+ H1 Q; d1 c, R0 d, F
- shownGroup.push_back(tempBlock);! T5 f+ I3 L* ~; L& X. c
- }) B4 a1 t. V* J+ q8 V1 h
- else
3 G8 S7 s: z' z" B- {( t - {1 Z- h7 T! m! [* p
- hiddenGroup.push_back(tempBlock);
9 x) d, [% j, T2 J - }
/ h9 A9 F# W9 ], A' N' y& D - } s* k7 K# v7 ^, w; ^4 K( H$ D
- }
1 W& t: ]! X' T' s% `# r; [4 w - }
1 P$ ~. O" t9 k6 I E' y3 m - if (!shownGroup.empty())
4 a: ^* _; `2 |3 k% Y8 k) \ - {
$ Z$ j- b- e9 x9 A - for (auto a : shownGroup)
+ j- A$ n2 ~) A) J8 K - {5 Z q! A1 u3 L3 m5 x
- a->SetShow(true);0 w+ {1 n t& s- S/ C* @% S
- 8 P5 M0 |7 d" Z5 f. [! O/ g
- }! U/ u8 I9 I- e0 J4 S! Y0 ^) Y
- }% T$ X* F" ^# r2 t
- if (!hiddenGroup.empty())
$ W5 r1 g2 d8 B1 |' m2 r - {
( M4 D% b) w) y8 j( Q( W6 s" ~3 H - for (auto a : hiddenGroup)
( @; a. W2 @) F6 U - {
5 h! R% _$ F5 Q - a->SetShow(false);- m) O) L" L4 c& q* }/ r
- }
) K+ ]& y( o9 D4 } D; Z- L/ @& J& p - }
5 [6 S7 {7 A- a; T8 W q1 c - ( `" O* y5 G) \( W/ G( | L" B7 {
- //实时更新显示/ K6 \- M+ W: f/ @2 L
- - N6 S0 V+ Y9 V/ E# Z4 k
- UI_UpdateDoubleRangeValue();
- ~7 @, k- C( i& C( Z - }
复制代码
' x/ ?2 S8 I u) Q; X" B. J! C' H# x& |4 U; C' g: Q6 G( U
/ `7 I) z& d9 W, r$ O* } |
|