|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
8 f! t7 a/ p3 _, r `' h
! n U- L+ d( B
! f0 Y+ }# e8 Y( e \6 m5 r
一种自定义颜色条的方法,直接可以用,可以作为CAE后处理
, R$ c) K: h8 v F. E- a- F( T5 R) i4 H9 V
4 l) E5 ^1 g5 v3 ?6 m, M, I5 k8 `; Y5 O8 r9 [1 Q
2 F7 P" ]+ I& m9 W8 X
4 y3 t7 M0 z A; D. n& y6 `- F
7 \7 U( {+ ?* D8 w% w5 \- & G6 E% D, T' i6 z% {* D
- void UI_ColorRangeUDB::UI_ShowColorMapBlocks()
5 {# E$ U0 |1 W; V% b - {
" m& v P0 c- L6 Q. b$ K+ t - int colorNum = integerColorNum->Value();0 @% x) I; r8 X K# o( J/ b' X
- vector<BlockStyler::UIBlock*> hiddenGroup;
4 Y" W; s- y, Z% a: _2 K - hiddenGroup.clear();- s! m0 ]4 h: H. R+ X) W, a8 u7 w
- vector<BlockStyler::UIBlock*> shownGroup;
1 `2 D5 E% Y6 w' M) b; Z3 X! i - shownGroup.clear();, S5 Z& i8 N p, h- z& d4 P6 T! r
- string groupPreStr = "groupColorRange";! [# G9 g; W8 K2 ^5 Z! O* _
- string doubleUPreStr = "doubleU";% E, H0 ]$ \8 k
- string doubleLPreStr = "doubleL";
8 U0 k7 t+ E1 M - //get all the groups with the name str //groupColorRange6
$ V3 ]- O8 R3 K4 W3 ?# F' Y: U - vector<BlockStyler::UIBlock*> allBlocks = theUserDefinedUIBlock->TopBlock()->GetBlocks();
$ H$ I% Y; ]" T - //type: Group name : groupColorRange. d! v' s, }9 O% S3 K* j: K
- //type : Group name : groupColorRange12 C) Z- c+ q4 ~. K4 f/ f- J
- //type : Group name : groupColorRange10
8 s6 \5 X. ?! q' N1 k - //type : Group name : groupColorRange11
( T+ B. _' ^- i0 K" K( e9 C8 A0 e - //type : Group name : groupColorRange12
$ N, k: `, [5 z/ o# H - //type : Group name : groupColorRange2
) |9 h7 j5 z" a$ ]% f - //type : Group name : groupColorRange3% o: h4 n, ~+ M9 [2 [9 I
- //type : Group name : groupColorRange4( ]8 T; x3 o+ ^( u2 Y; x
- //type : Group name : groupColorRange58 |2 ]8 W1 b0 h; F
- //type : Group name : groupColorRange65 N( M/ r9 M( f, }3 L" i- l* ^
- //type : Group name : groupColorRange76 X; W" ~ @5 c; @8 S5 R8 u2 c
- //type : Group name : groupColorRange88 j/ o5 B# I, x
- //type : Group name : groupColorRange99 {* U7 |; f! V2 x
- ( e3 e+ X) A3 u! ^
- for (int i = 0; i < allBlocks.size(); i++)
4 u1 T3 W, C* e5 ]+ K - {
+ M3 E8 q \: ^6 i - BlockStyler::UIBlock* tempBlock = allBlocks[i];/ W6 u' ~2 S) ^1 C2 V5 h
- if (isSameNXString("Group", tempBlock->Type().GetText()))
" f0 w6 k2 M9 {, v: I U - {
5 Y* ~; `* q% K, ^" c- x - string blockNameStr = tempBlock->Name().GetLocaleText();
' T! t Y5 @- P) l k& X5 {; z - size_t findIndex = blockNameStr.find("groupColorRange");
8 F: f7 `3 |0 m9 p# Y# m) X# n - if (findIndex != string::npos)! W M0 @. I) ?0 V
- {
: B9 ?* E6 u. K. b - string subStr = blockNameStr.substr(groupPreStr.length());' P2 }" [7 {7 `# s
- // Echo("%s", subStr.c_str());
9 f: k6 |6 u5 Y$ P2 s - //Echo("%d -- %d", atoi(subStr.c_str()), colorNum);
* r( k/ e$ L+ g! W2 ]8 T& y3 U5 \ - if (colorNum >= atoi(subStr.c_str()))
% ]; e4 b9 m1 g% X7 u& t) M - {3 k; P, ?2 A/ g$ e
- shownGroup.push_back(tempBlock);; A* g. A3 a$ l
- }
' v- ]" n' ~4 e; p& N. f4 `0 ^ - else. X, E+ w3 p: Z6 v z( p: c' \
- {
% T2 w: t% J1 v7 w4 a& ~ - hiddenGroup.push_back(tempBlock);( s% A& G" r8 {
- }1 |+ e" \. l3 M0 _3 Y3 G' d
- }5 Z% O3 P$ {0 g+ `
- }
! D! b' {" r5 K - }% D# K- }- w& ^
- if (!shownGroup.empty())3 g4 s0 s9 K+ u7 z/ R4 J
- {
3 }4 M1 i3 @. N u: F7 k - for (auto a : shownGroup)5 l! i0 V5 H" ?: C* o$ P2 v
- {7 ]' B0 ?6 h$ p' T7 u
- a->SetShow(true);
" A* ~) v- n( ^ g8 E g - " v; d% G# N: P+ _& N7 @
- }
* M. X. g- b; X6 U - }' H) X" I7 k% o' ^" O% ^6 r5 `
- if (!hiddenGroup.empty())
* X8 r R: I% ` I - {
$ `/ g3 S, u/ [# K Q! _ - for (auto a : hiddenGroup)
, u( i; @2 |# f% b4 o( s - {
$ w* C9 x) E1 w5 O - a->SetShow(false);3 G( f( }1 u& @: Q) U8 \9 J
- }
! S" p |2 i4 i+ F - }% t9 Y0 X% Y0 m1 m- E
8 u3 F# h8 O9 ~- //实时更新显示; O* D9 x g( u0 e5 k
- % I" q$ v+ _( I7 G
- UI_UpdateDoubleRangeValue();9 F9 x* J9 \2 ~6 i$ V
- }
复制代码
7 C8 y2 r1 j" K9 D0 S. y: A7 E! \% {( K C: J
$ v* x9 L$ R8 s
|
|