|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
×
: V& z& T2 M/ J' G* y- P6 H4 Q @" H- U" W
, e) B6 v m* d* u5 [7 |& x; O) `8 |
一种自定义颜色条的方法,直接可以用,可以作为CAE后处理( x8 r- G; {5 U1 e! T
" R& d1 l4 Q7 q; j
3 u. O" `1 ~6 _% D9 l+ S7 ]
. l/ [; i% h8 ^- " Z3 M7 f+ o9 Z A9 e7 L1 ?) T9 P
- ! e" O! ^4 x2 x: ^: X
f' y. W- ?: }3 _" I- " a9 D7 F, J: _* W- a. p4 ?4 K% Z( N
- void UI_ColorRangeUDB::UI_ShowColorMapBlocks()
* p2 k' e, U% Q. r - {% {$ ]+ `) R4 a
- int colorNum = integerColorNum->Value();
! U8 l* v8 U0 b - vector<BlockStyler::UIBlock*> hiddenGroup;
' s" o/ l" b1 x/ _6 U0 X. | - hiddenGroup.clear();( r3 P, A7 D' r) i3 w6 N
- vector<BlockStyler::UIBlock*> shownGroup;
( p% n2 v. x0 Z. o9 d" o4 R2 p( C - shownGroup.clear();( g2 C# P7 F; }8 d5 J) V3 J+ u0 F3 o
- string groupPreStr = "groupColorRange";
. O2 H% P% t& g4 g8 w - string doubleUPreStr = "doubleU";
& Q! a- ]& s& i& t - string doubleLPreStr = "doubleL";
/ j# a6 R& [$ L$ j$ |+ H4 |# L - //get all the groups with the name str //groupColorRange68 Z- \+ Q+ l0 T) h% c* z. h
- vector<BlockStyler::UIBlock*> allBlocks = theUserDefinedUIBlock->TopBlock()->GetBlocks();
1 W) j9 m2 j7 f% |& Q1 e+ l% E4 N5 ] - //type: Group name : groupColorRange+ X$ F) J( H; G4 @
- //type : Group name : groupColorRange1
& W0 M/ V' j2 |- ?$ Q' i - //type : Group name : groupColorRange10* F1 i: H9 E' ]3 U( q2 q
- //type : Group name : groupColorRange11
/ o. R( J. f: F |% X A) D% f( e - //type : Group name : groupColorRange12
/ b9 a! q# s. _9 Y - //type : Group name : groupColorRange2: X+ g: ~5 U E. z: h
- //type : Group name : groupColorRange3
! j4 _0 c1 G/ U- r5 y# d/ l' [ - //type : Group name : groupColorRange45 g7 X0 [4 L/ Z$ N" o
- //type : Group name : groupColorRange5
6 h2 p& Q, c* | - //type : Group name : groupColorRange6) H S- l1 m: c" K8 W
- //type : Group name : groupColorRange7
! t; d# b0 C ~& K. W4 O. ] - //type : Group name : groupColorRange8
7 k4 w) p$ c4 u$ X2 u - //type : Group name : groupColorRange9
7 m l% i. `3 X' W7 l) d - ( u6 Q7 E% x2 {4 b3 f9 E
- for (int i = 0; i < allBlocks.size(); i++)1 K) V' z7 E9 J2 q& z& v% b
- {
( Z- B+ T+ p+ j K8 r - BlockStyler::UIBlock* tempBlock = allBlocks[i];0 S5 \5 i j. W4 ?8 v/ h. v* G# F5 n
- if (isSameNXString("Group", tempBlock->Type().GetText()))
5 y, O. N; k+ x) b; {0 [ - {
- W0 ] y+ s# u, }8 L$ w; y - string blockNameStr = tempBlock->Name().GetLocaleText();
- D. y, E* H) m# R2 m3 R [ - size_t findIndex = blockNameStr.find("groupColorRange");
4 [8 K- @7 o/ a: | - if (findIndex != string::npos)
( @2 M S1 p* s - {" f" J9 p2 E5 n
- string subStr = blockNameStr.substr(groupPreStr.length());
/ O7 V: J+ Y) T2 l3 b \ - // Echo("%s", subStr.c_str());
1 l2 n" n6 h$ g; t4 C: p - //Echo("%d -- %d", atoi(subStr.c_str()), colorNum);
) }8 _" |+ X1 c8 J% o0 K7 K' U - if (colorNum >= atoi(subStr.c_str()))3 |$ B& U6 b9 P; Z
- {
, H* K1 r) u# t% P - shownGroup.push_back(tempBlock);# `" {5 P9 {+ D2 ]3 {' \
- }& R* H/ T9 H& }+ k, [* m* @. d' U
- else
, C5 m y) d' R; k$ M* N R" i3 L - {6 G& \/ u$ v8 }) h2 ?
- hiddenGroup.push_back(tempBlock);: j! Q. @ `& q4 k( R5 y5 e4 q
- }
1 T; g% p7 _6 ]. E$ U8 B+ q; ?" y/ u - }
9 w; N/ X1 d6 ] - }* e) j3 n7 T8 Q0 H2 v
- }
! J) |7 j: V+ E4 z/ @ K$ z - if (!shownGroup.empty()). ]1 Z; `" T& Z/ b* l
- {
# T$ m& F- l/ i8 V, \+ ^; J - for (auto a : shownGroup)
- w4 p$ F# n) |, A* w - {
, m: X8 H* j4 t8 Y! q - a->SetShow(true);
2 s$ j/ Q- J! q& {& v
p* A8 V7 G2 P. W! ]7 _* \- }
1 P7 @, h7 l/ V& M - }1 t" O$ U/ m" B; ^* P1 ^( U+ J
- if (!hiddenGroup.empty())
# j2 [! {# H) {) w - {
5 c' m z7 @* _5 f - for (auto a : hiddenGroup)+ w3 o, K9 q$ V" c! j1 {1 N4 U/ j
- {% ]- ?8 z+ C5 L, }" |
- a->SetShow(false);
. @ G% R/ D% c- O$ i/ [ - }
; ]4 i% n4 i$ f% n* ?) T* ` - }
7 ^9 z; o, U$ g - . ?( C9 g% r! w/ F. ^
- //实时更新显示4 N; d/ J; l3 Z! H4 ~, X
8 r1 I$ L" n1 T0 ?' @& R t- UI_UpdateDoubleRangeValue();0 k( s7 f/ z' t; G% M3 k8 v
- }
复制代码 x9 j9 g. T9 O- F+ b; O
) u9 w6 e- J# c) h- h: E8 `; ^
$ H" ~4 }4 C0 r |
|