|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
8 h# `/ _) h+ t) t+ f- h+ K
( I* z3 F& N9 C* R
, N; d: F6 M- [: J: D( t一种自定义颜色条的方法,直接可以用,可以作为CAE后处理
) s! q& y" C5 M$ U6 I, A4 Z8 M7 Q) p6 v+ u
' J% T% t6 y: F/ h
) e) L- i, s% s) [% R5 j% ?# n- & b- f9 N6 O1 {8 x$ s
- 0 z+ y8 \: V3 u# f( B X
: B2 l" ?! p: V. P9 x; s0 t- 1 a, S& g5 I1 B. `% ~5 t5 B
- void UI_ColorRangeUDB::UI_ShowColorMapBlocks()
[5 w( {0 {$ ^) j8 z8 s$ W. m+ | - {
6 A* m' b2 M. t) n: ?. e) B - int colorNum = integerColorNum->Value();# p, l4 l7 ?% G+ U; H
- vector<BlockStyler::UIBlock*> hiddenGroup;
. d& S: p3 x3 u1 x4 R- h+ I - hiddenGroup.clear();
3 P6 i0 ^* K! G% K1 C5 l - vector<BlockStyler::UIBlock*> shownGroup;2 a& Y- x. d0 H( @1 q& [
- shownGroup.clear();
- g$ G' z$ }+ G u) u" y3 J- w4 [ - string groupPreStr = "groupColorRange";! u9 W+ D4 O: G4 v
- string doubleUPreStr = "doubleU";* s. `/ }' \3 h2 M5 f8 E
- string doubleLPreStr = "doubleL";
, U! \+ b" `: |- n - //get all the groups with the name str //groupColorRange6
$ U7 C. H/ h4 c% m$ W6 f! i) p - vector<BlockStyler::UIBlock*> allBlocks = theUserDefinedUIBlock->TopBlock()->GetBlocks();
/ r9 a0 H, G3 n - //type: Group name : groupColorRange
' R6 k+ B7 C9 ]$ l - //type : Group name : groupColorRange1
" `8 A3 L7 `) B3 O1 o' Z - //type : Group name : groupColorRange10
" k7 r5 d' K! B$ g | X - //type : Group name : groupColorRange11/ X$ Y) Y2 i f3 v9 v. N3 A0 ^
- //type : Group name : groupColorRange12
6 [+ O$ V3 w' @ - //type : Group name : groupColorRange2
+ k$ z N( T" h2 F - //type : Group name : groupColorRange3
* Z. g7 A: a9 j. T% J - //type : Group name : groupColorRange4
2 ]! }: l, X& a* d - //type : Group name : groupColorRange5
+ V# }6 `, p( N9 P! ?+ I - //type : Group name : groupColorRange6" N8 X( k2 j6 S! K e+ A
- //type : Group name : groupColorRange7. J! ^5 G7 K2 H/ @' r5 N: H3 l
- //type : Group name : groupColorRange8. J1 u5 w5 T |) z9 V3 n
- //type : Group name : groupColorRange95 i/ [; _3 g" Q( }: h8 s1 \
- ) w5 M( F( j* E+ Z4 B: @
- for (int i = 0; i < allBlocks.size(); i++)
. Y" |0 Q& n4 W - {
& c2 a4 a4 O7 n% \8 {& h, t0 L% N - BlockStyler::UIBlock* tempBlock = allBlocks[i];
@/ P) d+ ?" v0 E2 e. b - if (isSameNXString("Group", tempBlock->Type().GetText()))
( U W n; N% x - {( P. t3 D9 p' W8 r/ w! ^9 N- Q M
- string blockNameStr = tempBlock->Name().GetLocaleText();
7 ]; m+ p7 ~2 _ t0 b9 e& \ - size_t findIndex = blockNameStr.find("groupColorRange");
c3 T) b: `( Q0 z5 b7 X. } - if (findIndex != string::npos)
9 I' _- l( G& d( A/ ]! M; N - {0 o2 J; g- p) ?4 @/ @* d
- string subStr = blockNameStr.substr(groupPreStr.length());
' d f! M& n) y' ]5 {) y - // Echo("%s", subStr.c_str());
' Q) ^* _- H' F- ?& m7 X - //Echo("%d -- %d", atoi(subStr.c_str()), colorNum);5 @4 L. J, D+ Z- t& ^3 _' c
- if (colorNum >= atoi(subStr.c_str()))
. [+ ^4 ?; e: ?* w! b, z - {
~7 c* ~; { J9 r - shownGroup.push_back(tempBlock);8 e' P5 ]8 T- Y* V. D% k, [- c
- }- Q/ \0 W* X0 x% t W
- else
; D6 N# f# c8 }$ e/ y, y9 [& q - {
* x( R8 b' T3 W( T* k7 u - hiddenGroup.push_back(tempBlock);
) T9 o9 K3 X% d7 U: a( k - }
! `! x% o1 u9 a5 A - }
8 I; [7 \4 Z. g5 ~ - }
; ]* W4 a0 ?; F, M8 S+ ] \9 F# E& s - }
3 {. I$ ~) r- {4 S7 B$ c - if (!shownGroup.empty())
5 y' [6 L- p$ N* y! L) X8 s - {) f6 j- z' h1 Q J/ T1 u
- for (auto a : shownGroup)" s; O6 W" n# P; ~- `9 O7 ?
- {/ l2 X. T3 a+ W/ y6 l9 X. B
- a->SetShow(true);) y! Z0 I6 p4 Z9 e
4 Y) a$ s c# t; p2 u5 K- o- }& n) l% m/ V0 i/ W* Z2 g
- }9 k- N1 M5 c# [' W! u
- if (!hiddenGroup.empty())7 W& w% r, e6 u" |. L# X; D9 k |
- {! g$ f. W! q# V: ?# \6 I* P
- for (auto a : hiddenGroup)
; G: o* |- U) b6 U9 P2 R - {
( D" j& d3 W# U1 Z# }% ~' a8 y - a->SetShow(false);5 P8 ~- B6 R+ c% f+ D& M! ?
- }
! q% H, i$ T: s# h. K, @1 J. | - }9 k2 W2 \$ @" r
; ^# [# V( s& q. [9 P# v- //实时更新显示9 E @. P' p5 k P0 c
- 6 }& z0 K. C: U: L; z% e% K
- UI_UpdateDoubleRangeValue();
, b' ~9 x0 C+ y" A ^4 U - }
复制代码 : ^( e, r8 |4 v) |( v# f
& C0 @5 y( h- D& m' p
+ U6 C0 @1 d& _- p# \3 J# I9 ~ |
|