From: eduardo.davila@creatis.insa-lyon.fr Date: Tue, 15 Sep 2026 14:09:46 +0000 (+0200) Subject: #3264 Copy Paste boxes option between diagrams X-Git-Url: http://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=2550f7d529a646fea4217b4224b3ce57abab41c1;p=bbtkGEditor.git #3264 Copy Paste boxes option between diagrams --- diff --git a/data/icons/wxart_copy.xpm b/data/icons/wxart_copy.xpm new file mode 100644 index 0000000..c8cf0a2 --- /dev/null +++ b/data/icons/wxart_copy.xpm @@ -0,0 +1,202 @@ +/* XPM */ +static char *copy_xpm[] = { +/* columns rows colors chars-per-pixel */ +"40 40 156 2 ", +" c None", +". c #848586", +"X c #8C8C8E", +"o c #929393", +"O c #949596", +"+ c #959697", +"@ c #979899", +"# c #98999A", +"$ c #9B9C9D", +"% c #9FA0A2", +"& c #A0A1A1", +"* c #A0A0A2", +"= c #A1A1A3", +"- c #A1A2A3", +"; c #A3A3A5", +": c #A5A6A7", +"> c #A6A6A7", +", c #A7A7A8", +"< c #A8A8A9", +"1 c #A9A9AA", +"2 c #A9A9AB", +"3 c #A9AAAB", +"4 c #AAABAC", +"5 c #ADADAE", +"6 c #ADAEAF", +"7 c #AEAEB0", +"8 c #AFB0B1", +"9 c #B1B1B2", +"0 c #B1B2B3", +"q c #B2B2B3", +"w c #B4B4B5", +"e c #B5B5B6", +"r c #B6B6B7", +"t c #B6B6B8", +"y c #B6B7B8", +"u c #B7B7B8", +"i c #B7B7B9", +"p c #B8B8B9", +"a c #B8B9B9", +"s c #B9B9BA", +"d c #B9BABA", +"f c #BABABB", +"g c #BBBBBC", +"h c #BCBCBD", +"j c #BCBDBE", +"k c #BDBDBE", +"l c #BEBEBF", +"z c #BEBFC0", +"x c #BFBFC0", +"c c #C0C0C1", +"v c #C1C1C1", +"b c #C0C1C2", +"n c #C1C1C2", +"m c #C1C2C3", +"M c #C2C2C3", +"N c #C2C2C4", +"B c #C3C3C4", +"V c #C4C4C5", +"C c #C4C4C6", +"Z c #C5C5C6", +"A c #C6C6C7", +"S c gray78", +"D c #C6C6C8", +"F c #C7C7C8", +"G c #C8C8C9", +"H c #C8C9CA", +"J c #C9C9CA", +"K c #CACACB", +"L c #CACBCC", +"P c #CBCBCC", +"I c #CCCCCD", +"U c #CDCDCE", +"Y c #CECECF", +"T c #CFCFD0", +"R c #CECFD1", +"E c #D0D0D1", +"W c #D1D1D2", +"Q c #D2D2D3", +"! c #D3D4D5", +"~ c #D4D4D6", +"^ c #D4D5D6", +"/ c #D5D5D6", +"( c #D5D5D7", +") c #D5D6D7", +"_ c #D6D6D7", +"` c #D8D8D9", +"' c #D9DADB", +"] c #DADADC", +"[ c #DADBDC", +"{ c #DBDBDC", +"} c #DBDCDD", +"| c #DCDCDD", +" . c #DCDCDE", +".. c #DDDDDF", +"X. c #DEDEDF", +"o. c #DFDFE0", +"O. c #DFDFE1", +"+. c #DFE0E1", +"@. c #DFE0E2", +"#. c #E0E0E1", +"$. c #E0E0E2", +"%. c #E0E1E2", +"&. c #E1E1E2", +"*. c #E1E1E3", +"=. c #E1E2E3", +"-. c #E2E2E3", +";. c #E2E2E4", +":. c #E2E3E4", +">. c #E3E3E4", +",. c #E3E3E5", +"<. c #E3E4E5", +"1. c #E4E4E5", +"2. c #E4E4E6", +"3. c #E4E5E6", +"4. c #E5E5E6", +"5. c #E5E5E7", +"6. c #E5E6E7", +"7. c #E6E6E7", +"8. c #E6E6E8", +"9. c #E6E7E8", +"0. c #E7E7E8", +"q. c #E7E7E9", +"w. c #E7E8E9", +"e. c #E8E8E9", +"r. c #E8E9E9", +"t. c #E8E8EA", +"y. c #E8E9EA", +"u. c #E9E9EA", +"i. c #E9E9EB", +"p. c #E9EAEB", +"a. c #EAEAEB", +"s. c #EAEAEC", +"d. c #EAEBEC", +"f. c #EBEBEC", +"g. c #EBEBED", +"h. c #EBECED", +"j. c #ECECED", +"k. c #ECEDEE", +"l. c #EDEDEE", +"z. c #EDEDEF", +"x. c #EDEEEF", +"c. c #EEEEEE", +"v. c #EEEEEF", +"b. c #EEEEF0", +"n. c #EEEFF0", +"m. c #EFEFF0", +"M. c #EFEFF1", +"N. c #EFF0F1", +"B. c #F0F0F1", +"V. c #F0F0F2", +"C. c #F1F1F2", +"Z. c #F2F2F3", +"A. c #F2F3F4", +"S. c #F3F3F4", +"D. c #F4F4F5", +"F. c #F5F5F6", +/* pixels */ +" ", +" B.m.m.m.m.m.m.B.B.l.l.l.f.f.f.f.f.f.f.f.f.f.f.f.f. ", +" D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D. ", +" D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D. ", +" e D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D. ", +" | P n D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D. ", +" >.u.B.D.D.D.f.Q n D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D. ", +" S.D.D.D.D.D.D.D.f.T x D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D. ", +" D.D.D.D.D.D.D.D.f.T x D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D. ", +" l.D.D.D.D.D.D.D.f.T x D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D. ", +" o.D.D.D.D.D.D.D.f.T l S.S.S.S.S.S.S.S.S.S.S.D.S.S.S.S.S.S.S.S.S.S.S.S.S. ", +" Q D.D.D.D.D.D.D.f.T l B.B.B.B.S.B.B.B.B.B.B.S.B.B.B.B.B.B.B.B.B.B.B.B.B. ", +" x D.D.D.D.D.D.D.f.T l B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B. ", +" B.D.D.D.D.D.D.u.U l B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B. ", +" f.D.D.D.D.D.S.u.U l B.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N. ", +" 7.S.S.S.S.S.B.u.U l m.m.m.m.m.m.m.m.m.m.m.m.m.m.m.m.m.m.m.m.m.m.m.m.m. ", +" =.B.B.B.B.B.B.q.U l m.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l. ", +" ` B.B.B.B.B.B.q.P g l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l. ", +" V B.B.B.B.B.B.7.P p l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l.l. ", +" B.N.m.m.m.m.7.K p l.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f. ", +" m.m.m.m.m.l.7.K p f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f.f. ", +" f.l.l.l.l.l.7.K p f.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u. ", +" | l.l.l.l.l.>.K p u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u. ", +" Q l.l.l.l.l.=.D p u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u.u. ", +" n h.f.f.f.f.=.D u u.q.q.q.q.q.q.q.q.q.q.q.q.q.q.q.q.q.q.q.q.q.q.q.q. ", +" u.f.f.u.u.=.V u q.q.q.q.q.q.q.q.q.q.q.q.q.q.q.q.q.q.q.q.q.q.q.q.q. ", +" 7.u.u.u.u.o.V e q.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7. ", +" o.u.u.u.u.o.V e 7.7.7.7.7.7.2.2.2.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7. ", +" ` u.u.u.w.| V e 7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.7.2.7.7.7.7.7.7. ", +" ( q.q.q.q.| N e 7.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>. ", +" D q.q.q.q.| N e 2.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>. ", +" 7.7.7.7.} n e >.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=. ", +" 7.7.7.7.{ n e >.=.=.=.=.=.=.=.=.=.=.=.=.=.+.+.+.+.+.+.+.+.+.+.+. ", +" 7.7.7.2.{ n < 5 < < < < < < < < , : ; & & % % & < 7 X O O O O # ", +" { 2.>.>.| P l p u u u u u u u u u u e e e e 5 : 4 q ", +" Q >.>.>.+.` ( ( ( ( ( ( ( ( ( ( ! T n 8 @ . ", +" n =.=.=.=.=.=.=.=.=.{ Q K x < o ", +" q =.=.=.=.=.( V q $ ", +" K e & ", +" " +}; diff --git a/data/icons/wxart_paste.xpm b/data/icons/wxart_paste.xpm new file mode 100644 index 0000000..0857f41 --- /dev/null +++ b/data/icons/wxart_paste.xpm @@ -0,0 +1,220 @@ +/* XPM */ +static char *paste_xpm[] = { +/* columns rows colors chars-per-pixel */ +"40 40 174 2 ", +" c None", +". c #797575", +"X c #925F28", +"o c #95622C", +"O c #9A6635", +"+ c #9E6A3A", +"@ c #9A6734", +"# c #A16D3D", +"$ c #A2703F", +"% c #8D6D4B", +"& c #936F4E", +"* c #9F7148", +"= c #94714F", +"- c #8C725B", +"; c #8A7C53", +": c #977352", +"> c #997655", +", c #9E7857", +"< c #A16F40", +"1 c #A47343", +"2 c #A87647", +"3 c #A5764C", +"4 c #A87748", +"5 c #A5794E", +"6 c #AC7B4D", +"7 c #A57A53", +"8 c #AB7D53", +"9 c #AC7F59", +"0 c #B07F51", +"q c #83766C", +"w c #837E77", +"e c #AE8155", +"r c #AE835B", +"t c #B28254", +"y c #B3865A", +"u c #B6895D", +"i c #B98A5E", +"p c #9B8974", +"a c #958A7B", +"s c #AB8B6B", +"d c #A98968", +"f c #B18661", +"g c #B48A63", +"h c #BA8E63", +"j c #B38E6B", +"k c #B88E6A", +"l c #BE9166", +"z c #B3906F", +"x c #BC936B", +"c c #A68D72", +"v c #AC9172", +"b c #AF9379", +"n c #B59373", +"m c #BB9673", +"M c #B5977A", +"N c #C1956A", +"B c #C59A6E", +"V c #C49B74", +"C c #C99E74", +"Z c #CAA176", +"A c #CCA47B", +"S c #C1A07F", +"D c #D0A87E", +"F c #667785", +"G c #7E8383", +"H c #6A8D9F", +"J c #708C9D", +"K c #71929E", +"L c #4E87B0", +"P c #4992BC", +"I c #5490BA", +"U c #6D8EA2", +"Y c #6687A3", +"T c #6595B3", +"R c #1383DA", +"E c #1984DA", +"W c #158ADE", +"Q c #1D8CDE", +"! c #1A83D5", +"~ c #378ECA", +"^ c #3991CD", +"/ c #228BDC", +"( c #288FDD", +") c #2495DA", +"_ c #3293D3", +"` c #3EA5DA", +"' c #3EA3D7", +"] c #168EE2", +"[ c #1795E6", +"{ c #1C93E4", +"} c #199CEB", +"| c #2783E1", +" . c #388DED", +".. c #2699E8", +"X. c #339AE0", +"o. c #1BA6F2", +"O. c #1CAEF7", +"+. c #1EB5FC", +"@. c #1FBAFF", +"#. c #2DA0E9", +"$. c #35A2E5", +"%. c #419BDD", +"&. c #489AD4", +"*. c #40A5D8", +"=. c #429DE2", +"-. c #47ABEA", +";. c #47B4F0", +":. c #6CB0E6", +">. c #7DB8E9", +",. c #818788", +"<. c #8B8B86", +"1. c #978E81", +"2. c #979285", +"3. c #B39B84", +"4. c #B79F89", +"5. c #B9A38D", +"6. c #B7A18A", +"7. c #B4B6B7", +"8. c #B4B6B8", +"9. c #BABBBD", +"0. c #CEA983", +"q. c #D2AB84", +"w. c #D3AE8A", +"e. c #D5B18C", +"r. c #C3AD97", +"t. c #C5B09C", +"y. c #CAB39D", +"u. c #D9B592", +"i. c #CFB9A4", +"p. c #D2BDA7", +"a. c #CBBEB2", +"s. c #D7C3AB", +"d. c #D2C8BE", +"f. c #E2C8AC", +"g. c #94CAF0", +"h. c #A9CEEB", +"j. c #A8CBE8", +"k. c #AAD2EE", +"l. c #BFD5E9", +"z. c #ADD5F1", +"x. c #BCDAF3", +"c. c #C5C6C6", +"v. c #CBCCCD", +"b. c #CECFD0", +"n. c #CFD0D1", +"m. c #D3D3D5", +"M. c #D6D7D8", +"N. c #DADADB", +"B. c #E0D7CC", +"V. c #E8E0D6", +"C. c #C5D5E7", +"Z. c #C4D6E8", +"A. c #C9DFF1", +"S. c #CAE0F1", +"D. c #D9E6F5", +"F. c #E7E3E0", +"G. c #E7E4E1", +"H. c #E5E6E6", +"J. c #E3E3E5", +"K. c #E8E4E2", +"L. c #E7E7E8", +"P. c #E6E7E9", +"I. c #E4E9EE", +"U. c #ECECED", +"Y. c #EAEBEC", +"T. c #E5ECF2", +"R. c #EFEFF1", +"E. c #EBF1F5", +"W. c #F2F3F6", +"Q. c #F5F5F6", +"!. c #F4F5F6", +"~. c gray97", +"^. c #F3F3F4", +"/. c gray98", +/* pixels */ +" J.J.J.J.J.J.M. ", +" N.M.M.M.M.M.v. ", +" J.J.L.L.L.J.N. ", +" s.V./././.B.y. ", +" q.f.e.w.q.q.A A Z Z a.~.~.~.t.x l l h h i i u V 3 ", +" w.u.D A w.p.p.i.i.i.d.J.J.J.a.y.y.y.y.t.x u y y 5 ", +" A e.A A y.v.c.c.c.c.c.c.c.c.c.c.c.c.c.c.3.y t t 2 ", +" Z e.A Z r.9.7.7.7.7.7.7.7.7.7.7.7.7.7.7.b t t t 2 ", +" V w.Z Z r.9.8.8.8.8.8.8.8.8.8.8.8.8.8.8.b t t 8 1 ", +" m q.Z C S 5.5.5.6.6.4.4.3.3.3.3.3.3.3.3.f t 8 6 1 ", +" m 0.C C x k g g r r r r e 8 8 7 7 7 5 3 6 8 6 6 < ", +" x 0.C B N h h g g u y y r e e 8 8 8 5 5 5 6 6 6 < ", +" k A B B N l x j j h u g M M M M n n n z j j j j d ", +" k A B N N x v 2.1.s u s K.K.G.G.G.F.F.F.F.F.F.F.F.L.U.U.U.U.U.U.M. ", +" k Z N N x v <.J T U p c ~.~.~.~.~.W.W.~.~.~.~.~.~.~.~.~.~.~.~.~.N. ", +" g Z N l v 2.H L ~ &.Y <.W.~.~.~.E.D.D.W.~.~.~.~.~.~.~.~.~.~.~.~.N. ", +" g V l l a K P ~ ! / %.I S.E.~.E.g. .x.E.~.~.~.~.~.~.~.~.~.~.~.~.N. ", +" g V l h c U _ ) W R ( %.>.A.T.k.#...z.E.~.~.~.~.~.~.~.~.~.~.~.~.N. ", +" g V h h i p ^ } [ W R / =.:.>...[ } z.E.~.~.~.~.~.~.~.~.~.~.~.~.N. ", +" f V h i i y ,._ } [ W R ( =.| ] [ { z.T.~.~.~.~.W.W.W.W.~.~.~.~.M. ", +" f V i i y y y a _ } [ W R E W W ] { k.T.W.W.^.^.^.^.^.^.W.W.W.W.M. ", +" f N u u y t t e G _ } [ W R R W W { k.T.^.^.^.^.^.^.^.^.^.^.^.^.M. ", +" y x y y t t t 8 8 w X.} [ W R R W Q h.T.^.^.^.^.^.^.^.^.^.^.^.^.M. ", +" r x y t t t 8 6 7 . $.o.} [ W R R Q h.T.R.R.R.R.R.R.R.R.R.R.R.R.M. ", +" r x t t t 8 6 7 F ) +.+.o.} [ W R E j.T.R.U.R.R.R.R.R.R.R.R.R.R.m. ", +" r l t t 6 6 5 . ) +.@.+.O.o.} [ W E j.I.U.U.U.U.U.U.U.U.U.U.U.U.m. ", +" r h 0 6 6 6 , Y ' ' *.' ;.-.-.-.=.%.l.I.U.U.U.U.U.U.U.U.U.U.U.U.m. ", +" 9 h 6 6 6 6 4 > - - - q C.C.C.Z.Z.Z.I.Y.Y.L.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.m. ", +" 9 g 6 6 6 4 2 2 1 1 # > Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.U.U.Y.Y.Y.Y.Y.Y.Y.Y.m. ", +" 8 u 6 6 4 2 2 1 1 < # > L.L.L.L.L.L.Y.Y.Y.Y.Y.Y.L.L.L.L.L.L.L.L.m. ", +" 8 y 4 4 2 2 1 1 # # + : L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.n. ", +" 8 y 2 2 1 1 1 # # # + : L.L.L.L.L.L.L.L.L.L.P.P.L.L.L.L.L.L.L.L.b. ", +" 8 y 2 1 1 $ # # + + O = L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.v. ", +" 7 y 1 1 # # # + + O O & J.J.J.J.J.J.J.J.J.L.J.J.J.J.J.J.J.J.J.J.v. ", +" * 8 1 < # # + + O O O & J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.v. ", +" @ o o o o o o o X X % J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.v. ", +" ; J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.v. ", +" J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.v. ", +" n.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.n.9. ", +" " +}; diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GlobalConstants.h b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GlobalConstants.h index 6c664ae..45dc2ad 100644 --- a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GlobalConstants.h +++ b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GlobalConstants.h @@ -208,44 +208,50 @@ namespace bbtk { const double BOXTEXT_SELECTED_B = 0.05; // GUI Id's - const int ID_NEW = 1000; - const int ID_SAVE_AS_DIAGRAM = 1001; - const int ID_SAVE_DIAGRAM = 1015; //last DFCH - const int ID_OPEN = 1002; - const int ID_RUN = 1003; - const int ID_DELETEALL = 1004; - const int ID_CENTERVIEW = 1005; - const int ID_BTNCOMPLEXBOX = 1006; - const int ID_ADDCOMPLEXBOXINPUT = 1007; - const int ID_ADDCOMPLEXBOXOUTPUT = 1008; - const int ID_OPEN_BBS = 1009; - const int ID_SAVE_AS_BBS = 1010; - const int ID_SAVE_AS_COMPLEXBOX = 1011; - const int ID_COPY_TO_COMPLEXDIAGRAM = 1012; - const int ID_BTNBOX = 1013; - const int ID_HELP_BBEDITOR = 1014; - const int ID_BTEXECUTABLEBOX = 1016; // EED - const int ID_EXPORT_CONSOLEAPP = 1017; // RaC - const int ID_EDIT_COMPLEXBOX_SCRIPT = 1018; // EED + const int ID_NEW = 1000; + const int ID_SAVE_AS_DIAGRAM = 1001; + const int ID_SAVE_DIAGRAM = 1015; //last DFCH + const int ID_OPEN = 1002; + const int ID_RUN = 1003; + const int ID_DELETEALL = 1004; + const int ID_CENTERVIEW = 1005; + const int ID_BTNCOMPLEXBOX = 1006; + const int ID_ADDCOMPLEXBOXINPUT = 1007; + const int ID_ADDCOMPLEXBOXOUTPUT = 1008; + const int ID_OPEN_BBS = 1009; + const int ID_SAVE_AS_BBS = 1010; + const int ID_SAVE_AS_COMPLEXBOX = 1011; + const int ID_CREATE_COMPLEXDIAGRAM_FROM_SELECTED_BOXES = 1012; + const int ID_BTNBOX = 1013; + const int ID_HELP_BBEDITOR = 1014; + const int ID_BTEXECUTABLEBOX = 1016; // EED + const int ID_EXPORT_CONSOLEAPP = 1017; // RaC + const int ID_EDIT_COMPLEXBOX_SCRIPT = 1018; // EED - const int wxID_NOTEBOOK = 1018; // EED updated + const int wxID_NOTEBOOK = 1018; // EED updated - const int ID_bbEditor_Tool_Menu_CreatePackage = 1019; // EED - const int ID_bbEditor_Tool_Menu_CreateBlackBox = 1020; // EED - const int ID_bbEditor_Tool_Menu_PlugPackage = 1021; // EED - const int ID_bbEditor_Tool_Menu_EditConfig = 1022; // EED - const int ID_bbEditor_Tool_Menu_ShowHTMLDoc = 1023; // EED - const int ID_bbEditor_Tool_Menu_CreateIndex = 1024; // EED + const int ID_bbEditor_Tool_Menu_CreatePackage = 1019; // EED + const int ID_bbEditor_Tool_Menu_CreateBlackBox = 1020; // EED + const int ID_bbEditor_Tool_Menu_PlugPackage = 1021; // EED + const int ID_bbEditor_Tool_Menu_EditConfig = 1022; // EED + const int ID_bbEditor_Tool_Menu_ShowHTMLDoc = 1023; // EED + const int ID_bbEditor_Tool_Menu_CreateIndex = 1024; // EED - const int ID_UNDO = 1025; // FCY - const int ID_REDO = 1026; // FCY - const int ID_CHANGENAME = 1027; + const int ID_UNDO = 1025; // FCY + const int ID_REDO = 1026; // FCY + const int ID_CHANGENAME = 1027; - const int ID_EDITPROPERTIES = 1028; // RaC 2nd HackFest - const int ID_SHOWTREE = 1029; // CFT + const int ID_EDITPROPERTIES = 1028; // RaC 2nd HackFest + const int ID_SHOWTREE = 1029; // CFT //EED 2022-10-28 - const int ID_BTNSELETBOXES = 1032; + const int ID_BTNSELETBOXES = 1032; + + // EED 2026-09-01 + const int ID_COPY_BOXES = 1041; + const int ID_PASTE_BOXES = 1042; + const int ID_BTN_COPY_BOXES = 1051; + const int ID_BTN_PASTE_BOXES = 1052; }// namespace bbtk #endif diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx index fd3bc0e..dea73ce 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx @@ -70,8 +70,7 @@ namespace bbtk { //========================================================================= -wxGUIEditorGraphicBBS::wxGUIEditorGraphicBBS(wxFrame *parent) - : wxFrame( parent, -1, _T("bbtkGEditor"), wxDefaultPosition, wxSize(1200,800) ) +wxGUIEditorGraphicBBS::wxGUIEditorGraphicBBS(wxFrame *parent): wxFrame( parent, -1, _T("bbtkGEditor"), wxDefaultPosition, wxSize(1200,800) ) { _pkgBrowser = NULL; _frameAUIMgr = new wxAuiManager(this); @@ -139,38 +138,31 @@ void wxGUIEditorGraphicBBS::initToolbar() wxBitmap bmp_undo(undo_xpm); wxBitmap bmp_redo(redo_xpm); wxBitmap bmp_editProperties(editProperties_xpm); - wxBitmap bmp_showTree(showTree_xpm); - + wxBitmap bmp_showTree(showTree_xpm); + wxBitmap bmp_copy(copy_xpm); + wxBitmap bmp_paste(paste_xpm); + // wxToolBar *toolbar = new wxToolBar(this, wxID_ANY); wxToolBar *toolbar = CreateToolBar(); //Adds a tool btn to the toolbar - toolbar->AddTool(ID_NEW, _T("New"), bmp_new, wxNullBitmap, wxITEM_NORMAL, - _T("New tab"), _T("Create a new panel tab")); - - toolbar->AddTool(ID_OPEN, _T("Open diagram"), bmp_open, wxNullBitmap, - wxITEM_NORMAL, _T("Open a diagram"), _T("Open a diagram")); - - toolbar->AddTool(ID_SAVE_DIAGRAM, _T("Save Diagram"), bmp_save, - wxNullBitmap, wxITEM_NORMAL, _T("Saves the current diagram"), - _T("Saves the current diagram")); //DFCH - //toolbar->AddTool(ID_SAVE_AS_DIAGRAM,_T("Save Diagram As"),bmp_save, wxNullBitmap, wxITEM_NORMAL,_T("Saves the current diagram"), _T("Saves the current diagram")); //DFCH - toolbar->AddTool(ID_RUN, _T("Run"), bmp_run, wxNullBitmap, wxITEM_NORMAL, - _T("Execute actual diagram"), _T("Execute actual diagram")); - toolbar->AddTool(ID_DELETEALL, _T("Delete all"), bmp_delete, wxNullBitmap, - wxITEM_NORMAL, _T("Delete all boxes"), _T("Delete all boxes")); - toolbar->AddTool(ID_CENTERVIEW, _T("Center view"), bmp_centerview, - wxNullBitmap, wxITEM_NORMAL, _T("Center view"), _T("Center view")); + toolbar->AddTool(ID_NEW, _T("New") , bmp_new , wxNullBitmap, wxITEM_NORMAL, _T("New tab"), _T("Create a new panel tab")); + toolbar->AddTool(ID_OPEN, _T("Open diagram") , bmp_open , wxNullBitmap, wxITEM_NORMAL, _T("Open a diagram"), _T("Open a diagram")); + toolbar->AddTool(ID_SAVE_DIAGRAM, _T("Save Diagram") , bmp_save , wxNullBitmap, wxITEM_NORMAL, _T("Saves the current diagram"),_T("Saves the current diagram")); //DFCH + //toolbar->AddTool(ID_SAVE_AS_DIAGRAM,_T("Save Diagram As"),bmp_save, wxNullBitmap, wxITEM_NORMAL, _T("Saves the current diagram"), _T("Saves the current diagram")); //DFCH + toolbar->AddTool(ID_RUN, _T("Run") , bmp_run , wxNullBitmap, wxITEM_NORMAL, _T("Execute actual diagram"), _T("Execute actual diagram")); + toolbar->AddTool(ID_DELETEALL, _T("Delete all") , bmp_delete , wxNullBitmap, wxITEM_NORMAL, _T("Delete all boxes"), _T("Delete all boxes")); + toolbar->AddTool(ID_CENTERVIEW, _T("Center view") , bmp_centerview, wxNullBitmap, wxITEM_NORMAL, _T("Center view"), _T("Center view")); + toolbar->AddSeparator(); + toolbar->AddTool(ID_BTN_COPY_BOXES, _T("Copy boxes") , bmp_copy , wxNullBitmap, wxITEM_NORMAL, _T("Copy boxes"), _T("Copy boxes")); + toolbar->AddTool(ID_BTN_PASTE_BOXES,_T("Paste boxes") , bmp_paste , wxNullBitmap, wxITEM_NORMAL, _T("Paste boxes"), _T("Paste boxes")); + toolbar->AddSeparator(); + toolbar->AddTool(ID_BTNBOX, _T("New Box") , bmp_box , wxNullBitmap, wxITEM_NORMAL, _T("New Box"), _T("Nex Box")); + toolbar->AddTool(ID_BTNSELETBOXES, _T("Select Boxes") , bmp_find , wxNullBitmap, wxITEM_NORMAL, _T("Select Boxes"), _T("Select Boxes")); toolbar->AddSeparator(); - toolbar->AddTool(ID_BTNBOX, _T("New Box"), bmp_box, wxNullBitmap,wxITEM_NORMAL, _T("New Box"), _T("Nex Box")); - toolbar->AddTool(ID_BTNSELETBOXES, _T("Select Boxes"), bmp_find, wxNullBitmap,wxITEM_NORMAL, _T("Select Boxes"), _T("Select Boxes")); + toolbar->AddTool(ID_BTEXECUTABLEBOX,_T("Select as executable Box"), bmp_executablebox, wxNullBitmap, wxITEM_NORMAL,_T("Select as executable Box"), _T("Select as executable Box")); toolbar->AddSeparator(); - toolbar->AddTool(ID_BTEXECUTABLEBOX, _T("Select as executable Box"), - bmp_executablebox, wxNullBitmap, wxITEM_NORMAL, - _T("Select as executable Box"), _T("Select as executable Box")); - toolbar->AddSeparator(); - toolbar->AddTool(ID_BTNCOMPLEXBOX, _T("Complex box"), complexbox_xpm, - wxNullBitmap, wxITEM_NORMAL, _T("Complex box"), _T("Complex box")); + toolbar->AddTool(ID_BTNCOMPLEXBOX, _T("Complex box"), complexbox_xpm , wxNullBitmap, wxITEM_NORMAL, _T("Complex box"), _T("Complex box")); //EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 #if wxMAJOR_VERSION <= 2 @@ -224,22 +216,24 @@ void wxGUIEditorGraphicBBS::initToolbar() wxCommandEventHandler(wxGUIEditorGraphicBBS::OnSaveActualDiagram)); //DFCH Connect(ID_SAVE_AS_DIAGRAM, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(wxGUIEditorGraphicBBS::OnSaveAsActualDiagram)); //DFCH - Connect( - ID_RUN, + Connect(ID_RUN, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(wxGUIEditorGraphicBBS::OnExecuteActualDiagram)); - Connect( - ID_DELETEALL, + Connect(ID_DELETEALL, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(wxGUIEditorGraphicBBS::OnDeleteAllBoxesActualDiagram)); - Connect( - ID_CENTERVIEW, - wxEVT_COMMAND_TOOL_CLICKED, - wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCenterViewActualDiagram)); + Connect(ID_CENTERVIEW, + wxEVT_COMMAND_TOOL_CLICKED, + wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCenterViewActualDiagram)); + Connect(ID_BTN_COPY_BOXES, + wxEVT_COMMAND_TOOL_CLICKED, + wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCopyBoxes)); + Connect(ID_BTN_PASTE_BOXES, + wxEVT_COMMAND_TOOL_CLICKED, + wxCommandEventHandler(wxGUIEditorGraphicBBS::OnPasteBoxes)); Connect(ID_BTNBOX, wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnClickBtnBox)); Connect(ID_BTNSELETBOXES, wxEVT_COMMAND_TOOL_CLICKED , wxCommandEventHandler(wxGUIEditorGraphicBBS::OnClickBtnSelectBoxes) ); - Connect( - ID_BTEXECUTABLEBOX, + Connect(ID_BTEXECUTABLEBOX, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(wxGUIEditorGraphicBBS::OnClickBtnExecutableBox)); Connect(ID_BTNCOMPLEXBOX, wxEVT_COMMAND_TOOL_CLICKED, @@ -302,12 +296,18 @@ void wxGUIEditorGraphicBBS::initMenu() { // Create Edit menu and its items wxMenu *editMenu = new wxMenu; - editMenu->Append(ID_COPY_TO_COMPLEXDIAGRAM, _T("Copy selected to complex box"), _T("Creates a new complex box diagram with selected boxes")); + editMenu->Append(ID_CREATE_COMPLEXDIAGRAM_FROM_SELECTED_BOXES, _T("Create complex box from selection"), _T("Creates a new complex box diagram with selected boxes")); editMenu->Append(ID_EDIT_COMPLEXBOX_SCRIPT, _T("Edit Complex Box"), _T("Edit Complex Box")); - Connect( ID_COPY_TO_COMPLEXDIAGRAM, wxEVT_COMMAND_MENU_SELECTED, - wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCopySelectedToComplexDiagram)); - Connect( ID_EDIT_COMPLEXBOX_SCRIPT, wxEVT_COMMAND_MENU_SELECTED, - wxCommandEventHandler(wxGUIEditorGraphicBBS::OnEditComplexBoxScript)); + + editMenu->Append(ID_COPY_BOXES, _T("Copy boxes"), _T("Copy selected boxes")); + editMenu->Append(ID_PASTE_BOXES, _T("Paste boxes"), _T("Paste de copy boxes")); + + Connect( ID_COPY_BOXES, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCopyBoxes)); + Connect( ID_PASTE_BOXES, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(wxGUIEditorGraphicBBS::OnPasteBoxes)); + + + Connect( ID_CREATE_COMPLEXDIAGRAM_FROM_SELECTED_BOXES, wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCreateComplexDiagramFromSelectedBoxes)); + Connect( ID_EDIT_COMPLEXBOX_SCRIPT, wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnEditComplexBoxScript)); // Create Help menu and its items wxMenu *helpMenu = new wxMenu; @@ -1123,17 +1123,16 @@ void wxGUIEditorGraphicBBS::refreshGUIControls() GetToolBar()->SetToolShortHelp(ID_REDO,crea::std2wx(stredo)); if (_tabsMgr->getNumActualSelectedObjects() > 0) { - GetMenuBar()->GetMenu(1)->Enable(ID_COPY_TO_COMPLEXDIAGRAM, true); + GetMenuBar()->GetMenu(1)->Enable(ID_CREATE_COMPLEXDIAGRAM_FROM_SELECTED_BOXES, true); } else { ///TODO Fix the possibility to say from the SceneManager to the GUI to refresh the options - GetMenuBar()->GetMenu(1)->Enable(ID_COPY_TO_COMPLEXDIAGRAM, true); + GetMenuBar()->GetMenu(1)->Enable(ID_CREATE_COMPLEXDIAGRAM_FROM_SELECTED_BOXES, true); } } //========================================================================= - -void wxGUIEditorGraphicBBS::OnDeleteAllBoxesActualDiagram(wxCommandEvent& event) +void wxGUIEditorGraphicBBS::OnDeleteAllBoxesActualDiagram(wxCommandEvent& event) { wxMessageDialog *dial = new wxMessageDialog(NULL,wxT("Are you sure to delete all boxes of the diagram?"),wxT("Delete all boxes"), wxYES_NO | wxNO_DEFAULT| wxICON_QUESTION); if (dial->ShowModal() == wxID_YES) @@ -1143,10 +1142,9 @@ void wxGUIEditorGraphicBBS::OnDeleteAllBoxesActualDiagram(wxCommandEvent& event) } //========================================================================= - -void wxGUIEditorGraphicBBS::OnCenterViewActualDiagram(wxCommandEvent& event) +void wxGUIEditorGraphicBBS::OnCenterViewActualDiagram(wxCommandEvent& event) { - _tabsMgr->centerViewActualDiagram(); + _tabsMgr->centerViewActualDiagram(); } //========================================================================= @@ -1301,10 +1299,21 @@ void wxGUIEditorGraphicBBS::OnAddComplexBoxOutput(wxCommandEvent& event) } //========================================================================= -void wxGUIEditorGraphicBBS::OnCopySelectedToComplexDiagram( - wxCommandEvent& event) +void wxGUIEditorGraphicBBS::OnCreateComplexDiagramFromSelectedBoxes(wxCommandEvent& event) +{ + _tabsMgr->createComplexDiagramFromSelectedBoxes(); +} + +//========================================================================= +void wxGUIEditorGraphicBBS::OnCopyBoxes(wxCommandEvent& event) +{ + _tabsMgr->copyBoxes(); +} + +//========================================================================= +void wxGUIEditorGraphicBBS::OnPasteBoxes(wxCommandEvent& event) { - _tabsMgr->copySelectedBBoxesToComplexDiagram(); + _tabsMgr->pasteBoxes(); } //========================================================================= diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.h b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.h index bee3528..1fac9e9 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.h +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.h @@ -70,6 +70,8 @@ #include "wxart_redo.xpm" #include "wxart_editProperties.xpm" #include "wxart_showTree.xpm" +#include "wxart_copy.xpm" +#include "wxart_paste.xpm" //Includes creaMaracasVisu @@ -169,7 +171,9 @@ namespace bbtk void OnExecuteActualDiagram(wxCommandEvent& event); void OnClickBtnExecutableBox(wxCommandEvent& event); void OnDeleteAllBoxesActualDiagram(wxCommandEvent& event); - void OnCenterViewActualDiagram(wxCommandEvent& event); + void OnCenterViewActualDiagram(wxCommandEvent& event); +// void OnCopyBoxes(wxCommandEvent& event); +// void OnPasteBoxes(wxCommandEvent& event); void OnClickBtnBox(wxCommandEvent& event); void OnClickBtnSelectBoxes(wxCommandEvent& event); void OnClickBtnComplexBox(wxCommandEvent& event); @@ -186,8 +190,9 @@ namespace bbtk // Edit menu events - void OnCopySelectedToComplexDiagram(wxCommandEvent& event); - + void OnCreateComplexDiagramFromSelectedBoxes(wxCommandEvent& event); + void OnCopyBoxes(wxCommandEvent& event); + void OnPasteBoxes(wxCommandEvent& event); // Tool menu events void OnCreatePackage(wxCommandEvent& event); @@ -225,39 +230,27 @@ namespace bbtk std::string getCurrentDiagramMessageLevel(); private: - //AuiManager for the wxWindow wxAuiManager *_frameAUIMgr; - //Class that manages all the tabs in the window wxTabPanelsManager *_tabsMgr; - //Notebook managed by the wxTabPanelsManager wxAuiNotebook *_notebook; - //Instance to the BBTK Package Browser WxGUIPackageBrowser2 *_pkgBrowser; - //Instance to the BBTK Help Browser WxGUIHtmlBrowser *_helpHtmlBrowser; - //Name of the box and its package that is shown in the browser std::string _actualPkgBrowserBoxName; std::string _actualPkgBrowserPkgName; - // VERY IMPORTANT FOR SAVE&LOAD PROCESSES // RaC 2012 2nd HackFest std::string _currentBBGversion; - NodeTreeC tree; wxVtkSceneManager *_sceneM; protected: - - }; - -} -// namespace bbtk +}// namespace bbtk #endif diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.cxx index 8d3ba3b..afa3837 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.cxx @@ -272,7 +272,6 @@ namespace bbtk } //========================================================================= - void wxGEditorTabPanel::centerView() { if(_sceneManager) @@ -282,7 +281,6 @@ namespace bbtk } //========================================================================= - void wxGEditorTabPanel::saveDiagram(std::string &content, const std::string &path) //DFCH { this->SetFullPath(path); @@ -290,7 +288,6 @@ namespace bbtk } //========================================================================= - void wxGEditorTabPanel::saveTempDiagram(const std::string &action) //FCY { std::string content = ""; @@ -309,9 +306,7 @@ namespace bbtk { states.push_back (content); saveStringAction(action); - } - else - { + } else { std::vector::iterator it = _actualdo+1; states.erase(it, states.end()); states.push_back(content); @@ -322,11 +317,9 @@ namespace bbtk } _actualdo = states.end(); _sactualdo = sstates.end(); - } //========================================================================= - void wxGEditorTabPanel::loadDiagram(std::ifstream &inputStream, const std::string &path) //DFCH { this->SetFullPath(path); @@ -412,9 +405,9 @@ printf("EED wxGEditorTabPanel::getUndoState This mecanisme is not working ????? } } _sceneManager->loadDiagram(ss); - } + //========================================================================= void wxGEditorTabPanel::saveStringAction(const std::string &action) { char temp[50]; @@ -423,66 +416,61 @@ printf("EED wxGEditorTabPanel::getUndoState This mecanisme is not working ????? } //========================================================================= - int wxGEditorTabPanel::getPanelId() { return _id; } - - //========================================================================= - bool wxGEditorTabPanel::isComplexBox() { return _sceneManager->isComplexBox(); } //========================================================================= - void wxGEditorTabPanel::setComplexBox(bool val) { _sceneManager->setComplexBox(val); } //========================================================================= - void wxGEditorTabPanel::addComplexInputPort(std::string portName) { _sceneManager->createGComplexBoxInputPort(portName); } //========================================================================= - void wxGEditorTabPanel::addComplexOutputPort(std::string portName) { _sceneManager->createGComplexBoxOutputPort(portName); } //========================================================================= - std::map wxGEditorTabPanel::getSelectedObjects() { return _sceneManager->getSelectedObjects(); } //========================================================================= - void wxGEditorTabPanel::addObjects(std::map objectsMap) { _sceneManager->addObjects(objectsMap); } - //========================================================================= + //========================================================================= + void wxGEditorTabPanel::DuplicateObjects( std::map mapSelectedObj ) + { + _sceneManager->DuplicateObjects( mapSelectedObj ); + _sceneManager->refresh(); + } + //========================================================================= int wxGEditorTabPanel::getNumSelectedObjects() { return _sceneManager->getNumSelectedObjects(); } //========================================================================= - - wxVtkSceneManager* wxGEditorTabPanel::getSceneManager() { return _sceneManager; diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.h b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.h index 372abfa..797692f 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.h +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.h @@ -198,23 +198,25 @@ namespace bbtk void SelectBoxWithPossibleName(std::string nameFilter ); + //EED 2026-09-11 + void DuplicateObjects( std::map mapSelectedObj ); + //========================================================================= private: - std::vector states; // represents each modification of the tab. Maxixum size 100!! - std::vector::iterator _actualdo; // actual position on modifications vector - std::vector sstates; // represents string of each modification of the tab. Maxixum size 100!! - std::vector::iterator _sactualdo; // actual position onstring modifications vector - int _id; - wxAuiManager *_panelAUIMgr; - wxVtkSceneManager *_sceneManager; - wxTabPanelsManager *_panelsManager; - std::string _fullPath; - std::string _fileName; + std::vector states; // represents each modification of the tab. Maxixum size 100!! + std::vector::iterator _actualdo; // actual position on modifications vector + std::vector sstates; // represents string of each modification of the tab. Maxixum size 100!! + std::vector::iterator _sactualdo; // actual position onstring modifications vector + int _id; + wxAuiManager *_panelAUIMgr; + wxVtkSceneManager *_sceneManager; + wxTabPanelsManager *_panelsManager; + std::string _fullPath; + std::string _fileName; protected: - Factory::Pointer _bbtkfactory; + Factory::Pointer _bbtkfactory; }; }// namespace bbtk #endif - diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxTabPanelsManager.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxTabPanelsManager.cxx index 17f6174..f0e1bdf 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxTabPanelsManager.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxTabPanelsManager.cxx @@ -221,25 +221,34 @@ namespace bbtk } //========================================================================= - void wxTabPanelsManager::addActualDiagramComplexOutputPort(std::string portName) { _actual->addComplexOutputPort(portName); } //========================================================================= - - void wxTabPanelsManager::copySelectedBBoxesToComplexDiagram() + void wxTabPanelsManager::createComplexDiagramFromSelectedBoxes() { std::map mapSelected = _actual->getSelectedObjects(); addNewTab(); setActualDiagramComplexBox(true); - _actual->addObjects(mapSelected); - _parent->refreshGUIControls(); + _actual -> addObjects(mapSelected); + _parent -> refreshGUIControls(); } - //========================================================================= + //========================================================================= + void wxTabPanelsManager::copyBoxes() + { + _mapSelectedObjCopyPaste = _actual->getSelectedObjects(); + } + + //========================================================================= + void wxTabPanelsManager::pasteBoxes() + { + _actual -> DuplicateObjects( _mapSelectedObjCopyPaste ); + } + //========================================================================= int wxTabPanelsManager::getNumActualSelectedObjects() { return _actual->getNumSelectedObjects(); diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxTabPanelsManager.h b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxTabPanelsManager.h index f226f95..cf0b404 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxTabPanelsManager.h +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxTabPanelsManager.h @@ -125,7 +125,9 @@ namespace bbtk void setActualDiagramComplexBox(bool val); void addActualDiagramComplexInputPort(std::string portName); void addActualDiagramComplexOutputPort(std::string portName); - void copySelectedBBoxesToComplexDiagram(); + void createComplexDiagramFromSelectedBoxes(); + void copyBoxes(); + void pasteBoxes(); int getNumActualSelectedObjects(); void OnTabChanged(wxAuiNotebookEvent& event); @@ -163,11 +165,13 @@ namespace bbtk private: // Private Attributes - wxGUIEditorGraphicBBS *_parent; - map _panels; - wxGEditorTabPanel *_actual; - wxAuiNotebook *_notebook; - int _lastId; + wxGUIEditorGraphicBBS *_parent; + map _panels; + wxGEditorTabPanel *_actual; + wxAuiNotebook *_notebook; + int _lastId; + // EED 2026-09-11 + std::map _mapSelectedObjCopyPaste; protected: diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx index cf208cb..58e0f4d 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx @@ -1293,7 +1293,7 @@ bool wxVtkSceneManager::OnChar() for(int i=0;i<_selectedObjects.size();i++) { std::cout<<_selectedObjects.at(i)<<" "; - } + } // for i DuplicateObjects(getSelectedObjects()); }else{ std::cout<<"No objects to copy\n"; @@ -2690,35 +2690,42 @@ std::vector wxVtkSceneManager::getBlackBoxes() { //========================================================================= -std::vector wxVtkSceneManager::getComplexInputPorts() { +std::vector wxVtkSceneManager::getComplexInputPorts() +{ std::vector vect; std::map::iterator it; - for (it = _controllers.begin(); it != _controllers.end(); ++it) { + for (it = _controllers.begin(); it != _controllers.end(); ++it) + { GObjectController *cont = it->second; - if (cont->getGObjectType() == GCOMPLEXINPUTPORT) { + if (cont->getGObjectType() == GCOMPLEXINPUTPORT) + { vect.push_back(cont->getId()); - } - } + } // if Type GCOMPLEXINPUTPORT + }// for it return vect; } //========================================================================= -std::vector wxVtkSceneManager::getComplexOutputPorts() { +std::vector wxVtkSceneManager::getComplexOutputPorts() +{ std::vector vect; std::map::iterator it; - for (it = _controllers.begin(); it != _controllers.end(); ++it) { + for (it = _controllers.begin(); it != _controllers.end(); ++it) + { GObjectController *cont = it->second; - if (cont->getGObjectType() == GCOMPLEXOUTPUTPORT) { + if (cont->getGObjectType() == GCOMPLEXOUTPUTPORT) + { vect.push_back(cont->getId()); - } - } + } // if Type GCOMPLEXOUTPUTPORT + } // for it return vect; } //========================================================================= -std::vector wxVtkSceneManager::getConnections() { +std::vector wxVtkSceneManager::getConnections() +{ std::vector vect; std::map::iterator it; for (it = _controllers.begin(); it != _controllers.end(); ++it) { @@ -2732,19 +2739,22 @@ std::vector wxVtkSceneManager::getConnections() { //========================================================================= -bool wxVtkSceneManager::isComplexBox() { +bool wxVtkSceneManager::isComplexBox() +{ return _isComplexBox; } //========================================================================= -void wxVtkSceneManager::setComplexBox(bool val) { +void wxVtkSceneManager::setComplexBox(bool val) +{ _isComplexBox = val; } //========================================================================= -int wxVtkSceneManager::addObjectController(GObjectController* objController) { +int wxVtkSceneManager::addObjectController(GObjectController* objController) +{ //Register the controller of the new object registerController((InteractorStyleMaracas*) objController); //Add the object to the objects list @@ -2758,7 +2768,7 @@ int wxVtkSceneManager::addObjectController(GObjectController* objController) { //========================================================================= -void wxVtkSceneManager::DuplicateObjects(std::map objectsMap) +void wxVtkSceneManager::DuplicateObjects( std::map objectsMap ) { std::map oldIdNewIdBoxes; std::vector connections; @@ -2803,37 +2813,32 @@ void wxVtkSceneManager::DuplicateObjects(std::map objec for (int i = 0; i < (int) connections.size(); i++) { - int objId = connections[i]; - GObjectController *cont = objectsMap[objId]; - GConnectorModel* connectModel = (GConnectorModel*) cont->getModel(); + int objId = connections[i]; + GObjectController *cont = objectsMap[objId]; + GConnectorModel *connectModel = (GConnectorModel*) cont->getModel(); - GPortModel* startPort = connectModel->getStartPort(); - int startPortIndex = startPort->getPosInBox(); - GPortModel* endPort = connectModel->getEndPort(); - int endPortIndex = endPort->getPosInBox(); + GPortModel *startPort = connectModel->getStartPort(); + int startPortIndex = startPort->getPosInBox(); + GPortModel *endPort = connectModel->getEndPort(); + int endPortIndex = endPort->getPosInBox(); - GBlackBoxModel* startPortParentBox = - (GBlackBoxModel*) startPort->getParentBox(); - GBlackBoxModel* endPortParentBox = - (GBlackBoxModel*) endPort->getParentBox(); + GBlackBoxModel *startPortParentBox = (GBlackBoxModel*) startPort->getParentBox(); + GBlackBoxModel *endPortParentBox = (GBlackBoxModel*) endPort->getParentBox(); - int idNewStartBox = oldIdNewIdBoxes[startPortParentBox->getObjectId()]; - int idNewEndBox = oldIdNewIdBoxes[endPortParentBox->getObjectId()]; + int idNewStartBox = oldIdNewIdBoxes[startPortParentBox->getObjectId()]; + int idNewEndBox = oldIdNewIdBoxes[endPortParentBox->getObjectId()]; - GBlackBoxModel* newStartBox = - (GBlackBoxModel*) _controllers[idNewStartBox]->getModel(); - GBlackBoxModel* newEndBox = - (GBlackBoxModel*) _controllers[idNewEndBox]->getModel(); + GBlackBoxModel *newStartBox = (GBlackBoxModel*) _controllers[idNewStartBox]->getModel(); + GBlackBoxModel *newEndBox = (GBlackBoxModel*) _controllers[idNewEndBox]->getModel(); - GPortModel* newStartPort = newStartBox->getOutputPort(startPortIndex); - GPortModel* newEndPort = newEndBox->getInputPort(endPortIndex); + GPortModel *newStartPort = newStartBox->getOutputPort(startPortIndex); + GPortModel *newEndPort = newEndBox->getInputPort(endPortIndex); // Creates connection - int idCon = createGConnector(newStartPort); - GConnectorController *tempp = - (GConnectorController*) _controllers[idCon]; - GConnectorModel *conMod = (GConnectorModel*) tempp->getModel(); - vtkGConnectorView *conView = (vtkGConnectorView*) tempp->getView(); + int idCon = createGConnector(newStartPort); + GConnectorController *tempp = (GConnectorController*) _controllers[idCon]; + GConnectorModel *conMod = (GConnectorModel*) tempp->getModel(); + vtkGConnectorView *conView = (vtkGConnectorView*) tempp->getView(); tempp->endContourCreation(); conMod->setEndPort(newEndPort); conView->updateStartEndPoints(); @@ -2849,14 +2854,13 @@ void wxVtkSceneManager::DuplicateObjects(std::map objec for (int i = 0; i < (int) _selectedObjects.size(); i++) { - int id = _selectedObjects[i]; - GObjectController* cont = _controllers[id]; + int id = _selectedObjects[i]; + GObjectController *cont = _controllers[id]; cont->getView()->setState(SELECTED); cont->getModel()->notifyObservers(_idManager); } // for i } - //========================================================================= int wxVtkSceneManager::getNumSelectedObjects() { @@ -2911,21 +2915,20 @@ void wxVtkSceneManager::addObjects(std::map objectsMap) for (it = objectsMap.begin(); it != objectsMap.end(); ++it) { GObjectController *cont = it->second; int type = cont->getGObjectType(); - if (type == GBLACKBOX) { // Copy black box double xInic, yInic, zInic; GBlackBoxModel* copyBox = (GBlackBoxModel*) cont->getModel(); copyBox->getInicPoint(xInic, yInic, zInic); - int idBox = createGBlackBox(0, 0, copyBox->getBBTKPackage(),copyBox->getBBTKType()); + int idBox = createGBlackBox(0, 0, copyBox->getBBTKPackage(),copyBox->getBBTKType()); - int idcB = copyBox->getObjectId(); - oldIdNewIdBoxes[idcB] = idBox; - cont = _controllers[idBox]; - GBlackBoxModel* newbox = (GBlackBoxModel*) cont->getModel(); + int idcB = copyBox->getObjectId(); + oldIdNewIdBoxes[idcB] = idBox; + cont = _controllers[idBox]; + GBlackBoxModel* newbox = (GBlackBoxModel*) cont->getModel(); newbox->setInicPoint(xInic, yInic, zInic); - int num = newbox->getNumInputPorts(); - for (int j = 0; j < num; j++) + int num = newbox->getNumInputPorts(); + for (int j = 0; j < num; j++) { newbox->setValueToInputPort(j, copyBox->getValueInputPort(j)); }// for j @@ -2934,41 +2937,30 @@ void wxVtkSceneManager::addObjects(std::map objectsMap) int idCon = cont->getId(); connections.push_back(idCon); } - } - for (int i = 0; i < (int) connections.size(); i++) { - int objId = connections[i]; - GObjectController *cont = objectsMap[objId]; - GConnectorModel* connectModel = (GConnectorModel*) cont->getModel(); - - GPortModel* startPort = connectModel->getStartPort(); - int startPortIndex = startPort->getPosInBox(); - GPortModel* endPort = connectModel->getEndPort(); - int endPortIndex = endPort->getPosInBox(); - - GBlackBoxModel* startPortParentBox = - (GBlackBoxModel*) startPort->getParentBox(); - GBlackBoxModel* endPortParentBox = - (GBlackBoxModel*) endPort->getParentBox(); - - int idNewStartBox = oldIdNewIdBoxes[startPortParentBox->getObjectId()]; - int idNewEndBox = oldIdNewIdBoxes[endPortParentBox->getObjectId()]; - - GBlackBoxModel* newStartBox = - (GBlackBoxModel*) _controllers[idNewStartBox]->getModel(); - GBlackBoxModel* newEndBox = - (GBlackBoxModel*) _controllers[idNewEndBox]->getModel(); - - GPortModel* newStartPort = newStartBox->getOutputPort(startPortIndex); - GPortModel* newEndPort = newEndBox->getInputPort(endPortIndex); - + for (int i = 0; i < (int) connections.size(); i++) + { + int objId = connections[i]; + GObjectController *cont = objectsMap[objId]; + GConnectorModel *connectModel = (GConnectorModel*) cont->getModel(); + GPortModel *startPort = connectModel->getStartPort(); + int startPortIndex = startPort->getPosInBox(); + GPortModel *endPort = connectModel->getEndPort(); + int endPortIndex = endPort->getPosInBox(); + GBlackBoxModel *startPortParentBox = (GBlackBoxModel*) startPort->getParentBox(); + GBlackBoxModel *endPortParentBox = (GBlackBoxModel*) endPort->getParentBox(); + int idNewStartBox = oldIdNewIdBoxes[startPortParentBox->getObjectId()]; + int idNewEndBox = oldIdNewIdBoxes[endPortParentBox->getObjectId()]; + GBlackBoxModel *newStartBox = (GBlackBoxModel*) _controllers[idNewStartBox]->getModel(); + GBlackBoxModel *newEndBox = (GBlackBoxModel*) _controllers[idNewEndBox]->getModel(); + GPortModel *newStartPort = newStartBox->getOutputPort(startPortIndex); + GPortModel *newEndPort = newEndBox->getInputPort(endPortIndex); // Creates connection - int idCon = createGConnector(newStartPort); - GConnectorController *tempp = - (GConnectorController*) _controllers[idCon]; - GConnectorModel *conMod = (GConnectorModel*) tempp->getModel(); - vtkGConnectorView *conView = (vtkGConnectorView*) tempp->getView(); + int idCon = createGConnector(newStartPort); + GConnectorController *tempp = (GConnectorController*) _controllers[idCon]; + GConnectorModel *conMod = (GConnectorModel*) tempp->getModel(); + vtkGConnectorView *conView = (vtkGConnectorView*) tempp->getView(); tempp->endContourCreation(); conMod->setEndPort(newEndPort); conView->updateStartEndPoints(); @@ -2976,101 +2968,93 @@ void wxVtkSceneManager::addObjects(std::map objectsMap) std::map::iterator itIds; for (itIds = oldIdNewIdBoxes.begin(); itIds != oldIdNewIdBoxes.end(); ++itIds) { - int idOld = itIds->first; - int idNew = itIds->second; - - GBlackBoxModel* oldBox = - (GBlackBoxModel*) objectsMap[idOld]->getModel(); - GBlackBoxModel* newBox = - (GBlackBoxModel*) _controllers[idNew]->getModel(); - - std::vector oldInputConnections = oldBox->getConnectedInputs(); - std::vector oldOutputConnections = oldBox->getConnectedOutputs(); - std::vector newInputConnections = newBox->getConnectedInputs(); - std::vector newOutputConnections = newBox->getConnectedOutputs(); - - for (int k = 0; k < (int) oldInputConnections.size(); k++) { + int idOld = itIds->first; + int idNew = itIds->second; + GBlackBoxModel *oldBox = (GBlackBoxModel*) objectsMap[idOld]->getModel(); + GBlackBoxModel *newBox = (GBlackBoxModel*) _controllers[idNew]->getModel(); + std::vector oldInputConnections = oldBox->getConnectedInputs(); + std::vector oldOutputConnections = oldBox->getConnectedOutputs(); + std::vector newInputConnections = newBox->getConnectedInputs(); + std::vector newOutputConnections = newBox->getConnectedOutputs(); + + for (int k = 0; k < (int) oldInputConnections.size(); k++) + { bool exist = false; //EED int toCreate=-1; - for (int l = 0; l < (int) newInputConnections.size() && !exist; l++) { - if (oldInputConnections[k] == newInputConnections[l]) { + for (int l = 0; l < (int) newInputConnections.size() && !exist; l++) + { + if (oldInputConnections[k] == newInputConnections[l]) + { exist = true; - } - } + } // if old/new Input Connection + } // for l - if (exist == false) { + if (exist == false) + { //Create complex input - int posInBox = oldInputConnections[k]; - GPortModel* inputPort = oldBox->getInputPort(posInBox); - std::string inputPortName = inputPort->getBBTKName(); - int idInputPort = createGComplexBoxInputPort(inputPortName); - GObjectController *cont = _controllers[idInputPort]; - GBoxModel *cbmod = (GBoxModel*) cont->getModel(); + int posInBox = oldInputConnections[k]; + GPortModel *inputPort = oldBox->getInputPort(posInBox); + std::string inputPortName = inputPort->getBBTKName(); + int idInputPort = createGComplexBoxInputPort(inputPortName); + GObjectController *cont = _controllers[idInputPort]; + GBoxModel *cbmod = (GBoxModel*) cont->getModel(); double xIn, yIn, zIn; inputPort->getInicPoint(xIn, yIn, zIn); yIn += 20; cbmod->setInicPoint(xIn, yIn, zIn); cbmod->notifyObservers(_idManager); - GPortModel* inputPortEnd = newBox->getInputPort(posInBox); + GPortModel *inputPortEnd = newBox->getInputPort(posInBox); // Creates connection - int idCon = createGConnector(cbmod->getOutputPort(0)); - GConnectorController *tempp = - (GConnectorController*) _controllers[idCon]; - GConnectorModel *conMod = (GConnectorModel*) tempp->getModel(); - vtkGConnectorView *conView = - (vtkGConnectorView*) tempp->getView(); + int idCon = createGConnector(cbmod->getOutputPort(0)); + GConnectorController *tempp = (GConnectorController*) _controllers[idCon]; + GConnectorModel *conMod = (GConnectorModel*) tempp->getModel(); + vtkGConnectorView *conView = (vtkGConnectorView*) tempp->getView(); tempp->endContourCreation(); conMod->setEndPort(inputPortEnd); conView->updateStartEndPoints(); + } // if exist + } // for k - } - - } - - for (int k = 0; k < (int) oldOutputConnections.size(); k++) { + for (int k = 0; k < (int) oldOutputConnections.size(); k++) + { bool exist = false; //EED int toCreate=-1; - for (int l = 0; l < (int) newOutputConnections.size() && !exist; l++) { - if (oldOutputConnections[k] == newOutputConnections[l]) { + for (int l = 0; l < (int) newOutputConnections.size() && !exist; l++) + { + if (oldOutputConnections[k] == newOutputConnections[l]) + { exist = true; - } - } - + } // if old/new Output Connections + } // for l if (exist == false) { //Create complex output - int posInBox = oldOutputConnections[k]; - GPortModel* outputPort = oldBox->getOutputPort(posInBox); - std::string outputPortName = outputPort->getBBTKName(); - int idOutputPort = createGComplexBoxOutputPort(outputPortName); - GObjectController *cont = _controllers[idOutputPort]; - GBoxModel *cbmod = (GBoxModel*) cont->getModel(); + int posInBox = oldOutputConnections[k]; + GPortModel *outputPort = oldBox->getOutputPort(posInBox); + std::string outputPortName = outputPort->getBBTKName(); + int idOutputPort = createGComplexBoxOutputPort(outputPortName); + GObjectController *cont = _controllers[idOutputPort]; + GBoxModel *cbmod = (GBoxModel*) cont->getModel(); double xIn, yIn, zIn; outputPort->getInicPoint(xIn, yIn, zIn); yIn -= 20; cbmod->setInicPoint(xIn, yIn, zIn); cbmod->notifyObservers(_idManager); - GPortModel* outputPortEnd = newBox->getOutputPort(posInBox); + GPortModel* outputPortEnd = newBox->getOutputPort(posInBox); // Creates connection - int idCon = createGConnector(outputPortEnd); - GConnectorController *tempp = - (GConnectorController*) _controllers[idCon]; - GConnectorModel *conMod = (GConnectorModel*) tempp->getModel(); - vtkGConnectorView *conView = - (vtkGConnectorView*) tempp->getView(); + int idCon = createGConnector(outputPortEnd); + GConnectorController *tempp = (GConnectorController*) _controllers[idCon]; + GConnectorModel *conMod = (GConnectorModel*) tempp->getModel(); + vtkGConnectorView *conView = (vtkGConnectorView*) tempp->getView(); tempp->endContourCreation(); conMod->setEndPort(cbmod->getInputPort(0)); conView->updateStartEndPoints(); - - } - - } - - } - + } // ifexist + } // for k + } // for itIds } //=========================================================================