|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
: D y4 E$ @& z2 U0 d7 [# T2 I
- `! Q% D" P5 m" E
6 e6 L e9 D6 A" H一种自定义颜色条的方法,直接可以用,可以作为CAE后处理) K$ P6 k8 \# B8 x: C
- G9 }# D+ E! ^/ x. d5 f
5 s, F8 a0 |+ A5 h* D, p& @
9 X0 C# j& u4 s- a3 Z0 @: l: R6 K4 d
9 f- k: H" I# L
6 d P4 }3 W5 @8 r% e- ! }* J7 m* T9 O- g1 ]! n
- ! k+ K! t. `; _( T
- void UI_ColorRangeUDB::UI_ShowColorMapBlocks()
' {5 `1 ~# w) z, L3 i - {
' r* o, S) p4 b, F9 a0 G4 I - int colorNum = integerColorNum->Value();
' S- Y/ h o/ z$ x$ f2 @/ C8 K - vector<BlockStyler::UIBlock*> hiddenGroup;
; v A! i% A6 j. l, L# ` - hiddenGroup.clear();2 d: U" o, W @. |
- vector<BlockStyler::UIBlock*> shownGroup;
4 Q& D5 B" P D5 |' ^ D. X - shownGroup.clear();& h3 c; ?, q6 m2 d& w1 W/ U. `
- string groupPreStr = "groupColorRange";
" j( D. i# T G/ M5 {! s - string doubleUPreStr = "doubleU";
- \, e/ l% }% h; T2 @ - string doubleLPreStr = "doubleL";+ g9 j4 f6 T6 U0 {& q( w
- //get all the groups with the name str //groupColorRange6
4 Q" E) g; [) x: G - vector<BlockStyler::UIBlock*> allBlocks = theUserDefinedUIBlock->TopBlock()->GetBlocks();0 s0 N2 m# V' [
- //type: Group name : groupColorRange% W, Q: F1 f, |0 u, y
- //type : Group name : groupColorRange1
" y% U4 l3 a# l- |& w% [$ U' J - //type : Group name : groupColorRange10
5 k4 W g/ Q6 X5 ] - //type : Group name : groupColorRange116 V4 P. `. f2 ]" o* b
- //type : Group name : groupColorRange12
- ~5 h3 t1 u8 M* S- W. y' y* S9 K- N - //type : Group name : groupColorRange21 m! p% k: C+ u5 h# S- @3 E" O
- //type : Group name : groupColorRange3
, O2 J! B& ^, Y7 d1 I4 F; a. g - //type : Group name : groupColorRange47 v+ V- f- f8 x8 \; Y
- //type : Group name : groupColorRange5" C) U( t4 U2 Y: P& I& j! I9 {
- //type : Group name : groupColorRange68 S7 t a# ~6 f$ _
- //type : Group name : groupColorRange71 M: K% M ^: n3 U: m* a9 T5 M3 g
- //type : Group name : groupColorRange8! F& a, Z! l8 ?& ?. p
- //type : Group name : groupColorRange9
# W$ p# y9 ~1 U/ k
" v- n9 Q! N6 I- for (int i = 0; i < allBlocks.size(); i++); X8 `1 i1 r& }5 w
- {
& y/ u. f( ]5 c1 y! R, ] - BlockStyler::UIBlock* tempBlock = allBlocks[i];
2 I8 D% g: I$ \+ X. F W( ^. f! t - if (isSameNXString("Group", tempBlock->Type().GetText()))/ K( ~6 {2 g! l* y* b
- {% v( J# ~% ^! P+ n5 E2 i
- string blockNameStr = tempBlock->Name().GetLocaleText();
. Y7 O6 Q) |4 K$ z1 _1 O4 r - size_t findIndex = blockNameStr.find("groupColorRange");
j# b- w+ ~/ B/ d: y A2 t* v; L$ K8 X - if (findIndex != string::npos)5 p; |1 x6 ^& u: Y+ H2 c8 l* U
- {7 ]( Y7 I% ]# N; O; F t6 B
- string subStr = blockNameStr.substr(groupPreStr.length());
- ^5 Y* B6 T* N9 N, W: J) k - // Echo("%s", subStr.c_str());
* ]5 g# x# D: ?, T1 g. m/ q* p - //Echo("%d -- %d", atoi(subStr.c_str()), colorNum);! S* l {! F: g( j1 Y
- if (colorNum >= atoi(subStr.c_str()))
; T* c' y# t) R7 K# a4 F - { S4 \' n3 t4 C4 D/ f
- shownGroup.push_back(tempBlock);
, y: g$ {/ O! t9 x. L ] - }/ b# n9 M. ^, A( _, X- y
- else l/ G, P' S* A2 M9 w$ K2 ^
- {7 r( i/ ?6 W. Q, {
- hiddenGroup.push_back(tempBlock);
' N, ~5 w0 [* o - }1 S( I: R7 ~$ F" L4 L7 {3 _
- }0 d5 m* z" r S, X0 ^% K
- }
% k6 L5 G. d9 A7 G4 b - }" u' z4 z- Y! t: s, ^) I
- if (!shownGroup.empty())4 f, d: F8 M+ R6 X
- {8 a5 L% o& Z R/ M+ k, h9 e3 J
- for (auto a : shownGroup)! s: p0 e; }) D4 d7 T9 L
- { R1 Y" o" E0 K3 X; t$ m& Z+ G9 `
- a->SetShow(true);# g4 O7 \$ p* f
4 `1 L" W1 y: G* C6 w* P1 L- }
( u) V1 Y' ]' ` - } I1 c) H6 V% C; p2 T' N6 f3 `
- if (!hiddenGroup.empty())) D) s }6 H' c
- {8 }& o* |* T) U- ^+ W
- for (auto a : hiddenGroup)4 s% L# _! T, u X& u5 @
- {
' P4 A- m; H4 h- ]8 d- l% n! D - a->SetShow(false);
2 [1 J( S2 ]4 V3 D' ` - }
- r$ b: u+ | T5 z - }* I. M# N7 V/ h+ e# z2 Z
- + t: E* u4 C1 Q, ?
- //实时更新显示
) B, g! H, P" G1 ~1 R& @
) \3 J0 e3 [' P9 Y( Q- UI_UpdateDoubleRangeValue();
, y2 W) C5 Y9 e4 x+ R! [$ z+ d - }
复制代码
5 I+ G j% b( u& y9 M. l8 T& Y" a) M _6 H
. K4 ?# v* d0 C9 o* M! i/ k! v$ n' c |
|