|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
4 @* R9 ?: G y; B4 M( L `3 j3 B2 x7 U5 `
- \' U. Z+ z' F, q2 i$ X0 s0 M
一种自定义颜色条的方法,直接可以用,可以作为CAE后处理# F! v5 G# v+ @
: D3 d& d5 s5 k* f. B
" s$ r0 M- V- N+ ~6 {
5 t' f$ p: d8 D, X- + @4 c/ _) @, x+ Q% e x; {) \
- ) y: G* K" Z. y9 g
3 l7 h, k4 L- N- 4 S' N( ~7 Q8 ^6 |/ r3 A, b
- void UI_ColorRangeUDB::UI_ShowColorMapBlocks()' k* Y, B- c2 X3 _. C
- {
4 F- M6 S8 M J7 E# `) y6 v - int colorNum = integerColorNum->Value();
1 N' x: w6 d; ~2 g/ \ e+ ~ - vector<BlockStyler::UIBlock*> hiddenGroup;
. V0 O- Q3 ~( c - hiddenGroup.clear();6 S/ J( M3 r) u3 u
- vector<BlockStyler::UIBlock*> shownGroup;/ m' n; R8 @* o! l: d2 o5 a
- shownGroup.clear();
4 |- ^: ?3 _& W% x5 B# ]7 t - string groupPreStr = "groupColorRange";
+ ?: b( w# v8 b0 m" L& i' t - string doubleUPreStr = "doubleU";
) [/ U0 P9 l7 g - string doubleLPreStr = "doubleL";
# ~; m" K( V' a" A K - //get all the groups with the name str //groupColorRange6
8 w/ A/ j) |6 A1 @1 K& o - vector<BlockStyler::UIBlock*> allBlocks = theUserDefinedUIBlock->TopBlock()->GetBlocks();5 @4 J3 t6 B2 K: W+ }+ I
- //type: Group name : groupColorRange2 p7 c% g/ E: i" V
- //type : Group name : groupColorRange1
: y% @7 N5 \ V# g9 f - //type : Group name : groupColorRange10' t' X& r6 g/ f7 x6 k
- //type : Group name : groupColorRange11
z: {# J# {- ?- }2 T% K: Y - //type : Group name : groupColorRange12
, ?# I: a& C6 l) k - //type : Group name : groupColorRange2
7 n4 a1 e# D+ `. m$ S - //type : Group name : groupColorRange3, G8 x3 O7 |4 ]1 z. A* h% g; _
- //type : Group name : groupColorRange46 V: U6 u& {1 H9 _
- //type : Group name : groupColorRange5
& _- d1 o. j2 {; V1 b# L9 r' x - //type : Group name : groupColorRange6. y* {6 r! x' A/ O3 R, _
- //type : Group name : groupColorRange7
& U7 v2 l8 K4 F+ N1 D% m - //type : Group name : groupColorRange87 i# t' u1 Z9 L& t- k' Y- d
- //type : Group name : groupColorRange9
5 v2 K& K! Y: z& n5 i) d - 0 E; d7 c' ^% j, w
- for (int i = 0; i < allBlocks.size(); i++)$ [! z* t& P4 O' i5 ]( |
- {$ `6 Z$ n0 m S) Q% a
- BlockStyler::UIBlock* tempBlock = allBlocks[i];$ @6 y2 W; f* T5 Q/ ^6 d% L( }
- if (isSameNXString("Group", tempBlock->Type().GetText()))
" W7 |1 O/ _9 V% \/ ]0 g - {
5 T0 f" @, E$ x - string blockNameStr = tempBlock->Name().GetLocaleText();3 s# @% i. o1 y6 @4 b) x
- size_t findIndex = blockNameStr.find("groupColorRange");) x4 `) n$ q! R! w- H
- if (findIndex != string::npos)4 C, M# ^1 A" Z
- {
7 {$ o- B+ A6 C W - string subStr = blockNameStr.substr(groupPreStr.length());* B0 x, d( |+ \! u# [# t7 Q
- // Echo("%s", subStr.c_str());
& p2 D2 [6 y5 v p. e: | - //Echo("%d -- %d", atoi(subStr.c_str()), colorNum);
2 E/ h2 H# L3 |' p! x - if (colorNum >= atoi(subStr.c_str()))
9 d3 F% {3 n v/ I: @ - {! Q8 y5 I2 V: Y" Z+ H- \2 O
- shownGroup.push_back(tempBlock);+ K: O6 b! l ] o3 l6 Y
- }$ H0 ~3 e1 P8 ^$ X1 K- l
- else
) H+ p% ?. U) v% w - {' ^0 Z( Q9 x6 n. [
- hiddenGroup.push_back(tempBlock);
# k4 ]' t) s% @) w - }
8 m1 x' k" R l; q. N( d2 l0 U - }. V" Y; L9 y2 a& i f5 T8 D8 q
- }
+ V& d* I' ~6 s$ f - }
F+ g* L* n9 t - if (!shownGroup.empty())2 e1 c5 J' K% ?4 H! x8 ?
- {
# W" |7 P c8 p: m4 c$ a2 T - for (auto a : shownGroup)+ W3 B! k/ ?7 y6 [9 J9 h0 J! a8 K. H
- {2 G. x" g% b& e! h
- a->SetShow(true);
" ^4 w' D: ?' y& e( E
, v7 q }* O) S' G U" N1 q+ F- }! E3 _ J% w+ W3 ]" N. x& L3 J% H
- }
# h8 D5 I+ B0 i0 ]2 F" ^' d( {1 _ - if (!hiddenGroup.empty())* O& U! \( R( g" x {+ U( `& K* `0 ~4 C
- {& E. P+ g. O3 W4 E
- for (auto a : hiddenGroup)$ q. [. n; P+ [9 S/ x
- {
' R9 ` q$ c% V+ t - a->SetShow(false);
3 L0 [7 G' H: Y. `3 U# Y - }
" Y1 G! j- \4 d+ Z7 g+ n$ I% p - }' i: a p! K! k' U+ n8 D6 m
N8 O# s7 U. z5 v* m; B9 s% d- //实时更新显示$ A8 H- i! b9 I; F6 u2 Y- Y2 q4 M
- , ~6 | M% I. o) G) o5 a
- UI_UpdateDoubleRangeValue();5 j, \6 f0 T6 O" D
- }
复制代码 : i' S! S* x" V$ c2 V6 ?) {
/ M; L8 @$ T7 g& O4 K) A2 Z
% Q) i& `1 B( F
|
|