From 98ea3201fa42dc17a8271e1ad14541e9701ec1d5 Mon Sep 17 00:00:00 2001 From: vsr Date: Fri, 14 May 2010 20:55:05 +0000 Subject: [PATCH] Merge from V5_1_main branch 14/05/2010 --- doc/salome/gui/VISU/static/header.html | 12 - doc/salome/tui/images/application.jpg | Bin 792 -> 0 bytes doc/salome/tui/images/logocorp.gif | Bin 1792 -> 0 bytes doc/salome/tui/images/occ.gif | Bin 14790 -> 0 bytes doc/salome/tui/static/myheader.html | 13 - resources/Visu_PlaneSegmentation.png | Bin 618 -> 0 bytes resources/Visu_SphereSegmentation.png | Bin 1081 -> 0 bytes resources/Visu_recording_pause.png | Bin 556 -> 0 bytes resources/Visu_recording_play.png | Bin 550 -> 0 bytes resources/Visu_recording_start.png | Bin 617 -> 0 bytes resources/Visu_vvtk_switch.png | Bin 782 -> 0 bytes src/CONVERTOR/Makefile.am | 2 +- src/GUITOOLS/Makefile.am | 49 -- src/GUITOOLS/VisuGUITools.h | 47 - src/GUITOOLS/VisuGUI_TableDlg.cxx | 1073 ----------------------- src/GUITOOLS/VisuGUI_TableDlg.h | 150 ---- src/VVTK/Makefile.am | 65 -- src/VVTK/VVTK.h | 34 - src/VVTK/VVTK_ImageWriter.cxx | 114 --- src/VVTK/VVTK_ImageWriter.h | 62 -- src/VVTK/VVTK_ImageWriterMgr.cxx | 105 --- src/VVTK/VVTK_ImageWriterMgr.h | 64 -- src/VVTK/VVTK_InteractorStyle.cxx | 292 ------ src/VVTK/VVTK_InteractorStyle.h | 148 ---- src/VVTK/VVTK_MainWindow.cxx | 474 ---------- src/VVTK/VVTK_MainWindow.h | 201 ----- src/VVTK/VVTK_PickingDlg.cxx | 717 --------------- src/VVTK/VVTK_PickingDlg.h | 140 --- src/VVTK/VVTK_PrimitiveBox.cxx | 372 -------- src/VVTK/VVTK_PrimitiveBox.h | 122 --- src/VVTK/VVTK_Recorder.cxx | 490 ----------- src/VVTK/VVTK_Recorder.h | 165 ---- src/VVTK/VVTK_RecorderDlg.cxx | 228 ----- src/VVTK/VVTK_RecorderDlg.h | 83 -- src/VVTK/VVTK_Renderer.cxx | 437 --------- src/VVTK/VVTK_Renderer.h | 179 ---- src/VVTK/VVTK_SegmentationCursorDlg.cxx | 859 ------------------ src/VVTK/VVTK_SegmentationCursorDlg.h | 199 ----- src/VVTK/VVTK_SizeBox.cxx | 374 -------- src/VVTK/VVTK_SizeBox.h | 123 --- src/VVTK/VVTK_ViewManager.cxx | 49 -- src/VVTK/VVTK_ViewManager.h | 49 -- src/VVTK/VVTK_ViewModel.cxx | 124 --- src/VVTK/VVTK_ViewModel.h | 76 -- src/VVTK/VVTK_ViewWindow.cxx | 324 ------- src/VVTK/VVTK_ViewWindow.h | 155 ---- 46 files changed, 1 insertion(+), 8169 deletions(-) delete mode 100755 doc/salome/gui/VISU/static/header.html delete mode 100755 doc/salome/tui/images/application.jpg delete mode 100755 doc/salome/tui/images/logocorp.gif delete mode 100755 doc/salome/tui/images/occ.gif delete mode 100755 doc/salome/tui/static/myheader.html delete mode 100644 resources/Visu_PlaneSegmentation.png delete mode 100644 resources/Visu_SphereSegmentation.png delete mode 100644 resources/Visu_recording_pause.png delete mode 100644 resources/Visu_recording_play.png delete mode 100644 resources/Visu_recording_start.png delete mode 100644 resources/Visu_vvtk_switch.png delete mode 100644 src/GUITOOLS/Makefile.am delete mode 100755 src/GUITOOLS/VisuGUITools.h delete mode 100644 src/GUITOOLS/VisuGUI_TableDlg.cxx delete mode 100644 src/GUITOOLS/VisuGUI_TableDlg.h delete mode 100755 src/VVTK/Makefile.am delete mode 100755 src/VVTK/VVTK.h delete mode 100755 src/VVTK/VVTK_ImageWriter.cxx delete mode 100755 src/VVTK/VVTK_ImageWriter.h delete mode 100755 src/VVTK/VVTK_ImageWriterMgr.cxx delete mode 100755 src/VVTK/VVTK_ImageWriterMgr.h delete mode 100644 src/VVTK/VVTK_InteractorStyle.cxx delete mode 100644 src/VVTK/VVTK_InteractorStyle.h delete mode 100644 src/VVTK/VVTK_MainWindow.cxx delete mode 100644 src/VVTK/VVTK_MainWindow.h delete mode 100644 src/VVTK/VVTK_PickingDlg.cxx delete mode 100644 src/VVTK/VVTK_PickingDlg.h delete mode 100644 src/VVTK/VVTK_PrimitiveBox.cxx delete mode 100644 src/VVTK/VVTK_PrimitiveBox.h delete mode 100755 src/VVTK/VVTK_Recorder.cxx delete mode 100755 src/VVTK/VVTK_Recorder.h delete mode 100644 src/VVTK/VVTK_RecorderDlg.cxx delete mode 100644 src/VVTK/VVTK_RecorderDlg.h delete mode 100644 src/VVTK/VVTK_Renderer.cxx delete mode 100644 src/VVTK/VVTK_Renderer.h delete mode 100644 src/VVTK/VVTK_SegmentationCursorDlg.cxx delete mode 100644 src/VVTK/VVTK_SegmentationCursorDlg.h delete mode 100644 src/VVTK/VVTK_SizeBox.cxx delete mode 100644 src/VVTK/VVTK_SizeBox.h delete mode 100644 src/VVTK/VVTK_ViewManager.cxx delete mode 100644 src/VVTK/VVTK_ViewManager.h delete mode 100644 src/VVTK/VVTK_ViewModel.cxx delete mode 100644 src/VVTK/VVTK_ViewModel.h delete mode 100755 src/VVTK/VVTK_ViewWindow.cxx delete mode 100755 src/VVTK/VVTK_ViewWindow.h diff --git a/doc/salome/gui/VISU/static/header.html b/doc/salome/gui/VISU/static/header.html deleted file mode 100755 index a70a95e3..00000000 --- a/doc/salome/gui/VISU/static/header.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - $title - - -
-
-SALOME documentation central -
-
diff --git a/doc/salome/tui/images/application.jpg b/doc/salome/tui/images/application.jpg deleted file mode 100755 index a6979ab9999552ccb91a0358f75103b09db5246c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 792 zcmex=LJ%Z3brs z4mLJ+HdYRHc6Lrq4lW)MULJ049!Vi#ei2zIc{y1r85so?J#_^o9c39A4RcK$149!N z6M1z@TMHu_J!2CikRgnmoSZz|JQBRT5=M$Libf=Z{|6WZIT%D3%$OOK7?=bZnFSgD zA7PMUU}Rthc>@7h+1MFbn1ONz0t}4I%#5t;OzcouMkZz!23A2KHbq0nKw(j(pu~w6 z3mZjLjGdA<9t7%;U}RuoMwkR-0lADUKp6!=1|~)pMph(AMnRxyib95giG>^g-(uil z25J^$7G$tz*b}$dob931la92ii?S2$h#I_dt2w(?+0U=MwPfirm!)r|%QL=xciqQ* zvhOkDlnJl1?mV9H$SWkchmTWj{f7p#7YBO!PTF5sw@#T`LbrdbWo*ZV_O$5xlkGCE z^PPVyNw8xApK>WbnDiuj&ts=vwm~?+7XwjY*R$0pI#j4 zw{W$hO=am?)v#v=Y$tVvo>o`d(V^*ixTv>ZZDX3QFXcToO*@xTm3CIa<27tEIc#! zWx8M8?h`8_qqEtJR5Yui4EIMazr(xByvXzMzf0?$2CWRax^UXZS*s@%RlmEiXqi&U zv6PDAY{#9wTC9VfKD+s&O=r4T6dx~>x9e7&gdYvo8^51ls#!DPMamTK%`aPJ6?q?+ z%yVDxb^Z406Q4}q)Ma`pwL@9=KH2nE%g+j0$PN+6w!7WCc0S)@-fuIzZ#hkAx*44E xJV2p&e;fZ&&B#yDAuHbPYtLW(<#g|%_lh@oH9azfmdriy#cs<|Z3p)MHvxBP8gc*t diff --git a/doc/salome/tui/images/logocorp.gif b/doc/salome/tui/images/logocorp.gif deleted file mode 100755 index 7697e0837777ed6aa775741b68962a9533f62caa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1792 zcmV+b2mkm-Nk%w1VT%AS0M!5hoSdBI=H|`K&1h+9yr%&i92}?s9Q4@(`}_LWPNmY) z(&*@(Mny)&y^n7I4{B!vuhPw}5?2IXir|z73~g1|qP6eq%$#@+9iPydLQ8d@5mkyJ+Hc*mQgIAO1%kNT04UJv^Xbjgu+dWmns}MAyYSKDkey3~zS-CTdiC?|VXDsV z?d^iw_xI-Rw^eTF^5`PJ@#MM6alNa@g__&l+iiR_0!%suKW6s!_KJ#%u&}WA_xAt* z0RH~|A^8LV00000EC2ui0E+-G000L6z*cWaEEFMdcUl8%k6r< z;IMd1E}O}{fWnGByWjA*T%KNE=i^n!GwFL42zY{nZ*^>hTQ53UFBcbmep(_Th?SOE zhIfM}6$ufa2{khhq>dLJA}%tkt1fMquyC2LZ!MHr03W&$x*ru47a5Ko78?>EAQ;LR zlsynM5HYdSVzXyGA}K7$$tgND9|gU-Gg%fED_O=l6359lG$r!$(A4%@)?Wxcfm$Z) z+}cSnp@6}-4=_%6F(H9MJ7g>%P{2W9o;(`&GUn6L2mz)+Fwufcx-*5n z@S9e57v2cMNN|`;0+1OSJ2C?x832H11!4j05dFhO7aal;cOEccbmAW^GY8IM0|4vM zhksbPEnti2(ORrz9?he0i{HaDW6G*2O9saoP)wdqokZ?102s91F@Ql~9t>;`7(2i- zfFG>61YiJqy^r_r8JI>7e@7Mp4B*GdRX~4%9gFk;Ujg$Cpq~!~Fd%>q{T=ATa(2-2 z0yq)CaDxWaO{c+z(ue{79uHb{#sC7~{jdUS1AwT-4h0Ob#d@IS7ax2B=+HugJ}~e@ z4?DbzJjJh0`Z8sx@TKUyeIKw9A87XWzTiFV$eUnaR;06o6Prl|-ND&qjL4msWr z4JIiZ4=XT8=m-F=1ptGaX!3yE z9WH>MhsQqu;KHmES)|GT*?<|$ydU1;59BgPK3Vaqg06dts+nHOeQ0fXKj!BaGW5yrqS)CJ^53@nK7h&4>24SnH6jU+IN4Il=mK7d6eYO#a{$YB?sI3=~j1U z#t5qaagB`mA|f(i!x7H$j}mkM4ey9YSnv=IaO~qB7a0N?MxcO&q>CO2kw`@{@`w>A zMyi3R{9CN;T9OC0hId_1Ed%V>ZMK(dsTIHem}kjgq@F#;8UjC{3wKSIW|sy7Z+T iFpX*a^t7Gi*z~42&8bdz%F~|u^rt`#YI0B%1OPi{2poO@ diff --git a/doc/salome/tui/images/occ.gif b/doc/salome/tui/images/occ.gif deleted file mode 100755 index ce017c8ae11236ef5c52eee1723657cb8b08989f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14790 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⁣iMxf-qnJ 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 diff --git a/doc/salome/tui/static/myheader.html b/doc/salome/tui/static/myheader.html deleted file mode 100755 index d2efb75f..00000000 --- a/doc/salome/tui/static/myheader.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - Main Page - - - - -  - - diff --git a/resources/Visu_PlaneSegmentation.png b/resources/Visu_PlaneSegmentation.png deleted file mode 100644 index 16bee54a6e5260406076a510ef30f85efa62cc57..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 618 zcmV-w0+s!VP)z@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ-;7LS5RCwBA{Qv(y12q9a05LI882|(j)eQs)Afl0w zkPuN}0}wz&yYTPdzaUBgh&k}70|+3Z4gB}-ABa+b8j2GD1Q1aMii(PYz01tZe4daC z0Ro6v#33v!3^Ftjhz;-=3J^fVdYOZZiwhQpg7^#s2q0n&`~fxa0}#Il@o^~x2q2;j zqHA5rnK0p95!g7Ln))Js$&@lV;186%C16}d|FUY`u zKnyhuh=BnN=3iV@#{eu(;f4Y6d4K?7WMgCd|L4yitT9HY@I^Nah#vq15F<3zgEGA# z5G#_HS5XWD@c{ye1!{mGRKar+^EfDxUxyh65&#G=02>Vi>S#sx>Hq)$07*qoM6N<$ Eg6DVjQ2+n{ diff --git a/resources/Visu_SphereSegmentation.png b/resources/Visu_SphereSegmentation.png deleted file mode 100644 index 3b5964487b9bf737b40330aa5b802b7e659c4322..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1081 zcmV-91jhS`P)z@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ!6l7pwVPRlqW@cbzWo4KaB4-nfx&DjCOcR>t*0Ac|VpFVwJ z`1R`-%(fj#NlAB3o;=CG$;rv^^XE^nJjfuBtJ&Gv8FY1Z@BI1mhvEA5>mE=Cyy)uc z`hV};E_!Cg> z`+q23dH($Q|IN+KLHvG4N5}t8PEP*;0*D19`1b8vhLVyJ15n_Kh={-f_zpBXy?`bO zAmBss^39t!VfmTi%a<<<|Ni}B00C>QKPyq-aMyQuOpc+7lnMYGo^9U%Q{r&wJ zK(PNh=mbH|Xl{^0a z{mTH#+u))J7$hJz&{wcL{vtLuwgXgnY}~jJ>>Gdpf+ri0AT-(7Ky6%e_wL;bump>q zoS=#S&eyMB!3M%gDu4iDM2=;c*MVU;1yq0n!^i+zasZap7eKjc>C&Ybz@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ-qDe$SRCwBA{Qv(y10?_;fS4F41ONdk-9#DdJp z%*_1H%*+gC|NZ-yVaALZj43H8|9}4c$?)ylH-@iYzcTFDv4asL5A!-e0D&1W3{w2{ z>-YcXA3pz|kdOdUp&S(z_5aJ4Z~u?qdHmnT#s(|~#N04F00D&J1(2;EgZ}}E@87?J zggihtgT(&)`^WI-&mXWD5KF-H00a<<0l$9zf*ADgKiJ7YpaL=AKf})-KfxA&#DJIw zrUxK^Pz(V16{Pqt&^C~NK>$R9T=VVg7nlJk03d)c41l@d$B!RiHptmuzI+5OalM{2*ZG;+%&Kzm~%nwsm--uHX|b= zh5-Np#E5JvP=P*>N&sR5sL%x{Hb4_w0MvI8!~qB(7BmCD0P!6pK8XDSi`W+!2OxmZ uUBC@ZWjsg*eu46l#a;mQffEWqfB^t(nFsGL;X&E}0000?0v z(btiIVPjv-@4(4GzCyA`kS_y6l_~>6Lo)-z&;LOBB?CjL0RzLU1O^7H84L{K`IF+0 zx-l>?&hd0{45_%4^ymM7duCMzg@zdt8Y~QqE*lvc7>_V~V&Yl8WXXg#@(m10E_}^r z&Ybz*)6>KA|KH!_8J5Lr%7$zVECSrS9I8@nXZ-v8{QUp;{dI;qaeE}zJ2Eh~BryaC z-_Vvya^i{Hde&k3pY$Jpet!PHzy7~b&b>X7t078G9NYh2;o(9~6BZV)U22AZm_Oa$ zSNmIDrS8vabM2Awsev9_WQG#`t|Ti9bHQG(OxdKVPyhZvWvAoEZo9?Bm;T=j?2Aeut@&3fYVt z3L?yP|Nou+Ah_b?!`<6?CQE5aIy9EQzNS0ln7)E^;}5AK*S1r3d4lgu6 ja)(?NcalnEP&mNgRd8K}Pmd88Zww5cu6{1-oD!M<#+BBT diff --git a/resources/Visu_recording_start.png b/resources/Visu_recording_start.png deleted file mode 100644 index 5b71dc511c498b6bfbc5a5d8d86dee85ade8141a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 617 zcmV-v0+#)WP)z@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ--$_J4RCwBA{Qv(y10?_;fS4F41ONdk-9#DdIW zWMqW1OG``t|M~NW;m4033}3%~WmvRm5hJ>0koN%shy|OeAkB>e0u29u|7KudV`KQw z!ou+0*Z2SC&6|0E(qEC)0t66-7mA9C{x|aRK{Nwx{|~}He=;ls8fa^4`vs_k8(BR- z05KxRLPkc$|2|Ps28MtC7#M&CfHi;r&cN{P8^b@KA>V;s@_YWA;nb;9V3&aO0t66> z7eIdf&&kQa@b@nR!>?a(1HJ>QOi0|&0P@h) z)vW>f_aD$ZAT_sc-GXTb1>O!24HW+h5J2b#FhJuOYzUO*fw>M@Gb|bb0tj15{0db7 z(_#cKcn03CEi zSad^gZEa<4bO1wgWnpw>WFU8GbZ8({Xk{QrNlj4iWF>9@00MGJL_t&-)76tdOB_KM z#(#6Spd0VpfEGCmvA8QN6zl}WN))tA<0mj5z%P}`P7WeSG(`kO1uZN@(GX77^KLJ< zx3jZ5JCnlPq48hRC2uwJ!26p&&-226S+}>hc5Q9Vo}8T6zwH&>g|&CRQc8PpaKPc= zAtNIr3=a>Zl%iIvQ7)I6nVAuP3_LwOwU?Kd%+Ai@x-P9&3&+WkWrj4>?CtFVu(Y)F z2r9&#l)En;9UZZ_xQOezB#Gkco6qO3mwd0?5Hy=qDiw?|?Ck73`xOs>j^h9jh9N4J z1nrcMpDfic4UCDoxw&C_dYU+nIX^$QuL8T*w${?=L=3*kh?5o$DI8 z&-3s+k9VaJ0E~e+mObFu*cjW}+bE@MUtgbi^2uqMJ{bh9Goq-2Qi@zIhcO1NHRI#s z?C$QqZp!b6NGXw0qP0eAO&EsM>vde$LoB+2u@iHQl0kB2qAD?m;U~Klu|@dL=Xf7K|mOWWLbvRnnI!Q@+`O8ZM(j{&fMG_tyT+T3|W?; zltM~Lnx;68gAjuK{e4zfR~Z@_65R|x0s>rIT-a*0N~KaEpU -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "utilities.h" - -using namespace std; - -#define MARGIN_SIZE 11 -#define SPACING_SIZE 6 -#define SPACER_SIZE 5 -#define MIN_TABLE_WIDTH 200 -#define MIN_TABLE_HEIGHT 200 - -NumDelegateItem::NumDelegateItem( QObject* parent, NumValidator mode ) - : QItemDelegate( parent ), - myMode( mode ) -{ -} - -NumDelegateItem::~NumDelegateItem() -{ -} - -QWidget * NumDelegateItem::createEditor( QWidget * parent, - const QStyleOptionViewItem & option, - const QModelIndex & index ) const -{ - QLineEdit *editor = new QLineEdit(parent); - switch ( myMode ) - { - case NV_Int: - editor->setValidator( new QIntValidator( editor ) ); - break; - case NV_Real: - editor->setValidator( new QDoubleValidator( editor ) ); - break; - default: - editor->setText( "No validator!" ); - } - - return editor; -} - -void NumDelegateItem::setEditorData( QWidget * editor, - const QModelIndex & index ) const -{ - QLineEdit *aLE = qobject_cast(editor); - if ( !aLE ) - return; - - switch ( myMode ) - { - case NV_Int: - { - int value = index.model()->data(index, Qt::DisplayRole).toInt(); - aLE->setText( QString("%1").arg( value ) ); - break; - } - case NV_Real: - { - double value = index.model()->data(index, Qt::DisplayRole).toDouble(); - aLE->setText( QString("%1").arg( value ) ); - break; - } - default: - aLE->setText( "No validator!!!" ); - } -} - - - - - -/*class VisuGUI_Table : public QTableWidget { -public: - VisuGUI_Table( Orientation orient, QWidget* parent = 0 ) - : QTableWidget( parent ), myValidator( 0 ), myOrientation( orient ) {} - VisuGUI_Table( Orientation orient, int numRows, int numCols, QWidget* parent = 0 ) - : QTableWidget( numRows, numCols, parent ), myValidator( 0 ), myOrientation( orient ) {} - - void setValidator( QValidator* v = 0 ) { myValidator = v; } - bool isEditing() const { return QTable::isEditing(); } - -protected: - QWidget* createEditor ( int row, int col, bool initFromCell ) const - { - bool testUnits = ( myOrientation == Qt::Horizontal && col == 0 ) || ( myOrientation == Qt::Vertical && row == 0 ); - QWidget* wg = QTable::createEditor( row, col, initFromCell ); - if ( wg && wg->inherits("QLineEdit") && myValidator && !testUnits ) - (( QLineEdit*)wg)->setValidator( myValidator ); - return wg; - } - -protected: - QValidator* myValidator; - Orientation myOrientation; - };*/ - -/*! - Constructor -*/ -VisuGUI_TableDlg::VisuGUI_TableDlg( QWidget* parent, - _PTR(SObject) obj, - bool edit, - int which, - Qt::Orientation orient, - bool showColumnTitles ) - : QDialog( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ), - myIntTable( 0 ), myRealTable( 0 ) -{ - setWindowTitle( edit ? tr( "EDIT_TABLE_TLT" ) : tr( "VIEW_TABLE_TLT" ) ); - setSizeGripEnabled( true ); - - myObject = obj; - bool bHasIntTable = false; - bool bHasRealTable = false; - if ( myObject ) { - _PTR(GenericAttribute) anAttr; - bHasIntTable = myObject->FindAttribute( anAttr, "AttributeTableOfInteger"); - bHasRealTable = myObject->FindAttribute( anAttr, "AttributeTableOfReal"); - } - - QVBoxLayout* mainLayout = new QVBoxLayout( this ); - mainLayout->setMargin( MARGIN_SIZE ); - mainLayout->setSpacing( SPACING_SIZE ); - - bool bDoInt = which == ttInt || which == ttBoth || which == ttAuto && bHasIntTable; - bool bDoReal = which == ttReal || which == ttBoth || which == ttAuto && bHasRealTable; - - QWidget* top; - QVBoxLayout* tl; - if ( bDoInt && bDoReal ) { - top = new QTabWidget( this ); - //( ( QTabWidget* ) top) ->setMargin( MARGIN_SIZE ); - } - else { - top = new QWidget( this ); - tl = new QVBoxLayout( top ); tl->setMargin( 0 ); tl->setSpacing( SPACING_SIZE ); - } - - if ( bDoInt ) { - myIntTable = new VisuGUI_TableWidget( top, "myIntTable", edit, orient, showColumnTitles ); - //myIntTable->getTable()->setValidator( new QIntValidator( this ) ); - //QAbstractItemDelegate* item = myIntTable->getTable()->itemDelegate(); - myIntTable->getTable()->setItemDelegate( new NumDelegateItem( myIntTable, NumDelegateItem::NV_Int ) ); - //item->deleteLater(); - - if ( bDoInt && bDoReal ) - ( ( QTabWidget* )top )->addTab( myIntTable, tr( "TABLE_OF_INTEGER_TLT" ) ); - else - tl->addWidget( myIntTable ); - } - if ( bDoReal ) { - myRealTable = new VisuGUI_TableWidget( top, "myRealTable", edit, orient, showColumnTitles ); - //myRealTable->getTable()->setValidator( new QDoubleValidator( this ) ); - //QAbstractItemDelegate* item = myIntTable->getTable()->itemDelegate(); - myRealTable->getTable()->setItemDelegate( new NumDelegateItem( myRealTable, NumDelegateItem::NV_Real ) ); - //item->deleteLater(); - if ( bDoInt && bDoReal ) - ( ( QTabWidget* )top )->addTab( myRealTable, tr( "TABLE_OF_REAL_TLT" ) ); - else - tl->addWidget( myRealTable ); - } - if ( !bDoInt && !bDoReal ) { - QLabel *dumbLabel = new QLabel( tr( "ERR_TABLE_NOT_AVAILABLE" ), top ); - dumbLabel->setAlignment( Qt::AlignCenter ); - tl->addWidget( dumbLabel ); - } - - QHBoxLayout* btnLayout = new QHBoxLayout; - btnLayout->setMargin( 0 ); btnLayout->setSpacing( SPACING_SIZE ); - - myOKBtn = new QPushButton( tr( "BUT_OK" ), this ); - myHelpBtn = new QPushButton( tr( "BUT_HELP" ), this ); - if ( edit ) { - myCancelBtn = new QPushButton( tr( "BUT_CANCEL" ), this ); - btnLayout->addWidget( myOKBtn ); - btnLayout->addItem( new QSpacerItem( SPACER_SIZE, SPACER_SIZE, QSizePolicy::Expanding, QSizePolicy::Minimum ) ); - btnLayout->addWidget( myCancelBtn ); - btnLayout->addWidget( myHelpBtn ); - connect( myOKBtn, SIGNAL( clicked() ), this, SLOT( onOK() ) ); - connect( myCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) ); - } - else { - btnLayout->addWidget( myOKBtn ); - btnLayout->addItem( new QSpacerItem( SPACER_SIZE, SPACER_SIZE, QSizePolicy::Expanding, QSizePolicy::Minimum ) ); - btnLayout->addWidget( myHelpBtn ); - connect( myOKBtn, SIGNAL( clicked() ), this, SLOT( accept() ) ); - } - connect( myHelpBtn, SIGNAL( clicked() ), this, SLOT( onHelp() ) ); - - mainLayout->addWidget( top ); - mainLayout->addLayout( btnLayout ); - - initDlg(); - resize( 500, 400 ); - SUIT_Tools::centerWidget( this, parent ); -} - -/*! - Destructor -*/ -VisuGUI_TableDlg::~VisuGUI_TableDlg() -{ -} - -/*! - button slot, saves table(s) - Called only in create/edit mode ( parameter for constructor is true ) -*/ -void VisuGUI_TableDlg::onOK() -{ - myOKBtn->setFocus(); // accept possible changes - bool done = true; - - if ( myObject ) { - _PTR(Study) study = myObject->GetStudy(); - _PTR(AttributeTableOfInteger) tblIntAttr; - _PTR(AttributeTableOfReal) tblRealAttr; - - if ( study ) { - _PTR(StudyBuilder) builder = study->NewBuilder(); - builder->NewCommand(); // start transaction !!!!!!!!!!!!!!!!!!!!!!!!!!!!! - try { - if ( myIntTable ) { - builder->RemoveAttribute( myObject, "AttributeTableOfInteger" ); - tblIntAttr = builder->FindOrCreateAttribute( myObject, "AttributeTableOfInteger" ); - - int i; - int nbRows = myIntTable->getNumRows(); - int nbCols = myIntTable->getNumCols(); - QString tlt = myIntTable->getTableTitle(); - QStringList rowTitles, colTitles, units; - myIntTable->getRowTitles( rowTitles ); - myIntTable->getColTitles( colTitles ); - myIntTable->getUnits( units ); - - if ( nbRows > 0) { - // data - int nRow = 0; - tblIntAttr->SetNbColumns( nbCols ); - for ( i = 0; i < nbRows; i++ ) { - QStringList data; - myIntTable->getRowData( i, data ); - bool bEmptyRow = true; - for ( int j = 0; j < data.count(); j++ ) { - if ( !data[ j ].isNull() ) { - tblIntAttr->PutValue( data[ j ].toInt(), nRow+1, j+1 ); - bEmptyRow = false; - } - } - if ( !bEmptyRow ) { // Skip rows with no data !!! - // set row title - tblIntAttr->SetRowTitle( nRow+1, rowTitles[ i ].isNull() ? "" : (const char*)rowTitles[ i ].toLatin1() ); - // set row unit - tblIntAttr->SetRowUnit( nRow+1, units[ i ].isNull() ? "" : (const char*)units[ i ].toLatin1() ); - nRow++; - } - } - if ( nRow > 0 ) { // Set columns only if table is not empty, otherwise exception is raised !!! - // column titles - for ( i = 0; i < colTitles.count(); i++ ) - tblIntAttr->SetColumnTitle( i+1, colTitles[ i ].isNull() ? "" : (const char*)colTitles[ i ].toLatin1() ); - } - } - // title - tblIntAttr->SetTitle( (const char*)myIntTable->getTableTitle().toLatin1() ); - } - if ( myRealTable ) { - builder->RemoveAttribute( myObject, "AttributeTableOfReal" ); - tblRealAttr = builder->FindOrCreateAttribute( myObject, "AttributeTableOfReal" ); - - int i; - int nbRows = myRealTable->getNumRows(); - int nbCols = myRealTable->getNumCols(); - QString tlt = myRealTable->getTableTitle(); - QStringList rowTitles, colTitles, units; - myRealTable->getRowTitles( rowTitles ); - myRealTable->getColTitles( colTitles ); - myRealTable->getUnits( units ); - - if ( nbRows > 0) { - // data - int nRow = 0; - tblRealAttr->SetNbColumns( nbCols ); - for ( i = 0; i < nbRows; i++ ) { - QStringList data; - myRealTable->getRowData( i, data ); - bool bEmptyRow = true; - for ( int j = 0; j < data.count(); j++ ) { - if ( !data[ j ].isNull() ) { - tblRealAttr->PutValue( data[ j ].toDouble(), nRow+1, j+1 ); - bEmptyRow = false; - } - } - if ( !bEmptyRow ) { // Skip rows with no data !!! - // set row title - tblRealAttr->SetRowTitle( nRow+1, rowTitles[ i ].isNull() ? "" : (const char*)rowTitles[ i ].toLatin1() ); - // set row unit - tblRealAttr->SetRowUnit( nRow+1, units[ i ].isNull() ? "" : (const char*)units[ i ].toLatin1() ); - nRow++; - } - } - if ( nRow > 0 ) { // Set columns only if table is not empty, otherwise exception is raised !!! - // column titles - for ( i = 0; i < colTitles.count(); i++ ) - tblRealAttr->SetColumnTitle( i+1, colTitles[ i ].isNull() ? "" : (const char*)colTitles[ i ].toLatin1() ); - } - } - // title - tblRealAttr->SetTitle( (const char*)myRealTable->getTableTitle().toLatin1() ); - } - if ( myIntTable || myRealTable) - builder->CommitCommand(); // commit transaction !!!!!!!!!!!!!!!!!!!!!!!!!!! - else - builder->AbortCommand(); // abort transaction !!!!!!!!!!!!!!!!!!!!!!!!!!! - } - catch( ... ) { - MESSAGE("VisuGUI_TableDlg::onOK : Exception has been caught !!!"); - builder->AbortCommand(); // abort transaction !!!!!!!!!!!!!!!!!!!!!!!!!!! - done = false; - SUIT_MessageBox::critical ( this, tr("ERR_ERROR"), tr("ERR_APP_EXCEPTION") ); - } - } - } - if ( done ) - accept(); -} - -/*! - button slot, shows corresponding help page -*/ -void VisuGUI_TableDlg::onHelp() -{ - QString aHelpFileName = "table_presentations_page.html"; - LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); - if (app) - app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName); - else { - QString platform; -#ifdef WIN32 - platform = "winapplication"; -#else - platform = "application"; -#endif - SUIT_MessageBox::warning(0, QObject::tr("WRN_WARNING"), - QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName) ); - } -} - -/*! - Populates table with data -*/ -void VisuGUI_TableDlg::initDlg() -{ - int i, j; - if ( myObject ) { - _PTR(GenericAttribute) anAttr; - _PTR(AttributeTableOfInteger) tblIntAttr; - _PTR(AttributeTableOfReal) tblRealAttr; - if ( myObject->FindAttribute( anAttr, "AttributeTableOfInteger") ) { - tblIntAttr = anAttr; - } - if ( myObject->FindAttribute( anAttr, "AttributeTableOfReal") ) { - tblRealAttr = anAttr; - } - // Table of integer - if ( tblIntAttr && myIntTable ) { - try { - // title - myIntTable->setTableTitle( tblIntAttr->GetTitle().c_str() ); - // nb of rows & cols - int nbRows = tblIntAttr->GetNbRows() ; - int nbCols = tblIntAttr->GetNbColumns(); - myIntTable->setNumRows( nbRows ); - myIntTable->setNumCols( nbCols ); - // rows titles - QStringList strlist; - vector rowTitles = tblIntAttr->GetRowTitles(); - for ( i = 0; i < nbRows; i++ ) { - if ( rowTitles.size() > 0 ) - strlist.append( rowTitles[i].c_str() ); - else - strlist.append( "" ); - } - myIntTable->setRowTitles( strlist ); - // columns titles - strlist.clear(); - vector colTitles = tblIntAttr->GetColumnTitles(); - for ( i = 0; i < nbCols; i++ ) { - if ( colTitles.size() > 0 ) - strlist.append( colTitles[i].c_str() ); - else - strlist.append( "" ); - } - myIntTable->setColTitles( strlist ); - // units - strlist.clear(); - vector rowUnits = tblIntAttr->GetRowUnits(); - if ( rowUnits.size() > 0 ) { - for ( i = 0; i < nbRows; i++ ) - strlist.append( rowUnits[i].c_str() ); - myIntTable->setUnits( strlist ); - } - // data - for ( i = 1; i <= nbRows; i++ ) { - strlist.clear(); - for ( j = 1; j <= nbCols; j++ ) { - if ( tblIntAttr->HasValue( i, j ) ) - strlist.append( QString::number( tblIntAttr->GetValue( i, j ) ) ); - else - strlist.append( QString::null ); - } - myIntTable->setRowData( i-1, strlist ); - } - myIntTable->adjustTable(); - } - catch( ... ) { - MESSAGE("VisuGUI_TableDlg::initDlg : Exception has been caught !!!"); - } - } - // Table of real - if ( tblRealAttr && myRealTable ) { - try { - // title - myRealTable->setTableTitle( tblRealAttr->GetTitle().c_str() ); - // nb of rows & cols - int nbRows = tblRealAttr->GetNbRows() ; - int nbCols = tblRealAttr->GetNbColumns(); - myRealTable->setNumRows( nbRows ); - myRealTable->setNumCols( nbCols ); - // rows titles - QStringList strlist; - vector rowTitles = tblRealAttr->GetRowTitles(); - for ( i = 0; i < nbRows; i++ ) { - if ( rowTitles.size() > 0 ) - strlist.append( rowTitles[i].c_str() ); - else - strlist.append( "" ); - } - myRealTable->setRowTitles( strlist ); - // columns titles - strlist.clear(); - vector colTitles = tblRealAttr->GetColumnTitles(); - for ( i = 0; i < nbCols; i++ ) { - if ( colTitles.size() > 0 ) - strlist.append( colTitles[i].c_str() ); - else - strlist.append( "" ); - } - myRealTable->setColTitles( strlist ); - // units - strlist.clear(); - vector rowUnits = tblRealAttr->GetRowUnits(); - if ( rowUnits.size() > 0 ) { - for ( i = 0; i < nbRows; i++ ) - strlist.append( rowUnits[i].c_str() ); - myRealTable->setUnits( strlist ); - } - // data - for ( i = 1; i <= nbRows; i++ ) { - strlist.clear(); - for ( j = 1; j <= nbCols; j++ ) { - if ( tblRealAttr->HasValue( i, j ) ) - strlist.append( QString::number( tblRealAttr->GetValue( i, j ) ) ); - else - strlist.append( QString::null ); - } - myRealTable->setRowData( i-1, strlist ); - } - myRealTable->adjustTable(); - } - catch( ... ) { - MESSAGE("VisuGUI_TableDlg::initDlg : Exception has been caught !!!"); - } - } - } -} - -/*! - Provides help on F1 button click -*/ -void VisuGUI_TableDlg::keyPressEvent( QKeyEvent* e ) -{ - QDialog::keyPressEvent( e ); - if ( e->isAccepted() ) - return; - - if ( e->key() == Qt::Key_F1 ) - { - e->accept(); - onHelp(); - } -} - -/*! - Constructor -*/ -VisuGUI_TableWidget::VisuGUI_TableWidget( QWidget* parent, - const char* name, - bool edit, - Qt::Orientation orient, - bool showColumnTitles ) - : QWidget( parent ), myOrientation( orient ) -{ - QGridLayout* mainLayout = new QGridLayout( this ); - mainLayout->setMargin( 0 ); - mainLayout->setSpacing( SPACING_SIZE ); - - myTitleEdit = new QLineEdit( this ); - myTitleEdit->setAlignment( Qt::AlignCenter ); - myTitleEdit->setReadOnly( !edit ); - QFont fnt = myTitleEdit->font(); - fnt.setBold( true ); - myTitleEdit->setFont( fnt ); - - //myTable = new VisuGUI_Table( orient, this ); - myTable = new QTableWidget( 5, 5, this ); - //myTable->setNumRows( 5 ); - //myTable->setNumCols( 5 ); - myTable->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) ); - myTable->setMinimumSize( MIN_TABLE_WIDTH, MIN_TABLE_HEIGHT ); - myTable->setSelectionMode( QAbstractItemView::SingleSelection ); - myTable->setShowGrid( true ); - myTable->horizontalHeader()->setMovable( false ); - myTable->verticalHeader()->setMovable( false ); - //myTable->setColumnMovingEnabled( false ); - //myTable->setRowMovingEnabled( false ); - myTable->setDragEnabled( false ); - //myTable->setReadOnly( !edit ); - myTable->setEditTriggers( edit ? QAbstractItemView::AllEditTriggers : QAbstractItemView::NoEditTriggers ); - - setUnitsTitle( tr( "UNITS_TLT" ) ); - - if ( !showColumnTitles ) { - if ( myOrientation == Qt::Horizontal ) { - myTable->horizontalHeader()->hide(); - //myTable->setTopMargin( 0 ); - } - else { - myTable->verticalHeader()->hide(); - //myTable->setLeftMargin( 0 ); - } - } - - mainLayout->addWidget( myTitleEdit, 0, 0 ); - mainLayout->addWidget( myTable, 1, 0 ); - - if ( edit ) { - myAddRowBtn = new QPushButton( tr( "ADD_ROW_BTN" ), this ); - myDelRowBtn = new QPushButton( tr( "REMOVE_ROW_BTN" ), this ); - myAddColBtn = new QPushButton( tr( "ADD_COLUMN_BTN" ), this ); - myDelColBtn = new QPushButton( tr( "REMOVE_COLUMN_BTN" ), this ); - myAdjustBtn = new QPushButton( tr( "ADJUST_CELLS_BTN" ), this ); - mySelectAllBtn = new QPushButton( tr( "SELECT_ALL_BTN" ), this ); - myClearBtn = new QPushButton( tr( "CLEAR_BTN"), this ); - QVBoxLayout* btnLayout = new QVBoxLayout; btnLayout->setMargin( 0 ); btnLayout->setSpacing( SPACING_SIZE ); - btnLayout->addWidget( myAddRowBtn ); - btnLayout->addWidget( myDelRowBtn ); - btnLayout->addWidget( myAddColBtn ); - btnLayout->addWidget( myDelColBtn ); - btnLayout->addStretch(); - btnLayout->addWidget( myAdjustBtn ); - btnLayout->addStretch(); - btnLayout->addWidget( mySelectAllBtn ); - btnLayout->addWidget( myClearBtn ); - mainLayout->addLayout( btnLayout, 1, 1 ); - connect( myTable, SIGNAL( selectionChanged() ), this, SLOT( updateButtonsState() ) ); - connect( myTable, SIGNAL( currentChanged( int, int) ), this, SLOT( updateButtonsState() ) ); - connect( myAddRowBtn, SIGNAL( clicked() ), this, SLOT( addRow() ) ); - connect( myAddColBtn, SIGNAL( clicked() ), this, SLOT( addCol() ) ); - connect( myDelRowBtn, SIGNAL( clicked() ), this, SLOT( delRow() ) ); - connect( myDelColBtn, SIGNAL( clicked() ), this, SLOT( delCol() ) ); - connect( myAdjustBtn, SIGNAL( clicked() ), this, SLOT( adjustTable() ) ); - connect( mySelectAllBtn, SIGNAL( clicked() ), this, SLOT( selectAll() ) ); - connect( myClearBtn, SIGNAL( clicked() ), this, SLOT( clearTable() ) ); - myTable->horizontalHeader()->installEventFilter( this ); - myTable->verticalHeader()->installEventFilter( this ); - myTable->installEventFilter( this ); - } - updateButtonsState(); -} -/*! - Destructor -*/ -VisuGUI_TableWidget::~VisuGUI_TableWidget() -{ -} -/*! - Sets table title -*/ -void VisuGUI_TableWidget::setTableTitle( const QString& title ) -{ - myTitleEdit->setText( title ); -} -/*! - Gets table title -*/ -QString VisuGUI_TableWidget::getTableTitle() -{ - return myTitleEdit->text(); -} -/*! - Sets total number of rows -*/ -void VisuGUI_TableWidget::setNumRows( const int num ) -{ - myOrientation == Qt::Horizontal ? myTable->setRowCount( num ) : myTable->setColumnCount( num ); -} -/*! - Gets total number of rows -*/ -int VisuGUI_TableWidget::getNumRows() -{ - return myOrientation == Qt::Horizontal ? myTable->rowCount() : myTable->columnCount(); -} -/*! - Sets total number of columns -*/ -void VisuGUI_TableWidget::setNumCols( const int num ) -{ - // !!! first column contains units !!! - myOrientation == Qt::Horizontal ? myTable->setColumnCount( num+1 ) : myTable->setRowCount( num+1 ); -// myOrientation == Qt::Horizontal ? myTable->setColumnReadOnly( 0, true ) : myTable->setRowReadOnly( 0, true ); -} -/*! - Gets total number of columns -*/ -int VisuGUI_TableWidget::getNumCols() -{ - // !!! first column contains units !!! - return myOrientation == Qt::Horizontal ? myTable->columnCount()-1 : myTable->rowCount()-1; -} -/*! - Sets rows titles -*/ -void VisuGUI_TableWidget::setRowTitles( QStringList& tlts ) -{ - QStringList aLabels; - for ( int i = 0; i < tlts.count(); i++ ) - tlts[i].isNull() ? aLabels.append("") : aLabels.append( tlts[i] ); - - myOrientation == Qt::Horizontal ? - myTable->setVerticalHeaderLabels( aLabels ) : - myTable->setHorizontalHeaderLabels( aLabels ); - - // myTable->verticalHeader()->setLabel( i, tlts[i] ) : - //myTable->horizontalHeader()->setLabel( i, tlts[i] ); - //} -} -/*! - Gets rows titles -*/ -void VisuGUI_TableWidget::getRowTitles( QStringList& tlts ) -{ - tlts.clear(); - if ( myOrientation == Qt::Horizontal ) { - for ( int i = 0; i < myTable->rowCount(); i++ ) { - tlts.append( myTable->verticalHeaderItem(i) ? myTable->verticalHeaderItem(i)->text() : "" ); - } - } - else { - for ( int i = 0; i < myTable->columnCount(); i++ ) { - tlts.append( myTable->horizontalHeaderItem(i) ? myTable->horizontalHeaderItem(i)->text() : "" ); - } - } -} -/*! - Sets columns titles -*/ -void VisuGUI_TableWidget::setColTitles( QStringList& tlts ) -{ - QStringList aLabels; - - // !!! first column contains units !!! - aLabels.append(""); // it'll be initialized below - in setUnitsTitle() method - - for ( int i = 0; i < tlts.count(); i++ ) - tlts[i].isNull() ? aLabels.append("") : aLabels.append( tlts[i] ); - - myOrientation == Qt::Horizontal ? - myTable->setHorizontalHeaderLabels( aLabels ) : - myTable->setVerticalHeaderLabels( aLabels ); - - setUnitsTitle( tr( "UNITS_TLT" ) ); -} -/*! - Sets columns titles -*/ -void VisuGUI_TableWidget::getColTitles( QStringList& tlts ) -{ - // !!! first column contains units !!! - tlts.clear(); - if ( myOrientation == Qt::Horizontal ) { - for ( int i = 1; i < myTable->columnCount(); i++ ) { - tlts.append( myTable->horizontalHeaderItem(i) ? myTable->horizontalHeaderItem(i)->text() : "" ); - } - } - else { - for ( int i = 1; i < myTable->rowCount(); i++ ) { - tlts.append( myTable->verticalHeaderItem(i) ? myTable->verticalHeaderItem(i)->text() : "" ); - } - } -} -/*! - Sets units title -*/ -void VisuGUI_TableWidget::setUnitsTitle( const QString& tlt ) { - // !!! first column contains units !!! - myTable->model()->setHeaderData( 0, myOrientation, QVariant(tlt.isNull() ? "" : tlt), Qt::DisplayRole ); -} -/*! - Sets units -*/ -void VisuGUI_TableWidget::setUnits( QStringList& units ) -{ - QAbstractTableModel* aModel = qobject_cast( myTable->model() ); - if ( aModel ) - { - QModelIndex anIndex; - for ( int i = 0; i < units.count(); i++ ) - { - myOrientation == Qt::Horizontal ? - anIndex = aModel->index( i, 0 ) : - anIndex = aModel->index( 0, i ); - - aModel->setData( anIndex, QVariant( units[i].isNull() ? "" : units[i] ) ); - } - } -} -/*! - Gets units -*/ -void VisuGUI_TableWidget::getUnits( QStringList& units ) -{ - units.clear(); - QAbstractTableModel* aModel = qobject_cast( myTable->model() ); - if ( aModel ) - { - if ( myOrientation == Qt::Horizontal ) - { - for ( int i = 0; i < myTable->rowCount(); i++ ) - units.append( aModel->index( i, 0 ).data().toString() ); - } - else { - for ( int i = 0; i < myTable->columnCount(); i++ ) - units.append( aModel->index( 0, i ).data().toString() ); - } - } -} -/*! - Sets row data -*/ -void VisuGUI_TableWidget::setRowData( int row, QStringList& data ) -{ - QAbstractTableModel* aModel = qobject_cast( myTable->model() ); - if ( aModel ) - { - QModelIndex anIndex; - if ( row >= 0 && row < getNumRows() ) { - for ( int i = 0; i < data.count(); i++ ) - { - myOrientation == Qt::Horizontal ? anIndex = aModel->index( row, i+1 ) : - anIndex = aModel->index( i+1, row ); - aModel->setData( anIndex, QVariant( data[i] ) ); - - } - } - } -} -/*! - Gets row data -*/ -void VisuGUI_TableWidget::getRowData( int row, QStringList& data ) -{ - data.clear(); - QAbstractTableModel* aModel = qobject_cast( myTable->model() ); - if ( aModel ) - { - if ( row >= 0 && row < getNumRows() ) - { - if ( myOrientation == Qt::Horizontal ) - { - for ( int i = 1; i < myTable->columnCount(); i++ ) - data.append( aModel->index( row, i ).data().toString() ); - } - else { - for ( int i = 1; i < myTable->rowCount(); i++ ) - data.append( aModel->index( i, row ).data().toString() ); - } - } - } -} -/*! - Adjusts table cell to see contents, button slot -*/ -void VisuGUI_TableWidget::adjustTable() -{ - myTable->resizeRowsToContents(); - myTable->resizeColumnsToContents(); -} -/*! - Called when selection changed in table -*/ -void VisuGUI_TableWidget::updateButtonsState() -{ - if ( myTable->editTriggers() == QAbstractItemView::NoEditTriggers ) - return; - bool bDR = false; // - bool bDC = false; // - bool bSA = false; // button slot -*/ -void VisuGUI_TableWidget::selectAll() -{ - /*myTable->clearSelection(); - QTableSelection ts; - ts.init( 0, 0 ); ts.expandTo( myTable->numRows()-1, myTable->numCols()-1 ); - myTable->addSelection( ts );*/ - myTable->selectAll(); - updateButtonsState(); -} -/*! - button slot -*/ -void VisuGUI_TableWidget::clearTable() -{ - /*int nbSel = myTable->numSelections(); - for ( int i = 0; i < nbSel; i++ ) { - QTableSelection ts = myTable->selection( i ); - for ( int j = ts.topRow(); j < ts.bottomRow()+1; j++) { - if ( myOrientation == Qt::Vertical && j == 0 ) { -// continue; // UNITS - } - for ( int k = ts.leftCol(); k < ts.rightCol()+1; k++) { - if ( myOrientation == Qt::Horizontal && k == 0 ) { -// continue; // UNITS - } - myTable->clearCell( j, k ); - } - } - } - if ( nbSel == 0 ) - myTable->clearCell( myTable->currentRow(), myTable->currentColumn() ); - myTable->clearSelection();*/ - myTable->clearContents(); - updateButtonsState(); -} -/*! - Event filter - handles titles editing -*/ -bool VisuGUI_TableWidget::eventFilter( QObject* o, QEvent* e ) -{ - if ( e->type() == QEvent::MouseButtonDblClick) { - //TODO - /*QMouseEvent* me = ( QMouseEvent* )e; - if ( me->button() == Qt::LeftButton && (myTable->editTriggers() != QAbstractItemView::NoEditTriggers ) ) { - if ( o == myTable->horizontalHeader() ) { - for ( int i = 0; i < myTable->horizontalHeader()->count(); i++ ) { - QRect rect = myTable->horizontalHeader()->sectionRect( i ); - rect.addCoords( 1, 1, -1, -1 ); - if ( rect.contains( myTable->horizontalHeader()->mapFromGlobal( me->globalPos() ) ) ) { - if ( myOrientation == Qt::Vertical || i != 0 ) { - bool bOk; - QString tlt = QInputDialog::getText( tr( "SET_TITLE_TLT" ), - tr( "TITLE_LBL" ), - QLineEdit::Normal, - myTable->horizontalHeader()->label( i ), - &bOk, - this ); - if ( bOk && !tlt.isNull() ) - myTable->horizontalHeader()->setLabel( i, tlt ); - break; - } - } - } - } - if ( o == myTable->verticalHeader() ) { - for ( int i = 0; i < myTable->verticalHeader()->count(); i++ ) { - QRect rect = myTable->verticalHeader()->sectionRect( i ); - rect.addCoords( 1, 1, -1, -1 ); - if ( rect.contains( myTable->verticalHeader()->mapFromGlobal( me->globalPos() ) ) ) { - if ( myOrientation == Qt::Horizontal || i != 0 ) { - bool bOk; - QString tlt = QInputDialog::getText( tr( "SET_TITLE_TLT" ), - tr( "TITLE_LBL" ), - QLineEdit::Normal, - myTable->verticalHeader()->label( i ), - &bOk, - this ); - if ( bOk && !tlt.isNull() ) - myTable->verticalHeader()->setLabel( i, tlt ); - break; - } - } - } - } - }*/ - } - else if ( e->type() == QEvent::KeyRelease && o == myTable ) { - QKeyEvent* ke = (QKeyEvent*)e; - if ( ke->key() == Qt::Key_Delete && (myTable->editTriggers() != QAbstractItemView::NoEditTriggers) ) { - clearTable(); - } - else if ( ke->key() == Qt::Key_Backspace && (myTable->editTriggers() != QAbstractItemView::NoEditTriggers) ) { - clearTable(); - int i = myTable->currentRow(); - int j = myTable->currentColumn() - 1; - if ( j < 0 ) { j = myTable->columnCount()-1; i--; } - if ( i >= 0 && j >= 0 ) - myTable->setCurrentCell( i, j ); - } - } - return QWidget::eventFilter( o, e ); -} diff --git a/src/GUITOOLS/VisuGUI_TableDlg.h b/src/GUITOOLS/VisuGUI_TableDlg.h deleted file mode 100644 index 9f708ae7..00000000 --- a/src/GUITOOLS/VisuGUI_TableDlg.h +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// File : VisuGUI_TableDlg.h -// Author : Vadim SANDLER -// Module : VISU -// -#ifndef VisuGUI_TABLE_DLG_H -#define VisuGUI_TABLE_DLG_H - -#include -#include -#include -#include - -class QTableWidget; -class VisuGUI_TableWidget; - -#include - -#include "VisuGUITools.h" - -class VISU_GUITOOLS_EXPORT VisuGUI_TableDlg : public QDialog -{ - Q_OBJECT - -public: - - enum { ttNone, ttInt, ttReal, ttBoth, ttAuto }; - - VisuGUI_TableDlg( QWidget* parent, - _PTR(SObject) obj, - bool edit = false, - int which = ttAuto, - Qt::Orientation orient = Qt::Horizontal, - bool showColumnTitles = true ); - ~VisuGUI_TableDlg(); - -private: - void keyPressEvent( QKeyEvent* e ); - -public slots: - void onOK(); - void onHelp(); - -private: - void initDlg(); - -private: - VisuGUI_TableWidget* myIntTable; - VisuGUI_TableWidget* myRealTable; - QPushButton* myOKBtn; - QPushButton* myCancelBtn; - QPushButton* myHelpBtn; - - _PTR(SObject) myObject; -}; - -class VISU_GUITOOLS_EXPORT VisuGUI_TableWidget : public QWidget -{ - Q_OBJECT -public: - VisuGUI_TableWidget( QWidget* parent = 0, - const char* name = 0, - bool edit = false, - Qt::Orientation orient = Qt::Horizontal, - bool showColumnTitles = true ); - ~VisuGUI_TableWidget(); - - void setTableTitle( const QString& title ); - QString getTableTitle(); - void setNumRows( const int num ); - int getNumRows(); - void setNumCols( const int num ); - int getNumCols(); - void setRowTitles( QStringList& tlts ); - void getRowTitles( QStringList& tlts ); - void setColTitles( QStringList& tlts ); - void getColTitles( QStringList& tlts ); - void setUnitsTitle( const QString& tlt ); - void setUnits( QStringList& units ); - void getUnits( QStringList& units ); - void setRowData( int row, QStringList& data ); - void getRowData( int row, QStringList& data ); - - QTableWidget* getTable() { return myTable; } - QLineEdit* getTitleEdit() { return myTitleEdit; } - - bool eventFilter( QObject* o, QEvent* e); - -public slots: - void updateButtonsState(); - void addRow(); - void addCol(); - void delRow(); - void delCol(); - void adjustTable(); - void selectAll(); - void clearTable(); - -private: - QLineEdit* myTitleEdit; - QTableWidget* myTable; - QPushButton* myAddRowBtn; - QPushButton* myAddColBtn; - QPushButton* myDelRowBtn; - QPushButton* myDelColBtn; - QPushButton* myAdjustBtn; - QPushButton* mySelectAllBtn; - QPushButton* myClearBtn; - Qt::Orientation myOrientation; -}; - -class VISU_GUITOOLS_EXPORT NumDelegateItem: public QItemDelegate -{ -public: - enum NumValidator{ NV_Int, NV_Real }; - - NumDelegateItem( QObject* parent, NumValidator mode = NV_Int ); - virtual ~NumDelegateItem(); - - virtual QWidget * createEditor( QWidget * parent, - const QStyleOptionViewItem & option, - const QModelIndex & index ) const; - virtual void setEditorData( QWidget * editor, - const QModelIndex & index ) const; -private: - int myMode; -}; - -#endif // VisuGUI_TABLE_DLG_H - diff --git a/src/VVTK/Makefile.am b/src/VVTK/Makefile.am deleted file mode 100755 index ace532c0..00000000 --- a/src/VVTK/Makefile.am +++ /dev/null @@ -1,65 +0,0 @@ -# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -# -# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# -# File : Makefile.in -# Author : Alexander Solovyov(OCN) -# Module : VVTK -# $Header: -# -include $(top_srcdir)/adm_local/unix/make_common_starter.am - -lib_LTLIBRARIES= libVVTK.la - -# header files -salomeinclude_HEADERS= \ - VVTK.h \ - VVTK_PrimitiveBox.h \ - VVTK_SizeBox.h - -dist_libVVTK_la_SOURCES= \ - VVTK_PrimitiveBox.cxx \ - VVTK_SizeBox.cxx - -MOC_FILES= \ - VVTK_PrimitiveBox_moc.cxx \ - VVTK_SizeBox_moc.cxx - -nodist_libVVTK_la_SOURCES=$(MOC_FILES) - -libVVTK_la_CPPFLAGS= \ - $(QT_INCLUDES) \ - @CAS_CXXFLAGS@ @CAS_CPPFLAGS@ \ - $(VTK_INCLUDES) \ - $(BOOST_CPPFLAGS) \ - $(KERNEL_CXXFLAGS) \ - $(GUI_CXXFLAGS) \ - $(MED_CXXFLAGS) \ - -I$(srcdir)/../OBJECT -I$(srcdir)/../PIPELINE -I$(srcdir)/../CONVERTOR - -libVVTK_la_LDFLAGS= \ - ../OBJECT/libVisuObject.la \ - ../PIPELINE/libVisuPipeLine.la \ - ../CONVERTOR/libVisuConvertor.la \ - $(KERNEL_LDFLAGS) -lOpUtil \ - $(GUI_LDFLAGS) -lsuit -lCAM -lSalomeObject -lSVTK \ - $(QT_MT_LIBS) \ - $(OCC_LIBS) \ - $(VTK_LIBS) diff --git a/src/VVTK/VVTK.h b/src/VVTK/VVTK.h deleted file mode 100755 index 9564091c..00000000 --- a/src/VVTK/VVTK.h +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -#ifdef WNT -#if defined VISU_VVTK_EXPORTS || defined VVTK_EXPORTS -#define VVTK_EXPORT __declspec(dllexport) -#else -#define VVTK_EXPORT __declspec(dllimport) -#endif -#else -#define VVTK_EXPORT -#endif - -#if defined WNT -#pragma warning ( disable: 4251 ) -#endif diff --git a/src/VVTK/VVTK_ImageWriter.cxx b/src/VVTK/VVTK_ImageWriter.cxx deleted file mode 100755 index 326498f2..00000000 --- a/src/VVTK/VVTK_ImageWriter.cxx +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// SALOME VTKViewer : build VTK viewer into Salome desktop -// File : -// Author : -// Module : -// $Header$ -// -#include "VVTK_ImageWriter.h" - -#include - -#include "utilities.h" - -#include -#include -#include -#include - -#ifdef _DEBUG_ -static int MYDEBUG = 0; -#else -static int MYDEBUG = 0; -#endif - - -//---------------------------------------------------------------------------- -VVTK_ImageWriter -::VVTK_ImageWriter(QSemaphore* theSemaphore, - vtkImageData* theImageData, - const std::string& theName, - int theProgressive, - int theQuality): - mySemaphore(theSemaphore), - myImageData(theImageData), - myName(theName), - myProgressive(theProgressive), - myQuality(theQuality), - myConstraint16Flag(true) -{} - -//---------------------------------------------------------------------------- -VVTK_ImageWriter -::~VVTK_ImageWriter() -{ - if(MYDEBUG) MESSAGE("VVTK_ImageWriter::~VVTK_ImageWriter - this = "< anImageClip; - // - if(myConstraint16Flag){ - int uExtent[6]; - myImageData->UpdateInformation(); - myImageData->GetUpdateExtent(uExtent); - unsigned int width = uExtent[1] - uExtent[0] + 1; - unsigned int height = uExtent[3] - uExtent[2] + 1; - width = (width / 16) * 16; - height= (height / 16) * 16; - uExtent[1] = uExtent[0] + width - 1; - uExtent[3] = uExtent[2] + height - 1; - // - anImageClip = vtkImageClip::New(); - anImageClip->Delete(); - - anImageClip->SetInput(myImageData); - anImageClip->SetOutputWholeExtent(uExtent); - anImageClip->ClipDataOn(); - anImageData = anImageClip->GetOutput(); - } - // - aWriter->WriteToMemoryOff(); - aWriter->SetFileName(myName.c_str()); - aWriter->SetQuality(myQuality); - aWriter->SetProgressive(myProgressive); - aWriter->SetInput(anImageData); - aWriter->Write(); - - aWriter->Delete(); - myImageData->Delete(); - - if(MYDEBUG) MESSAGE("VVTK_ImageWriter::run "<< - "- this = "< - -#include - -#include "utilities.h" - -#include - -#ifdef _DEBUG_ -static int MYDEBUG = 0; -#else -static int MYDEBUG = 0; -#endif - -//---------------------------------------------------------------------------- -VVTK_ImageWriterMgr -::VVTK_ImageWriterMgr() -{ - int aMax = std::numeric_limits::max() / 2; - mySemaphore = new QSemaphore(aMax); - mySemaphore->acquire( aMax ); - if(MYDEBUG) MESSAGE("VVTK_ImageWriterMgr::VVTK_ImageWriterMgr "<< - //"- total = "<total()<< - "; available = "<available() ); -} - - -//---------------------------------------------------------------------------- -VVTK_ImageWriterMgr -::~VVTK_ImageWriterMgr() -{ - Stop(); - delete mySemaphore; -} - - -//---------------------------------------------------------------------------- -void -VVTK_ImageWriterMgr -::StartImageWriter(vtkImageData *theImageData, - const std::string& theName, - const int theProgressive, - const int theQuality) -{ - VVTK_ImageWriter *anImageWriter = - new VVTK_ImageWriter(mySemaphore, - theImageData, - theName, - theProgressive, - theQuality); - myThreads.push_back(anImageWriter); - - anImageWriter->start(); - -} - - -//---------------------------------------------------------------------------- -void -VVTK_ImageWriterMgr -::Stop() -{ - if(MYDEBUG) MESSAGE("VVTK_ImageWriterMgr::Stop "<< - //"- total = "<total()<< - "; available = "<available() ); - if(MYDEBUG) MESSAGE("VVTK_ImageWriterMgr::Stop - *mySemaphore += "<acquire( myThreads.size() ); - - for(size_t anId = 0, anEnd = myThreads.size(); anId < anEnd; anId++){ - VVTK_ImageWriter* anImageWriter = myThreads[anId]; - anImageWriter->wait(); - delete anImageWriter; - } - myThreads.clear(); -} diff --git a/src/VVTK/VVTK_ImageWriterMgr.h b/src/VVTK/VVTK_ImageWriterMgr.h deleted file mode 100755 index dcc196e9..00000000 --- a/src/VVTK/VVTK_ImageWriterMgr.h +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// SALOME VTKViewer : build VTK viewer into Salome desktop -// File : -// Author : -// Module : -// $Header$ -// -#ifndef _VVTK_ImageWriterMgr_Header_File_ -#define _VVTK_ImageWriterMgr_Header_File_ - -#include -#include - -class QString; -class vtkImageData; -class VVTK_ImageWriter; -class QSemaphore; - -class VVTK_ImageWriterMgr -{ - public: - VVTK_ImageWriterMgr(); - ~VVTK_ImageWriterMgr(); - - void - StartImageWriter(vtkImageData *theImageData, - const std::string& theName, - const int theProgressive, - const int theQuality); - - void - Stop(); - - typedef std::vector TWriterThreads; - - protected: - TWriterThreads myThreads; - - QSemaphore* mySemaphore; -}; - - -#endif - diff --git a/src/VVTK/VVTK_InteractorStyle.cxx b/src/VVTK/VVTK_InteractorStyle.cxx deleted file mode 100644 index c50c8cd0..00000000 --- a/src/VVTK/VVTK_InteractorStyle.cxx +++ /dev/null @@ -1,292 +0,0 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// SALOME VTKViewer : build VTK viewer into Salome desktop -// File : VVTK_InteractorStyle.cxx -// Author : Christophe ATTANASIO -// Module : SALOME -// $Header$ -// -#include "VVTK_InteractorStyle.h" -#include "VISU_GaussPtsSettings.h" -#include "SVTK_Selector.h" -#include "VISU_Event.h" - -#include -#include -#include -#include -#include -#include - - -//---------------------------------------------------------------------------- -vtkStandardNewMacro(VVTK_InteractorStyle); -//---------------------------------------------------------------------------- - -VVTK_InteractorStyle -::VVTK_InteractorStyle(): - myIsMidButtonDown( false ), - myIsLeftButtonDown( false ), - mySMDecreaseMagnificationBtn(10), - mySMIncreaseMagnificationBtn(11) -{ -} - -//---------------------------------------------------------------------------- -VVTK_InteractorStyle -::~VVTK_InteractorStyle() -{ -} - -//---------------------------------------------------------------------------- -void -VVTK_InteractorStyle -::OnLeftButtonDown(int ctrl, int shift, - int x, int y) -{ - myIsLeftButtonDown = true; - - if (this->HasObserver(vtkCommand::LeftButtonPressEvent)) { - this->InvokeEvent(vtkCommand::LeftButtonPressEvent,NULL); - return; - } - this->FindPokedRenderer(x, y); - if (this->CurrentRenderer == NULL) { - return; - } - myShiftState = shift; - // finishing current viewer operation - if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE) { - onFinishOperation(); - startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE); - } - myOtherPoint = myPoint = QPoint(x, y); - if (ForcedState != VTK_INTERACTOR_STYLE_CAMERA_NONE) { - startOperation(ForcedState); - } - else { - if (!(ctrl||shift)){ - if (myIsMidButtonDown){ - startOperation(VTK_INTERACTOR_STYLE_CAMERA_ZOOM); - } - else{ - startOperation(VTK_INTERACTOR_STYLE_CAMERA_ROTATE); - } - } - } - return; -} - -//---------------------------------------------------------------------------- -void -VVTK_InteractorStyle -::OnMiddleButtonDown(int ctrl, - int shift, - int x, int y) -{ - myIsMidButtonDown = true; - - if (this->HasObserver(vtkCommand::MiddleButtonPressEvent)) { - this->InvokeEvent(vtkCommand::MiddleButtonPressEvent,NULL); - return; - } - this->FindPokedRenderer(x, y); - if (this->CurrentRenderer == NULL) { - return; - } - myShiftState = shift; - // finishing current viewer operation - if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE) { - onFinishOperation(); - startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE); - } - myOtherPoint = myPoint = QPoint(x, y); - if (ForcedState != VTK_INTERACTOR_STYLE_CAMERA_NONE) { - startOperation(ForcedState); - } - else { - if (!(ctrl||shift)){ - if ( myIsLeftButtonDown ){ - startOperation(VTK_INTERACTOR_STYLE_CAMERA_ZOOM); - } - else{ - startOperation(VTK_INTERACTOR_STYLE_CAMERA_PAN); - } - } - } -} - -//---------------------------------------------------------------------------- -void -VVTK_InteractorStyle -::OnLeftButtonUp(int ctrl, int shift, int x, int y) -{ - myIsLeftButtonDown = false; - SVTK_InteractorStyle::OnLeftButtonUp( ctrl, shift, x, y ); - - if ( myIsMidButtonDown ) - OnMiddleButtonDown( ctrl, shift, x, y ); -} - -//---------------------------------------------------------------------------- -void -VVTK_InteractorStyle -::OnMiddleButtonUp(int ctrl, int shift, int x, int y) -{ - myIsMidButtonDown = false; - SVTK_InteractorStyle::OnMiddleButtonUp( ctrl, shift, x, y ); - - if ( myIsLeftButtonDown ) - OnLeftButtonDown( ctrl, shift, x, y ); -} -//---------------------------------------------------------------------------- -void VVTK_InteractorStyle::onFinishOperation() -{ - Superclass::onFinishOperation(); -} - - -//---------------------------------------------------------------------------- -void -VVTK_InteractorStyle -::SetInteractor( vtkRenderWindowInteractor* theInteractor ) -{ - // register EventCallbackCommand as observer of standard events (keypress, mousemove, etc) - Superclass::SetInteractor( theInteractor ); - - if(theInteractor){ - theInteractor->AddObserver( VISU::SetSMDecreaseMagnificationEvent, EventCallbackCommand, Priority ); - theInteractor->AddObserver( VISU::SetSMIncreaseMagnificationEvent, EventCallbackCommand, Priority ); - } -} - - -//---------------------------------------------------------------------------- -void -VVTK_InteractorStyle -::ProcessEvents( vtkObject* object, - unsigned long event, - void* clientData, - void* callData ) -{ - if ( clientData ) { - vtkObject* anObject = reinterpret_cast( clientData ); - VVTK_InteractorStyle* self = dynamic_cast( anObject ); - if( self ){ - switch ( event ) { - case VISU::SetSMDecreaseMagnificationEvent: - self->mySMDecreaseMagnificationBtn = *((int*)callData); - return; - case VISU::SetSMIncreaseMagnificationEvent: - self->mySMIncreaseMagnificationBtn = *((int*)callData); - return; - } - } - } - - Superclass::ProcessEvents( object, event, clientData, callData ); -} - - -//---------------------------------------------------------------------------- -void -VVTK_InteractorStyle -::onSpaceMouseButton( int button ) -{ - if( mySMDecreaseMagnificationBtn == button ) - DecreaseGaussPointMagnification(); - if( mySMIncreaseMagnificationBtn == button ) - IncreaseGaussPointMagnification(); - - Superclass::onSpaceMouseButton( button ); -} - -//---------------------------------------------------------------------------- -void -VVTK_InteractorStyle -::DecreaseGaussPointMagnification() -{ - Interactor->InvokeEvent(VISU::SetSMDecreaseMagnificationEvent,NULL); -} - -//---------------------------------------------------------------------------- -void -VVTK_InteractorStyle -::IncreaseGaussPointMagnification() -{ - Interactor->InvokeEvent(VISU::SetSMIncreaseMagnificationEvent,NULL); -} -//============================================================================ -// -// Controllers -// -vtkStandardNewMacro(VVTK_ControllerIncrement); -//---------------------------------------------------------------------------- -VVTK_ControllerIncrement::VVTK_ControllerIncrement() -{ - myIncrement=10; -} -//---------------------------------------------------------------------------- -VVTK_ControllerIncrement::~VVTK_ControllerIncrement() -{ -} -//---------------------------------------------------------------------------- -int VVTK_ControllerIncrement::Increase() -{ - myIncrement*=2; - return myIncrement; -} -//---------------------------------------------------------------------------- -int VVTK_ControllerIncrement::Decrease() -{ - myIncrement/=2; - if (!myIncrement){ - myIncrement=1; - } - return myIncrement; -} -// -vtkStandardNewMacro(VVTK_ControllerOnKeyDown); -//---------------------------------------------------------------------------- -VVTK_ControllerOnKeyDown::VVTK_ControllerOnKeyDown() -{ -} -//---------------------------------------------------------------------------- -VVTK_ControllerOnKeyDown::~VVTK_ControllerOnKeyDown() -{ -} -//---------------------------------------------------------------------------- -bool VVTK_ControllerOnKeyDown::OnKeyDown(vtkInteractorStyle* theIS) -{ - SVTK_InteractorStyle *pIS=dynamic_cast(theIS); - if (pIS){ - if(pIS->GetSelector()->SelectionMode()==GaussPointSelection){ - char key = pIS->GetInteractor()->GetKeyCode(); - // - if (key == 'S') { - pIS->ActionPicking(); - return false; - } - } - } - return Superclass::OnKeyDown(theIS); -} diff --git a/src/VVTK/VVTK_InteractorStyle.h b/src/VVTK/VVTK_InteractorStyle.h deleted file mode 100644 index 86702bed..00000000 --- a/src/VVTK/VVTK_InteractorStyle.h +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// SALOME VTKViewer : build VTK viewer into Salome desktop -// File : VVTK_InteractorStyle.h -// Author : Christophe ATTANASIO -// Module : SALOME -// $Header$ -// -#ifndef __VVTK_InteractorStyle_h -#define __VVTK_InteractorStyle_h - - -#include "VVTK.h" - -#include "SVTK_InteractorStyle.h" -// -//------------------------------------------- -//! Control the value of increment in new style of interaction. -/*! - This class controls of value of increment, - for pan/rotate/zoom operations in new style - of interaction -*/ -class VVTK_ControllerIncrement : public SVTK_ControllerIncrement { - public: - vtkTypeMacro(VVTK_ControllerIncrement,SVTK_ControllerIncrement); - static VVTK_ControllerIncrement* New(); - - //! Increace the increment value by multiplying on 2 - virtual int Increase(); - - //! Decreace the increment value by division on 2 - virtual int Decrease(); - - protected: - VVTK_ControllerIncrement(); - virtual ~VVTK_ControllerIncrement(); - // - private: - VVTK_ControllerIncrement(const VVTK_ControllerIncrement&); //Not implemented - void operator=(const VVTK_ControllerIncrement&); //Not implemented -}; -// -//------------------------------------------- -//! Control the behaviour of KeyDown event in new style of interaction. -/*! - This class controls of behaviour of of KeyDown event - in new style of interaction. -*/ -class VVTK_ControllerOnKeyDown : public SVTK_ControllerOnKeyDown{ - public: - vtkTypeMacro(VVTK_ControllerOnKeyDown, SVTK_ControllerOnKeyDown); - static VVTK_ControllerOnKeyDown* New(); - - //! Provides the action on event - virtual bool OnKeyDown(vtkInteractorStyle* ); - - protected: - VVTK_ControllerOnKeyDown(); - virtual ~VVTK_ControllerOnKeyDown(); - - private: - VVTK_ControllerOnKeyDown(const VVTK_ControllerOnKeyDown&);//Not implemented - void operator=(const VVTK_ControllerOnKeyDown&); //Not implemented -}; - - -//! Introduce new style of interaction (keyboard free) -class VVTK_EXPORT VVTK_InteractorStyle : public SVTK_InteractorStyle -{ - public: - static VVTK_InteractorStyle *New(); - vtkTypeMacro(VVTK_InteractorStyle,SVTK_InteractorStyle); - - //! Redefined from SVTK_InteractorStyle::SetInteractor in order to add an observer (callback) for custorm event (space mouse event) - virtual - void - SetInteractor( vtkRenderWindowInteractor* ); - - protected: - VVTK_InteractorStyle(); - ~VVTK_InteractorStyle(); - - VVTK_InteractorStyle(const VVTK_InteractorStyle&); // Not implemented - void operator=(const VVTK_InteractorStyle&); // Not implemented - - // Generic event bindings must be overridden in subclasses - - //! Redefine SVTK_InteractorStyle::OnLeftButtonDown - virtual void OnLeftButtonDown(int ctrl, int shift, int x, int y); - - //! Redefine SVTK_InteractorStyle::OnMiddleButtonDown - virtual void OnMiddleButtonDown(int ctrl, int shift, int x, int y); - - //! Redefine SVTK_InteractorStyle::OnLeftButtonUp - virtual void OnLeftButtonUp(int ctrl, int shift, int x, int y); - - //! Redefine SVTK_InteractorStyle::OnMiddleButtonUp - virtual void OnMiddleButtonUp(int ctrl, int shift, int x, int y); - - //! Redefine SVTK_InteractorStyle::onFinishOperation - virtual void onFinishOperation(); - - //! Main process VTK event method - static - void - ProcessEvents(vtkObject* object, - unsigned long event, - void* clientData, - void* callData ); - - //! Redefine SVTK_InteractorStyle::onSpaceMouseButton - virtual void onSpaceMouseButton( int button ); - - //! To decrease magnification of the Gauss Points - void DecreaseGaussPointMagnification(); - - //! To increase magnification of the Gauss Points - void IncreaseGaussPointMagnification(); - - //! SpaceMouse short cuts - int mySMDecreaseMagnificationBtn; - int mySMIncreaseMagnificationBtn; - - bool myIsMidButtonDown; - bool myIsLeftButtonDown; -}; - -#endif diff --git a/src/VVTK/VVTK_MainWindow.cxx b/src/VVTK/VVTK_MainWindow.cxx deleted file mode 100644 index b0324408..00000000 --- a/src/VVTK/VVTK_MainWindow.cxx +++ /dev/null @@ -1,474 +0,0 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers -// File : -// Author : -// Module : -// $Header$ -// -#include "VVTK_MainWindow.h" -#include "VVTK_InteractorStyle.h" -#include "VVTK_Recorder.h" -#include "VVTK_RecorderDlg.h" -#include "VISU_WidgetCtrl.hxx" -#include "VISU_GaussPtsAct.h" -#include "VISU_Event.h" - -#include "SVTK_ViewWindow.h" -#include "SVTK_RenderWindowInteractor.h" -#include "VVTK_Renderer.h" -#include "VVTK_PickingDlg.h" -#include "VVTK_SegmentationCursorDlg.h" - -#include "SUIT_Application.h" -#include "SUIT_Session.h" -#include "SUIT_Tools.h" -#include "SUIT_ViewWindow.h" -#include "SUIT_ResourceMgr.h" -#include "SUIT_Accel.h" -#include "SUIT_MessageBox.h" -#include "QtxAction.h" -#include "QtxMultiAction.h" -#include "QtxActionToolMgr.h" - -#include -#include -#include -#include -#include - -//---------------------------------------------------------------------------- -VVTK_MainWindow::VVTK_MainWindow(QWidget* theParent, - const char* theName, - SUIT_ResourceMgr* theResourceMgr, - SUIT_ViewWindow* theViewWindow): - SVTK_MainWindow(theParent,theName,theResourceMgr,theViewWindow), - myControllerIncrement(VVTK_ControllerIncrement::New()), - myControllerOnKeyDown(VVTK_ControllerOnKeyDown::New()) -{ - myToolMgr = new QtxActionToolMgr( this ); - - myControllerIncrement->Delete(); - myControllerOnKeyDown->Delete(); - - // Recording - myRecordingToolBar = new QToolBar(tr("LBL_TOOLBAR_RECORD_LABEL"), this); - addToolBar(Qt::LeftToolBarArea, myRecordingToolBar ); - myViewWindow->toolMgr()->remove( NonIsometric, myToolBar ); - - - myStartAction = new QtxAction(tr("MNU_VVTK_RECORDING_START"), - theResourceMgr->loadPixmap( "VISU", tr( "ICON_VVTK_RECORDING_START" ) ), - tr( "MNU_VVTK_RECORDING_START" ), 0, this); - myStartAction->setStatusTip(tr("DSC_VVTK_RECORDING_START")); - //myStartAction->addTo( myRecordingToolBar ); - myRecordingToolBar->addAction( myStartAction ); - connect( myStartAction, SIGNAL( triggered ( bool ) ), this, SLOT( OnStartRecording() ) ); - - myPlayAction = new QtxAction(tr("MNU_VVTK_RECORDING_PLAY"), - theResourceMgr->loadPixmap( "VISU", tr( "ICON_VVTK_RECORDING_PLAY" ) ), - tr( "MNU_VVTK_RECORDING_PLAY" ), 0, this); - myPlayAction->setStatusTip(tr("DSC_VVTK_RECORDING_PLAY")); - myPlayAction->setEnabled( false ); - //myPlayAction->addTo( myRecordingToolBar ); - myRecordingToolBar->addAction( myPlayAction ); - connect( myPlayAction, SIGNAL( triggered ( bool ) ), this, SLOT( OnPlayRecording() ) ); - - myPauseAction = new QtxAction(tr("MNU_VVTK_RECORDING_PAUSE"), - theResourceMgr->loadPixmap( "VISU", tr( "ICON_VVTK_RECORDING_PAUSE" ) ), - tr( "MNU_VVTK_RECORDING_PAUSE" ), 0, this); - myPauseAction->setStatusTip(tr("DSC_VVTK_RECORDING_PAUSE")); - myPauseAction->setEnabled( false ); - //myPauseAction->addTo( myRecordingToolBar ); - myRecordingToolBar->addAction( myPauseAction ); - connect( myPauseAction, SIGNAL( triggered ( bool ) ), this, SLOT( OnPauseRecording() ) ); - - myStopAction = new QtxAction(tr("MNU_VVTK_RECORDING_STOP"), - theResourceMgr->loadPixmap( "VISU", tr( "ICON_VVTK_RECORDING_STOP" ) ), - tr( "MNU_VVTK_RECORDING_STOP" ), 0, this); - myStopAction->setStatusTip(tr("DSC_VVTK_RECORDING_STOP")); - myStopAction->setEnabled( false ); - //myStopAction->addTo( myRecordingToolBar ); - myRecordingToolBar->addAction( myStopAction ); - connect( myStopAction, SIGNAL( triggered ( bool ) ), this, SLOT( OnStopRecording() ) ); - - myRecorder = VVTK_Recorder::New(); - //myRecorder->CheckExistAVIMaker(); - //if(myRecorder->ErrorStatus()) - // myRecordingToolBar->setEnabled(false); -} - -//---------------------------------------------------------------------------- - -QtxActionToolMgr* VVTK_MainWindow::toolMgr() const -{ - return myToolMgr; -} - -//---------------------------------------------------------------------------- -void VVTK_MainWindow::Initialize(SVTK_RenderWindowInteractor* theInteractor) -{ - vtkInteractorStyle* aStyle = theInteractor->GetInteractorStyle(); - if(SVTK_InteractorStyle *anInteractorStyle = dynamic_cast(aStyle)){ - anInteractorStyle->SetControllerIncrement(myControllerIncrement.GetPointer()); - anInteractorStyle->SetControllerOnKeyDown(myControllerOnKeyDown.GetPointer()); - } - - myRecorder->SetNbFPS(17.3); - myRecorder->SetQuality(100); - myRecorder->SetProgressiveMode(true); - myRecorder->SetUseSkippedFrames(true); - myRecorder->SetRenderWindow(theInteractor->getRenderWindow()); - - disconnect( SVTK_MainWindow::action( DumpId ), SIGNAL( activated() ), - myViewWindow, SLOT( onDumpView() ) ); - - connect( SVTK_MainWindow::action( DumpId ), SIGNAL( activated() ), - this, SLOT( onDumpView() ) ); - - SVTK_MainWindow::Initialize(theInteractor); - addToolBar( Qt::LeftToolBarArea, getToolBar() ); -} - -VVTK_MainWindow::~VVTK_MainWindow() -{ - if(myRecorder) - myRecorder->Delete(); -} - -//---------------------------------------------------------------------------- -void VVTK_MainWindow::onDumpView() -{ - QImage img = dumpView(); - if( img.isNull() ) - return; - - SUIT_Application* app = SUIT_Session::session()->activeApplication(); - QString fileName = app->getFileName( false, QString::null, - tr( "TLT_IMAGE_FILES" ), - tr( "TLT_DUMP_VIEW" ), 0 ); - if( fileName.isEmpty() ) - return; - - QString fmt = SUIT_Tools::extension( fileName ).toUpper(); - if( fmt.isEmpty() ) - fmt = QString( "BMP" ); // default format - else if( fmt == "JPG" ) - fmt = "JPEG"; - - QApplication::setOverrideCursor( Qt::WaitCursor ); - img.save( fileName, fmt.toLatin1() ); - QApplication::restoreOverrideCursor(); -} - -//---------------------------------------------------------------------------- -void VVTK_MainWindow::OnStartRecording() -{ - myRecorder->CheckExistAVIMaker(); - if (myRecorder->ErrorStatus()) { - SUIT_MessageBox::warning(this, tr("ERROR"), tr("MSG_NO_AVI_MAKER") ); - } - else { - VVTK_RecorderDlg* aRecorderDlg = new VVTK_RecorderDlg( this, myRecorder ); - - if( !aRecorderDlg->exec() ) - return; - - myStartAction->setEnabled( false ); - myPlayAction->setEnabled( false ); - myPauseAction->setEnabled( true ); - myStopAction->setEnabled( true ); - - myRecorder->Record(); - } -} - -//---------------------------------------------------------------------------- -void VVTK_MainWindow::OnPlayRecording() -{ - myStartAction->setEnabled( false ); - myPlayAction->setEnabled( false ); - myPauseAction->setEnabled( true ); - myStopAction->setEnabled( true ); - // - myRecorder->Pause(); -} - -//---------------------------------------------------------------------------- -void VVTK_MainWindow::OnPauseRecording() -{ - myStartAction->setEnabled( false ); - myPlayAction->setEnabled( true ); - myPauseAction->setEnabled( false ); - myStopAction->setEnabled( true ); - // - myRecorder->Pause(); -} - -//---------------------------------------------------------------------------- -void VVTK_MainWindow::OnStopRecording() -{ - myStartAction->setEnabled( true ); - myPlayAction->setEnabled( false ); - myPauseAction->setEnabled( false ); - myStopAction->setEnabled( false ); - // - myRecorder->Stop(); -} - -//---------------------------------------------------------------------------- -void VVTK_MainWindow::action( const int accelAction ) -{ - if ( accelAction == SUIT_Accel::ZoomFit ) - onFitAll(); - else { - int anEvent = SVTK::convertAction( accelAction ); - InvokeEvent( anEvent, 0 ); - } -} - -//---------------------------------------------------------------------------- -VVTK_MainWindow1::VVTK_MainWindow1(QSplitter* theParent, - const char* theName, - SUIT_ResourceMgr* theResourceMgr, - SUIT_ViewWindow* theViewWindow): - VVTK_MainWindow(theParent,theName,theResourceMgr,theViewWindow), - mySplitter(theParent), - myPickingDlg(NULL) -{ - myPtsToolBar = new QToolBar( tr("LBL_TOOLBAR_GAUSS_LABEL"), this ); - addToolBar( Qt::LeftToolBarArea, myPtsToolBar ); - - QPixmap aPixmap; - QtxAction* anAction; - - aPixmap = theResourceMgr->loadPixmap("VISU",tr("ICON_VVTK_SELECTION_MODE_SWITCH")); - myPickingAction = new QtxAction(tr("MNU_VVTK_SELECTION_MODE_SWITCH"), - aPixmap, - tr( "MNU_VVTK_SELECTION_MODE_SWITCH" ), - 0, - this, - //"VVTK/SVTK SelectionSwitch", - true); - myPickingAction->setCheckable(true); - myPickingAction->setStatusTip(tr("DSC_VVTK_SELECTION_MODE_SWITCH")); - myPtsToolBar->addAction( myPickingAction ); - connect(myPickingAction, SIGNAL(toggled(bool)), this, SLOT(OnSelectionModeSwitch(bool))); - - myPickingDlg = new VVTK_PickingDlg( myPickingAction, this, "PickingDlg" ); - - // Plane/Sphere Segmentation - aPixmap = theResourceMgr->loadPixmap("VISU",tr("ICON_VVTK_PLANE_SEGMENTATION_SWITCH")); - myPlaneSegmentationAction = new QtxAction(tr("MNU_VVTK_PLANE_SEGMENTATION_SWITCH"), - aPixmap, - tr( "MNU_VVTK_PLANE_SEGMENTATION_SWITCH" ), - 0, - this, - //"VVTK/SVTK PlaneSegmentationSwitch", - true); - myPlaneSegmentationAction->setCheckable(true); - myPlaneSegmentationAction->setStatusTip(tr("DSC_VVTK_PLANE_SEGMENTATION_SWITCH")); - //myPlaneSegmentationAction->addTo( myPtsToolBar ); - connect( myPlaneSegmentationAction, SIGNAL( triggered() ), this, SLOT( OnSegmentationSwitch() ) ); - - aPixmap = theResourceMgr->loadPixmap("VISU",tr("ICON_VVTK_SPHERE_SEGMENTATION_SWITCH")); - mySphereSegmentationAction = new QtxAction(tr("MNU_VVTK_SPHERE_SEGMENTATION_SWITCH"), - aPixmap, - tr( "MNU_VVTK_SPHERE_SEGMENTATION_SWITCH" ), - 0, - this, - //"VVTK/SVTK SphereSegmentationSwitch", - true); - mySphereSegmentationAction->setCheckable(true); - mySphereSegmentationAction->setStatusTip(tr("DSC_VVTK_SPHERE_SEGMENTATION_SWITCH")); - //mySphereSegmentationAction->addTo( myPtsToolBar ); - connect( mySphereSegmentationAction, SIGNAL( activated() ), this, SLOT( OnSegmentationSwitch() ) ); - - mySegmentationCursorDlg = new VVTK_SegmentationCursorDlg( this, "SegmentationCursorDlg" ); - mySegmentationCursorDlg->SetPlaneAction( myPlaneSegmentationAction ); - mySegmentationCursorDlg->SetSphereAction( mySphereSegmentationAction ); - connect( mySegmentationCursorDlg, SIGNAL( scgClose() ), this, SLOT( OnSegmentationSwitch() ) ); - - //SUIT_ToolButton* aSegmentationButton = new SUIT_ToolButton( myPtsToolBar ); - QtxMultiAction* aSegmentationAction = new QtxMultiAction( this ); - aSegmentationAction->insertAction( myPlaneSegmentationAction ); - aSegmentationAction->insertAction( mySphereSegmentationAction ); - myPtsToolBar->addAction( aSegmentationAction ); -} - -void VVTK_MainWindow1::Initialize(SVTK_RenderWindowInteractor* theInteractor, - VVTK_Renderer1* theRenderer) -{ - myRenderer = theRenderer; - VVTK_MainWindow::Initialize(theInteractor); - - mySegmentationCursorDlg->SetWidgetCtrl( theRenderer->GetWidgetCtrl() ); - mySegmentationCursorDlg->SetInteractor( theInteractor ); - - connect( theInteractor, SIGNAL( selectionChanged() ), SLOT( OnSelectionChanged() ) ); - myPickingDlg->SetInteractor( theInteractor ); -} - -VVTK_MainWindow1::~VVTK_MainWindow1() -{} - -//---------------------------------------------------------------------------- -VVTK_MainWindow2* VVTK_MainWindow1::CreateMainWindow2(QWidget* theParent, - const char* theName, - SUIT_ResourceMgr* theResourceMgr, - SUIT_ViewWindow* theViewWindow) -{ - myMainWindow2 = new VVTK_MainWindow2(theParent, - theName, - theResourceMgr, - theViewWindow); - return myMainWindow2; -} - - -//---------------------------------------------------------------------------- -void VVTK_MainWindow1::OnSelectionModeSwitch(bool theIsSelectionOn) -{ - if ( theIsSelectionOn && !isVisible() ) - return; - - Selection_Mode aSelectionMode = SelectionMode(); - if(theIsSelectionOn && aSelectionMode != GaussPointSelection) - SetSelectionMode(GaussPointSelection); - else if(!theIsSelectionOn && aSelectionMode == GaussPointSelection) - SetSelectionMode(ActorSelection); - - if( theIsSelectionOn ) - { - myPickingDlg->Update(); - myPickingDlg->show(); - } - else - myPickingDlg->hide(); -} - -void VVTK_MainWindow1::OnSelectionChanged() -{ - Selection_Mode aSelectionMode = SelectionMode(); - if(myPickingAction->isChecked() && aSelectionMode != GaussPointSelection) - myPickingAction->setChecked(false); - else if(!myPickingAction->isChecked() && aSelectionMode == GaussPointSelection) - myPickingAction->setChecked(true); -} - - -//---------------------------------------------------------------------------- -VISU_WidgetCtrl* VVTK_MainWindow1::GetWidgetCtrl() -{ - return myRenderer->GetWidgetCtrl(); -} - -VISU_InsideCursorSettings* VVTK_MainWindow1::GetInsideCursorSettings() -{ - return mySegmentationCursorDlg->GetInsideCursorSettings(); -} - -VISU_OutsideCursorSettings* VVTK_MainWindow1::GetOutsideCursorSettings() -{ - return mySegmentationCursorDlg->GetOutsideCursorSettings(); -} - -VISU_PickingSettings* VVTK_MainWindow1::GetPickingSettings() -{ - return myPickingDlg->GetPickingSettings(); -} - -//---------------------------------------------------------------------------- -void VVTK_MainWindow1::SetPlanesSegementation(bool theIsOn) -{ - myPlaneSegmentationAction->setChecked( theIsOn ); - OnSegmentationSwitch(myPlaneSegmentationAction); -} - -void VVTK_MainWindow1::SetSphereSegementation(bool theIsOn) -{ - mySphereSegmentationAction->setChecked( theIsOn ); - OnSegmentationSwitch(mySphereSegmentationAction); -} - -void VVTK_MainWindow1::OnSegmentationSwitch(QtxAction* theAction) -{ - bool anIsSegmentationOn = myPlaneSegmentationAction->isChecked() || - mySphereSegmentationAction->isChecked(); - - if( !theAction ) - return; - - VISU_WidgetCtrl *aWidgetCtrl = myRenderer->GetWidgetCtrl(); - - if (anIsSegmentationOn) { - int anIndex = (theAction == myPlaneSegmentationAction) ? 0 : 1; - aWidgetCtrl->SetActiveIndex(anIndex); - } - aWidgetCtrl->SetEnabled(anIsSegmentationOn); - - if( theAction == myPlaneSegmentationAction && anIsSegmentationOn ) - mySphereSegmentationAction->setChecked( false ); - else if( theAction == mySphereSegmentationAction && anIsSegmentationOn ) - myPlaneSegmentationAction->setChecked( false ); - - if( anIsSegmentationOn ) - { - myMainWindow2->show(); - mySegmentationCursorDlg->SetIsPlaneSegmentation( theAction == myPlaneSegmentationAction ); - mySegmentationCursorDlg->UpdateSegmentation(); - mySegmentationCursorDlg->UpdateInsideGaussPoints(); - mySegmentationCursorDlg->UpdateOutsideGaussPoints(); - mySegmentationCursorDlg->show(); - } - else - { - myMainWindow2->hide(); - mySegmentationCursorDlg->hide(); - } -} - -void VVTK_MainWindow1::OnSegmentationSwitch() -{ - QtxAction* anAction = ( QtxAction* )sender(); - OnSegmentationSwitch(anAction); -} - - -//---------------------------------------------------------------------------- -VVTK_MainWindow2::VVTK_MainWindow2(QWidget* theParent, - const char* theName, - SUIT_ResourceMgr* theResourceMgr, - SUIT_ViewWindow* theViewWindow): - VVTK_MainWindow(theParent,theName,theResourceMgr,theViewWindow) -{} - -VVTK_MainWindow2::~VVTK_MainWindow2() -{} - - -//---------------------------------------------------------------------------- -void VVTK_MainWindow2::Initialize(SVTK_RenderWindowInteractor* theInteractor) -{ - VVTK_MainWindow::Initialize(theInteractor); -} - diff --git a/src/VVTK/VVTK_MainWindow.h b/src/VVTK/VVTK_MainWindow.h deleted file mode 100644 index 81491724..00000000 --- a/src/VVTK/VVTK_MainWindow.h +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -#ifndef VVTK_MAINWINDOW_H -#define VVTK_MAINWINDOW_H - -#ifdef WIN32 -#pragma warning( disable:4251 ) -#endif - -#include "VVTK.h" -#include "SVTK_MainWindow.h" - -class QSplitter; - -class VISU_WidgetCtrl; -class VVTK_SegmentationCursorDlg; -class VISU_InsideCursorSettings; -class VISU_OutsideCursorSettings; -class VISU_PickingSettings; -class VVTK_InteractorStyle; -class VVTK_ControllerIncrement; -class VVTK_ControllerOnKeyDown; -class VVTK_PickingDlg; -class VVTK_MainWindow2; -class VVTK_Renderer1; -class VVTK_Renderer2; -class VVTK_Recorder; - -//---------------------------------------------------------------------------- -//! Customize SVTK_MainWindow to provide VVTK functionality -class VVTK_EXPORT VVTK_MainWindow: public SVTK_MainWindow -{ - Q_OBJECT; - -public: - //! Construct instance of the class - VVTK_MainWindow(QWidget* theParent, - const char* theName, - SUIT_ResourceMgr* theResourceMgr, - SUIT_ViewWindow* theViewWindow); - - //! Reimplement SVTK_MainWindow::Initialize - virtual void Initialize(SVTK_RenderWindowInteractor* theInteractor); - - //! Destroy instance of the class - virtual ~VVTK_MainWindow(); - - public slots: - - virtual void onDumpView(); - - virtual void action( const int ); - - virtual void OnStartRecording(); - - virtual void OnPlayRecording(); - - virtual void OnPauseRecording(); - - virtual void OnStopRecording(); - - protected: - virtual QtxActionToolMgr* toolMgr() const; - - vtkSmartPointer myControllerIncrement; - vtkSmartPointer myControllerOnKeyDown; - - QToolBar* myRecordingToolBar; - QtxAction* myStartAction; - QtxAction* myPlayAction; - QtxAction* myPauseAction; - QtxAction* myStopAction; - - VVTK_Recorder *myRecorder; - QtxActionToolMgr* myToolMgr; -}; - - -//---------------------------------------------------------------------------- -//! Extend VVTK_MainWindow to implement functionality for base view -class VVTK_EXPORT VVTK_MainWindow1: public VVTK_MainWindow -{ - Q_OBJECT; - -public: - //! Construct instance of the class - VVTK_MainWindow1(QSplitter* theParent, - const char* theName, - SUIT_ResourceMgr* theResourceMgr, - SUIT_ViewWindow* theViewWindow); - - //! Reimplement VVTK_MainWindow::Initialize - virtual void Initialize(SVTK_RenderWindowInteractor* theInteractor, - VVTK_Renderer1* theRenderer); - - //! Destroy instance of the class - virtual ~VVTK_MainWindow1(); - - //! Create instance of the segmented VVTK_MainWindow - /*! - The two views (VVTK_MainWindow1 and VVTK_MainWindow2) should change its behaviour in the same time. - So, it is necessary to synhronize them through sharing some common pointers. - */ - VVTK_MainWindow2* CreateMainWindow2(QWidget* theParent, - const char* theName, - SUIT_ResourceMgr* theResourceMgr, - SUIT_ViewWindow* theViewWindow); - - VISU_WidgetCtrl* GetWidgetCtrl(); - - void SetPlanesSegementation(bool theIsOn); - - void SetSphereSegementation(bool theIsOn); - - VISU_InsideCursorSettings* GetInsideCursorSettings(); - - //! Get contained VISU_OutsideCursorSettings - VISU_OutsideCursorSettings* GetOutsideCursorSettings(); - - //! Get contained VISU_PickingSettings - VISU_PickingSettings* GetPickingSettings(); - - public slots: - //! To activate/ deactivate the segementation cursor at run-time - void OnSegmentationSwitch();//bool theIsSegmentationOn); - - void OnSegmentationSwitch(QtxAction* theAction);//bool theIsSegmentationOn); - - //! To change active selection mode at run-time - virtual void OnSelectionModeSwitch(bool theIsSelectionOn); - - //! To adjust to the current selection mode - virtual void OnSelectionChanged(); - - protected: - VVTK_Renderer1* myRenderer; //!< Keeps extended version of SVTK_Renderer - - VVTK_MainWindow2* myMainWindow2; //!< Refer to segmented view - - QToolBar* myPtsToolBar; //!< Additional tool bar - - //! To implement show/hide segmented view on acttivate/ deactivate segementation cursor - QSplitter* mySplitter; - - QtxAction* myPickingAction; //!< Action for switch selection mode - QtxAction* myPlaneSegmentationAction; //!< Action for switch segmentation mode to plane - QtxAction* mySphereSegmentationAction; //!< Action for switch segmentation mode to sphere - - //! Keep reference to VVTK_SegmentationCursorDlg - VVTK_SegmentationCursorDlg* mySegmentationCursorDlg; - VVTK_PickingDlg* myPickingDlg; //!< Keep reference to VVTK_PickingDlg -}; - - -//---------------------------------------------------------------------------- -//! Extend VVTK_MainWindow to implement functionality for segmented view -class VVTK_EXPORT VVTK_MainWindow2: public VVTK_MainWindow -{ - Q_OBJECT; - - friend class VVTK_MainWindow1; - - //! Construct instance of the class - VVTK_MainWindow2(QWidget* theParent, - const char* theName, - SUIT_ResourceMgr* theResourceMgr, - SUIT_ViewWindow* theViewWindow); -public: - //! Destroy instance of the class - virtual ~VVTK_MainWindow2(); - - //! Reimplement SVTK_MainWindow::Initialize - virtual void Initialize(SVTK_RenderWindowInteractor* theInteractor); - -}; - - -#ifdef WIN32 -#pragma warning( default:4251 ) -#endif - -#endif diff --git a/src/VVTK/VVTK_PickingDlg.cxx b/src/VVTK/VVTK_PickingDlg.cxx deleted file mode 100644 index 37730f7f..00000000 --- a/src/VVTK/VVTK_PickingDlg.cxx +++ /dev/null @@ -1,717 +0,0 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// File : VVTK_PickingDlg.cxx -// Author : Oleg Uvarov -// Module : VISU -// -#include "VVTK_PickingDlg.h" - -#include "VISU_GaussPtsAct.h" -#include "VISU_PickingSettings.h" -#include "VISU_GaussPointsPL.hxx" - -#include "SUIT_MessageBox.h" -#include "SUIT_ResourceMgr.h" -#include "SUIT_Session.h" - -#include "CAM_Module.h" - -#include "SVTK_Selector.h" -#include "SVTK_MainWindow.h" -#include "SVTK_RenderWindowInteractor.h" - -#include "VTKViewer_Algorithm.h" -#include "SVTK_Functor.h" - -#include -#include -#include -#include -#include -#include - -#include "utilities.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "QtxAction.h" -#include "QtxDoubleSpinBox.h" -#include "QtxIntSpinBox.h" -#include "QtxColorButton.h" - -#include "LightApp_Application.h" - -namespace -{ - struct SelectorHelper - { - public: - SelectorHelper( SVTK_RenderWindowInteractor* theInteractor ): - myInteractor( theInteractor ) - {} - - bool - get() - { - bool aResult = false; - myMapIndex.Clear(); - mySelector = NULL; - myPipeLine = NULL; - myActor = NULL; - - if ( !myInteractor ) - return aResult; - - mySelector = myInteractor->GetSelector(); - if ( !mySelector ) - return aResult; - - const SALOME_ListIO& aListIO = mySelector->StoredIObjects(); - if ( aListIO.Extent() != 1 ) - return aResult; - - myIO = aListIO.First(); - if ( mySelector->HasIndex( myIO ) ) - mySelector->GetIndex(myIO, myMapIndex); - - VTK::ActorCollectionCopy aCopy(myInteractor->getRenderer()->GetActors()); - myActor = SVTK::Find(aCopy.GetActors(), - SVTK::TIsSameIObject( myIO )); - if ( !myActor ) - return aResult; - - myPipeLine = myActor->GetGaussPointsPL(); - - return true; - } - - SVTK_RenderWindowInteractor* myInteractor; - TColStd_IndexedMapOfInteger myMapIndex; - Handle(SALOME_InteractiveObject) myIO; - SVTK_Selector* mySelector; - - VISU_GaussPointsPL* myPipeLine; - VISU_GaussPtsAct* myActor; - }; - - - - class GaussPtsIDValidator: public QIntValidator - { - public: - GaussPtsIDValidator( SVTK_RenderWindowInteractor* theInteractor, - QObject * theParent ): - QIntValidator( 0, VTK_LARGE_ID, theParent ), - myHelper(theInteractor) - {} - - virtual - State - validate ( QString & theInput, int & thePos ) const - { - if ( QIntValidator::validate( theInput, thePos ) == QValidator::Invalid) - return QValidator::Invalid; - - if ( !myHelper.get() ) - return QValidator::Invalid; - - return QValidator::Acceptable; - } - - protected: - mutable SelectorHelper myHelper; - }; - - - class GaussCellIDValidator: public GaussPtsIDValidator - { - public: - GaussCellIDValidator( QLineEdit* theLocalPointLabel, - SVTK_RenderWindowInteractor* theInteractor, - QObject * theParent ): - GaussPtsIDValidator( theInteractor, theParent ), - myLocalPointLineEdit( theLocalPointLabel ) - {} - - virtual - State - validate ( QString & theInput, int & thePos ) const - { - if ( GaussPtsIDValidator::validate( theInput, thePos ) == QValidator::Invalid) - return QValidator::Invalid; - - VISU::TCellID aCellID = theInput.toInt(); - VISU::TLocalPntID aLocalPntID = myLocalPointLineEdit->text().toInt(); - VISU::PGaussPtsIDMapper anIDMapper = myHelper.myPipeLine->GetGaussPtsIDMapper(); - if ( anIDMapper->GetVTKID( VISU::TGaussPointID( aCellID, aLocalPntID ) ) < 0 ) - return QValidator::Intermediate; - - return QValidator::Acceptable; - } - - private: - QLineEdit* myLocalPointLineEdit; - }; - - - class GaussLocalPointIDValidator: public GaussPtsIDValidator - { - public: - GaussLocalPointIDValidator( QLineEdit* theParentElementLineEdit, - SVTK_RenderWindowInteractor* theInteractor, - QObject * theParent ): - GaussPtsIDValidator( theInteractor, theParent ), - myParentElementLineEdit( theParentElementLineEdit ) - {} - - virtual - State - validate ( QString & theInput, int & thePos ) const - { - if ( GaussPtsIDValidator::validate( theInput, thePos ) == QValidator::Invalid) - return QValidator::Invalid; - - VISU::TLocalPntID aLocalPntID = theInput.toInt(); - VISU::TCellID aCellID = myParentElementLineEdit->text().toInt(); - VISU::PGaussPtsIDMapper anIDMapper = myHelper.myPipeLine->GetGaussPtsIDMapper(); - if ( anIDMapper->GetVTKID( VISU::TGaussPointID( aCellID, aLocalPntID ) ) < 0 ) - return QValidator::Intermediate; - - return QValidator::Acceptable; - } - - private: - QLineEdit* myParentElementLineEdit; - }; -} - - -VVTK_ValidatedLineEdit::VVTK_ValidatedLineEdit( QWidget* parent ): - QLineEdit( parent ) -{ - connect( this, SIGNAL( textChanged( const QString& ) ), this, SLOT( MarkValidated( const QString& ) ) ); -} - -void VVTK_ValidatedLineEdit::MarkValidated( const QString& theText ) -{ - if ( !validator() ) - return; - - int aPos; - QString aText( theText ); - QPalette pal = palette(); - switch ( validator()->validate( aText, aPos ) ) { - case QValidator::Invalid: - case QValidator::Intermediate: - pal.setColor( foregroundRole(), QColor( 255, 0, 0 )); - setPalette( pal ); - break; - case QValidator::Acceptable: - pal.setColor( foregroundRole(), QColor( 0, 0, 0 )); - setPalette( pal ); - break; - } -} - -//--------------------------------------------------------------------------------- - -VVTK_PickingDlg::VVTK_PickingDlg(QtxAction* theAction, - SVTK_MainWindow* theParent, - const char* theName): - SVTK_DialogBase(theAction, - theParent, - theName), - myEventCallbackCommand( vtkCallbackCommand::New() ), - myPickingSettings( VISU_PickingSettings::New() ) -{ - myPriority = 0.0; - myEventCallbackCommand->Delete(); - myEventCallbackCommand->SetClientData(this); - myEventCallbackCommand->SetCallback(VVTK_PickingDlg::ProcessEvents); - - setWindowTitle( tr( "PICKING_DLG_TITLE" ) ); - setSizeGripEnabled(TRUE); - - QVBoxLayout* TopLayout = new QVBoxLayout( this ); - TopLayout->setSpacing(6); - TopLayout->setMargin(11); - - QWidget* aBox = new QWidget( this ); - QVBoxLayout* BoxLayout = new QVBoxLayout( aBox ); - BoxLayout->setMargin(0); - BoxLayout->setSpacing(6); - - // Cursor - QGroupBox* CursorGroup = new QGroupBox( tr( "CURSOR_TITLE" ), aBox ); - //CursorGroup->setColumnLayout(0, Qt::Vertical ); - //CursorGroup->layout()->setSpacing( 0 ); - //CursorGroup->layout()->setMargin( 0 ); - - QGridLayout* CursorGroupLayout = new QGridLayout (CursorGroup); - CursorGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter); - CursorGroupLayout->setSpacing(6); - CursorGroupLayout->setMargin(11); - - QLabel* CursorSizeLabel = new QLabel( tr( "CURSOR_SIZE" ), CursorGroup ); - myCursorSizeSpinBox = new QtxDoubleSpinBox( 0, 1, 0.1, CursorGroup ); - myCursorSizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - - QLabel* PyramidHeightLabel = new QLabel( tr( "PYRAMID_HEIGHT" ), CursorGroup ); - double aHeightMin=1.e-7; - double aHeightMax=10.; - double aHeightStep=0.1; - myPyramidHeightSpinBox = new QtxDoubleSpinBox(aHeightMin, aHeightMax, aHeightStep, CursorGroup ); - myPyramidHeightSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - - QLabel* SelectionColorLabel = new QLabel( tr( "SELECTION_COLOR" ), CursorGroup ); - mySelectionColorButton = new QtxColorButton( CursorGroup ); - mySelectionColorButton->setColor( Qt::blue ); - //QPalette aPalette( mySelectionColorButton->palette() ); - //aPalette.setColor( mySelectionColorButton->backgroundRole(), Qt::blue ); - //mySelectionColorButton->setPalette( aPalette ); - //connect( mySelectionColorButton, SIGNAL( clicked() ), this, SLOT( onColorButtonPressed() ) ); - - CursorGroupLayout->addWidget( CursorSizeLabel, 0, 0 ); - CursorGroupLayout->addWidget( myCursorSizeSpinBox, 0, 1 ); - CursorGroupLayout->addWidget( PyramidHeightLabel, 1, 0 ); - CursorGroupLayout->addWidget( myPyramidHeightSpinBox, 1, 1 ); - CursorGroupLayout->addWidget( SelectionColorLabel, 2, 0 ); - CursorGroupLayout->addWidget( mySelectionColorButton, 2, 1 ); - - BoxLayout->addWidget( CursorGroup ); - - // Tolerance - QGroupBox* ToleranceGroup = new QGroupBox( tr( "TOLERANCE_TITLE" ), aBox ); - //ToleranceGroup->setColumnLayout(0, Qt::Vertical ); - //ToleranceGroup->layout()->setSpacing( 0 ); - //ToleranceGroup->layout()->setMargin( 0 ); - - QGridLayout* ToleranceGroupLayout = new QGridLayout (ToleranceGroup); - ToleranceGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter); - ToleranceGroupLayout->setSpacing(6); - ToleranceGroupLayout->setMargin(11); - - QLabel* PointToleranceLabel = new QLabel( tr( "POINT_TOLERANCE" ), ToleranceGroup ); - myPointToleranceSpinBox = new QtxDoubleSpinBox( 0.001, 10.0, 0.01, ToleranceGroup ); - myPointToleranceSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - - ToleranceGroupLayout->addWidget( PointToleranceLabel, 0, 0 ); - ToleranceGroupLayout->addWidget( myPointToleranceSpinBox, 0, 1 ); - - BoxLayout->addWidget( ToleranceGroup ); - - // Information window - QGroupBox* InfoWindowGroup = new QGroupBox( tr( "INFO_WINDOW_TITLE" ), aBox ); - //InfoWindowGroup->setColumnLayout(0, Qt::Vertical ); - //InfoWindowGroup->layout()->setSpacing( 0 ); - //InfoWindowGroup->layout()->setMargin( 0 ); - - QGridLayout* InfoWindowGroupLayout = new QGridLayout (InfoWindowGroup); - InfoWindowGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter); - InfoWindowGroupLayout->setSpacing(6); - InfoWindowGroupLayout->setMargin(11); - - QLabel* TransparencyLabel = new QLabel( tr( "TRANSPARENCY" ), InfoWindowGroup ); - myTransparencySpinBox = new QtxIntSpinBox( 0, 100, 10, InfoWindowGroup ); - myTransparencySpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - - InfoWindowGroupLayout->addWidget( TransparencyLabel, 0, 0 ); - InfoWindowGroupLayout->addWidget( myTransparencySpinBox, 0, 1 ); - - QLabel* PositionLabel = new QLabel( tr( "POSITION" ), InfoWindowGroup ); - myPositionComboBox = new QComboBox( InfoWindowGroup ); - myPositionComboBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - - myPositionComboBox->addItem( tr( "BELOW_POINT" ) ); - myPositionComboBox->addItem( tr( "TOP_LEFT_CORNER" ) ); - - InfoWindowGroupLayout->addWidget( TransparencyLabel, 0, 0 ); - InfoWindowGroupLayout->addWidget( myTransparencySpinBox, 0, 1 ); - InfoWindowGroupLayout->addWidget( PositionLabel, 1, 0 ); - InfoWindowGroupLayout->addWidget( myPositionComboBox, 1, 1 ); - - BoxLayout->addWidget( InfoWindowGroup ); - - // Movement of the camera - QGroupBox* CameraGroup = new QGroupBox( tr( "CAMERA_TITLE" ), aBox ); - //CameraGroup->setColumnLayout(0, Qt::Vertical ); - //CameraGroup->layout()->setSpacing( 0 ); - //CameraGroup->layout()->setMargin( 0 ); - - QGridLayout* CameraGroupLayout = new QGridLayout (CameraGroup); - CameraGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter); - CameraGroupLayout->setSpacing(6); - CameraGroupLayout->setMargin(11); - - QLabel* ZoomFactorLabel = new QLabel( tr( "ZOOM_FACTOR" ), CameraGroup ); - myZoomFactorSpinBox = new QtxDoubleSpinBox( 0.1, 10.0, 0.1, CameraGroup ); - myZoomFactorSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - - QLabel* StepNumberLabel = new QLabel( tr( "STEP_NUMBER" ), CameraGroup ); - myStepNumberSpinBox = new QtxIntSpinBox( 1, 100, 1, CameraGroup ); - myStepNumberSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - - CameraGroupLayout->addWidget( ZoomFactorLabel, 0, 0 ); - CameraGroupLayout->addWidget( myZoomFactorSpinBox, 0, 1 ); - CameraGroupLayout->addWidget( StepNumberLabel, 1, 0 ); - CameraGroupLayout->addWidget( myStepNumberSpinBox, 1, 1 ); - - BoxLayout->addWidget( CameraGroup ); - - // Display parent mesh element - QGroupBox* PositionGroup = new QGroupBox( tr( "DATA_POSITION" ), aBox ); - //PositionGroup->setColumnLayout(0, Qt::Vertical ); - //PositionGroup->layout()->setSpacing( 0 ); - //PositionGroup->layout()->setMargin( 0 ); - - QGridLayout* PositionGroupLayout = new QGridLayout (PositionGroup); - PositionGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignLeft); - PositionGroupLayout->setSpacing(6); - PositionGroupLayout->setMargin(11); - - QLabel* ParentElementLabel = new QLabel( tr( "PARENT_ELEMENT" ), PositionGroup ); - - myParentElementLineEdit = new VVTK_ValidatedLineEdit( PositionGroup ); - - QLabel* LocalPointLabel = new QLabel( tr( "LOCAL_POINT" ), PositionGroup ); - - myLocalPointLineEdit = new VVTK_ValidatedLineEdit( PositionGroup ); - - myDisplayParentMeshCheckBox = new QCheckBox( tr( "DISPLAY_PARENT_MESH" ), PositionGroup ); - - PositionGroupLayout->addWidget( ParentElementLabel, 0, 0, 1, 3 ); - PositionGroupLayout->addWidget( myParentElementLineEdit, 0, 3 ); - PositionGroupLayout->addWidget( LocalPointLabel, 1, 0, 1, 3 ); - PositionGroupLayout->addWidget( myLocalPointLineEdit, 1, 3 ); - PositionGroupLayout->addWidget( myDisplayParentMeshCheckBox, 2, 0, 1, 4 ); - - BoxLayout->addWidget( PositionGroup ); - - // Common buttons =========================================================== - QGroupBox* GroupButtons = new QGroupBox( this ); - //GroupButtons->setColumnLayout(0, Qt::Vertical ); - //GroupButtons->layout()->setSpacing( 0 ); - //GroupButtons->layout()->setMargin( 0 ); - QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - - QPushButton* buttonApply = new QPushButton( tr( "&Apply" ), GroupButtons ); - buttonApply->setAutoDefault( TRUE ); - buttonApply->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonApply, 0, 0 ); - GroupButtonsLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 ); - - QPushButton* buttonClose = new QPushButton( tr( "&Close" ) , GroupButtons ); - buttonClose->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonClose, 0, 2 ); - - QPushButton* buttonHelp = new QPushButton( tr( "&Help" ) , GroupButtons ); - buttonHelp->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonHelp, 0, 3 ); - - TopLayout->addWidget( aBox ); - TopLayout->addWidget( GroupButtons ); - - connect( buttonApply, SIGNAL( clicked() ), this, SLOT( onClickApply() ) ); - connect( buttonClose, SIGNAL( clicked() ), this, SLOT( onClickClose() ) ); - connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( onClickHelp() ) ); - - connect( myParentElementLineEdit, SIGNAL( textChanged( const QString& ) ), this, SLOT( onSelectionValidate() ) ); - connect( myLocalPointLineEdit, SIGNAL( textChanged( const QString& ) ), this, SLOT( onSelectionValidate() ) ); - -} - -VVTK_PickingDlg::~VVTK_PickingDlg() -{ -} - -void VVTK_PickingDlg::AddActor( VISU_GaussPtsAct* theActor ) -{ - //theActor->SetPickingSettings( myPickingSettings.GetPointer() ); -} - -void VVTK_PickingDlg::RemoveActor( VISU_GaussPtsAct* theActor ) -{ - //theActor->SetPickingSettings( NULL ); -} - -void VVTK_PickingDlg::Update() -{ - float aCursorSize = 0.5; - float aPyramidHeight = 10.0; - float aPointTolerance = 0.1; - QColor aColor = Qt::yellow; - int anInfoWindowTransparency = 50; - int anInfoWindowPosition = VISU_PickingSettings::BelowPoint; - float aZoomFactor = 1.5; - int aStepNumber = 10; - bool aDisplayParentMesh = false; - - //if( !myPickingSettings->GetInitial() ) - { - myCursorSizeSpinBox->setValue( myPickingSettings->GetCursorSize() ); - myPyramidHeightSpinBox->setValue( myPickingSettings->GetPyramidHeight() ); - myPointToleranceSpinBox->setValue( myPickingSettings->GetPointTolerance() ); - myTransparencySpinBox->setValue( int(myPickingSettings->GetInfoWindowTransparency() * 100.0) ); - myPositionComboBox->setCurrentIndex( myPickingSettings->GetInfoWindowPosition() ); - myZoomFactorSpinBox->setValue( myPickingSettings->GetZoomFactor() ); - myStepNumberSpinBox->setValue( myPickingSettings->GetStepNumber() ); - myDisplayParentMeshCheckBox->setChecked( myPickingSettings->GetDisplayParentMesh() ); - - vtkFloatingPointType* aColor = myPickingSettings->GetColor(); - - //QPalette aPalette( mySelectionColorButton->palette() ); - /*aPalette.setColor( mySelectionColorButton->backgroundRole(), - QColor( ( int )( aColor[0] * 255.0 ), - ( int )( aColor[1] * 255.0 ), - ( int )( aColor[2] * 255.0 ) ) ); - mySelectionColorButton->setPalette( aPalette );*/ - mySelectionColorButton->setColor( - QColor( ( int )( aColor[0] * 255.0 ), - ( int )( aColor[1] * 255.0 ), - ( int )( aColor[2] * 255.0 ) ) ); - - return; - } - - SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr(); - - aCursorSize = aResourceMgr->doubleValue( "VISU", "picking_cursor_size", aCursorSize ); - myCursorSizeSpinBox->setValue( aCursorSize ); - - aPyramidHeight = aResourceMgr->doubleValue( "VISU", "picking_pyramid_height", aPyramidHeight ); - myPyramidHeightSpinBox->setValue( aPyramidHeight ); - - aPointTolerance = aResourceMgr->doubleValue( "VISU", "picking_point_tolerance", aPointTolerance ); - myPointToleranceSpinBox->setValue( aPointTolerance ); - - aColor = aResourceMgr->colorValue( "VISU", "picking_selection_color", aColor ); - //QPalette aPalette( mySelectionColorButton->palette() ); - //aPalette.setColor( mySelectionColorButton->backgroundRole(), aColor ); - mySelectionColorButton->setColor( aColor ); - - anInfoWindowTransparency = aResourceMgr->integerValue( "VISU", "picking_transparency", anInfoWindowTransparency ); - myTransparencySpinBox->setValue( anInfoWindowTransparency ); - - anInfoWindowPosition = aResourceMgr->integerValue( "VISU", "picking_position", anInfoWindowPosition ); - myPositionComboBox->setCurrentIndex( anInfoWindowPosition ); - - aZoomFactor = aResourceMgr->doubleValue( "VISU", "picking_zoom_factor", aZoomFactor ); - myZoomFactorSpinBox->setValue( aZoomFactor ); - - aStepNumber = aResourceMgr->integerValue( "VISU", "picking_step_number", aStepNumber ); - myStepNumberSpinBox->setValue( aStepNumber ); - - aDisplayParentMesh = aResourceMgr->booleanValue( "VISU", "picking_display_parent_mesh", aDisplayParentMesh ); - myDisplayParentMeshCheckBox->setChecked( aDisplayParentMesh ); - - onClickApply(); -} - -void VVTK_PickingDlg::onSelectionValidate() -{ - myParentElementLineEdit->MarkValidated( myParentElementLineEdit->text() ); - myLocalPointLineEdit->MarkValidated( myLocalPointLineEdit->text() ); -} - -void VVTK_PickingDlg::onSelectionEvent() -{ - SelectorHelper aHelper( myInteractor ); - if ( !aHelper.get() ) - return; - - const TColStd_IndexedMapOfInteger& aMapIndex = aHelper.myMapIndex; - if ( aMapIndex.Extent() != 1 ) - return; - - int anObjId = aHelper.myMapIndex(1); - - VISU::TGaussPointID aGaussPointID = aHelper.myPipeLine->GetObjID( anObjId ); - - VISU::TCellID aCellID = aGaussPointID.first; - myParentElementLineEdit->setText( QString::number( aCellID ) ); - - VISU::TLocalPntID aLocalPntID = aGaussPointID.second; - myLocalPointLineEdit->setText( QString::number( aLocalPntID ) ); -} - -VISU_PickingSettings* -VVTK_PickingDlg -::GetPickingSettings() -{ - return myPickingSettings.GetPointer(); -} - -void VVTK_PickingDlg::SetInteractor( SVTK_RenderWindowInteractor* theInteractor ) -{ - myInteractor = theInteractor; - - theInteractor->GetDevice()->AddObserver(vtkCommand::KeyPressEvent, - myEventCallbackCommand.GetPointer(), - myPriority); - theInteractor->GetDevice()->AddObserver(vtkCommand::EndPickEvent, - myEventCallbackCommand.GetPointer(), - myPriority); - { - QValidator* aValidator = new GaussCellIDValidator( myLocalPointLineEdit, theInteractor, myParentElementLineEdit ); - myParentElementLineEdit->setValidator( aValidator ); - } - { - QValidator* aValidator = new GaussLocalPointIDValidator( myParentElementLineEdit, theInteractor, myLocalPointLineEdit ); - myLocalPointLineEdit->setValidator( aValidator ); - } -} - -void VVTK_PickingDlg::ProcessEvents(vtkObject* vtkNotUsed(theObject), - unsigned long theEvent, - void* theClientData, - void* vtkNotUsed(theCallData)) -{ - VVTK_PickingDlg* self = reinterpret_cast(theClientData); - - switch(theEvent){ - case vtkCommand::KeyPressEvent: - self->KeyPressed(); - break; - case vtkCommand::EndPickEvent: - self->onSelectionEvent(); - break; - } -} - -void VVTK_PickingDlg::KeyPressed() -{ - if( myInteractor->GetDevice()->GetKeyCode() == 'P' ) - { - bool aDisplayParentMesh = !myPickingSettings->GetDisplayParentMesh(); - myPickingSettings->SetDisplayParentMesh( aDisplayParentMesh ); - - myDisplayParentMeshCheckBox->setChecked( aDisplayParentMesh ); - - myPickingSettings->InvokeEvent(VISU::UpdatePickingSettingsEvent,NULL); - } -} - -void VVTK_PickingDlg::onClickApply() -{ - //myPickingSettings->SetInitial( false ); - - myPickingSettings->SetCursorSize( myCursorSizeSpinBox->value() ); - myPickingSettings->SetPyramidHeight( myPyramidHeightSpinBox->value() ); - myPickingSettings->SetPointTolerance( myPointToleranceSpinBox->value() ); - myPickingSettings->SetInfoWindowTransparency( myTransparencySpinBox->value() / 100.0 ); - myPickingSettings->SetInfoWindowPosition( myPositionComboBox->currentIndex() ); - myPickingSettings->SetZoomFactor( myZoomFactorSpinBox->value() ); - myPickingSettings->SetStepNumber( myStepNumberSpinBox->value() ); - myPickingSettings->SetDisplayParentMesh( myDisplayParentMeshCheckBox->isChecked() ); - - //QPalette aPalette( mySelectionColorButton->palette() ); - QColor aButtonColor = mySelectionColorButton->color();//aPalette.color(mySelectionColorButton->backgroundRole() ); - vtkFloatingPointType aColor[3]; - aColor[0] = aButtonColor.red() / 255.0; - aColor[1] = aButtonColor.green() / 255.0; - aColor[2] = aButtonColor.blue() / 255.0; - myPickingSettings->SetColor( aColor ); - - myPickingSettings->InvokeEvent( VISU::UpdatePickingSettingsEvent,NULL ); - - SelectorHelper aHelper( myInteractor ); - if ( !aHelper.get() ) - return; - - VISU::TCellID aCellID = myParentElementLineEdit->text().toInt(); - VISU::TLocalPntID aLocalPntID = myLocalPointLineEdit->text().toInt(); - VISU::PGaussPtsIDMapper anIDMapper = aHelper.myPipeLine->GetGaussPtsIDMapper(); - vtkIdType anObjId = anIDMapper->GetVTKID( VISU::TGaussPointID( aCellID, aLocalPntID ) ); - if ( anObjId < 0 ) - return; - - aHelper.myMapIndex.Clear(); - aHelper.myMapIndex.Add( anObjId ); - aHelper.mySelector->AddOrRemoveIndex( aHelper.myIO, aHelper.myMapIndex, false ); - aHelper.myActor->Highlight( aHelper.myIO ); - myInteractor->GetDevice()->CreateTimer( VTKI_TIMER_FIRST ); -} - -void VVTK_PickingDlg::onClickClose() -{ - reject(); -} - -void VVTK_PickingDlg::onClickHelp() -{ - QString aHelpFileName = "picking.htm"; - LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); - if (app) - app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName); - else { - QString platform; -#ifdef WIN32 - platform = "winapplication"; -#else - platform = "application"; -#endif - SUIT_MessageBox::warning( 0, - QObject::tr("WRN_WARNING"), - QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName), - QObject::tr("BUT_OK")); - } -} - -/*void VVTK_PickingDlg::onColorButtonPressed() -{ - QPalette aPalette( mySelectionColorButton->palette() ); - QColor aColor = QColorDialog:: - getColor( aPalette.color(mySelectionColorButton->backgroundRole() ), this ); - - if( aColor.isValid() ) - { - aPalette.setColor( mySelectionColorButton->backgroundRole(), - aColor ); - mySelectionColorButton->setPalette( aPalette ); - } -}*/ - -void VVTK_PickingDlg::keyPressEvent( QKeyEvent* e ) -{ - QDialog::keyPressEvent( e ); - if ( e->isAccepted() ) - return; - - if ( e->key() == Qt::Key_F1 ) - { - e->accept(); - onClickHelp(); - } -} diff --git a/src/VVTK/VVTK_PickingDlg.h b/src/VVTK/VVTK_PickingDlg.h deleted file mode 100644 index 0b06abae..00000000 --- a/src/VVTK/VVTK_PickingDlg.h +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// File : VVTK_PickingDlg.h -// Author : Oleg Uvarov -// Module : VISU -// -#ifndef VVTK_PICKINGDLG_H -#define VVTK_PICKINGDLG_H - -#include "SVTK_DialogBase.h" - -#include -#include - -#include - -class vtkActorCollection; -class vtkCallbackCommand; -class vtkImageData; - -class QLabel; -class QComboBox; -class QCheckBox; -class QPushButton; - -class QtxAction; -class QtxDoubleSpinBox; -class QtxIntSpinBox; -class QtxColorButton; - -class VISU_GaussPtsAct; -class VISU_PickingSettings; - -class SVTK_MainWindow; -class SVTK_RenderWindowInteractor; -class VVTK_ValidatedLineEdit; - -//! Picking Dialog. -/*! - * Uses for set up picking preferenses and apply - * them to all actors in the current renderer. - */ -class VVTK_PickingDlg : public SVTK_DialogBase -{ - Q_OBJECT - -public: - VVTK_PickingDlg(QtxAction* theAction, - SVTK_MainWindow* theParent, - const char* theName); - - ~VVTK_PickingDlg(); - - //! Make an actor to listen the event of Update Picking Settings event. - void AddActor( VISU_GaussPtsAct* ); - void RemoveActor( VISU_GaussPtsAct* ); - - //! Update dialog contents. - void Update(); - - VISU_PickingSettings* GetPickingSettings(); - - void SetInteractor( SVTK_RenderWindowInteractor* ); - -protected slots: - void onSelectionEvent(); - void onClickApply(); - void onClickClose(); - void onClickHelp(); - - //void onColorButtonPressed(); - void onSelectionValidate(); - -private: - static void ProcessEvents(vtkObject* theObject, - unsigned long theEvent, - void* theClientData, - void* theCallData); - - void KeyPressed(); - void keyPressEvent( QKeyEvent* e ); - -private: - QtxDoubleSpinBox* myCursorSizeSpinBox; - QtxDoubleSpinBox* myPyramidHeightSpinBox; - QtxColorButton* mySelectionColorButton; - QtxDoubleSpinBox* myPointToleranceSpinBox; - QtxIntSpinBox* myTransparencySpinBox; - QComboBox* myPositionComboBox; - QtxDoubleSpinBox* myZoomFactorSpinBox; - QtxIntSpinBox* myStepNumberSpinBox; - QCheckBox* myDisplayParentMeshCheckBox; - - QtxAction* myAction; - vtkSmartPointer - myPickingSettings; - - VVTK_ValidatedLineEdit* - myParentElementLineEdit; - VVTK_ValidatedLineEdit* - myLocalPointLineEdit; - - SVTK_RenderWindowInteractor* - myInteractor; - - float myPriority; - vtkSmartPointer - myEventCallbackCommand; -}; - -class VVTK_ValidatedLineEdit : public QLineEdit -{ - Q_OBJECT; -public: - VVTK_ValidatedLineEdit( QWidget* parent ); - -public slots: - void MarkValidated( const QString& theText ); -}; - -#endif diff --git a/src/VVTK/VVTK_PrimitiveBox.cxx b/src/VVTK/VVTK_PrimitiveBox.cxx deleted file mode 100644 index 67023c5c..00000000 --- a/src/VVTK/VVTK_PrimitiveBox.cxx +++ /dev/null @@ -1,372 +0,0 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// VISU VISUGUI : GUI of VISU component -// File : VVTK_PrimitiveBox.cxx -// Author : Oleg UVAROV -// Module : VISU -// -#include "VVTK_PrimitiveBox.h" - -#include "VISU_OpenGLPointSpriteMapper.hxx" - -#include "SUIT_ResourceMgr.h" -#include "SUIT_Session.h" - -#include "QtxDoubleSpinBox.h" -#include "QtxIntSpinBox.h" - -#include -#include -#include -#include -#include -#include -#include - -#include - -using namespace std; - -VVTK_PrimitiveBox::VVTK_PrimitiveBox( QWidget* parent ) : - QGroupBox( parent ) -{ - SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr(); - - setTitle( tr( "PRIMITIVE_TITLE" ) ); - //setColumnLayout(0, Qt::Vertical ); - //layout()->setSpacing( 0 ); - //layout()->setMargin( 0 ); - - QGridLayout* aLayout = new QGridLayout( this ); - aLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter); - aLayout->setSpacing(6); - aLayout->setMargin(11); - - myPrimitiveType = VISU_OpenGLPointSpriteMapper::PointSprite; - - QString aRootDir = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/visu/"; - myMainTexture = aRootDir + "sprite_texture.bmp"; - myAlphaTexture = aRootDir + "sprite_alpha.bmp"; - - // Primitive Type - QGroupBox* aPrimitiveTypeGroup = new QGroupBox( this ); - aPrimitiveTypeGroup->setMinimumWidth( 450 ); - QHBoxLayout* aPrimLayout = new QHBoxLayout( aPrimitiveTypeGroup ); - aPrimLayout->setMargin( 0 ); - - //QButtonGroup* aPrimitiveTypeGroup = new QButtonGroup( 3, Qt::Horizontal, this, "PrimitiveTypeGroup" ); - //aPrimitiveTypeGroup->setMinimumWidth( 450 ); - //aPrimitiveTypeGroup->setRadioButtonExclusive( true ); - //aPrimitiveTypeGroup->setFrameStyle( QFrame::NoFrame ); - //aPrimitiveTypeGroup->layout()->setMargin( 0 ); - - myPointSpriteButton = new QRadioButton( tr( "POINT_SPRITE" ), aPrimitiveTypeGroup ); - myOpenGLPointButton = new QRadioButton( tr( "OPENGL_POINT" ), aPrimitiveTypeGroup ); - myGeomSphereButton = new QRadioButton( tr( "GEOMETRICAL_SPHERE" ), aPrimitiveTypeGroup ); - - aPrimLayout->addWidget( myPointSpriteButton ); - aPrimLayout->addWidget( myOpenGLPointButton ); - aPrimLayout->addWidget( myGeomSphereButton ); - - aLayout->addWidget( aPrimitiveTypeGroup, 0, 0, 1, 2 ); - - // Clamp ( Point Sprite & OpenGL Point ) - myClampLabel = new QLabel( tr( "CLAMP" ), this ); - myClampSpinBox = new QtxDoubleSpinBox( 1.0, 512.0, 1.0, this ); - myClampSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - - aLayout->addWidget( myClampLabel, 1, 0 ); - aLayout->addWidget( myClampSpinBox, 1, 1, 1, 2 ); - - // Main Texture ( Point Sprite ) - myMainTextureLabel = new QLabel( tr( "MAIN_TEXTURE" ), this ); - myMainTextureLineEdit = new QLineEdit( this ); - myMainTextureButton = new QPushButton( this ); - myMainTextureButton->setAutoDefault( false ); - myMainTextureButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_LOAD_TEXTURE" ) ) ); - connect( myMainTextureButton, SIGNAL( clicked() ), this, SLOT( onBrowseMainTexture() ) ); - - aLayout->addWidget( myMainTextureLabel, 2, 0 ); - aLayout->addWidget( myMainTextureLineEdit, 2, 1 ); - aLayout->addWidget( myMainTextureButton, 2, 2 ); - - // Alpha Texture ( Point Sprite ) - myAlphaTextureLabel = new QLabel( tr( "ALPHA_TEXTURE" ), this ); - myAlphaTextureLineEdit = new QLineEdit( this ); - myAlphaTextureButton = new QPushButton( this ); - myAlphaTextureButton->setAutoDefault( false ); - myAlphaTextureButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_LOAD_TEXTURE" ) ) ); - connect( myAlphaTextureButton, SIGNAL( clicked() ), this, SLOT( onBrowseAlphaTexture() ) ); - - aLayout->addWidget( myAlphaTextureLabel, 3, 0 ); - aLayout->addWidget( myAlphaTextureLineEdit, 3, 1 ); - aLayout->addWidget( myAlphaTextureButton, 3, 2 ); - - // Alpha Threshold ( Point Sprite ) - myAlphaThresholdLabel = new QLabel( tr( "ALPHA_THRESHOLD" ), this ); - myAlphaThresholdSpinBox = new QtxDoubleSpinBox( 0.0, 1.0, 0.1, this ); - myAlphaThresholdSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - - aLayout->addWidget( myAlphaThresholdLabel, 4, 0 ); - aLayout->addWidget( myAlphaThresholdSpinBox, 4, 1, 1, 2 ); - - // Resolution ( Geometrical Sphere ) - myResolutionLabel = new QLabel( tr( "RESOLUTION" ), this ); - myResolutionSpinBox = new QtxIntSpinBox( 3, 100, 1, this ); - myResolutionSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - connect( myResolutionSpinBox, SIGNAL( valueChanged( int ) ), this, SLOT( onResolutionChanged( int ) ) ); - - aLayout->addWidget( myResolutionLabel, 5, 0 ); - aLayout->addWidget( myResolutionSpinBox, 5, 1, 1, 2 ); - - // Number of faces ( Geometrical Sphere ) - myFaceNumberLabel = new QLabel( tr( "FACE_NUMBER" ), this ); - myFaceNumberLineEdit = new QLineEdit( this ); - myFaceNumberLineEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - myFaceNumberLineEdit->setEnabled( false ); - //myFaceNumberLineEdit->setReadOnly( true ); - - aLayout->addWidget( myFaceNumberLabel, 6, 0 ); - aLayout->addWidget( myFaceNumberLineEdit, 6, 1, 1, 2 ); - - // Notification ( Geometrical Sphere ) - myFaceLimitLabel = new QLabel( tr( "FACE_LIMIT" ), this ); - myFaceLimitSpinBox = new QtxIntSpinBox( 10, 1000000, 10, this ); - myFaceLimitSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - - aLayout->addWidget( myFaceLimitLabel, 7, 0 ); - aLayout->addWidget( myFaceLimitSpinBox, 7, 1, 1, 2 ); - - connect( myPointSpriteButton, SIGNAL( clicked() ), this, SLOT( onTogglePointSprite() ) ); - connect( myOpenGLPointButton, SIGNAL( clicked() ), this, SLOT( onToggleOpenGLPoint() ) ); - connect( myGeomSphereButton, SIGNAL( clicked() ), this, SLOT( onToggleGeomSphere() ) ); -} - -void VVTK_PrimitiveBox::onTogglePointSprite() -{ - myPrimitiveType = VISU_OpenGLPointSpriteMapper::PointSprite; - - myClampLabel->show(); - myClampSpinBox->show(); - - myMainTextureLabel->show(); - myMainTextureLineEdit->show(); - myMainTextureButton->show(); - - myAlphaTextureLabel->show(); - myAlphaTextureLineEdit->show(); - myAlphaTextureButton->show(); - - myAlphaThresholdLabel->show(); - myAlphaThresholdSpinBox->show(); - - myResolutionLabel->hide(); - myResolutionSpinBox->hide(); - - myFaceNumberLabel->hide(); - myFaceNumberLineEdit->hide(); - - myFaceLimitLabel->hide(); - myFaceLimitSpinBox->hide(); -} - -void VVTK_PrimitiveBox::onToggleOpenGLPoint() -{ - myPrimitiveType = VISU_OpenGLPointSpriteMapper::OpenGLPoint; - - myClampLabel->show(); - myClampSpinBox->show(); - - myMainTextureLabel->hide(); - myMainTextureLineEdit->hide(); - myMainTextureButton->hide(); - - myAlphaTextureLabel->hide(); - myAlphaTextureLineEdit->hide(); - myAlphaTextureButton->hide(); - - myAlphaThresholdLabel->hide(); - myAlphaThresholdSpinBox->hide(); - - myResolutionLabel->hide(); - myResolutionSpinBox->hide(); - - myFaceNumberLabel->hide(); - myFaceNumberLineEdit->hide(); - - myFaceLimitLabel->hide(); - myFaceLimitSpinBox->hide(); -} - -void VVTK_PrimitiveBox::onToggleGeomSphere() -{ - myPrimitiveType = VISU_OpenGLPointSpriteMapper::GeomSphere; - - myClampLabel->hide(); - myClampSpinBox->hide(); - - myMainTextureLabel->hide(); - myMainTextureLineEdit->hide(); - myMainTextureButton->hide(); - - myAlphaTextureLabel->hide(); - myAlphaTextureLineEdit->hide(); - myAlphaTextureButton->hide(); - - myAlphaThresholdLabel->hide(); - myAlphaThresholdSpinBox->hide(); - - myResolutionLabel->show(); - myResolutionSpinBox->show(); - - myFaceNumberLabel->show(); - myFaceNumberLineEdit->show(); - - myFaceLimitLabel->show(); - myFaceLimitSpinBox->show(); -} - -void VVTK_PrimitiveBox::onResolutionChanged( int theResolution ) -{ - setFaceNumber( 2 * theResolution * ( theResolution - 2 ) ); -} - -void VVTK_PrimitiveBox::setPrimitiveType( int theType ) -{ - myPrimitiveType = theType; - - switch( myPrimitiveType ) - { - case VISU_OpenGLPointSpriteMapper::PointSprite : - myPointSpriteButton->setChecked( true ); - onTogglePointSprite(); - break; - case VISU_OpenGLPointSpriteMapper::OpenGLPoint : - myOpenGLPointButton->setChecked( true ); - onToggleOpenGLPoint(); - break; - case VISU_OpenGLPointSpriteMapper::GeomSphere : - myGeomSphereButton->setChecked( true ); - onToggleGeomSphere(); - break; - default : break; - } -} - -float VVTK_PrimitiveBox::getClamp() const -{ - return myClampSpinBox->value(); -} - -void VVTK_PrimitiveBox::setClamp( float theClamp ) -{ - myClampSpinBox->setValue( theClamp ); -} - -void VVTK_PrimitiveBox::setClampMaximum( float theClampMaximum ) -{ - myClampSpinBox->setMaximum( theClampMaximum ); -} - -void VVTK_PrimitiveBox::setMainTexture( const QString& theMainTexture ) -{ - myMainTexture = theMainTexture; - myMainTextureLineEdit->setText( theMainTexture.section( '/', -1 ) ); -} - -void VVTK_PrimitiveBox::setAlphaTexture( const QString& theAlphaTexture ) -{ - myAlphaTexture = theAlphaTexture; - myAlphaTextureLineEdit->setText( theAlphaTexture.section( '/', -1 ) ); -} - -float VVTK_PrimitiveBox::getAlphaThreshold() const -{ - return myAlphaThresholdSpinBox->value(); -} - -void VVTK_PrimitiveBox::setAlphaThreshold( float theAlphaThreshold ) -{ - myAlphaThresholdSpinBox->setValue( theAlphaThreshold ); -} - -int VVTK_PrimitiveBox::getResolution() const -{ - return myResolutionSpinBox->value(); -} - -void VVTK_PrimitiveBox::setResolution( int theResolution ) -{ - myResolutionSpinBox->setValue( theResolution ); -} - -int VVTK_PrimitiveBox::getFaceNumber() const -{ - int aResolution = getResolution(); - return 2 * aResolution * ( aResolution - 2 ); - //return myFaceNumberLineEdit->text().toInt(); -} - -void VVTK_PrimitiveBox::setFaceNumber( int theFaceNumber ) -{ - myFaceNumberLineEdit->setText( QString::number( theFaceNumber ) ); -} - -int VVTK_PrimitiveBox::getFaceLimit() const -{ - return myFaceLimitSpinBox->value(); -} - -void VVTK_PrimitiveBox::setFaceLimit( int theFaceLimit ) -{ - myFaceLimitSpinBox->setValue( theFaceLimit ); -} - -void VVTK_PrimitiveBox::onBrowseMainTexture() -{ - QString aRootDir = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/visu/"; - QString aFileName = QFileDialog::getOpenFileName( this, - 0, - aRootDir, - "Bitmap (*.bmp *.jpg *.png)" ); - - if( aFileName.isNull() ) - return; - - myMainTexture = aFileName; - myMainTextureLineEdit->setText( aFileName.section( '/', -1 ) ); -} - -void VVTK_PrimitiveBox::onBrowseAlphaTexture() -{ - QString aRootDir = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/visu/"; - QString aFileName = QFileDialog::getOpenFileName( this, - 0, - aRootDir, - "Bitmap (*.bmp *.jpg *.png)" ); - - if( aFileName.isNull() ) - return; - - myAlphaTexture = aFileName; - myAlphaTextureLineEdit->setText( aFileName.section( '/', -1 ) ); -} diff --git a/src/VVTK/VVTK_PrimitiveBox.h b/src/VVTK/VVTK_PrimitiveBox.h deleted file mode 100644 index c0ea8c4d..00000000 --- a/src/VVTK/VVTK_PrimitiveBox.h +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// VISU VISUGUI : GUI of VISU component -// File : VVTK_PrimitiveBox.h -// Author : Oleg UVAROV -// Module : VISU -// -#ifndef VVTK_PRIMITIVEBOX_H -#define VVTK_PRIMITIVEBOX_H - -#include "VVTK.h" - -#include - -class QLabel; -class QLineEdit; -class QPushButton; -class QRadioButton; - -class QtxDoubleSpinBox; -class QtxIntSpinBox; - -class VVTK_EXPORT VVTK_PrimitiveBox : public QGroupBox -{ - Q_OBJECT - -public: - VVTK_PrimitiveBox( QWidget* ); - ~VVTK_PrimitiveBox() {} - -public: - int getPrimitiveType() const { return myPrimitiveType; } - void setPrimitiveType( int ); - - float getClamp() const; - void setClamp( float ); - void setClampMaximum( float ); - - QString getMainTexture() const { return myMainTexture; } - void setMainTexture( const QString& ); - - QString getAlphaTexture() const { return myAlphaTexture; } - void setAlphaTexture( const QString& ); - - float getAlphaThreshold() const; - void setAlphaThreshold( float ); - - int getResolution() const; - void setResolution( int ); - - int getFaceNumber() const; - void setFaceNumber( int ); - - int getFaceLimit() const; - void setFaceLimit( int ); - -protected slots: - void onTogglePointSprite(); - void onToggleOpenGLPoint(); - void onToggleGeomSphere(); - - void onBrowseMainTexture(); - void onBrowseAlphaTexture(); - - void onResolutionChanged( int ); - -private: - int myPrimitiveType; - - QRadioButton* myPointSpriteButton; - QRadioButton* myOpenGLPointButton; - QRadioButton* myGeomSphereButton; - - QString myMainTexture; - QString myAlphaTexture; - - QLabel* myClampLabel; - QtxDoubleSpinBox* myClampSpinBox; - - QLabel* myMainTextureLabel; - QLineEdit* myMainTextureLineEdit; - QPushButton* myMainTextureButton; - - QLabel* myAlphaTextureLabel; - QLineEdit* myAlphaTextureLineEdit; - QPushButton* myAlphaTextureButton; - - QLabel* myAlphaThresholdLabel; - QtxDoubleSpinBox* myAlphaThresholdSpinBox; - - QLabel* myResolutionLabel; - QtxIntSpinBox* myResolutionSpinBox; - - QLabel* myFaceNumberLabel; - QLineEdit* myFaceNumberLineEdit; - - QLabel* myFaceLimitLabel; - QtxIntSpinBox* myFaceLimitSpinBox; -}; - - - -#endif diff --git a/src/VVTK/VVTK_Recorder.cxx b/src/VVTK/VVTK_Recorder.cxx deleted file mode 100755 index 9ef0f6dc..00000000 --- a/src/VVTK/VVTK_Recorder.cxx +++ /dev/null @@ -1,490 +0,0 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// SALOME VTKViewer : build VTK viewer into Salome desktop -// File : -// Author : -// Module : -// $Header$ -// -#include "VVTK_Recorder.h" - -#include "VVTK_ImageWriter.h" -#include "VVTK_ImageWriterMgr.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#ifndef WIN32 -#include -#endif - -#include -#include -#include - -#include "utilities.h" - -#ifdef _DEBUG_ -static int MYDEBUG = 0; -#else -static int MYDEBUG = 0; -#endif - - -namespace -{ - //---------------------------------------------------------------------------- - inline - void - GetNameJPEG(const std::string& thePreffix, - const int theIndex, - std::string& theName) - { - using namespace std; - ostringstream aStream; - aStream<SetClientData(this); - myCommand->SetCallback(VVTK_Recorder::ProcessEvents); -} - - -//---------------------------------------------------------------------------- -VVTK_Recorder -::~VVTK_Recorder() -{ - myCommand->Delete(); - myFilter->Delete(); - delete myWriterMgr; -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::CheckExistAVIMaker() -{ - myErrorStatus = 0; - using namespace std; - ostringstream aStream; - aStream<<"which "<& /dev/null"; - std::string anAVIMakeCheck = aStream.str(); - int iErr = system(anAVIMakeCheck.c_str()); - if(iErr != 0) - myErrorStatus = 127; -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::SetName(const char* theName) -{ - myName = theName; -} - -const char* -VVTK_Recorder::Name() const -{ - return myName.c_str(); -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::SetNbFPS(const double theNbFPS) -{ - myNbFPS = theNbFPS; -} - -double -VVTK_Recorder -::NbFPS() const -{ - return myNbFPS; -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::SetQuality(int theQuality) -{ - myQuality = theQuality; -} - -int -VVTK_Recorder -::GetQuality() const -{ - return myQuality; -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::SetRenderWindow(vtkRenderWindow* theRenderWindow) -{ - myRenderWindow = theRenderWindow; -} - -vtkRenderWindow* -VVTK_Recorder -::RenderWindow() -{ - return myRenderWindow; -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::SetProgressiveMode(bool theProgressiveMode) -{ - myProgressiveMode = theProgressiveMode; -} - -bool -VVTK_Recorder -::GetProgressiveMode() const -{ - return myProgressiveMode; -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::SetUseSkippedFrames(bool theUseSkippedFrames) -{ - myUseSkippedFrames = theUseSkippedFrames; -} - -bool -VVTK_Recorder -::UseSkippedFrames() const -{ - return myUseSkippedFrames; -} - - -//---------------------------------------------------------------------------- -int -VVTK_Recorder -::ErrorStatus() const -{ - return myErrorStatus; -} - -int -VVTK_Recorder -::State() const -{ - return myState; -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::ProcessEvents(vtkObject* vtkNotUsed(theObject), - unsigned long theEvent, - void* theClientData, - void* vtkNotUsed(theCallData)) -{ - if(vtkObject* anObj = reinterpret_cast(theClientData)){ - if(VVTK_Recorder* aSelf = dynamic_cast(anObj)){ - if(theEvent==vtkCommand::EndEvent){ - if(aSelf->State() == VVTK_Recorder::VVTK_Recorder_Record){ - aSelf->DoRecord(); - } - } - } - } -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::Record() -{ - if(myState == VVTK_Recorder_Stop){ - if(myRenderWindow){ - myState = VVTK_Recorder_Record; - myFilter->SetInput(myRenderWindow); - myFrameIndex = -1; - myNbWrittenFrames = 0; - myRenderWindow->RemoveObserver(myCommand); - myRenderWindow->AddObserver(vtkCommand::EndEvent, - myCommand, - myPriority); - myRenderWindow->Render(); - } - } -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::Stop() -{ - QApplication::setOverrideCursor( Qt::WaitCursor ); - - if(myState == VVTK_Recorder_Record){ - if(!myPaused) - DoRecord(); - - myWriterMgr->Stop(); - - if(myUseSkippedFrames) - AddSkippedFrames(); - - myFrameIndexes.clear(); - - MakeFileAVI(); - } - myState = VVTK_Recorder_Stop; - myPaused = 0; - - QApplication::restoreOverrideCursor(); -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::Pause() -{ - myPaused = myPaused ? 0 : 1; - if(myPaused && !myFrameIndexes.empty()){ - myFrameIndexes.back() *= -1; - if(MYDEBUG) MESSAGE("VVTK_Recorder::Pause - myFrameIndexes.back() = "< -#include -#include - -#include - -class vtkRenderWindow; -class vtkCallbackCommand; -class vtkWindowToImageFilter; -class VVTK_ImageWriterMgr; -// -class VVTK_Recorder : public vtkObject -{ - protected: - enum State { - VVTK_Recorder_Unknown=0, - VVTK_Recorder_Record, - VVTK_Recorder_Stop - }; - - public: - static VVTK_Recorder *New(); - vtkTypeRevisionMacro(VVTK_Recorder,vtkObject); - - void - SetRenderWindow(vtkRenderWindow* theRenderWindow); - - vtkRenderWindow* - RenderWindow(); - - void - SetName(const char *theName); - - const char* - Name() const; - - void - SetNbFPS(const double theNbFPS); - - double - NbFPS() const; - - void - SetQuality(int theQuality); - - int - GetQuality() const; - - void - SetProgressiveMode(bool theProgressiveMode); - - bool - GetProgressiveMode() const; - - void - SetUseSkippedFrames(bool theUseSkippedFrames); - - bool - UseSkippedFrames() const; - - void - Record(); - - void - Pause(); - - void - Stop(); - - int - State() const; - - int - ErrorStatus() const; - - void - CheckExistAVIMaker(); - -protected : - VVTK_Recorder(); - - ~VVTK_Recorder(); - - void - DoRecord(); - - void - MakeFileAVI(); - - void - AddSkippedFrames(); - - void - PreWrite(); - - static - void - ProcessEvents(vtkObject* theObject, - unsigned long theEvent, - void* theClientData, - void* theCallData); - -protected : - int myState; - int myPaused; - int myErrorStatus; - - float myPriority; - double myTimeStart; - - int myFrameIndex; - int myNbWrittenFrames; - - double myNbFPS; - int myQuality; - bool myProgressiveMode; - - typedef std::vector TFrameIndexes; - TFrameIndexes myFrameIndexes; - bool myUseSkippedFrames; - - std::string myName; - std::string myNameAVIMaker; - - vtkCallbackCommand *myCommand; - vtkRenderWindow *myRenderWindow; - vtkWindowToImageFilter *myFilter; - VVTK_ImageWriterMgr *myWriterMgr; - - -private: - VVTK_Recorder(const VVTK_Recorder&); //Not implemented - void operator=(const VVTK_Recorder&); //Not implemented -}; -#endif diff --git a/src/VVTK/VVTK_RecorderDlg.cxx b/src/VVTK/VVTK_RecorderDlg.cxx deleted file mode 100644 index 5b68652d..00000000 --- a/src/VVTK/VVTK_RecorderDlg.cxx +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// VISU VISUGUI : GUI of VISU component -// File : VVTK_RecorderDlg.cxx -// Author : Oleg UVAROV -// Module : VISU -// -#include "VVTK_RecorderDlg.h" -#include "VVTK_Recorder.h" - -#include "SUIT_FileDlg.h" -#include "SUIT_MessageBox.h" -#include "SUIT_ResourceMgr.h" -#include "SUIT_Session.h" - -#include "QtxDoubleSpinBox.h" -#include "QtxIntSpinBox.h" - -#include "LightApp_Application.h" - -#include "CAM_Module.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -/*! - * Constructor - */ -VVTK_RecorderDlg::VVTK_RecorderDlg( QWidget* theParent, VVTK_Recorder* theRecorder ): - QDialog( theParent ), - myRecorder( theRecorder ) -{ - setWindowTitle( tr( "DLG_RECORDER_TITLE" ) ); - - SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr(); - - QVBoxLayout* aTopLayout = new QVBoxLayout( this ); - aTopLayout->setSpacing( 6 ); - aTopLayout->setMargin( 6 ); - //aTopLayout->setAutoAdd( true ); - - // Settings - QGroupBox* mySettingsBox = new QGroupBox( tr( "SETTINGS" ), this ); - //mySettingsBox->setColumnLayout( 0, Qt::Vertical ); - //mySettingsBox->layout()->setSpacing( 0 ); - //mySettingsBox->layout()->setMargin( 0 ); - - QGridLayout* aSettingsLayout = new QGridLayout( mySettingsBox ); - aSettingsLayout->setSpacing( 6 ); - aSettingsLayout->setMargin( 11 ); - - QLabel* aFileNameLabel = new QLabel( tr( "FILE_NAME" ), mySettingsBox ); - myFileNameLineEdit = new QLineEdit( mySettingsBox ); - myFileNameLineEdit->setMinimumWidth( 250 ); - myFileNameLineEdit->setReadOnly( true ); - - QLabel* aRecordingModeLabel = new QLabel( tr( "RECORDING_MODE" ), mySettingsBox ); - myRecordingModeComboBox = new QComboBox( mySettingsBox ); - myRecordingModeComboBox->addItem( tr( "SKIPPED_FRAMES" ) ); - myRecordingModeComboBox->addItem( tr( "ALL_DISLPAYED_FRAMES" ) ); - myRecordingModeComboBox->setCurrentIndex( aResourceMgr->integerValue( "VISU", "recorder_mode", 1 ) ); - - QLabel* aFPSLabel = new QLabel( tr( "FPS" ), mySettingsBox ); - myFPSSpinBox = new QtxDoubleSpinBox( 0.1, 100.0, 1.0, mySettingsBox ); - myFPSSpinBox->setValue( aResourceMgr->doubleValue( "VISU", "recorder_fps", 10.0 ) ); - - QLabel* aQualityLabel = new QLabel( tr( "QUALITY" ), mySettingsBox ); - myQualitySpinBox = new QtxIntSpinBox( 1, 100, 1, mySettingsBox ); - myQualitySpinBox->setValue( aResourceMgr->integerValue( "VISU", "recorder_quality", 80 ) ); - - myProgressiveCheckBox = new QCheckBox( tr( "PROGRESSIVE" ), mySettingsBox ); - myProgressiveCheckBox->setChecked( aResourceMgr->booleanValue( "VISU", "recorder_progressive", false ) ); - - aSettingsLayout->addWidget( aFileNameLabel, 0, 0 ); - aSettingsLayout->addWidget( myFileNameLineEdit, 1, 0, 1, 2 ); - //aSettingsLayout->addWidget( aFileNameButton, 1, 2 ); - aSettingsLayout->addWidget( aRecordingModeLabel, 2, 0 ); - aSettingsLayout->addWidget( myRecordingModeComboBox, 2, 1 ); - aSettingsLayout->addWidget( aFPSLabel, 3, 0 ); - aSettingsLayout->addWidget( myFPSSpinBox, 3, 1 ); - aSettingsLayout->addWidget( aQualityLabel, 4, 0 ); - aSettingsLayout->addWidget( myQualitySpinBox, 4, 1 ); - aSettingsLayout->addWidget( myProgressiveCheckBox, 5, 0 ); - - aTopLayout->addWidget( mySettingsBox ); - - // Start / Close - QGroupBox* CommonGroup = new QGroupBox( this ); - //CommonGroup->setColumnLayout(0, Qt::Vertical ); - //CommonGroup->layout()->setSpacing( 0 ); - //CommonGroup->layout()->setMargin( 0 ); - QGridLayout* CommonGroupLayout = new QGridLayout( CommonGroup ); - CommonGroupLayout->setAlignment( Qt::AlignTop ); - CommonGroupLayout->setSpacing( 6 ); - CommonGroupLayout->setMargin( 11 ); - - QPushButton* aStartButton = new QPushButton( tr( "START" ), CommonGroup ); - aStartButton->setAutoDefault( true ); - aStartButton->setDefault( true ); - CommonGroupLayout->addWidget( aStartButton, 0, 0 ); - CommonGroupLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 ); - - QPushButton* aCloseButton = new QPushButton( tr( "CLOSE" ), CommonGroup ); - aCloseButton->setAutoDefault( true ); - CommonGroupLayout->addWidget( aCloseButton, 0, 2 ); - - QPushButton* aHelpButton = new QPushButton( tr( "HELP" ), CommonGroup ); - aHelpButton->setAutoDefault( true ); - CommonGroupLayout->addWidget( aHelpButton, 0, 3 ); - - aTopLayout->addWidget( CommonGroup ); - - connect( aStartButton, SIGNAL( clicked() ), this, SLOT( onStart() ) ); - connect( aCloseButton, SIGNAL( clicked() ), this, SLOT( onClose() ) ); - connect( aHelpButton, SIGNAL( clicked() ), this, SLOT( onHelp() ) ); -} - -VVTK_RecorderDlg::~VVTK_RecorderDlg() -{ -} - -void VVTK_RecorderDlg::onStart() -{ - if( myFileName.isNull() ) - return; - - myRecorder->SetName( (const char*)myFileName.toLatin1() ); - - myRecorder->SetUseSkippedFrames( myRecordingModeComboBox->currentIndex() == 0 ); - myRecorder->SetNbFPS( myFPSSpinBox->value() ); - myRecorder->SetQuality( myQualitySpinBox->value() ); - myRecorder->SetProgressiveMode( myProgressiveCheckBox->isChecked() ); - - accept(); - -} - -void VVTK_RecorderDlg::onClose() -{ - reject(); -} - -void VVTK_RecorderDlg::onHelp() -{ - QString aHelpFileName = "animation_in_gauss_viewer.htm"; - LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); - if (app) - app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName); - else { - QString platform; -#ifdef WIN32 - platform = "winapplication"; -#else - platform = "application"; -#endif - SUIT_MessageBox::warning(0, QObject::tr("WRN_WARNING"), - QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName) ); - } -} - -bool VVTK_RecorderDlg::onBrowseFile() -{ - QString aRootDir = QString( getenv( "VISU_ROOT_DIR") ); - - QStringList aFilter; - aFilter.append( tr( "FLT_AVI_FILES" ) ); - aFilter.append( tr( "FLT_ALL_FILES" ) ); - - QString aFileName = SUIT_FileDlg::getFileName( this, getenv( "HOME" ), aFilter, - tr( "FILE_NAME" ), false ); - - if( aFileName.isNull() ) - return false; - - myFileName = aFileName; - myFileNameLineEdit->setText( aFileName.section( '/', -1 ) ); - - return true; -} - -int VVTK_RecorderDlg::exec() -{ - if( !onBrowseFile() ) - { - reject(); - return 0; - } - return QDialog::exec(); -} - -void VVTK_RecorderDlg::keyPressEvent( QKeyEvent* e ) -{ - QDialog::keyPressEvent( e ); - if ( e->isAccepted() ) - return; - - if ( e->key() == Qt::Key_F1 ) - { - e->accept(); - onHelp(); - } -} diff --git a/src/VVTK/VVTK_RecorderDlg.h b/src/VVTK/VVTK_RecorderDlg.h deleted file mode 100644 index f6b8bac4..00000000 --- a/src/VVTK/VVTK_RecorderDlg.h +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// VISU VISUGUI : GUI of VISU component -// File : VVTK_RecorderDlg.h -// Author : Oleg UVAROV -// Module : VISU -// $Header$ -// -#ifndef VVTK_RECORDERDLG_H -#define VVTK_RECORDERDLG_H - -#include -#include - -class QCheckBox; -class QComboBox; -class QGroupBox; -class QLCDNumber; -class QLineEdit; -class QPushButton; -class QTimer; - -class QtxDoubleSpinBox; -class QtxIntSpinBox; - -class VVTK_Recorder; - -//! Recorder Dialog. -class VVTK_RecorderDlg : public QDialog -{ - Q_OBJECT - -public: - VVTK_RecorderDlg( QWidget*, VVTK_Recorder* ); - ~VVTK_RecorderDlg(); - - int exec(); - - QString fileName() const { return myFileName; } - -private: - virtual void keyPressEvent( QKeyEvent* ); - -protected slots: - void onStart(); - void onClose(); - void onHelp(); - - bool onBrowseFile(); - -private: - VVTK_Recorder* myRecorder; - QString myFileName; - - QLineEdit* myFileNameLineEdit; - - QComboBox* myRecordingModeComboBox; - QtxDoubleSpinBox* myFPSSpinBox; - QtxIntSpinBox* myQualitySpinBox; - QCheckBox* myProgressiveCheckBox; - -}; - -#endif diff --git a/src/VVTK/VVTK_Renderer.cxx b/src/VVTK/VVTK_Renderer.cxx deleted file mode 100644 index 23cc1c54..00000000 --- a/src/VVTK/VVTK_Renderer.cxx +++ /dev/null @@ -1,437 +0,0 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// SALOME VTKViewer : build VTK viewer into Salome desktop -// File : -// Author : -// Module : -// $Header$ -// -#include "VVTK_Renderer.h" - -#include "VISU_GaussPtsAct.h" -#include "VISU_GaussPointsPL.hxx" -#include "VISU_WidgetCtrl.hxx" -#include "VISU_PlanesWidget.hxx" -#include "VISU_SphereWidget.hxx" - -#include - -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "utilities.h" - -#ifdef _DEBUG_ -static int MYDEBUG = 0; -#else -static int MYDEBUG = 0; -#endif - -//====================================================================== -class VISU_FPSActor : public vtkTextActor -{ -public: - vtkTypeMacro( VISU_FPSActor, vtkTextActor); - static - VISU_FPSActor* - New(); - - virtual - int - RenderOpaqueGeometry(vtkViewport *theViewport); -}; - -//====================================================================== -vtkStandardNewMacro(VISU_FPSActor); - -//====================================================================== -// function: RenderOpaqueGeometry -// purpose : -//====================================================================== -int -VISU_FPSActor -::RenderOpaqueGeometry(vtkViewport *theViewport) -{ - // It's impossible to render opaque geometry of text actor - // if the size of the viewport is less than 1.0 - int *size = theViewport->GetSize(); - if( size[0] <= 1.0 || size[1] <= 1.0 ) - return 1; - - if(vtkRenderer *aRenderer = dynamic_cast(theViewport)){ - static float aTol = 1.e-6; - float aLastRenderTimeInSeconds = aRenderer->GetLastRenderTimeInSeconds(); - if(aLastRenderTimeInSeconds > aTol){ - size_t aNumberOfCells = 0; - VTK::ActorCollectionCopy aCopy(aRenderer->GetActors()); - if(vtkActorCollection *anActorCollection = aCopy.GetActors()){ - anActorCollection->InitTraversal(); - while(vtkActor *anActor = anActorCollection->GetNextActor()){ - if(anActor->GetVisibility()){ - if(SALOME_Actor *aSActor = dynamic_cast(anActor)){ - if(vtkMapper *aMapper = aSActor->GetMapper()){ - if(vtkDataSet *aDataSet = aMapper->GetInput()){ - aNumberOfCells += aDataSet->GetNumberOfCells(); - } - } - } - } - } - } - std::ostringstream aStr; - float aFPS = 1.0 / aLastRenderTimeInSeconds; - aStr<<"FPS: "<Delete(); - - vtkTextMapper* aTextMapper = vtkTextMapper::New(); - vtkTextProperty *aTextProperty = aTextMapper->GetTextProperty(); - aTextProperty->SetJustificationToRight(); - aTextProperty->SetVerticalJustificationToTop(); - aTextProperty->SetFontSize(10); - - myFPSActor->SetPickable(false); - myFPSActor->ScaledTextOff(); - myFPSActor->SetAlignmentPoint(8); - myFPSActor->SetPosition2 (1., 1.); - myFPSActor->SetMapper(aTextMapper); - aTextMapper->Delete(); - - //GetDevice()->AddActor2D(myFPSActor.GetPointer()); - - myGaussPointPicker->Delete(); - - myGaussPreHighlightProperty->Delete(); - myGaussPreHighlightProperty->SetColor(0,1,1); - - myGaussHighlightProperty->Delete(); - myGaussHighlightProperty->SetColor(1,1,0); - -} - -VVTK_Renderer -::~VVTK_Renderer() -{ - if(MYDEBUG) INFOS("~VVTK_Renderer() - "<(theActor)){ - anActor->SetPointPicker(myGaussPointPicker.GetPointer()); - anActor->SetPreHighlightProperty(myGaussPreHighlightProperty.GetPointer()); - anActor->SetHighlightProperty(myGaussHighlightProperty.GetPointer()); - - anActor->SetInsideCursorSettings(myInsideCursorSettings); - //anActor->SetPickingSettings(myPickingSettings); - } -} - -//---------------------------------------------------------------------------- -void -VVTK_Renderer -::RemoveActor(VTKViewer_Actor* theActor) -{ - Superclass::RemoveActor(theActor); - if(VISU_GaussPtsAct* anActor = dynamic_cast(theActor)){ - anActor->SetPointPicker(NULL); - anActor->SetPreHighlightProperty(NULL); - anActor->SetHighlightProperty(NULL); - - anActor->SetInsideCursorSettings(NULL); - //anActor->SetPickingSettings(NULL); - } -} - -//---------------------------------------------------------------------------- -void -VVTK_Renderer -::SetInsideCursorSettings(VISU_InsideCursorSettings* theInsideCursorSettings) -{ - myInsideCursorSettings = theInsideCursorSettings; -} - -//---------------------------------------------------------------------------- -void -VVTK_Renderer -::SetPickingSettings(VISU_PickingSettings* thePickingSettings) -{ - myPickingSettings = thePickingSettings; -} - - -//---------------------------------------------------------------------------- -vtkStandardNewMacro(VVTK_Renderer1); - -//---------------------------------------------------------------------------- -VVTK_Renderer1::VVTK_Renderer1(): - myWidgetCtrl(VISU_WidgetCtrl::New()), - myOutsideCursorSettings(NULL) -{ - if(MYDEBUG) INFOS("VVTK_Renderer1() - "<SetPlaceFactor(1.1); - // - VISU_PlanesWidget *aPlanesWidget = myWidgetCtrl->GetPlanesWidget(); - aPlanesWidget->SetOutlineTranslation(false); - vtkProperty* aSelectedPlaneProperty = aPlanesWidget->GetSelectedPlaneProperty(); - vtkProperty* aPlaneProperty = aPlanesWidget->GetPlaneProperty(); - aPlaneProperty->SetOpacity(aSelectedPlaneProperty->GetOpacity()*1.5); - // - //myWidgetCtrl->Delete(); -} - -VVTK_Renderer1 -::~VVTK_Renderer1() -{ - if(MYDEBUG) INFOS("~VVTK_Renderer1() - "<SetInteractor(NULL); -} - -//---------------------------------------------------------------------------- -void -VVTK_Renderer1 -::AddActor(VTKViewer_Actor* theActor) -{ - Superclass::AddActor(theActor); - if(VISU_GaussPtsAct1* anActor = dynamic_cast(theActor)){ - anActor->SetWidgetCtrl(GetWidgetCtrl()); - anActor->SetOutsideCursorSettings(myOutsideCursorSettings); - AdjustWidgetCtrl(); - } -} - - -//---------------------------------------------------------------------------- -void -VVTK_Renderer1 -::RemoveActor(VTKViewer_Actor* theActor) -{ - Superclass::RemoveActor(theActor); - if(VISU_GaussPtsAct1* anActor = dynamic_cast(theActor)){ - anActor->SetWidgetCtrl(NULL); - anActor->SetOutsideCursorSettings(NULL); - AdjustWidgetCtrl(); - } -} - - -//---------------------------------------------------------------------------- -void -VVTK_Renderer1 -::AdjustWidgetCtrl() -{ - VISU_PlanesWidget *aPlanesWidget = myWidgetCtrl->GetPlanesWidget(); - aPlanesWidget->InitialPlaceWidget(myBndBox); - aPlanesWidget->SetOrigin(0.5*(myBndBox[1] + myBndBox[0]), - 0.5*(myBndBox[3] + myBndBox[2]), - 0.5*(myBndBox[5] + myBndBox[4])); - // - VISU_SphereWidget *aSphereWidget = myWidgetCtrl->GetSphereWidget(); - aSphereWidget->SetCenter(0.5*(myBndBox[1] + myBndBox[0]), - 0.5*(myBndBox[3] + myBndBox[2]), - 0.5*(myBndBox[5] + myBndBox[4])); - - float aMinLength = VTK_LARGE_FLOAT; - for (int i=0; i<3; ++i) { - float aLength = myBndBox[2*i+1]-myBndBox[2*i]; - aMinLength = std::min(aMinLength,aLength); - } - aSphereWidget->SetRadius(aMinLength); -} - -//---------------------------------------------------------------------------- -void -VVTK_Renderer1 -::Initialize(vtkRenderWindowInteractor* theInteractor, - SVTK_Selector* theSelector) -{ - SVTK_Renderer::Initialize(theInteractor,theSelector); - myWidgetCtrl->SetInteractor(theInteractor); -} - -//---------------------------------------------------------------------------- -void -VVTK_Renderer1 -::SetOutsideCursorSettings(VISU_OutsideCursorSettings* theOutsideCursorSettings) -{ - myOutsideCursorSettings = theOutsideCursorSettings; -} - -//---------------------------------------------------------------------------- -VISU_WidgetCtrl* -VVTK_Renderer1 -::GetWidgetCtrl() -{ - return myWidgetCtrl;//.GetPointer(); -} - -//---------------------------------------------------------------------------- -bool -VVTK_Renderer1 -::OnAdjustActors() -{ - return SVTK_Renderer::OnAdjustActors(); -} - - -//---------------------------------------------------------------------------- -vtkStandardNewMacro(VVTK_Renderer2); - -//---------------------------------------------------------------------------- -VVTK_Renderer2 -::VVTK_Renderer2(): - myEventCallbackCommand(vtkCallbackCommand::New()) -{ - if(MYDEBUG) INFOS("VVTK_Renderer2() - "<Delete(); - - myPriority = 0.0; - myEventCallbackCommand->SetClientData(this); - myEventCallbackCommand->SetCallback(VVTK_Renderer2::ProcessEvents); -} - -VVTK_Renderer2 -::~VVTK_Renderer2() -{ - if(MYDEBUG) INFOS("~VVTK_Renderer2() - "<AddObserver(vtkCommand::EndInteractionEvent, - myEventCallbackCommand.GetPointer(), - myPriority); - theWidgetCtrl->AddObserver(vtkCommand::EnableEvent, - myEventCallbackCommand.GetPointer(), - myPriority); - theWidgetCtrl->AddObserver(vtkCommand::DisableEvent, - myEventCallbackCommand.GetPointer(), - myPriority); - myWidgetCtrl = theWidgetCtrl; -} - -void -VVTK_Renderer2 -::ProcessEvents(vtkObject* vtkNotUsed(theObject), - unsigned long theEvent, - void* theClientData, - void* vtkNotUsed(theCallData)) -{ - VVTK_Renderer2* self = reinterpret_cast(theClientData); - - switch(theEvent){ - case vtkCommand::EnableEvent: - case vtkCommand::EndInteractionEvent: - self->OnEndInteractionEvent(); - break; - } -} - -void -VVTK_Renderer2 -::OnEndInteractionEvent() -{ - AdjustActors(); - myInteractor->Render(); -} - - -//---------------------------------------------------------------------------- -void VVTK_Renderer2::AddActor(VTKViewer_Actor* theActor) -{ - if(VISU_GaussPtsAct1* anActor = dynamic_cast(theActor)){ - if(VISU::TGaussPtsActorFactory* aFactory = anActor->GetGaussPtsFactory()){ - if(VISU_GaussPtsAct2* anActor2 = aFactory->CloneActor(anActor)){ - anActor2->SetWidgetCtrl(myWidgetCtrl); - Superclass::AddActor(anActor2); - } - } - } -} - -//---------------------------------------------------------------------------- -void -VVTK_Renderer2 -::RemoveActor(VTKViewer_Actor* theActor) -{ - using namespace VISU; - if(VISU_GaussPtsAct2* anActor = dynamic_cast(theActor)){ - anActor->SetWidgetCtrl(NULL); - Superclass::RemoveActor(theActor); - } -} diff --git a/src/VVTK/VVTK_Renderer.h b/src/VVTK/VVTK_Renderer.h deleted file mode 100644 index ae558db2..00000000 --- a/src/VVTK/VVTK_Renderer.h +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// SALOME VTKViewer : build VTK viewer into Salome desktop -// File : -// Author : -// Module : SALOME -// $Header$ -// -#ifndef VVTK_Renderer_h -#define VVTK_Renderer_h - -#include "VVTK.h" - -#include "SVTK_Renderer.h" - -class VISU_WidgetCtrl; -class VISU_InsideCursorSettings; -class VISU_OutsideCursorSettings; -class VISU_PickingSettings; -class VISU_FPSActor; - -class vtkPointPicker; -class vtkImplicitFunction; - -//---------------------------------------------------------------------------- -//! To customize SVTK_Renderer according to VVTK functionality -class VVTK_EXPORT VVTK_Renderer : public SVTK_Renderer -{ - public: - vtkTypeMacro(VVTK_Renderer,SVTK_Renderer); - static VVTK_Renderer* New(); - - //! Reimplement SVTK_Renderer::AddActor - /*! - Perform an additional action - apply picking settings on the published VISU_GaussPtsAct actors - */ - virtual - void - AddActor(VTKViewer_Actor* theActor); - - //! Reimplement SVTK_Renderer::RemoveActor (remove additional settings) - virtual - void - RemoveActor(VTKViewer_Actor* theActor); - - //! To set VISU_PickingSettings to share them among all VISU_GaussPtsAct actors published into the view - void - SetInsideCursorSettings(VISU_InsideCursorSettings* theInsideCursorSettings); - - void - SetPickingSettings(VISU_PickingSettings* thePickingSettings); - - protected: - VVTK_Renderer(); - ~VVTK_Renderer(); - - VISU_PickingSettings* myPickingSettings; //! Keeps reference of the VISU_PickingSettings - VISU_InsideCursorSettings* myInsideCursorSettings; //! Keeps reference of the VISU_InsideCursorSettings - vtkSmartPointer myFPSActor; //!< To show FPS of the rendering at run-time - - vtkSmartPointer myGaussPointPicker; - vtkSmartPointer myGaussPreHighlightProperty; - vtkSmartPointer myGaussHighlightProperty; -}; - - -//---------------------------------------------------------------------------- -//! To extend VVTK_Renderer to implement base view functionality -class VVTK_EXPORT VVTK_Renderer1 : public VVTK_Renderer -{ - public: - vtkTypeMacro(VVTK_Renderer1,VVTK_Renderer); - static VVTK_Renderer1* New(); - - //! Reimplement SVTK_Renderer::Initialize - virtual - void - Initialize(vtkRenderWindowInteractor* theInteractor, - SVTK_Selector* theSelector); - - //! Reimplement VVTK_Renderer::AddActor to apply to the actor additional settings - virtual - void - AddActor(VTKViewer_Actor* theActor); - - //! Reimplement VVTK_Renderer::RemoveActor - virtual - void - RemoveActor(VTKViewer_Actor* theActor); - - //! To set VISU_PickingSettings to share them among all VISU_GaussPtsAct1 actors published into the view - void - SetOutsideCursorSettings(VISU_OutsideCursorSettings* theOutsideCursorSettings); - - VISU_WidgetCtrl* GetWidgetCtrl(); - - protected: - VVTK_Renderer1(); - ~VVTK_Renderer1(); - - //! Reimplement VVTK_Renderer::OnAdjustActors - virtual - bool - OnAdjustActors(); - - void AdjustWidgetCtrl(); - - VISU_WidgetCtrl* myWidgetCtrl; - //vtkSmartPointer myWidgetCtrl; - VISU_OutsideCursorSettings* myOutsideCursorSettings; - vtkSmartPointer myTextActor; -}; - - -//---------------------------------------------------------------------------- -class VVTK_EXPORT VVTK_Renderer2 : public VVTK_Renderer -{ - public: - vtkTypeMacro(VVTK_Renderer2,VVTK_Renderer); - static VVTK_Renderer2* New(); - - //! Reimplement VVTK_Renderer::AddActor to apply to the actor additional settings - virtual - void - AddActor(VTKViewer_Actor* theActor); - - //! Reimplement VVTK_Renderer::RemoveActor - virtual - void - RemoveActor(VTKViewer_Actor* theActor); - - void SetWidgetCtrl(VISU_WidgetCtrl* theWidgetCtrl); - - //! To handle vtkCommand::EndInteractionEvent to redraw the view - void - OnEndInteractionEvent(); - - protected: - VVTK_Renderer2(); - ~VVTK_Renderer2(); - - //! Main process VTK event method - static - void - ProcessEvents(vtkObject* theObject, - unsigned long theEvent, - void* theClientData, - void* theCallData); - - //! Used to process VTK events - vtkSmartPointer myEventCallbackCommand; - - //! Priority at which events are processed - float myPriority; - - VISU_WidgetCtrl* myWidgetCtrl; -}; - - -#endif diff --git a/src/VVTK/VVTK_SegmentationCursorDlg.cxx b/src/VVTK/VVTK_SegmentationCursorDlg.cxx deleted file mode 100644 index 5b927c7e..00000000 --- a/src/VVTK/VVTK_SegmentationCursorDlg.cxx +++ /dev/null @@ -1,859 +0,0 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// File : VVTK_SegmentationCursorDlg.cxx -// Author : Oleg Uvarov -// Module : VISU -// -#include "VVTK_SegmentationCursorDlg.h" -#include "VVTK_PrimitiveBox.h" -#include "VVTK_SizeBox.h" - -#include "VISU_GaussPtsAct.h" -#include "VISU_GaussPtsSettings.h" - -#include "VISU_WidgetCtrl.hxx" -#include "VISU_PlanesWidget.hxx" -#include "VISU_SphereWidget.hxx" - -#include "VISU_GaussPointsPL.hxx" -#include "VISU_OpenGLPointSpriteMapper.hxx" - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "utilities.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -//---------------------------------------------------------------- -VVTK_SegmentationCursorDlg::VVTK_SegmentationCursorDlg( QWidget* parent, const char* name ) - :QDialog( parent, - Qt::WindowTitleHint | Qt::WindowSystemMenuHint ), - myEventCallbackCommand( vtkCallbackCommand::New() ), - myInsideCursorSettings( VISU_InsideCursorSettings::New() ), - myOutsideCursorSettings( VISU_OutsideCursorSettings::New() ), - myIsPlaneSegmentation( true ), - myWidgetCtrl(NULL), - myInteractor(NULL) -{ - setAccessibleName( name ); - - myPriority = 0.0; - myEventCallbackCommand->Delete(); - myEventCallbackCommand->SetClientData(this); - myEventCallbackCommand->SetCallback(VVTK_SegmentationCursorDlg::ProcessEvents); - - myInsideCursorSettings->AddObserver(VISU::UpdateFromSettingsEvent, - myEventCallbackCommand.GetPointer(), - myPriority); - - setWindowTitle( tr( "SEGMENTATION_CURSOR_DLG_TITLE" ) ); - setSizeGripEnabled(TRUE); - - QVBoxLayout* TopLayout = new QVBoxLayout( this ); - TopLayout->setSpacing(6); - TopLayout->setMargin(11); - - myTabBox = new QTabWidget( this ); - - // Segmentation cursor pane - mySegmentationCursorBox = new QWidget( this ); - QVBoxLayout* SCBoxLayout = new QVBoxLayout( mySegmentationCursorBox ); - SCBoxLayout->setMargin(11); - SCBoxLayout->setSpacing(6); - SCBoxLayout->setAlignment(Qt::AlignTop); - - // Origin - myOriginGroup = new QGroupBox( tr( "ORIGIN_TITLE" ), mySegmentationCursorBox ); - //myOriginGroup->setColumnLayout( 0, Qt::Vertical ); - //myOriginGroup->layout()->setSpacing( 0 ); - //myOriginGroup->layout()->setMargin( 0 ); - - QGridLayout* OriginGroupLayout = new QGridLayout( myOriginGroup ); - OriginGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter); - OriginGroupLayout->setSpacing(6); - OriginGroupLayout->setMargin(11); - - QLabel* XOriginLabel = new QLabel( tr( "ORIGIN_X" ), myOriginGroup ); - myXOriginSpinBox = new QtxDoubleSpinBox( -1000.0, 1000.0, 0.1, myOriginGroup ); - myXOriginSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - myXOriginSpinBox->setMinimumWidth( 100 ); - myXOriginSpinBox->setValue( 0.0 ); - - QLabel* YOriginLabel = new QLabel( tr( "ORIGIN_Y" ), myOriginGroup ); - myYOriginSpinBox = new QtxDoubleSpinBox( -1000.0, 1000.0, 0.1, myOriginGroup ); - myYOriginSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - myYOriginSpinBox->setMinimumWidth( 100 ); - myYOriginSpinBox->setValue( 0.0 ); - - QLabel* ZOriginLabel = new QLabel( tr( "ORIGIN_Z" ), myOriginGroup ); - myZOriginSpinBox = new QtxDoubleSpinBox( -1000.0, 1000.0, 0.1, myOriginGroup ); - //myZOriginSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - myZOriginSpinBox->setMinimumWidth( 100 ); - myZOriginSpinBox->setValue( 1.0 ); - - OriginGroupLayout->addWidget( XOriginLabel, 0, 0 ); - OriginGroupLayout->addWidget( myXOriginSpinBox, 0, 1 ); - OriginGroupLayout->addWidget( YOriginLabel, 0, 2 ); - OriginGroupLayout->addWidget( myYOriginSpinBox, 0, 3 ); - OriginGroupLayout->addWidget( ZOriginLabel, 0, 4 ); - OriginGroupLayout->addWidget( myZOriginSpinBox, 0, 5 ); - - SCBoxLayout->addWidget( myOriginGroup ); - - // Direction ( Plane Segmentation ) - myDirectionGroup = new QGroupBox( tr( "DIRECTION_TITLE" ), mySegmentationCursorBox ); - //myDirectionGroup->setColumnLayout( 0, Qt::Vertical ); - //myDirectionGroup->layout()->setSpacing( 0 ); - //myDirectionGroup->layout()->setMargin( 0 ); - - QGridLayout* DirectionGroupLayout = new QGridLayout( myDirectionGroup ); - DirectionGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter); - DirectionGroupLayout->setSpacing(6); - DirectionGroupLayout->setMargin(11); - - QLabel* DXDirectionLabel = new QLabel( tr( "DIRECTION_DX" ), myDirectionGroup ); - myDXDirectionSpinBox = new QtxDoubleSpinBox( -1.0, 1.0, 0.1, myDirectionGroup ); - myDXDirectionSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - myDXDirectionSpinBox->setMinimumWidth( 100 ); - myDXDirectionSpinBox->setValue( 0.0 ); - - QLabel* DYDirectionLabel = new QLabel( tr( "DIRECTION_DY" ), myDirectionGroup ); - myDYDirectionSpinBox = new QtxDoubleSpinBox( -1.0, 1.0, 0.1, myDirectionGroup ); - myDYDirectionSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - myDYDirectionSpinBox->setMinimumWidth( 100 ); - myDYDirectionSpinBox->setValue( 0.0 ); - - QLabel* DZDirectionLabel = new QLabel( tr( "DIRECTION_DZ" ), myDirectionGroup ); - myDZDirectionSpinBox = new QtxDoubleSpinBox( -1.0, 1.0, 0.1, myDirectionGroup ); - myDZDirectionSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - myDZDirectionSpinBox->setMinimumWidth( 100 ); - myDZDirectionSpinBox->setValue( 1.0 ); - - DirectionGroupLayout->addWidget( DXDirectionLabel, 0, 0 ); - DirectionGroupLayout->addWidget( myDXDirectionSpinBox, 0, 1 ); - DirectionGroupLayout->addWidget( DYDirectionLabel, 0, 2 ); - DirectionGroupLayout->addWidget( myDYDirectionSpinBox, 0, 3 ); - DirectionGroupLayout->addWidget( DZDirectionLabel, 0, 4 ); - DirectionGroupLayout->addWidget( myDZDirectionSpinBox, 0, 5 ); - - SCBoxLayout->addWidget( myDirectionGroup ); - - // Depth ( Plane Segmentation ) - myDepthGroup = new QGroupBox( tr( "DEPTH_TITLE" ), mySegmentationCursorBox ); - //myDepthGroup->setColumnLayout( 0, Qt::Vertical ); - //myDepthGroup->layout()->setSpacing( 0 ); - //myDepthGroup->layout()->setMargin( 0 ); - - QGridLayout* DepthGroupLayout = new QGridLayout( myDepthGroup ); - DepthGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter); - DepthGroupLayout->setSpacing(6); - DepthGroupLayout->setMargin(11); - - QLabel* DepthLabel = new QLabel( tr( "DEPTH" ), myDepthGroup ); - myDepthSpinBox = new QtxDoubleSpinBox( 0.0, VTK_LARGE_FLOAT, 0.1, myDepthGroup ); - myDepthSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - myDepthSpinBox->setMinimumWidth( 100 ); - myDepthSpinBox->setValue( 1.0 ); - - DepthGroupLayout->addWidget( DepthLabel, 0, 0 ); - DepthGroupLayout->addWidget( myDepthSpinBox, 0, 1 ); - - SCBoxLayout->addWidget( myDepthGroup ); - - // Radius ( Sphere Segmentation ) - myRadiusGroup = new QGroupBox( tr( "RADIUS_TITLE" ), mySegmentationCursorBox ); - //myRadiusGroup->setColumnLayout( 0, Qt::Vertical ); - //myRadiusGroup->layout()->setSpacing( 0 ); - //myRadiusGroup->layout()->setMargin( 0 ); - - QGridLayout* RadiusGroupLayout = new QGridLayout( myRadiusGroup ); - RadiusGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter); - RadiusGroupLayout->setSpacing(6); - RadiusGroupLayout->setMargin(11); - - QLabel* RadiusLabel = new QLabel( tr( "RADIUS" ),myRadiusGroup ); - myRadiusSpinBox = new QtxDoubleSpinBox( 0.0, 1000.0, 1.0,myRadiusGroup ); - myRadiusSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - myRadiusSpinBox->setMinimumWidth( 100 ); - myRadiusSpinBox->setValue( 100.0 ); - - QLabel* RatioLabel = new QLabel( tr( "RATIO" ), myRadiusGroup ); - myRatioSpinBox = new QtxDoubleSpinBox( 0.1, 10.0, 0.1,myRadiusGroup ); - myRatioSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - myRatioSpinBox->setMinimumWidth( 100 ); - myRatioSpinBox->setValue( 2.0 ); - - RadiusGroupLayout->addWidget( RadiusLabel, 0, 0 ); - RadiusGroupLayout->addWidget( myRadiusSpinBox, 0, 1 ); - RadiusGroupLayout->addWidget( RatioLabel, 0, 2 ); - RadiusGroupLayout->addWidget( myRatioSpinBox, 0, 3 ); - - SCBoxLayout->addWidget( myRadiusGroup ); - - myTabBox->addTab( mySegmentationCursorBox, tr( "SEGMENTATION_CURSOR_TAB" ) ); - - // Gauss points pane - myGaussPointsBox = new QWidget( this ); - QVBoxLayout* GPBoxLayout = new QVBoxLayout( myGaussPointsBox ); - GPBoxLayout->setMargin(11); - GPBoxLayout->setSpacing(6); - - // Inside Gauss points - QGroupBox* anInsideGroup = new QGroupBox( tr( "INSIDE_GAUSS_POINTS" ), myGaussPointsBox ); - //anInsideGroup->setColumnLayout( 0, Qt::Vertical ); - //anInsideGroup->layout()->setSpacing( 0 ); - //anInsideGroup->layout()->setMargin( 0 ); - - QGridLayout* anInsideGroupLayout = new QGridLayout( anInsideGroup ); - anInsideGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter); - anInsideGroupLayout->setSpacing(6); - anInsideGroupLayout->setMargin(11); - - // Primitive - myInsidePrimitiveBox = new VVTK_PrimitiveBox( anInsideGroup ); - - // Size - myInsideSizeBox = new VVTK_SizeBox( anInsideGroup ); - myInsideSizeBox->setType( VVTK_SizeBox::Inside ); - - anInsideGroupLayout->addWidget( myInsidePrimitiveBox, 0, 0 ); - anInsideGroupLayout->addWidget( myInsideSizeBox, 1, 0 ); - - GPBoxLayout->addWidget( anInsideGroup ); - - // Outside Gauss points - QGroupBox* anOutsideGroup = new QGroupBox( tr( "OUTSIDE_GAUSS_POINTS" ), myGaussPointsBox ); - //anOutsideGroup->setColumnLayout( 0, Qt::Vertical ); - //anOutsideGroup->layout()->setSpacing( 0 ); - //anOutsideGroup->layout()->setMargin( 0 ); - - QGridLayout* anOutsideGroupLayout = new QGridLayout( anOutsideGroup ); - anOutsideGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter); - anOutsideGroupLayout->setSpacing(6); - anOutsideGroupLayout->setMargin(11); - - // Primitive - myOutsidePrimitiveBox = new VVTK_PrimitiveBox( anOutsideGroup ); - - // Size - myOutsideSizeBox = new VVTK_SizeBox( anOutsideGroup ); - myOutsideSizeBox->setType( VVTK_SizeBox::Outside ); - - anOutsideGroupLayout->addWidget( myOutsidePrimitiveBox, 0, 0 ); - anOutsideGroupLayout->addWidget( myOutsideSizeBox, 1, 0 ); - - GPBoxLayout->addWidget( anOutsideGroup ); - - // Magnification - QGroupBox* MagnificationGroup = new QGroupBox ( tr( "MAGNIFICATION_TITLE" ), myGaussPointsBox ); - //MagnificationGroup->setColumnLayout(0, Qt::Vertical ); - //MagnificationGroup->layout()->setSpacing( 0 ); - //MagnificationGroup->layout()->setMargin( 0 ); - - QGridLayout* MagnificationGroupLayout = new QGridLayout ( MagnificationGroup ); - MagnificationGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter); - MagnificationGroupLayout->setSpacing(6); - MagnificationGroupLayout->setMargin(11); - - myMagnificationLabel = new QLabel( tr( "MAGNIFICATION" ), MagnificationGroup ); - myMagnificationSpinBox = new QtxIntSpinBox( 1, 10000, 10, MagnificationGroup ); - myMagnificationSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - - MagnificationGroupLayout->addWidget( myMagnificationLabel, 0, 0 ); - MagnificationGroupLayout->addWidget( myMagnificationSpinBox, 0, 1 ); - - // Increment - myIncrementLabel = new QLabel( tr( "INCREMENT" ), MagnificationGroup ); - myIncrementSpinBox = new QtxDoubleSpinBox( 0.01, 10, 0.1, MagnificationGroup ); - myIncrementSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - - MagnificationGroupLayout->addWidget( myIncrementLabel, 0, 2 ); - MagnificationGroupLayout->addWidget( myIncrementSpinBox, 0, 3 ); - - - myTabBox->addTab( myGaussPointsBox, tr( "GAUSS_POINTS_TAB" ) ); - //myTabBox->showPage( myGaussPointsBox ); - myTabBox->setCurrentWidget( myGaussPointsBox ); - - GPBoxLayout->addWidget( MagnificationGroup ); - - - // Common buttons =========================================================== - QGroupBox* GroupButtons = new QGroupBox( this ); - //GroupButtons->setColumnLayout(0, Qt::Vertical ); - //GroupButtons->layout()->setSpacing( 0 ); - //GroupButtons->layout()->setMargin( 0 ); - QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons ); - GroupButtonsLayout->setAlignment( Qt::AlignTop ); - GroupButtonsLayout->setSpacing( 6 ); - GroupButtonsLayout->setMargin( 11 ); - - QPushButton* buttonApply = new QPushButton( tr( "&Apply" ), GroupButtons ); - buttonApply->setAutoDefault( TRUE ); - buttonApply->setDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonApply, 0, 0 ); - GroupButtonsLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 ); - - QPushButton* buttonClose = new QPushButton( tr( "&Close" ) , GroupButtons ); - buttonClose->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonClose, 0, 2 ); - - QPushButton* buttonHelp = new QPushButton( tr( "&Help" ) , GroupButtons ); - buttonHelp->setAutoDefault( TRUE ); - GroupButtonsLayout->addWidget( buttonHelp, 0, 3 ); - - TopLayout->addWidget( myTabBox ); - TopLayout->addWidget( GroupButtons ); - - connect( buttonApply, SIGNAL( clicked() ), this, SLOT( onClickApply() ) ); - connect( buttonClose, SIGNAL( clicked() ), this, SLOT( onClickClose() ) ); - connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( onClickHelp() ) ); - - connect(parent, SIGNAL(Show( QShowEvent * )), this, SLOT(onParentShow())); - connect(parent, SIGNAL(Hide( QHideEvent * )), this, SLOT(onParentHide())); -} - -VVTK_SegmentationCursorDlg::~VVTK_SegmentationCursorDlg() -{ - SetWidgetCtrl(NULL); -} - -float VVTK_SegmentationCursorDlg::getMagnification() const -{ - return myMagnificationSpinBox->value() / 100.0; -} - -void VVTK_SegmentationCursorDlg::setMagnification( float theMagnification ) -{ - myMagnificationSpinBox->setValue( ( int )( theMagnification * 100 ) ); -} - -float VVTK_SegmentationCursorDlg::getIncrement() const -{ - return myIncrementSpinBox->value(); -} - -void VVTK_SegmentationCursorDlg::setIncrement( float theIncrement ) -{ - myIncrementSpinBox->setValue( theIncrement ); -} - - -void VVTK_SegmentationCursorDlg::SetWidgetCtrl( VISU_WidgetCtrl* theWidgetCtrl ) -{ - if(myWidgetCtrl == theWidgetCtrl) - return; - - if(myWidgetCtrl) - myWidgetCtrl->RemoveObserver(myEventCallbackCommand.GetPointer()); - - myWidgetCtrl = theWidgetCtrl; - - if(theWidgetCtrl) - theWidgetCtrl->AddObserver(vtkCommand::EndInteractionEvent, - myEventCallbackCommand.GetPointer(), - myPriority); -} - -void VVTK_SegmentationCursorDlg::ProcessEvents(vtkObject* vtkNotUsed(theObject), - unsigned long theEvent, - void* theClientData, - void* vtkNotUsed(theCallData)) -{ - VVTK_SegmentationCursorDlg* self = reinterpret_cast(theClientData); - - switch(theEvent){ - case vtkCommand::EndInteractionEvent: - self->UpdateSegmentation(); - break; - case VISU::UpdateFromSettingsEvent: - self->GetOutsideCursorSettings()->SetMagnification( self->GetInsideCursorSettings()->GetMagnification() ); - self->GetOutsideCursorSettings()->SetIncrement( self->GetInsideCursorSettings()->GetIncrement() ); - - self->UpdateInsideGaussPoints(); - self->UpdateOutsideGaussPoints(); - - self->GetInsideCursorSettings()->InvokeEvent(VISU::UpdateInsideSettingsEvent,NULL); - self->GetOutsideCursorSettings()->InvokeEvent(VISU::UpdateOutsideSettingsEvent,NULL); - break; - } -} - -void VVTK_SegmentationCursorDlg::UpdateSegmentation() -{ - if( myIsPlaneSegmentation ) - { - myDirectionGroup->show(); - myDepthGroup->show(); - myRadiusGroup->hide(); - - VISU_PlanesWidget *pPlanesWidget=myWidgetCtrl->GetPlanesWidget(); - vtkFloatingPointType origin[3]; - pPlanesWidget->GetOrigin( origin ); - myXOriginSpinBox->setValue( origin[0] ); - myYOriginSpinBox->setValue( origin[1] ); - myZOriginSpinBox->setValue( origin[2] ); - - vtkFloatingPointType normal[3]; - pPlanesWidget->GetNormal( normal ); - myDXDirectionSpinBox->setValue( normal[0] ); - myDYDirectionSpinBox->setValue( normal[1] ); - myDZDirectionSpinBox->setValue( normal[2] ); - - myDepthSpinBox->setValue( pPlanesWidget->Distance() ); - } - else - { - myDirectionGroup->hide(); - myDepthGroup->hide(); - myRadiusGroup->show(); - - VISU_SphereWidget *pSphereWidget=myWidgetCtrl->GetSphereWidget(); - vtkFloatingPointType origin[3], aRadius; - pSphereWidget->GetCenter(origin); - myXOriginSpinBox->setValue( origin[0] ); - myYOriginSpinBox->setValue( origin[1] ); - myZOriginSpinBox->setValue( origin[2] ); - aRadius=pSphereWidget->GetRadius(); - myRadiusSpinBox->setValue(aRadius); - myRatioSpinBox->setValue(pSphereWidget->GetRatio()); - } -} - -void VVTK_SegmentationCursorDlg::UpdateInsideGaussPoints() -{ - int aPrimitiveType = VISU_OpenGLPointSpriteMapper::PointSprite; - vtkFloatingPointType aClamp = 200.0; - QString aMainTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/visu/sprite_texture.bmp"; - QString anAlphaTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/visu/sprite_alpha.bmp"; - vtkFloatingPointType anAlphaThreshold = 0.1; - int aResolution = 8; - int aMinSize = 3; - int aMaxSize = 33; - int aMagnification = 100; - vtkFloatingPointType anIncrement = 2.0; - - if( !myInsideCursorSettings->GetInitial() ) - { - myInsidePrimitiveBox->setPrimitiveType( myInsideCursorSettings->GetPrimitiveType() ); - myInsidePrimitiveBox->setClamp( myInsideCursorSettings->GetClamp() ); - myInsidePrimitiveBox->setMainTexture( myInsideMainTexture ); - myInsidePrimitiveBox->setAlphaTexture( myInsideAlphaTexture ); - myInsidePrimitiveBox->setAlphaThreshold( myInsideCursorSettings->GetAlphaThreshold() ); - myInsidePrimitiveBox->setResolution( myInsideCursorSettings->GetResolution() ); - - myInsideSizeBox->setMinSize( myInsideCursorSettings->GetMinSize() ); - myInsideSizeBox->setMaxSize( myInsideCursorSettings->GetMaxSize() ); - - this->setMagnification( myInsideCursorSettings->GetMagnification() ); - this->setIncrement( myInsideCursorSettings->GetIncrement() ); - - return; - } - - SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr(); - - aPrimitiveType = aResourceMgr->integerValue( "VISU", "inside_point_sprite_primitive_type", aPrimitiveType ); - myInsidePrimitiveBox->setPrimitiveType( aPrimitiveType ); - - aClamp = aResourceMgr->doubleValue( "VISU", "inside_point_sprite_clamp", aClamp ); - myInsidePrimitiveBox->setClamp( aClamp ); - - aMainTexture = aResourceMgr->stringValue( "VISU", "inside_point_sprite_main_texture", aMainTexture ); - myInsidePrimitiveBox->setMainTexture( aMainTexture ); - - anAlphaTexture = aResourceMgr->stringValue( "VISU", "inside_point_sprite_alpha_texture", anAlphaTexture ); - myInsidePrimitiveBox->setAlphaTexture( anAlphaTexture ); - - anAlphaThreshold = aResourceMgr->doubleValue( "VISU", "inside_point_sprite_alpha_threshold", anAlphaThreshold ); - myInsidePrimitiveBox->setAlphaThreshold( anAlphaThreshold ); - - aResolution = aResourceMgr->integerValue( "VISU", "inside_geom_sphere_resolution", aResolution ); - myInsidePrimitiveBox->setResolution( aResolution ); - - aMinSize = aResourceMgr->integerValue( "VISU", "inside_point_sprite_min_size", aMinSize ); - myInsideSizeBox->setMinSize( aMinSize / 100.0 ); - - aMaxSize = aResourceMgr->integerValue( "VISU", "inside_point_sprite_max_size", aMaxSize ); - myInsideSizeBox->setMaxSize( aMaxSize / 100.0 ); - - aMagnification = aResourceMgr->integerValue( "VISU", "inside_point_sprite_magnification", aMagnification ); - this->setMagnification( aMagnification / 100.0 ); - - anIncrement = aResourceMgr->doubleValue( "VISU", "inside_point_sprite_increment", anIncrement ); - this->setIncrement( anIncrement ); - - myInsidePrimitiveBox->setFaceLimit( 50000 ); - - ApplyInsideGaussPoints(); -} - -void VVTK_SegmentationCursorDlg::UpdateOutsideGaussPoints() -{ - vtkFloatingPointType aClamp = 256.0; - int aPrimitiveType = VISU_OpenGLPointSpriteMapper::PointSprite; - QString aMainTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/visu/sprite_texture.bmp"; - QString anAlphaTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/visu/sprite_alpha.bmp"; - vtkFloatingPointType anAlphaThreshold = 0.1; - int aResolution = 8; - int aSize = 25; - bool aUniform = false; - QColor aColor = Qt::blue; - - if( !myOutsideCursorSettings->GetInitial() ) - { - myOutsidePrimitiveBox->setPrimitiveType( myOutsideCursorSettings->GetPrimitiveType() ); - myOutsidePrimitiveBox->setClamp( myOutsideCursorSettings->GetClamp() ); - myOutsidePrimitiveBox->setMainTexture( myOutsideMainTexture ); - myOutsidePrimitiveBox->setAlphaTexture( myOutsideAlphaTexture ); - myOutsidePrimitiveBox->setAlphaThreshold( myOutsideCursorSettings->GetAlphaThreshold() ); - myOutsidePrimitiveBox->setResolution( myOutsideCursorSettings->GetResolution() ); - - myOutsideSizeBox->setOutsideSize( myOutsideCursorSettings->GetSize() ); - myOutsideSizeBox->setUniform( myOutsideCursorSettings->GetUniform() ); - - vtkFloatingPointType* aColor = myOutsideCursorSettings->GetColor(); - myOutsideSizeBox->setColor( QColor( ( int )( aColor[0] * 255.0 ), - ( int )( aColor[1] * 255.0 ), - ( int )( aColor[2] * 255.0 ) ) ); - - return; - } - - SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr(); - - aPrimitiveType = aResourceMgr->integerValue( "VISU", "outside_point_sprite_primitive_type", aPrimitiveType ); - myOutsidePrimitiveBox->setPrimitiveType( aPrimitiveType ); - - aClamp = aResourceMgr->doubleValue( "VISU", "outside_point_sprite_clamp", aClamp ); - myOutsidePrimitiveBox->setClamp( aClamp ); - - aMainTexture = aResourceMgr->stringValue( "VISU", "outside_point_sprite_main_texture", aMainTexture ); - myOutsidePrimitiveBox->setMainTexture( aMainTexture ); - - anAlphaTexture = aResourceMgr->stringValue( "VISU", "outside_point_sprite_alpha_texture", anAlphaTexture ); - myOutsidePrimitiveBox->setAlphaTexture( anAlphaTexture ); - - anAlphaThreshold = aResourceMgr->doubleValue( "VISU", "outside_point_sprite_alpha_threshold", anAlphaThreshold ); - myOutsidePrimitiveBox->setAlphaThreshold( anAlphaThreshold ); - - aResolution = aResourceMgr->integerValue( "VISU", "outside_geom_sphere_resolution", aResolution ); - myOutsidePrimitiveBox->setResolution( aResolution ); - - aSize = aResourceMgr->integerValue( "VISU", "outside_point_sprite_size", aSize ); - myOutsideSizeBox->setOutsideSize( aSize / 100.0 ); - - aUniform = aResourceMgr->booleanValue( "VISU", "outside_point_sprite_uniform", aUniform ); - myOutsideSizeBox->setUniform( aUniform ); - - aColor = aResourceMgr->colorValue( "VISU", "outside_point_sprite_color", aColor ); - myOutsideSizeBox->setColor( aColor ); - - myOutsidePrimitiveBox->setFaceLimit( 50000 ); - - ApplyOutsideGaussPoints(); -} - -VISU_InsideCursorSettings* VVTK_SegmentationCursorDlg::GetInsideCursorSettings() -{ - return myInsideCursorSettings.GetPointer(); -} - -VISU_OutsideCursorSettings* VVTK_SegmentationCursorDlg::GetOutsideCursorSettings() -{ - return myOutsideCursorSettings.GetPointer(); -} - -VISU::TTextureValue -VVTK_SegmentationCursorDlg -::MakeImageData( bool theInside, - const QString& theMainTexture, - const QString& theAlphaTexture ) -{ - if( theInside ) - { - bool updateMainTexture = myInsideMainTexture != theMainTexture; - bool updateAlphaTexture = myInsideAlphaTexture != theAlphaTexture; - if( !updateMainTexture && !updateAlphaTexture ) - return 0; - - myInsideMainTexture = theMainTexture; - myInsideAlphaTexture = theAlphaTexture; - } - else - { - bool updateMainTexture = myOutsideMainTexture != theMainTexture; - bool updateAlphaTexture = myOutsideAlphaTexture != theAlphaTexture; - if( !updateMainTexture && !updateAlphaTexture ) - return 0; - - myOutsideMainTexture = theMainTexture; - myOutsideAlphaTexture = theAlphaTexture; - } - - return VISU::GetTexture( (const char*)theMainTexture.toLatin1(), - (const char*)theAlphaTexture.toLatin1()); -} - -void VVTK_SegmentationCursorDlg::onClickApply() -{ - if( myTabBox->currentWidget() == mySegmentationCursorBox ) - ApplySegmentationCursor(); - else - { - QString aWarning = "The number of faces needed to perform the 'Geometrical Sphere' primitive\n"; - aWarning.append( "presentation might be too important to ensure an acceptable frame rate.\n\n" ); - aWarning.append( "Can you please confirm that you want to continue anyway?" ); - bool toApply = CheckNumberOfFaces() || - SUIT_MessageBox::warning( this, tr( "Warning" ), aWarning, - tr( "&OK" ), tr( "&Cancel" ), 0, 1, 1 ) == 0; - - if( toApply ) - { - ApplyInsideGaussPoints(); - ApplyOutsideGaussPoints(); - } - } -} - -void VVTK_SegmentationCursorDlg::ApplySegmentationCursor() -{ - if( myIsPlaneSegmentation ) - { - VISU_PlanesWidget *pPlanesWidget=myWidgetCtrl->GetPlanesWidget(); - vtkFloatingPointType origin[3]; - origin[0] = myXOriginSpinBox->value(); - origin[1] = myYOriginSpinBox->value(); - origin[2] = myZOriginSpinBox->value(); - pPlanesWidget->SetOrigin( origin ); - - vtkFloatingPointType normal[3]; - normal[0] = myDXDirectionSpinBox->value(); - normal[1] = myDYDirectionSpinBox->value(); - normal[2] = myDZDirectionSpinBox->value(); - - if( normal[0] == 0.0 && normal[1] == 0.0 && normal[2] == 0.0 ) - { - normal[2] = 1.0; - myDZDirectionSpinBox->setValue( 1.0 ); - } - pPlanesWidget->SetNormal( normal ); - - pPlanesWidget->SetDistance( myDepthSpinBox->value() ); - - myWidgetCtrl->InvokeEvent(vtkCommand::EndInteractionEvent,NULL); - myWidgetCtrl->GetInteractor()->Render(); - } - else - { - VISU_SphereWidget *pSphereWidget=myWidgetCtrl->GetSphereWidget(); - vtkFloatingPointType origin[3], aRadius; - origin[0] = myXOriginSpinBox->value(); - origin[1] = myYOriginSpinBox->value(); - origin[2] = myZOriginSpinBox->value(); - pSphereWidget->SetCenter(origin); - - aRadius=myRadiusSpinBox->value(); - pSphereWidget->SetRadius(aRadius); - - pSphereWidget->SetRatio(myRatioSpinBox->value()); - - myWidgetCtrl->InvokeEvent(vtkCommand::EndInteractionEvent,NULL); - myWidgetCtrl->GetInteractor()->Render(); - } -} - -void VVTK_SegmentationCursorDlg::ApplyInsideGaussPoints() -{ - QString anInsideMainTexture = myInsidePrimitiveBox->getMainTexture(); - QString anInsideAlphaTexture = myInsidePrimitiveBox->getAlphaTexture(); - VISU::TTextureValue aTexture = MakeImageData( true, anInsideMainTexture, anInsideAlphaTexture ); - - if( aTexture.GetPointer() ) - myInsideCursorSettings->SetTexture( aTexture.GetPointer() ); - - myInsideCursorSettings->SetInitial( false ); - myInsideCursorSettings->SetPrimitiveType( myInsidePrimitiveBox->getPrimitiveType() ); - myInsideCursorSettings->SetClamp( myInsidePrimitiveBox->getClamp() ); - myInsideCursorSettings->SetAlphaThreshold( myInsidePrimitiveBox->getAlphaThreshold() ); - myInsideCursorSettings->SetResolution( myInsidePrimitiveBox->getResolution() ); - - myInsideCursorSettings->SetMinSize( myInsideSizeBox->getMinSize() ); - myInsideCursorSettings->SetMaxSize( myInsideSizeBox->getMaxSize() ); - - myInsideCursorSettings->SetMagnification( this->getMagnification() ); - myInsideCursorSettings->SetIncrement( this->getIncrement() ); - - myInsideCursorSettings->InvokeEvent(VISU::UpdateInsideSettingsEvent,NULL); -} - -void VVTK_SegmentationCursorDlg::ApplyOutsideGaussPoints() -{ - QString anOutsideMainTexture = myOutsidePrimitiveBox->getMainTexture(); - QString anOutsideAlphaTexture = myOutsidePrimitiveBox->getAlphaTexture(); - VISU::TTextureValue aTexture = MakeImageData( false, anOutsideMainTexture, anOutsideAlphaTexture ); - - if( aTexture.GetPointer() ) - myOutsideCursorSettings->SetTexture( aTexture.GetPointer() ); - - myOutsideCursorSettings->SetInitial( false ); - myOutsideCursorSettings->SetPrimitiveType( myOutsidePrimitiveBox->getPrimitiveType() ); - myOutsideCursorSettings->SetClamp( myOutsidePrimitiveBox->getClamp() ); - myOutsideCursorSettings->SetAlphaThreshold( myOutsidePrimitiveBox->getAlphaThreshold() ); - myOutsideCursorSettings->SetResolution( myOutsidePrimitiveBox->getResolution() ); - - myOutsideCursorSettings->SetSize( myOutsideSizeBox->getOutsideSize() ); - myOutsideCursorSettings->SetUniform( myOutsideSizeBox->getUniform() ); - - QColor aButtonColor = myOutsideSizeBox->getColor(); - vtkFloatingPointType aColor[3]; - aColor[0] = aButtonColor.red() / 255.0; - aColor[1] = aButtonColor.green() / 255.0; - aColor[2] = aButtonColor.blue() / 255.0; - myOutsideCursorSettings->SetColor( aColor ); - - myOutsideCursorSettings->SetMagnification( this->getMagnification() ); - myOutsideCursorSettings->SetIncrement( this->getIncrement() ); - - myOutsideCursorSettings->InvokeEvent(VISU::UpdateOutsideSettingsEvent,NULL); -} - -void VVTK_SegmentationCursorDlg::onClickClose() -{ - myPlaneAction->setChecked( false ); - mySphereAction->setChecked( false ); - - emit scgClose(); - - reject(); -} - -void VVTK_SegmentationCursorDlg::onClickHelp() -{ - QString aHelpFileName = "segmentation.htm"; - LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); - if (app) - app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName); - else { - QString platform; -#ifdef WIN32 - platform = "winapplication"; -#else - platform = "application"; -#endif - SUIT_MessageBox::warning( 0, QObject::tr("WRN_WARNING"), - QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName), - QObject::tr("BUT_OK")); - } -} - -void VVTK_SegmentationCursorDlg::done( int r ) -{ - myPlaneAction->setChecked( false ); - mySphereAction->setChecked( false ); - - emit scgClose(); - - QDialog::done( r ); -} - -void VVTK_SegmentationCursorDlg::onParentShow() -{ - if(myPlaneAction->isChecked() || mySphereAction->isChecked()) - show(); - else - hide(); -} - -void VVTK_SegmentationCursorDlg::onParentHide() -{ - hide(); -} - -bool VVTK_SegmentationCursorDlg::CheckNumberOfFaces() -{ - if( !myInteractor ) - return false; - - vtkRenderer* aRenderer = myInteractor->getRenderer(); - - if( !aRenderer ) - return false; - - int aNumberOfPoints = 0; - - vtkActor* anActor; - VTK::ActorCollectionCopy aCopy(aRenderer->GetActors()); - vtkActorCollection* anActColl = aCopy.GetActors(); - for( anActColl->InitTraversal(); ( anActor = anActColl->GetNextActor() ) != NULL; ) - { - if( VISU_GaussPtsAct1* aGaussActor = VISU_GaussPtsAct1::SafeDownCast( anActor ) ) - aNumberOfPoints += aGaussActor->GetInput()->GetNumberOfCells(); - } - return !( myInsidePrimitiveBox->getPrimitiveType() == VISU_OpenGLPointSpriteMapper::GeomSphere && - aNumberOfPoints * myInsidePrimitiveBox->getFaceNumber() * 2 > myInsidePrimitiveBox->getFaceLimit() || - myOutsidePrimitiveBox->getPrimitiveType() == VISU_OpenGLPointSpriteMapper::GeomSphere && - aNumberOfPoints * myOutsidePrimitiveBox->getFaceNumber() > myOutsidePrimitiveBox->getFaceLimit() ); -} - -void VVTK_SegmentationCursorDlg::keyPressEvent( QKeyEvent* e ) -{ - QDialog::keyPressEvent( e ); - if ( e->isAccepted() ) - return; - - if ( e->key() == Qt::Key_F1 ) - { - e->accept(); - onClickHelp(); - } -} diff --git a/src/VVTK/VVTK_SegmentationCursorDlg.h b/src/VVTK/VVTK_SegmentationCursorDlg.h deleted file mode 100644 index 960d0218..00000000 --- a/src/VVTK/VVTK_SegmentationCursorDlg.h +++ /dev/null @@ -1,199 +0,0 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// File : VVTK_SegmentationCursorDlg.h -// Author : Oleg Uvarov -// Module : VISU -// -#ifndef VVTK_SEGMENTATIONCURSORDLG_H -#define VVTK_SEGMENTATIONCURSORDLG_H - -#include "VVTK.h" - -#include "VISU_GaussPtsDeviceActor.h" - -#include - -#include -#include - -class vtkActorCollection; -class vtkCallbackCommand; -class vtkImageData; - -class QLabel; -class QLineEdit; -class QPushButton; -class QRadioButton; -class QTabWidget; -class QGroupBox; -class QWidget; -//class QVBox; - -class QtxAction; -class QtxDoubleSpinBox; -class QtxIntSpinBox; - -class VISU_GaussPtsAct1; -class VISU_InsideCursorSettings; -class VISU_OutsideCursorSettings; -class VISU_WidgetCtrl; - -class VVTK_PrimitiveBox; -class VVTK_SizeBox; - -class SVTK_RenderWindowInteractor; - - -//! Segmentation Cursor Dialog. -/*! - * Uses for set up Segmentation and Outside Cursor Gauss Points preferenses - * and apply them to all actors in the current renderer. - */ -class VVTK_SegmentationCursorDlg : public QDialog -{ - Q_OBJECT - -public: - VVTK_SegmentationCursorDlg( QWidget* parent = 0, const char* name = 0 ); - ~VVTK_SegmentationCursorDlg(); - - void SetWidgetCtrl( VISU_WidgetCtrl* ); - void SetPlaneAction( QtxAction* theAction ) { myPlaneAction = theAction; } - void SetSphereAction( QtxAction* theAction ) { mySphereAction = theAction; } - - bool GetIsPlaneSegmentation() const { return myIsPlaneSegmentation; } - void SetIsPlaneSegmentation( bool on ) { myIsPlaneSegmentation = on; } - - //! Update contents of the Segmentation tab. - void UpdateSegmentation(); - void UpdateInsideGaussPoints(); - void UpdateOutsideGaussPoints(); - - //! Update contents of the Outside Cursor tab. - void UpdateOutsideCursor(); - - VISU_InsideCursorSettings* GetInsideCursorSettings(); - VISU_OutsideCursorSettings* GetOutsideCursorSettings(); - - vtkSmartPointer GetEventCallbackCommand() { return myEventCallbackCommand; } - - void SetInteractor( SVTK_RenderWindowInteractor* theInteractor ) { myInteractor = theInteractor; } - -public: - float getMagnification() const; - void setMagnification( float ); - - float getIncrement() const; - void setIncrement( float ); - -protected: - void ApplySegmentationCursor(); - void ApplyInsideGaussPoints(); - void ApplyOutsideGaussPoints(); - - bool CheckNumberOfFaces(); - - VISU::TTextureValue - MakeImageData( bool theInside, - const QString& theMainTexture, - const QString& theAlphaTexture ); - -private: - static void ProcessEvents(vtkObject* theObject, - unsigned long theEvent, - void* theClientData, - void* theCallData); - - void keyPressEvent( QKeyEvent* e ); - -protected slots: - virtual void done( int ); - void onParentShow(); - void onParentHide(); - - void onClickApply(); - void onClickClose(); - void onClickHelp(); - -signals: - void scgClose(); - -private: - SVTK_RenderWindowInteractor* myInteractor; - - QTabWidget* myTabBox; - - // Segmentation cursor - QWidget* mySegmentationCursorBox; - - QGroupBox* myOriginGroup; - QtxDoubleSpinBox* myXOriginSpinBox; - QtxDoubleSpinBox* myYOriginSpinBox; - QtxDoubleSpinBox* myZOriginSpinBox; - - QGroupBox* myDirectionGroup; - QtxDoubleSpinBox* myDXDirectionSpinBox; - QtxDoubleSpinBox* myDYDirectionSpinBox; - QtxDoubleSpinBox* myDZDirectionSpinBox; - - QGroupBox* myDepthGroup; - QtxDoubleSpinBox* myDepthSpinBox; - - QGroupBox* myRadiusGroup; - QtxDoubleSpinBox* myRadiusSpinBox; - QtxDoubleSpinBox* myRatioSpinBox; - - bool myIsPlaneSegmentation; - - float myPriority; - vtkSmartPointer myEventCallbackCommand; - - VISU_WidgetCtrl* myWidgetCtrl; - QtxAction* myPlaneAction; - QtxAction* mySphereAction; - - // Gauss Points - QWidget* myGaussPointsBox; - - VVTK_PrimitiveBox* myInsidePrimitiveBox; - VVTK_SizeBox* myInsideSizeBox; - - QString myInsideMainTexture; - QString myInsideAlphaTexture; - - vtkSmartPointer myInsideCursorSettings; - - VVTK_PrimitiveBox* myOutsidePrimitiveBox; - VVTK_SizeBox* myOutsideSizeBox; - - QString myOutsideMainTexture; - QString myOutsideAlphaTexture; - - vtkSmartPointer myOutsideCursorSettings; - - QLabel* myMagnificationLabel; - QtxIntSpinBox* myMagnificationSpinBox; - QLabel* myIncrementLabel; - QtxDoubleSpinBox* myIncrementSpinBox; -}; - -#endif diff --git a/src/VVTK/VVTK_SizeBox.cxx b/src/VVTK/VVTK_SizeBox.cxx deleted file mode 100644 index 7d040131..00000000 --- a/src/VVTK/VVTK_SizeBox.cxx +++ /dev/null @@ -1,374 +0,0 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// VISU VISUGUI : GUI of VISU component -// File : VVTK_SizeBox.cxx -// Author : Oleg UVAROV -// Module : VISU -// -#include "VVTK_SizeBox.h" - -#include "SUIT_ResourceMgr.h" -#include "SUIT_Session.h" - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std; - -VVTK_SizeBox::VVTK_SizeBox( QWidget* parent ) : - QWidget( parent ) -{ - QVBoxLayout* aMainLayout = new QVBoxLayout( this ); - aMainLayout->setSpacing( 0 ); - aMainLayout->setMargin( 0 ); - - // Size - QGroupBox* SizeGroup = new QGroupBox ( tr( "SIZE_TITLE" ), this ); - //SizeGroup->setColumnLayout(0, Qt::Vertical ); - //SizeGroup->layout()->setSpacing( 0 ); - //SizeGroup->layout()->setMargin( 0 ); - - QGridLayout* SizeGroupLayout = new QGridLayout (SizeGroup); - SizeGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter); - SizeGroupLayout->setSpacing(6); - SizeGroupLayout->setMargin(11); - - // Outside Size - myOutsideSizeLabel = new QLabel( tr( "OUTSIDE_SIZE" ), SizeGroup ); - myOutsideSizeSpinBox = new QtxIntSpinBox( 0, 100, 1, SizeGroup ); - myOutsideSizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - - SizeGroupLayout->addWidget( myOutsideSizeLabel, 0, 0 ); - SizeGroupLayout->addWidget( myOutsideSizeSpinBox, 0, 1 ); - - // Geometry Size - myGeomSizeLabel = new QLabel( tr( "GEOM_SIZE" ), SizeGroup ); - myGeomSizeSpinBox = new QtxIntSpinBox( 0, 100, 1, SizeGroup ); - myGeomSizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - - SizeGroupLayout->addWidget( myGeomSizeLabel, 0, 0 ); - SizeGroupLayout->addWidget( myGeomSizeSpinBox, 0, 1 ); - - // Min Size - myMinSizeLabel = new QLabel( tr( "MIN_SIZE" ), SizeGroup ); - myMinSizeSpinBox = new QtxIntSpinBox( 0, 100, 1, SizeGroup ); - myMinSizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - - SizeGroupLayout->addWidget( myMinSizeLabel, 1, 0 ); - SizeGroupLayout->addWidget( myMinSizeSpinBox, 1, 1 ); - - // Max Size - myMaxSizeLabel = new QLabel( tr( "MAX_SIZE" ), SizeGroup ); - myMaxSizeSpinBox = new QtxIntSpinBox( 0, 100, 1, SizeGroup ); - myMaxSizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - - SizeGroupLayout->addWidget( myMaxSizeLabel, 1, 2 ); - SizeGroupLayout->addWidget( myMaxSizeSpinBox, 1, 3 ); - - // Magnification - myMagnificationLabel = new QLabel( tr( "MAGNIFICATION" ), SizeGroup ); - myMagnificationSpinBox = new QtxIntSpinBox( 1, 10000, 10, SizeGroup ); - myMagnificationSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - - SizeGroupLayout->addWidget( myMagnificationLabel, 2, 0 ); - SizeGroupLayout->addWidget( myMagnificationSpinBox, 2, 1 ); - - // Increment - myIncrementLabel = new QLabel( tr( "INCREMENT" ), SizeGroup ); - myIncrementSpinBox = new QtxDoubleSpinBox( 0.01, 10, 0.1, SizeGroup ); - myIncrementSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - - SizeGroupLayout->addWidget( myIncrementLabel, 2, 2 ); - SizeGroupLayout->addWidget( myIncrementSpinBox, 2, 3 ); - - aMainLayout->addWidget( SizeGroup ); - - // Color - myColorGroup = new QGroupBox ( tr( "COLOR_TITLE" ), this ); - //myColorGroup->setColumnLayout(0, Qt::Vertical ); - //myColorGroup->layout()->setSpacing( 0 ); - //myColorGroup->layout()->setMargin( 0 ); - - QGridLayout* ColorGroupLayout = new QGridLayout ( myColorGroup ); - ColorGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignLeft); - ColorGroupLayout->setSpacing(6); - ColorGroupLayout->setMargin(11); - - myUniformCheckBox = new QCheckBox( tr( "UNIFORM_COLOR" ), myColorGroup ); - - myColorLabel = new QLabel( tr( "COLOR" ), myColorGroup ); - myColorButton = new QtxColorButton( myColorGroup ); - - ColorGroupLayout->addWidget( myUniformCheckBox, 0, 0 ); - ColorGroupLayout->addWidget( myColorLabel, 0, 1 ); - ColorGroupLayout->addWidget( myColorButton, 0, 2 ); - - aMainLayout->addWidget( myColorGroup ); - - connect( myUniformCheckBox, SIGNAL( toggled( bool ) ), myColorButton, SLOT( setEnabled( bool ) ) ); - //connect( myColorButton, SIGNAL( clicked() ), this, SLOT( onColorButtonPressed() ) ); - - setType( VVTK_SizeBox::Results ); -} - -void VVTK_SizeBox::onToggleResults() -{ - myType = VVTK_SizeBox::Results; - - myOutsideSizeLabel->hide(); - myOutsideSizeSpinBox->hide(); - - myGeomSizeLabel->hide(); - myGeomSizeSpinBox->hide(); - - myMinSizeLabel->show(); - myMinSizeSpinBox->show(); - - myMaxSizeLabel->show(); - myMaxSizeSpinBox->show(); - - myMagnificationLabel->show(); - myMagnificationSpinBox->show(); - - myIncrementLabel->show(); - myIncrementSpinBox->show(); - - myColorGroup->hide(); - - myUniformCheckBox->hide(); -} - -void VVTK_SizeBox::onToggleGeometry() -{ - myType = VVTK_SizeBox::Geometry; - - myOutsideSizeLabel->hide(); - myOutsideSizeSpinBox->hide(); - - myGeomSizeLabel->show(); - myGeomSizeSpinBox->show(); - - myMinSizeLabel->hide(); - myMinSizeSpinBox->hide(); - - myMaxSizeLabel->hide(); - myMaxSizeSpinBox->hide(); - - myMagnificationLabel->show(); - myMagnificationSpinBox->show(); - - myIncrementLabel->show(); - myIncrementSpinBox->show(); - - myColorGroup->show(); - - myUniformCheckBox->hide(); -} - -void VVTK_SizeBox::onToggleInside() -{ - myType = VVTK_SizeBox::Inside; - - myOutsideSizeLabel->hide(); - myOutsideSizeSpinBox->hide(); - - myGeomSizeLabel->hide(); - myGeomSizeSpinBox->hide(); - - myMinSizeLabel->show(); - myMinSizeSpinBox->show(); - - myMaxSizeLabel->show(); - myMaxSizeSpinBox->show(); - - myMagnificationLabel->hide(); - myMagnificationSpinBox->hide(); - - myIncrementLabel->hide(); - myIncrementSpinBox->hide(); - - myColorGroup->hide(); - - myUniformCheckBox->hide(); -} - -void VVTK_SizeBox::onToggleOutside() -{ - myType = VVTK_SizeBox::Outside; - - myOutsideSizeLabel->show(); - myOutsideSizeSpinBox->show(); - - myGeomSizeLabel->hide(); - myGeomSizeSpinBox->hide(); - - myMinSizeLabel->hide(); - myMinSizeSpinBox->hide(); - - myMaxSizeLabel->hide(); - myMaxSizeSpinBox->hide(); - - myMagnificationLabel->hide(); - myMagnificationSpinBox->hide(); - - myIncrementLabel->hide(); - myIncrementSpinBox->hide(); - - myColorGroup->show(); - - myUniformCheckBox->show(); -} - -void VVTK_SizeBox::setType( int theType ) -{ - myType = theType; - - switch( myType ) - { - case VVTK_SizeBox::Results : onToggleResults(); break; - case VVTK_SizeBox::Geometry : onToggleGeometry(); break; - case VVTK_SizeBox::Inside : onToggleInside(); break; - case VVTK_SizeBox::Outside : onToggleOutside(); break; - default : break; - } -} - -float VVTK_SizeBox::getOutsideSize() const -{ - return myOutsideSizeSpinBox->value() / 100.0; -} - -void VVTK_SizeBox::setOutsideSize( float theOutsideSize ) -{ - myOutsideSizeSpinBox->setValue( ( int )( theOutsideSize * 100 ) ); -} - -float VVTK_SizeBox::getGeomSize() const -{ - return myGeomSizeSpinBox->value() / 100.0; -} - -void VVTK_SizeBox::setGeomSize( float theGeomSize ) -{ - myGeomSizeSpinBox->setValue( ( int )( theGeomSize * 100 ) ); -} - -float VVTK_SizeBox::getMinSize() const -{ - return myMinSizeSpinBox->value() / 100.0; -} - -void VVTK_SizeBox::setMinSize( float theMinSize ) -{ - myMinSizeSpinBox->setValue( ( int )( theMinSize * 100 ) ); -} - -float VVTK_SizeBox::getMaxSize() const -{ - return myMaxSizeSpinBox->value() / 100.0; -} - -void VVTK_SizeBox::setMaxSize( float theMaxSize ) -{ - myMaxSizeSpinBox->setValue( ( int )( theMaxSize * 100 ) ); -} - -float VVTK_SizeBox::getMagnification() const -{ - return myMagnificationSpinBox->value() / 100.0; -} - -void VVTK_SizeBox::setMagnification( float theMagnification ) -{ - myMagnificationSpinBox->setValue( ( int )( theMagnification * 100 ) ); -} - -float VVTK_SizeBox::getIncrement() const -{ - return myIncrementSpinBox->value(); -} - -void VVTK_SizeBox::setIncrement( float theIncrement ) -{ - myIncrementSpinBox->setValue( theIncrement ); -} - -bool VVTK_SizeBox::getUniform() const -{ - return myUniformCheckBox->isChecked(); -} - -void VVTK_SizeBox::setUniform( bool theUniform ) -{ - myUniformCheckBox->setChecked( theUniform ); - myColorButton->setEnabled( theUniform ); -} - -QColor VVTK_SizeBox::getColor() const -{ - return myColorButton->color();//palette().color( myColorButton->backgroundRole() ); - //return myColorButton->paletteBackgroundColor(); -} - -void VVTK_SizeBox::setColor( const QColor& theColor ) -{ - if ( theColor.isValid() ) - { - //QPalette aPalette( myColorButton->palette() ); - //aPalette.setColor( myColorButton->backgroundRole(), theColor ); - myColorButton->setColor( theColor ); - } - //myColorButton->setPaletteBackgroundColor( theColor ); -} - -void VVTK_SizeBox::enableSizeControls( bool enabled ) -{ - myMagnificationSpinBox->setEnabled( enabled ); - myMaxSizeSpinBox->setEnabled( enabled ); - myMinSizeSpinBox->setEnabled( enabled ); - myIncrementSpinBox->setEnabled( enabled ); - myGeomSizeSpinBox->setEnabled( enabled ); -} - -/*void VVTK_SizeBox::onColorButtonPressed() -{ - QPalette aPalette( myColorButton->palette() ); - QColor aColor = QColorDialog:: - getColor( aPalette.color(myColorButton->backgroundRole() ), this ); - - if( aColor.isValid() ) - { - aPalette.setColor( myColorButton->backgroundRole(), aColor ); - myColorButton->setPalette( aPalette ); - } -}*/ diff --git a/src/VVTK/VVTK_SizeBox.h b/src/VVTK/VVTK_SizeBox.h deleted file mode 100644 index 296ff51d..00000000 --- a/src/VVTK/VVTK_SizeBox.h +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// VISU VISUGUI : GUI of VISU component -// File : VVTK_SizeBox.h -// Author : Oleg UVAROV -// Module : VISU -// -#ifndef VVTK_SIZEBOX_H -#define VVTK_SIZEBOX_H - -#include "VVTK.h" - -#include - -class QLabel; -class QLineEdit; -class QPushButton; -class QCheckBox; -class QGroupBox; - -class QtxDoubleSpinBox; -class QtxIntSpinBox; -class QtxColorButton; - -class VVTK_EXPORT VVTK_SizeBox : public QWidget -{ - Q_OBJECT - -public: - enum { Results = 0, Geometry, Inside, Outside }; - -public: - VVTK_SizeBox( QWidget* ); - ~VVTK_SizeBox() {} - -public: - int getType() const { return myType; } - void setType( int ); - - float getOutsideSize() const; - void setOutsideSize( float ); - - float getGeomSize() const; - void setGeomSize( float ); - - float getMinSize() const; - void setMinSize( float ); - - float getMaxSize() const; - void setMaxSize( float ); - - float getMagnification() const; - void setMagnification( float ); - - float getIncrement() const; - void setIncrement( float ); - - bool getUniform() const; - void setUniform( bool ); - - QColor getColor() const; - void setColor( const QColor& ); - - void enableSizeControls( bool enabled ); - -protected slots: - void onToggleResults(); - void onToggleGeometry(); - void onToggleInside(); - void onToggleOutside(); - - //void onColorButtonPressed(); - -private: - int myType; - - QLabel* myOutsideSizeLabel; - QtxIntSpinBox* myOutsideSizeSpinBox; - - QLabel* myGeomSizeLabel; - QtxIntSpinBox* myGeomSizeSpinBox; - - QLabel* myMinSizeLabel; - QtxIntSpinBox* myMinSizeSpinBox; - - QLabel* myMaxSizeLabel; - QtxIntSpinBox* myMaxSizeSpinBox; - - QLabel* myMagnificationLabel; - QtxIntSpinBox* myMagnificationSpinBox; - - QLabel* myIncrementLabel; - QtxDoubleSpinBox* myIncrementSpinBox; - - QCheckBox* myUniformCheckBox; - - QGroupBox* myColorGroup; - QLabel* myColorLabel; - QtxColorButton* myColorButton; -}; - - - -#endif diff --git a/src/VVTK/VVTK_ViewManager.cxx b/src/VVTK/VVTK_ViewManager.cxx deleted file mode 100644 index 2c9f8512..00000000 --- a/src/VVTK/VVTK_ViewManager.cxx +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -#include "VVTK_ViewManager.h" -#include "VVTK_ViewModel.h" - -#include - -int VVTK_ViewManager::_VVTKViewMgr_Id = 0; - -//*************************************************************** -VVTK_ViewManager -::VVTK_ViewManager( SUIT_Study* study, - SUIT_Desktop* theDesktop ) -: SVTK_ViewManager( study, theDesktop ) -{ - myId = ++_VVTKViewMgr_Id; - setViewModel( new VVTK_Viewer() ); -} - -//*************************************************************** -VVTK_ViewManager::~VVTK_ViewManager() -{ -} - -//*************************************************************** -void VVTK_ViewManager::setViewName(SUIT_ViewWindow* theView) -{ - int aPos = myViews.indexOf(theView); - theView->setWindowTitle( tr( "VTK_VIEW_TITLE" ).arg( myId ).arg( aPos + 1 ) ); -} diff --git a/src/VVTK/VVTK_ViewManager.h b/src/VVTK/VVTK_ViewManager.h deleted file mode 100644 index 5bc84e43..00000000 --- a/src/VVTK/VVTK_ViewManager.h +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -#ifndef VVTK_VIEWMANAGER_H -#define VVTK_VIEWMANAGER_H - -#include "SVTK_ViewManager.h" -#include "VVTK.h" - -class SUIT_Desktop; - -//! Extend SUIT_ViewManager to deal with VVTK_Viewer -class VVTK_EXPORT VVTK_ViewManager : public SVTK_ViewManager -{ - Q_OBJECT; -public: - //! Construct the view manager - VVTK_ViewManager( SUIT_Study* study, SUIT_Desktop* ); - - //! Destroy the view manager - virtual ~VVTK_ViewManager(); - -protected: - void setViewName( SUIT_ViewWindow* theView ); - -private: - int myId; - static int _VVTKViewMgr_Id; -}; - -#endif diff --git a/src/VVTK/VVTK_ViewModel.cxx b/src/VVTK/VVTK_ViewModel.cxx deleted file mode 100644 index a06b2ca3..00000000 --- a/src/VVTK/VVTK_ViewModel.cxx +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -#include "VVTK_ViewModel.h" -#include "VISU_ActorFactory.h" -#include "VVTK_ViewWindow.h" - -#include "VTKViewer_Algorithm.h" -#include "SVTK_Functor.h" -#include "VISU_ActorBase.h" -#include "SVTK_View.h" -#include "SVTK_Prs.h" - -#include - -#include -#include - -//--------------------------------------------------------------- -VVTK_Viewer::VVTK_Viewer() -{ -} - -//--------------------------------------------------------------- -VVTK_Viewer::~VVTK_Viewer() -{ -} - -//--------------------------------------------------------------- -SUIT_ViewWindow* VVTK_Viewer::createView( SUIT_Desktop* theDesktop ) -{ - TViewWindow* aViewWindow = new TViewWindow (theDesktop); - aViewWindow->Initialize(this); - - aViewWindow->setBackgroundColor( backgroundColor() ); - aViewWindow->SetTrihedronSize( trihedronSize() ); - aViewWindow->SetProjectionMode( projectionMode() ); - aViewWindow->SetInteractionStyle( interactionStyle() ); - aViewWindow->SetIncrementalSpeed( incrementalSpeed(), incrementalSpeedMode() ); - aViewWindow->SetSpacemouseButtons( spacemouseBtn(1), spacemouseBtn(2), spacemouseBtn(3) ); - - return aViewWindow; -} - -//--------------------------------------------------------------- -void VVTK_Viewer::Display(const SALOME_VTKPrs* thePrs) -{ - // try do downcast object - if(const SVTK_Prs* aPrs = dynamic_cast(thePrs)){ - if(aPrs->IsNull()) - return; - if(vtkActorCollection* aCollection = aPrs->GetObjects()){ - aCollection->InitTraversal(); - while(VISU_ActorBase* anActor = dynamic_cast(aCollection->GetNextActor())){ - if(!anActor->GetFactory()->GetActiveState()) - continue; - QVector aViews = myViewManager->getViews(); - for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){ - if(SVTK_ViewWindow* aViewWindow = dynamic_cast(aViews.at(i))){ - if(SVTK_View* aView = aViewWindow->getView()){ - aView->Display(anActor, false); - } - } - } - } - } - } -} - -//--------------------------------------------------------------- -namespace VVTK -{ - struct TIsOneActorVisibleAction - { - bool& myResult; - TIsOneActorVisibleAction(bool& theResult): - myResult(theResult) - { - myResult = false; - } - void - operator()(SALOME_Actor* theActor) - { - if(!myResult) - myResult = theActor->GetVisibility(); - } - }; -} - -//--------------------------------------------------------------- -bool VVTK_Viewer::isVisible( const Handle(SALOME_InteractiveObject)& theIO ) -{ - QVector aViews = myViewManager->getViews(); - for(int i = 0, iEnd = aViews.size(); i < iEnd; i++) - if(SVTK_ViewWindow* aViewWindow = dynamic_cast(aViews.at(i))){ - bool aResult; - VVTK::TIsOneActorVisibleAction anAction(aResult); - VTK::ActorCollectionCopy aCopy(aViewWindow->getRenderer()->GetActors()); - SVTK::ForEachIf(aCopy.GetActors(), - SVTK::TIsSameIObject(theIO), - anAction); - return anAction.myResult; - } - - return false; -} diff --git a/src/VVTK/VVTK_ViewModel.h b/src/VVTK/VVTK_ViewModel.h deleted file mode 100644 index 7cfb87c3..00000000 --- a/src/VVTK/VVTK_ViewModel.h +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -#ifndef VVTK_VIEWMODEL_H -#define VVTK_VIEWMODEL_H - -#include - -#include "VVTK.h" -#include "SVTK_ViewModel.h" - -class VVTK_ViewWindow; - -//! VVTK View Model -class VVTK_EXPORT VVTK_Viewer : public SVTK_Viewer -{ - Q_OBJECT; - -public: - typedef VVTK_ViewWindow TViewWindow; - - static - QString - Type() - { - return "VVTK"; - } - - VVTK_Viewer(); - - virtual - ~VVTK_Viewer(); - - //! See #SUIT_ViewModel::createView - virtual - SUIT_ViewWindow* - createView(SUIT_Desktop*); - - //! See SUIT_ViewModel::getType - virtual - QString - getType() const - { - return Type(); - } - - //! See #SALOME_View::Display( const SALOME_Prs* ) - virtual - void - Display(const SALOME_VTKPrs* thePrs); - - //! See #SALOME_View::isVisible( const Handle(SALOME_InteractiveObject)& ) - virtual - bool - isVisible(const Handle(SALOME_InteractiveObject)& theIO); -}; - -#endif diff --git a/src/VVTK/VVTK_ViewWindow.cxx b/src/VVTK/VVTK_ViewWindow.cxx deleted file mode 100755 index 1d5be16b..00000000 --- a/src/VVTK/VVTK_ViewWindow.cxx +++ /dev/null @@ -1,324 +0,0 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// SALOME VTKViewer : build VTK viewer into Salome desktop -// File : -// Author : -// Module : SALOME -// $Header$ -// -#include "VVTK_ViewWindow.h" -#include "VVTK_ViewModel.h" -#include "VVTK_MainWindow.h" -#include "SVTK_View.h" - -#include "SUIT_Session.h" - -#include "VVTK_Renderer.h" -#include "SVTK_Selector.h" -#include "SVTK_InteractorStyle.h" -#include "SVTK_RenderWindowInteractor.h" -#include "SVTK_GenericRenderWindowInteractor.h" - -#include - -#include -#include -#include -#include - -//---------------------------------------------------------------------------- -VVTK_ViewWindow -::VVTK_ViewWindow(SUIT_Desktop* theDesktop): - SVTK_ViewWindow(theDesktop), - myMainWindow1(NULL), - myMainWindow2(NULL), - myView2(NULL), - myDumpImage(QImage()) -{} - -//---------------------------------------------------------------------------- -void VVTK_ViewWindow::Initialize(SVTK_ViewModelBase* theModel) -{ - if(SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr()){ - - QSplitter* s = new QSplitter( Qt::Vertical, this ); - setCentralWidget( s ); - - VISU_WidgetCtrl* aWidgetCtrl = NULL; - VISU_InsideCursorSettings* anInsideCursorSettings = NULL; - VISU_OutsideCursorSettings* anOutsideCursorSettings = NULL; - VISU_PickingSettings* aPickingSettings = NULL; - SVTK_Selector* aSelector = SVTK_Selector::New(); - { - myMainWindow1 = new VVTK_MainWindow1(s, - "VVTK_MainWindow", - aResourceMgr, - this); - - anInsideCursorSettings = myMainWindow1->GetInsideCursorSettings(); - anOutsideCursorSettings = myMainWindow1->GetOutsideCursorSettings(); - aPickingSettings = myMainWindow1->GetPickingSettings(); - - SVTK_RenderWindowInteractor* anIteractor = - new SVTK_RenderWindowInteractor(myMainWindow1,"SVTK_RenderWindowInteractor1"); - - SVTK_GenericRenderWindowInteractor* aDevice = - SVTK_GenericRenderWindowInteractor::New(); - aDevice->SetRenderWidget(anIteractor); - aDevice->SetSelector(aSelector); - - VVTK_Renderer1* aRenderer = VVTK_Renderer1::New(); - aRenderer->Initialize(aDevice,aSelector); - - aWidgetCtrl = aRenderer->GetWidgetCtrl(); - - aRenderer->SetInsideCursorSettings(anInsideCursorSettings); - aRenderer->SetOutsideCursorSettings(anOutsideCursorSettings); - aRenderer->SetPickingSettings(aPickingSettings); - - anIteractor->Initialize(aDevice,aRenderer,aSelector); - - SVTK_InteractorStyle* aStyle = SVTK_InteractorStyle::New(); - anIteractor->PushInteractorStyle(aStyle); - aStyle->Delete(); - - aDevice->Delete(); - aRenderer->Delete(); - - myMainWindow1->Initialize(anIteractor,aRenderer); - - myView1 = new SVTK_View(myMainWindow1); - SVTK_ViewWindow::Initialize(myView1,theModel); - - anIteractor->getRenderWindow()->Render(); - myMainWindow1->onResetView(); - } - { - myMainWindow2 = myMainWindow1->CreateMainWindow2(s, - "VVTK_SegmantationWindow", - aResourceMgr, - this); - SVTK_RenderWindowInteractor* anIteractor = - new SVTK_RenderWindowInteractor(myMainWindow2,"SVTK_RenderWindowInteractor1"); - - SVTK_GenericRenderWindowInteractor* aDevice = - SVTK_GenericRenderWindowInteractor::New(); - aDevice->SetRenderWidget(anIteractor); - aDevice->SetSelector(aSelector); - - VVTK_Renderer2* aRenderer = VVTK_Renderer2::New(); - aRenderer->Initialize(aDevice,aSelector); - - aRenderer->SetWidgetCtrl(aWidgetCtrl); - - aRenderer->SetInsideCursorSettings(anInsideCursorSettings); - aRenderer->SetPickingSettings(aPickingSettings); - - anIteractor->Initialize(aDevice,aRenderer,aSelector); - - SVTK_InteractorStyle* aStyle = SVTK_InteractorStyle::New(); - anIteractor->PushInteractorStyle(aStyle); - aStyle->Delete(); - - aDevice->Delete(); - aRenderer->Delete(); - - myMainWindow2->Initialize(anIteractor); - - myView2 = new SVTK_View(myMainWindow2); - SVTK_ViewWindow::Initialize(myView2,theModel); - - anIteractor->getRenderWindow()->Render(); - myMainWindow2->onResetView(); - } - aSelector->Delete(); - - int h = height() / 2; - QList aSizes; - aSizes.append( h ); - aSizes.append( h ); - s->setSizes( aSizes ); - myMainWindow2->hide(); - - myMainWindow = myMainWindow1; - myView = myView1; - } -} - -//---------------------------------------------------------------------------- -VVTK_ViewWindow -::~VVTK_ViewWindow() -{} - - -//---------------------------------------------------------------------------- -VVTK_MainWindow1* -VVTK_ViewWindow -::getMainWindow1() -{ - return myMainWindow1; -} - -VVTK_MainWindow2* -VVTK_ViewWindow -::getMainWindow2() -{ - return myMainWindow2; -} - - -//---------------------------------------------------------------------------- -void -VVTK_ViewWindow -::AddActor(VTKViewer_Actor* theActor, - bool theIsUpdate) -{ - myMainWindow1->AddActor(theActor,theIsUpdate); - myMainWindow2->AddActor(theActor,theIsUpdate); -} - -//---------------------------------------------------------------------------- -void -VVTK_ViewWindow -::RemoveActor(VTKViewer_Actor* theActor, - bool theIsUpdate) -{ - myMainWindow1->RemoveActor(theActor,theIsUpdate); - myMainWindow2->RemoveActor(theActor,theIsUpdate); -} - -//---------------------------------------------------------------------------- -void -VVTK_ViewWindow -::Repaint(bool theUpdateTrihedron) -{ - myMainWindow1->Repaint(theUpdateTrihedron); - myMainWindow2->Repaint(theUpdateTrihedron); -} - -//---------------------------------------------------------------- -void -VVTK_ViewWindow -::unHighlightAll() -{ - myView1->unHighlightAll(); - myView2->unHighlightAll(); -} - -//---------------------------------------------------------------- -void -VVTK_ViewWindow -::highlight(const Handle(SALOME_InteractiveObject)& theIO, - bool theIsHighlight, - bool theIsUpdate ) -{ - if(GetSelector()->AddIObject(theIO)) - GetSelector()->EndPickCallback(); - myView1->highlight( theIO, theIsHighlight, theIsUpdate ); - myView2->highlight( theIO, theIsHighlight, theIsUpdate ); -} - -//---------------------------------------------------------------- -void -VVTK_ViewWindow -::onSelectionChanged() -{ - myView1->onSelectionChanged(); - myView2->onSelectionChanged(); -} - -//---------------------------------------------------------------------------- -void -VVTK_ViewWindow -::onResetView() -{ - myMainWindow1->onResetView(); - myMainWindow2->onResetView(); -} - -//---------------------------------------------------------------------------- -void -VVTK_ViewWindow -::onFitAll() -{ - myMainWindow1->onFitAll(); - myMainWindow2->onFitAll(); -} - -//---------------------------------------------------------------------------- -bool -VVTK_ViewWindow -::action( const int accelAction ) -{ - if ( myMainWindow1->hasFocus() ) - myMainWindow1->action( accelAction ); - else if ( myMainWindow2->hasFocus() ) - myMainWindow2->action( accelAction ); - else - return false; - return true; -} - -//---------------------------------------------------------------------------- -QImage -VVTK_ViewWindow -::dumpView() -{ - if( myMainWindow1->GetInteractor()->hasFocus() ) - { - if ( myMainWindow1->getToolBar()->testAttribute(Qt::WA_UnderMouse) || myDumpImage.isNull() ) - return myMainWindow1->dumpView(); - else - return myDumpImage; - } - - if( myMainWindow2->GetInteractor()->hasFocus() ) - { - if ( myMainWindow1->getToolBar()->testAttribute(Qt::WA_UnderMouse) || myDumpImage.isNull() ) - return myMainWindow2->dumpView(); - else - return myDumpImage; - } - - return QImage(); -} - -//---------------------------------------------------------------------------- -void -VVTK_ViewWindow -::setBackgroundColor( const QColor& theColor ) -{ - myMainWindow1->SetBackgroundColor( theColor ); - myMainWindow2->SetBackgroundColor( theColor ); -} - - -//---------------------------------------------------------------------------- -void -VVTK_ViewWindow -::RefreshDumpImage() -{ - if( myMainWindow1->GetInteractor()->hasFocus() ) - myDumpImage = myMainWindow1->dumpView(); - else if ( myMainWindow2->GetInteractor()->hasFocus() ) - myDumpImage = myMainWindow2->dumpView(); -} diff --git a/src/VVTK/VVTK_ViewWindow.h b/src/VVTK/VVTK_ViewWindow.h deleted file mode 100755 index bedf4b44..00000000 --- a/src/VVTK/VVTK_ViewWindow.h +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -#ifndef VVTK_VIEWWINDOW_H -#define VVTK_VIEWWINDOW_H - -#ifdef WIN32 -#pragma warning( disable:4251 ) -#endif - -#include "VVTK.h" -#include "SVTK_ViewWindow.h" - -#include - -#include - -class VVTK_MainWindow1; -class VVTK_MainWindow2; -class SVTK_View; - -//---------------------------------------------------------------------------- -//! Customize the SVTK_ViewWindow in order to manage two SVTK_View (base and segmented one) -class VVTK_EXPORT VVTK_ViewWindow : public SVTK_ViewWindow -{ - Q_OBJECT; - -public: - //! To construct the class - VVTK_ViewWindow(SUIT_Desktop* theDesktop); - - //! Destroy - virtual - ~VVTK_ViewWindow(); - - //! To initialize - virtual - void - Initialize(SVTK_ViewModelBase* theModel); - - //---------------------------------------------------------------------------- - //! Get access to base SVTK_MainWindow - VVTK_MainWindow1* - getMainWindow1(); - - //! Get access to segmented SVTK_MainWindow - VVTK_MainWindow2* - getMainWindow2(); - - //---------------------------------------------------------------------------- - //! Redefine SVTK_ViewWindow::AddActor method - /*! - This is an entry point for publication the presentation into the viewer. - Pointed actor published into the basic MainWindow. If the actor is - a Gauss Points one second actor is created from initial actor and - is put into segemented MainWindow. - */ - virtual - void - AddActor(VTKViewer_Actor* theActor, - bool theIsUpdate = false); - - //! Redefine SVTK_ViewWindow::RemoveActor method - virtual - void - RemoveActor(VTKViewer_Actor* theActor, - bool theIsUpdate = false); - - //! Redefine SVTK_ViewWindow::Repaint method - virtual - void - Repaint(bool theUpdateTrihedron = true); - - //---------------------------------------------------------------------------- - /* interactive object management */ - //! Redefine SVTK_ViewWindow::highlight method - virtual - void - highlight(const Handle(SALOME_InteractiveObject)& theIO, - bool theIsHighlight = true, - bool theIsUpdate = true); - - //! Redefine SVTK_ViewWindow::unHighlightAll method - virtual - void - unHighlightAll(); - - //! Redefine SVTK_ViewWindow::setBackgroundColor method - virtual - void - setBackgroundColor( const QColor& ); - - //---------------------------------------------------------------------------- - - //! Refresh dump images of the viewers - virtual - void RefreshDumpImage(); - -public slots: - //! Redefine SVTK_ViewWindow::onSelectionChanged method - virtual - void - onSelectionChanged(); - - //! Redefine SVTK_ViewWindow::onResetView method - virtual - void - onResetView(); - - //! Redefine SVTK_ViewWindow::onFitAll method - virtual - void - onFitAll(); - - //---------------------------------------------------------------------------- -protected: - virtual - bool - action( const int ); - - virtual QImage dumpView(); - - VVTK_MainWindow1* myMainWindow1; //!< The manage base view - SVTK_View* myView1; //!< The manage base view - - VVTK_MainWindow2* myMainWindow2; //!< The manage segmented view - SVTK_View* myView2; //!< The manage segmented view - -private: - QImage myDumpImage; -}; - -#ifdef WIN32 -#pragma warning( default:4251 ) -#endif - -#endif -- 2.39.2