|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
" N7 {+ Q1 q1 C; ?4 E
* \+ s! Q5 |/ ^
! y# l3 D5 H- U9 W, a' d一种自定义颜色条的方法,直接可以用,可以作为CAE后处理
6 a1 m4 M- } M8 @' i
9 P& g) F/ _0 i) f
+ Q& K4 [8 t1 Z x
/ g2 R8 ~% g' x S/ B% d1 ~/ P- + a: e: X" X$ I' j! B3 e3 y
8 g5 T& C$ |5 L {9 n2 x
* v. V3 @, E M! r6 N- $ X3 D N; D* q# A' P$ b) P3 d
- void UI_ColorRangeUDB::UI_ShowColorMapBlocks()+ U+ P$ E6 G B
- {2 f) S0 @3 \, [0 J& {6 j' ]* ^* |
- int colorNum = integerColorNum->Value();
3 Y- S, B7 ]) ?0 p+ }1 b; _ - vector<BlockStyler::UIBlock*> hiddenGroup;
0 l# ^! z5 }" m1 V, D6 ]4 [7 m9 b - hiddenGroup.clear();
0 I0 o E# x! T - vector<BlockStyler::UIBlock*> shownGroup;3 u7 X8 X1 \1 n! l
- shownGroup.clear();
7 m1 e7 K) t! m7 g: v - string groupPreStr = "groupColorRange";
* i( M) L* w% x/ o( M - string doubleUPreStr = "doubleU";
/ d# C+ l" Y ]; I' ~2 u5 Q - string doubleLPreStr = "doubleL";
5 d& M( s/ K Y3 _3 G - //get all the groups with the name str //groupColorRange6
$ M0 e, G! F3 w2 n: v - vector<BlockStyler::UIBlock*> allBlocks = theUserDefinedUIBlock->TopBlock()->GetBlocks();% S7 s3 W. U, S! J+ X% Z8 [
- //type: Group name : groupColorRange
! [# Q0 P/ x% _# b$ m! \# ? - //type : Group name : groupColorRange1
8 H2 k3 |1 ^& W3 J4 x4 `; p - //type : Group name : groupColorRange10
4 Q0 O5 c- F% U$ z9 f8 h5 D* g - //type : Group name : groupColorRange11
5 k! D- t9 Y% g - //type : Group name : groupColorRange12' r" `% M$ Y8 X M# a
- //type : Group name : groupColorRange2" J6 m" h: f5 z# s+ R
- //type : Group name : groupColorRange3
; \! v- f, Q! G1 f% l; R - //type : Group name : groupColorRange49 K( g7 X7 A3 M8 f; j' e
- //type : Group name : groupColorRange5
. N( W+ Q/ e5 a1 l, y0 Q - //type : Group name : groupColorRange60 K2 `7 o; L0 [1 @: e& g& ?
- //type : Group name : groupColorRange7
5 V. j2 }* C# |9 i, g6 n1 v" g- I' e - //type : Group name : groupColorRange8. D7 X/ ~, a- m" ~ i3 I
- //type : Group name : groupColorRange97 F" j' k; U8 V2 u) x1 w+ E
- ) l! @; t* k J! C6 c
- for (int i = 0; i < allBlocks.size(); i++)6 \+ D: g0 U! z$ C
- {
; Q' n a+ B: j s$ A - BlockStyler::UIBlock* tempBlock = allBlocks[i];
8 d- Y" s3 C6 Q/ ~ - if (isSameNXString("Group", tempBlock->Type().GetText())) O8 @$ i7 l1 D& v& S
- {
1 M q: ~; z/ [% R# `$ i - string blockNameStr = tempBlock->Name().GetLocaleText();
6 u- b% ^/ o" G4 c3 I - size_t findIndex = blockNameStr.find("groupColorRange");
/ t& L( o& }: t - if (findIndex != string::npos)- P/ F" F/ G' }) A
- {
& j. k5 X6 E( b& d - string subStr = blockNameStr.substr(groupPreStr.length());. P0 ?6 e: _4 E7 a& S
- // Echo("%s", subStr.c_str());
6 n- G' `/ w3 R+ |, ]3 X - //Echo("%d -- %d", atoi(subStr.c_str()), colorNum);
/ [9 |/ M+ H( n5 H2 P) E8 Z0 J1 r - if (colorNum >= atoi(subStr.c_str()))
l1 s- ~& p7 y# y) z: }# Z& H - {2 K4 y' {: [; p) {
- shownGroup.push_back(tempBlock);
+ p+ S3 V% K! C. m% g/ l0 w - }* \+ a$ R+ p# m1 K' s2 H: `8 H
- else: B1 w- s+ p8 q+ u+ u
- {
& e" }* \3 X3 {* p% W1 z$ W3 L - hiddenGroup.push_back(tempBlock);
2 J$ ]5 @0 o" Z% V4 ^ - }
" n3 {5 i z8 Z, L - }
: [& L; z( p3 a7 l, o - }
3 S6 F- c/ B# C% z+ {2 X; R. X' { - }
( N3 s H5 e# ]( q3 w4 x, s - if (!shownGroup.empty())
1 h; Q: L; m5 ~7 v( e4 t ` - {
, y9 \8 {$ o6 u* Z. \/ _ - for (auto a : shownGroup), I6 `" `% q7 r9 _* {
- {- {- R4 V& O! r" A" `5 Q8 I
- a->SetShow(true);
; J9 b* d/ w& d1 v8 y8 z) s- v
6 ?* Q: [- X: x% l% X( B: C2 ~- }2 W( j( j! W, M7 o
- }7 r: o5 m9 n, w" l
- if (!hiddenGroup.empty())
0 e8 }" o; H- L$ T - {
) o1 F; d; m% Z% Q - for (auto a : hiddenGroup)- Y; }( t5 o0 C8 _# i
- {
7 Q. S7 B, K7 ~0 l; V - a->SetShow(false);0 d+ f/ }( W' O0 X3 N- A. n
- }
x" A/ _4 d# ~0 _ - }1 @7 l; O: Q$ c3 w- R% c
0 x$ m" ?2 e' W, ]6 \- //实时更新显示
0 m9 H) C, ]0 ^
' f& i& c4 A/ r& p- UI_UpdateDoubleRangeValue();1 Z' ^7 W7 N9 x! x) Y; F
- }
复制代码 ) E8 k( c5 Y+ x3 A# @/ l
7 F5 ^+ p2 d$ x1 ~; W
( i7 Y# l6 x: n$ A |
|