From: Eduardo DAVILA Date: Wed, 2 Aug 2023 15:41:36 +0000 (+0200) Subject: #3533 Update Curent contour and actual point ShowNPoints in Undo Redo X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=a7363880f465ae8443aa4e32f39e7300323a9296;p=creaMaracasVisu.git #3533 Update Curent contour and actual point ShowNPoints in Undo Redo --- diff --git a/bbtk/bbs/boxes/FreePlane.bbg b/bbtk/bbs/boxes/FreePlane.bbg index b5bab76..772f3af 100644 --- a/bbtk/bbs/boxes/FreePlane.bbg +++ b/bbtk/bbs/boxes/FreePlane.bbg @@ -10,10 +10,18 @@ AUTHOR:Author ?? COMPLEXBOX:TRUE COMPLEXBOXNAME:FreePlane PACKAGENAME:creaMaracasVisu -COMPLEXOUTPUTS:1 +COMPLEXOUTPUTS:3 COMPLEX_PORT widgetOut --62.292736:-23.904606:-900.000000 +-62.602729:-39.249279:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +actualPoint +-77.515256:-39.520234:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +transform +-86.142372:-39.145142:-900.000000 FIN_COMPLEX_PORT COMPLEXINPUTS:5 COMPLEX_PORT @@ -36,18 +44,18 @@ COMPLEX_PORT wxvtkbaseview3 -88.303489:121.573553:-900.000000 FIN_COMPLEX_PORT -BOXES:19 +BOXES:20 BOX vtk:ImageVtkProperties:Box00 ISEXEC:FALSE --38.467279:72.794940:-900.000000 --15.932279:70.294940:-900.000000 +-32.329410:83.365715:-900.000000 +-9.794410:80.865715:-900.000000 FIN_BOX BOX wx:LayoutLine:Box01 ISEXEC:FALSE --63.373517:-14.619552:-900.000000 --30.053517:-17.119552:-900.000000 +-63.683510:-29.964225:-900.000000 +-30.363510:-32.464225:-900.000000 PORT Orientation:"V" PORT @@ -56,8 +64,8 @@ FIN_BOX BOX creaMaracasVisu:SliceImage:Box02 ISEXEC:FALSE --80.494473:39.228278:-900.000000 --58.769473:36.728278:-900.000000 +-84.927379:60.199332:-900.000000 +-63.202379:57.699332:-900.000000 PORT InterpolationMode:"1" PORT @@ -70,20 +78,20 @@ FIN_BOX BOX creaVtk:TransformVector:Box03 ISEXEC:FALSE --81.471694:78.694065:-900.000000 --59.261694:76.194065:-900.000000 +-82.665169:85.343423:-900.000000 +-60.455169:82.843423:-900.000000 PORT -InX:"1 0 0" +InX:"1 0 0" PORT -InY:"0 1 0" +InY:"0 1 0" PORT -InZ:"0 0 1" +InZ:"0 0 1" FIN_BOX BOX creaMaracasVisu:ImageActor:Box04 ISEXEC:FALSE --74.810398:8.024573:-900.000000 --53.015398:5.524573:-900.000000 +-78.731815:15.867406:-900.000000 +-56.936815:13.367406:-900.000000 PORT InterpolationMode:"1" PORT @@ -92,26 +100,26 @@ FIN_BOX BOX vtk:Transform:Box06 ISEXEC:FALSE --52.487360:57.978654:-900.000000 --30.932360:55.478654:-900.000000 +-52.657856:54.398230:-900.000000 +-31.102856:51.898230:-900.000000 FIN_BOX BOX creaVtk:ConcatTransform:Box07 ISEXEC:FALSE --59.880124:50.051963:-900.000000 --37.600124:47.551963:-900.000000 +-57.032835:42.993414:-900.000000 +-34.752835:40.493414:-900.000000 FIN_BOX BOX std:ConcatStrings:Box08 ISEXEC:FALSE --61.804071:72.216477:-900.000000 --39.044071:69.716477:-900.000000 +-59.468271:72.710916:-900.000000 +-36.708271:70.210916:-900.000000 FIN_BOX BOX std:ConcatStrings:Box09 ISEXEC:FALSE --83.220618:67.537653:-900.000000 --60.460618:65.037653:-900.000000 +-85.948560:72.652544:-900.000000 +-63.188560:70.152544:-900.000000 PORT In2:" " PORT @@ -120,8 +128,8 @@ FIN_BOX BOX creaVtk:ScalarsToColors:Box10 ISEXEC:FALSE --98.732708:19.851377:-900.000000 --76.572708:17.351377:-900.000000 +-115.782345:24.454779:-900.000000 +-93.622345:21.954779:-900.000000 PORT BelowAboveRangeTransparence:"false" PORT @@ -130,14 +138,14 @@ FIN_BOX BOX vtk:vtkImageDataPointerRelay:Box11 ISEXEC:FALSE --37.376549:80.928257:-900.000000 --14.166549:78.428257:-900.000000 +-31.920665:88.941586:-900.000000 +-8.710665:86.441586:-900.000000 FIN_BOX BOX std:MagicBox:Box12 ISEXEC:FALSE --9.582458:51.091206:-900.000000 -12.017542:48.591206:-900.000000 +-3.274092:50.238724:-900.000000 +18.325908:47.738724:-900.000000 FIN_BOX BOX creaMaracasVisu:wxVtkBaseView_Info:Box13 @@ -150,16 +158,16 @@ FIN_BOX BOX wx:CheckBox:Box14 ISEXEC:FALSE --41.816958:17.966024:-900.000000 --20.186958:15.466024:-900.000000 +-54.604186:35.015661:-900.000000 +-32.974186:32.515661:-900.000000 PORT Title:"Pivot plane" FIN_BOX BOX creaMaracasVisu:DrawAxisTree3D:Box15 ISEXEC:FALSE --21.443228:8.210101:-900.000000 -6.596772:5.710101:-900.000000 +-33.889463:16.223430:-900.000000 +-5.849463:13.723430:-900.000000 PORT Colour:"1 0 0 1 1 0 0 0 1" PORT @@ -169,11 +177,11 @@ LineWidth:"2" PORT lstIndexs:"2 2 2" PORT -lstPointX:"0 20 0 0 0 0" +lstPointX:"0 20 0 0 0 0" PORT -lstPointY:"0 0 0 80 0 0" +lstPointY:"0 0 0 160 0 0" PORT -lstPointZ:"0 0 0 0 0 20" +lstPointZ:"0 0 0 0 0 20" FIN_BOX BOX creaMaracasVisu:TransformWidget2:Box16 @@ -186,26 +194,34 @@ FIN_BOX BOX std:MathOperationVector:Box17 ISEXEC:FALSE --48.533350:63.839056:-900.000000 --24.013350:61.339056:-900.000000 +-40.349524:60.429129:-900.000000 +-15.829524:57.929129:-900.000000 PORT Type:"2" FIN_BOX BOX vtk:UpdateRender:Box19 ISEXEC:FALSE --33.296893:-8.492065:-900.000000 --11.271893:-10.992065:-900.000000 +-15.224278:-8.833058:-900.000000 +6.800722:-11.333058:-900.000000 PORT Active:"true" FIN_BOX BOX std:MultipleInputs:Box20 ISEXEC:FALSE --42.283321:-2.005626:-900.000000 --20.313321:-4.505626:-900.000000 +-48.591687:6.860185:-900.000000 +-26.621687:4.360185:-900.000000 +FIN_BOX +BOX +vtk:UpdateRender:Box21 +ISEXEC:FALSE +13.267914:-8.800431:-900.000000 +35.292914:-11.300431:-900.000000 +PORT +Active:"true" FIN_BOX -CONNECTIONS:40 +CONNECTIONS:45 CONNECTION Box02:Out:Box04:In NumberOfControlPoints:0 @@ -326,4 +342,19 @@ NumberOfControlPoints:0 CONNECTION Box14:Out:Box19:Active NumberOfControlPoints:0 +CONNECTION +Box14:BoxChange:Box21:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box12:Out:Box21:Renderer +NumberOfControlPoints:0 +CONNECTION +Box14:BoxChange:Box04:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box16:Out:transform:transform +NumberOfControlPoints:0 +CONNECTION +Box08:Out:actualPoint:actualPoint +NumberOfControlPoints:0 APP_END diff --git a/bbtk/bbs/boxes/FreePlane.bbs b/bbtk/bbs/boxes/FreePlane.bbs index 86d3619..8e8da14 100644 --- a/bbtk/bbs/boxes/FreePlane.bbs +++ b/bbtk/bbs/boxes/FreePlane.bbs @@ -31,9 +31,9 @@ new creaMaracasVisu:SliceImage Box02 set Box02.Z "0" new creaVtk:TransformVector Box03 - set Box03.InX "1 0 0" - set Box03.InY "0 1 0" - set Box03.InZ "0 0 1" + set Box03.InX "1 0 0" + set Box03.InY "0 1 0" + set Box03.InZ "0 0 1" new creaMaracasVisu:ImageActor Box04 set Box04.InterpolationMode "1" @@ -68,9 +68,9 @@ new creaMaracasVisu:DrawAxisTree3D Box15 set Box15.ColourLaw "2" set Box15.LineWidth "2" set Box15.lstIndexs "2 2 2" - set Box15.lstPointX "0 20 0 0 0 0" - set Box15.lstPointY "0 0 0 80 0 0" - set Box15.lstPointZ "0 0 0 0 0 20" + set Box15.lstPointX "0 20 0 0 0 0" + set Box15.lstPointY "0 0 0 160 0 0" + set Box15.lstPointZ "0 0 0 0 0 20" new creaMaracasVisu:TransformWidget2 Box16 set Box16.Type "1" @@ -83,6 +83,9 @@ new vtk:UpdateRender Box19 new std:MultipleInputs Box20 +new vtk:UpdateRender Box21 + set Box21.Active "true" + connect Box02.Out Box04.In connect Box08.Out Box02.AxisOrigin @@ -118,6 +121,9 @@ connect Box15.BoxChange Box20.In2 connect Box20.BoxChange Box19.BoxExecute connect Box14.BoxChange Box20.In4 connect Box14.Out Box19.Active +connect Box14.BoxChange Box21.BoxExecute +connect Box12.Out Box21.Renderer +connect Box14.BoxChange Box04.BoxExecute # Complex input ports input possiblePoint Box16.PossiblePoint " " @@ -128,6 +134,8 @@ input wxvtkbaseview3 Box13.wxVtkBaseView3 " " # Complex output ports output widgetOut Box01.Widget " " +output transform Box16.Out " " +output actualPoint Box08.Out " " endefine diff --git a/bbtk/bbs/boxes/Mesh_Application.bbg b/bbtk/bbs/boxes/Mesh_Application.bbg index 1cdd1ff..e7257b9 100644 --- a/bbtk/bbs/boxes/Mesh_Application.bbg +++ b/bbtk/bbs/boxes/Mesh_Application.bbg @@ -13,11 +13,11 @@ PACKAGENAME:creaMaracasVisu COMPLEXOUTPUTS:2 COMPLEX_PORT WidgetOut --94.131893:-165.134889:-900.000000 +-94.836423:-188.666206:-900.000000 FIN_COMPLEX_PORT COMPLEX_PORT MeshOut --42.369841:-162.975814:-900.000000 +-43.074371:-186.507131:-900.000000 FIN_COMPLEX_PORT COMPLEXINPUTS:11 COMPLEX_PORT @@ -64,7 +64,7 @@ COMPLEX_PORT OutDir_ExMa 334.933146:91.638847:-900.000000 FIN_COMPLEX_PORT -BOXES:88 +BOXES:92 BOX creaMaracasVisu:ImageChangeInformation:Box07 ISEXEC:FALSE @@ -100,8 +100,8 @@ FIN_BOX BOX wx:LayoutSplit:Box11 ISEXEC:FALSE --96.149542:-151.649281:-900.000000 --73.389542:-154.149281:-900.000000 +-96.854072:-175.180598:-900.000000 +-74.094072:-177.680598:-900.000000 PORT Proportion:"20" FIN_BOX @@ -128,14 +128,14 @@ FIN_BOX BOX wx:LayoutTab:Box20 ISEXEC:FALSE --97.190069:-143.295975:-900.000000 --63.870069:-145.795975:-900.000000 +-97.894599:-166.827292:-900.000000 +-64.574599:-169.327292:-900.000000 FIN_BOX BOX wx:LayoutLine:Box22 ISEXEC:FALSE --93.245472:-124.500159:-900.000000 --59.925472:-127.000159:-900.000000 +-98.464877:-148.781741:-900.000000 +-65.144877:-151.281741:-900.000000 PORT Orientation:"V" FIN_BOX @@ -400,8 +400,8 @@ FIN_BOX BOX std:MagicBox:Box63 ISEXEC:FALSE -58.021240:79.902351:-900.000000 -79.621240:77.402351:-900.000000 +59.709154:78.964621:-900.000000 +81.309154:76.464621:-900.000000 FIN_BOX BOX std:MagicBox:Box64 @@ -510,8 +510,8 @@ FIN_BOX BOX wx:CommandButton:Box82 ISEXEC:FALSE -8.420647:-70.684200:-900.000000 -30.695647:-73.184200:-900.000000 +72.561381:-85.500335:-900.000000 +94.836381:-88.000335:-900.000000 PORT Label:"Delete" FIN_BOX @@ -528,24 +528,24 @@ FIN_BOX BOX wx:CommandButton:Box85 ISEXEC:FALSE -33.746725:-86.333842:-900.000000 -56.021725:-88.833842:-900.000000 +19.493228:-85.208566:-900.000000 +41.768228:-87.708566:-900.000000 PORT Label:"Undo" FIN_BOX BOX wx:CommandButton:Box86 ISEXEC:FALSE -58.718958:-88.609672:-900.000000 -80.993958:-91.109672:-900.000000 +46.153376:-84.671206:-900.000000 +68.428376:-87.171206:-900.000000 PORT Label:"Redo" FIN_BOX BOX creaVtk:MeshManager_tool:Box87 ISEXEC:FALSE -29.917129:-100.474845:-900.000000 -52.417129:-102.974845:-900.000000 +16.788909:-94.473373:-900.000000 +39.288909:-96.973373:-900.000000 PORT BoxProcessMode:"Manual" PORT @@ -554,8 +554,8 @@ FIN_BOX BOX creaVtk:MeshManager_tool:Box88 ISEXEC:FALSE -58.862846:-100.406121:-900.000000 -81.362846:-102.906121:-900.000000 +49.110454:-94.779741:-900.000000 +71.610454:-97.279741:-900.000000 PORT BoxProcessMode:"Manual" PORT @@ -590,8 +590,8 @@ FIN_BOX BOX vtk:AppendPolyData:Box94 ISEXEC:FALSE --45.393590:-134.654487:-900.000000 --23.113590:-137.154487:-900.000000 +-46.098120:-158.185804:-900.000000 +-23.818120:-160.685804:-900.000000 FIN_BOX BOX std:MagicBox:Box95 @@ -608,16 +608,18 @@ FIN_BOX BOX wx:LayoutLine:Box97 ISEXEC:FALSE --7.124880:-128.548522:-900.000000 -26.195120:-131.048522:-900.000000 +-10.875800:-123.428516:-900.000000 +22.444200:-125.928516:-900.000000 PORT Orientation:"V" +PORT +WinTitle:"Mesh" FIN_BOX BOX wx:LayoutLine:Box98 ISEXEC:FALSE --89.210191:-133.998503:-900.000000 --55.890191:-136.498503:-900.000000 +-89.914721:-157.529820:-900.000000 +-56.594721:-160.029820:-900.000000 PORT Orientation:"H" PORT @@ -626,8 +628,10 @@ FIN_BOX BOX wx:LayoutLine:Box99 ISEXEC:FALSE --306.243673:-95.958722:-900.000000 --272.923673:-98.458722:-900.000000 +-269.707835:-93.008623:-900.000000 +-236.387835:-95.508623:-900.000000 +PORT +WinTitle:"Plane Cursor" FIN_BOX BOX wx:ComboBox:Box100 @@ -740,8 +744,8 @@ FIN_BOX BOX wx:LayoutLine:Box115 ISEXEC:FALSE -31.857190:-110.620145:-900.000000 -65.177190:-113.120145:-900.000000 +35.608110:-109.494869:-900.000000 +68.928110:-111.994869:-900.000000 PORT Orientation:"H" FIN_BOX @@ -756,10 +760,42 @@ FIN_BOX BOX creaMaracasVisu:FreePlane:Box117 ISEXEC:FALSE -93.494064:-6.191633:-900.000000 -115.189064:-8.691633:-900.000000 +56.462546:15.002506:-900.000000 +78.157546:12.502506:-900.000000 +FIN_BOX +BOX +wx:LayoutTab:Box118 +ISEXEC:FALSE +-20.425667:-137.883493:-900.000000 +12.894333:-140.383493:-900.000000 +FIN_BOX +BOX +wx:LayoutLine:Box119 +ISEXEC:FALSE +31.186709:-123.851967:-900.000000 +64.506709:-126.351967:-900.000000 +PORT +Orientation:"V" +PORT +WinTitle:"conf" FIN_BOX -CONNECTIONS:236 +BOX +wx:LayoutTab:Box120 +ISEXEC:FALSE +-95.895242:-140.334310:-900.000000 +-62.575242:-142.834310:-900.000000 +FIN_BOX +BOX +wx:LayoutLine:Box121 +ISEXEC:FALSE +79.152135:-20.239180:-900.000000 +112.472135:-22.739180:-900.000000 +PORT +Orientation:"V" +PORT +WinTitle:"Free plane" +FIN_BOX +CONNECTIONS:242 CONNECTION Box08:MeshBase:Box15:polydata NumberOfControlPoints:0 @@ -1289,15 +1325,9 @@ CONNECTION Box96:Out:Box73:OutDir NumberOfControlPoints:0 CONNECTION -Box97:Widget:Box98:Widget3 -NumberOfControlPoints:0 -CONNECTION Box98:Widget:Box20:Widget1 NumberOfControlPoints:0 CONNECTION -Box82:Widget:Box97:Widget5 -NumberOfControlPoints:0 -CONNECTION Box22:Widget:Box98:Widget5 NumberOfControlPoints:0 CONNECTION @@ -1406,12 +1436,6 @@ CONNECTION Box110:Out:Box105:Active NumberOfControlPoints:0 CONNECTION -Box100:Widget:Box22:Widget2 -NumberOfControlPoints:0 -CONNECTION -Box99:Widget:Box22:Widget3 -NumberOfControlPoints:0 -CONNECTION Box17:_widgetB:Box113:Widget2 NumberOfControlPoints:0 CONNECTION @@ -1451,9 +1475,6 @@ CONNECTION Box92:Widget:Box116:Widget6 NumberOfControlPoints:0 CONNECTION -Box117:widgetOut:Box22:Widget5 -NumberOfControlPoints:0 -CONNECTION Box64:Out:Box117:possiblePoint NumberOfControlPoints:0 CONNECTION @@ -1468,4 +1489,37 @@ NumberOfControlPoints:0 CONNECTION Box69:Out:Box117:wxvtkbaseview3 NumberOfControlPoints:0 +CONNECTION +Box97:Widget:Box118:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box118:Widget:Box98:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box119:Widget:Box118:Widget3 +NumberOfControlPoints:0 +CONNECTION +Box100:Widget:Box119:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box120:Widget:Box22:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box121:Widget:Box120:Widget4 +NumberOfControlPoints:0 +CONNECTION +Box117:widgetOut:Box121:Widget3 +NumberOfControlPoints:0 +CONNECTION +Box99:Widget:Box120:Widget6 +NumberOfControlPoints:0 +CONNECTION +Box82:Widget:Box115:Widget6 +NumberOfControlPoints:0 +CONNECTION +Box117:transform:Box10:freeplane_transform +NumberOfControlPoints:0 +CONNECTION +Box117:actualPoint:Box10:freeplane_point +NumberOfControlPoints:0 APP_END diff --git a/bbtk/bbs/boxes/Mesh_Application.bbs b/bbtk/bbs/boxes/Mesh_Application.bbs index aa9f371..250fd52 100644 --- a/bbtk/bbs/boxes/Mesh_Application.bbs +++ b/bbtk/bbs/boxes/Mesh_Application.bbs @@ -222,12 +222,14 @@ new std:MagicBox Box96 new wx:LayoutLine Box97 set Box97.Orientation "V" + set Box97.WinTitle "Mesh" new wx:LayoutLine Box98 set Box98.Orientation "H" set Box98.WinTitle "Final Surface (Red)" new wx:LayoutLine Box99 + set Box99.WinTitle "Plane Cursor" new wx:ComboBox Box100 set Box100.In "Red JET B&W" @@ -277,6 +279,18 @@ new wx:LayoutLine Box116 new creaMaracasVisu:FreePlane Box117 +new wx:LayoutTab Box118 + +new wx:LayoutLine Box119 + set Box119.Orientation "V" + set Box119.WinTitle "conf" + +new wx:LayoutTab Box120 + +new wx:LayoutLine Box121 + set Box121.Orientation "V" + set Box121.WinTitle "Free plane" + connect Box08.MeshBase Box15.polydata connect Box08.MeshTemp Box10.mesh @@ -441,9 +455,7 @@ connect Box08.AllPolyDatas Box94.InVector connect Box08.MeshSelection Box79.Selection connect Box95.Out Box73.BaseImageFileName connect Box96.Out Box73.OutDir -connect Box97.Widget Box98.Widget3 connect Box98.Widget Box20.Widget1 -connect Box82.Widget Box97.Widget5 connect Box22.Widget Box98.Widget5 connect Box54.Widget Box99.Widget2 connect Box53.Widget Box99.Widget4 @@ -480,8 +492,6 @@ connect Box39.Out Box111.In1 connect Box108.Out Box111.In2 connect Box111.Out Box40.Active connect Box110.Out Box105.Active -connect Box100.Widget Box22.Widget2 -connect Box99.Widget Box22.Widget3 connect Box17._widgetB Box113.Widget2 connect Box15.widgetB Box113.Widget4 connect Box17._widgetA Box112.Widget2 @@ -495,12 +505,22 @@ connect Box79.Widget Box116.Widget4 connect Box116.Widget Box97.Widget2 connect Box115.Widget Box97.Widget4 connect Box92.Widget Box116.Widget6 -connect Box117.widgetOut Box22.Widget5 connect Box64.Out Box117.possiblePoint connect Box65.Out Box117.render connect Box67.Out Box117.wxvtkbaseview1 connect Box68.Out Box117.wxvtkbaseview2 connect Box69.Out Box117.wxvtkbaseview3 +connect Box97.Widget Box118.Widget1 +connect Box118.Widget Box98.Widget2 +connect Box119.Widget Box118.Widget3 +connect Box100.Widget Box119.Widget1 +connect Box120.Widget Box22.Widget2 +connect Box121.Widget Box120.Widget4 +connect Box117.widgetOut Box121.Widget3 +connect Box99.Widget Box120.Widget6 +connect Box82.Widget Box115.Widget6 +connect Box117.transform Box10.freeplane_transform +connect Box117.actualPoint Box10.freeplane_point # Complex input ports input MeshIn Box56.In " " diff --git a/bbtk/bbs/boxes/Mesh_tool_ApplyCut.bbg b/bbtk/bbs/boxes/Mesh_tool_ApplyCut.bbg index bb6f6ee..e600651 100644 --- a/bbtk/bbs/boxes/Mesh_tool_ApplyCut.bbg +++ b/bbtk/bbs/boxes/Mesh_tool_ApplyCut.bbg @@ -72,7 +72,7 @@ COMPLEX_PORT meshmanagermodel -150.374274:130.740991:-900.000000 FIN_COMPLEX_PORT -BOXES:147 +BOXES:148 BOX creaMaracasVisu:ShowNPoints:showNpoints ISEXEC:FALSE @@ -140,8 +140,8 @@ FIN_BOX BOX creaMaracasVisu:ManualContourModel_Box:Box29 ISEXEC:FALSE -75.865053:27.949535:-900.000000 -100.385053:25.449535:-900.000000 +59.667734:12.704999:-900.000000 +84.187734:10.204999:-900.000000 PORT NbPoints:"40" PORT @@ -196,8 +196,8 @@ FIN_BOX BOX std:VectorFilterDouble:Box70 ISEXEC:FALSE -49.425284:47.197247:-900.000000 -75.705284:44.697247:-900.000000 +38.732936:52.596353:-900.000000 +65.012936:50.096353:-900.000000 PORT Type:"11" FIN_BOX @@ -1319,7 +1319,15 @@ Params:"0" PORT Type:"250" FIN_BOX -CONNECTIONS:256 +BOX +std:VectorFilterDouble:Box239 +ISEXEC:FALSE +67.977472:28.319012:-900.000000 +94.257472:25.819012:-900.000000 +PORT +Type:"14" +FIN_BOX +CONNECTIONS:261 CONNECTION Box06:LstContourPointsX:Box04:LstX NumberOfControlPoints:0 @@ -1339,9 +1347,6 @@ CONNECTION Box30:BoxChange:Box31:In4 NumberOfControlPoints:0 CONNECTION -showNpoints:lstIndexs:Box29:LstIndexsIn -NumberOfControlPoints:0 -CONNECTION Box29:LstContourPointsX:Box30:lstPointX NumberOfControlPoints:0 CONNECTION @@ -1384,15 +1389,6 @@ CONNECTION Box70:Out2:Box06:LstControlPointsZ NumberOfControlPoints:0 CONNECTION -Box70:Out0:Box29:LstControlPointsX -NumberOfControlPoints:0 -CONNECTION -Box70:Out1:Box29:LstControlPointsY -NumberOfControlPoints:0 -CONNECTION -Box70:Out2:Box29:LstControlPointsZ -NumberOfControlPoints:0 -CONNECTION Box78:Out:Box77:Operation NumberOfControlPoints:0 CONNECTION @@ -2089,4 +2085,31 @@ NumberOfControlPoints:0 CONNECTION Box185:Out:Box29:OpenClose NumberOfControlPoints:0 +CONNECTION +Box70:Out0:Box239:In0 +NumberOfControlPoints:0 +CONNECTION +Box70:Out1:Box239:In1 +NumberOfControlPoints:0 +CONNECTION +Box70:Out2:Box239:In2 +NumberOfControlPoints:0 +CONNECTION +Box239:Out0:Box29:LstControlPointsX +NumberOfControlPoints:0 +CONNECTION +Box239:Out1:Box29:LstControlPointsY +NumberOfControlPoints:0 +CONNECTION +Box239:Out2:Box29:LstControlPointsZ +NumberOfControlPoints:0 +CONNECTION +Box239:Out3:Box29:LstIndexsIn +NumberOfControlPoints:0 +CONNECTION +showNpoints:lstIndexs:Box239:In3 +NumberOfControlPoints:0 +CONNECTION +showNpoints:lstSelectedIndexs:Box239:k1 +NumberOfControlPoints:0 APP_END diff --git a/bbtk/bbs/boxes/Mesh_tool_ApplyCut.bbs b/bbtk/bbs/boxes/Mesh_tool_ApplyCut.bbs index 85c342f..5c879fe 100644 --- a/bbtk/bbs/boxes/Mesh_tool_ApplyCut.bbs +++ b/bbtk/bbs/boxes/Mesh_tool_ApplyCut.bbs @@ -494,6 +494,9 @@ new creaMaracasVisu:ShowNPoints_Tools Box238 set Box238.Params "0" set Box238.Type "250" +new std:VectorFilterDouble Box239 + set Box239.Type "14" + connect Box06.LstContourPointsX Box04.LstX connect showNpoints.lstIndexs Box06.LstIndexsIn @@ -501,7 +504,6 @@ connect Box06.LstContourPointsY Box04.LstY connect Box06.LstContourPointsZ Box04.LstZ connect Box06.LstIndexsOut Box04.LstIndexs connect Box30.BoxChange Box31.In4 -connect showNpoints.lstIndexs Box29.LstIndexsIn connect Box29.LstContourPointsX Box30.lstPointX connect Box29.LstContourPointsY Box30.lstPointY connect Box29.LstContourPointsZ Box30.lstPointZ @@ -516,9 +518,6 @@ connect showNpoints.lstPointsZ Box70.In2 connect Box70.Out0 Box06.LstControlPointsX connect Box70.Out1 Box06.LstControlPointsY connect Box70.Out2 Box06.LstControlPointsZ -connect Box70.Out0 Box29.LstControlPointsX -connect Box70.Out1 Box29.LstControlPointsY -connect Box70.Out2 Box29.LstControlPointsZ connect Box78.Out Box77.Operation connect Box66.Out Box11.Renderer connect Box66.Out Box30.Renderer @@ -736,6 +735,15 @@ connect Box04.BoxChange Box238.BoxExecute connect showNpoints.WidgetShowNPoints Box238.WidgetShowNPoints connect Box68.Spacing Box238.Spacing connect Box185.Out Box29.OpenClose +connect Box70.Out0 Box239.In0 +connect Box70.Out1 Box239.In1 +connect Box70.Out2 Box239.In2 +connect Box239.Out0 Box29.LstControlPointsX +connect Box239.Out1 Box29.LstControlPointsY +connect Box239.Out2 Box29.LstControlPointsZ +connect Box239.Out3 Box29.LstIndexsIn +connect showNpoints.lstIndexs Box239.In3 +connect showNpoints.lstSelectedIndexs Box239.k1 # Complex input ports input point showNpoints.In " " diff --git a/bbtk/bbs/boxes/Mesh_tool_ApplyPatch.bbg b/bbtk/bbs/boxes/Mesh_tool_ApplyPatch.bbg index 3d758f7..ae8feda 100644 --- a/bbtk/bbs/boxes/Mesh_tool_ApplyPatch.bbg +++ b/bbtk/bbs/boxes/Mesh_tool_ApplyPatch.bbg @@ -72,7 +72,7 @@ COMPLEX_PORT meshmanagermodel -150.374274:130.740991:-900.000000 FIN_COMPLEX_PORT -BOXES:92 +BOXES:93 BOX creaMaracasVisu:ShowNPoints:showNpoints ISEXEC:FALSE @@ -827,7 +827,15 @@ Params:"0" PORT Type:"250" FIN_BOX -CONNECTIONS:177 +BOX +std:VectorFilterDouble:Box150 +ISEXEC:FALSE +79.990672:41.410563:-900.000000 +106.270672:38.910563:-900.000000 +PORT +Type:"14" +FIN_BOX +CONNECTIONS:182 CONNECTION Box06:LstContourPointsX:Box04:LstX NumberOfControlPoints:0 @@ -847,9 +855,6 @@ CONNECTION Box30:BoxChange:Box31:In4 NumberOfControlPoints:0 CONNECTION -showNpoints:lstIndexs:Box29:LstIndexsIn -NumberOfControlPoints:0 -CONNECTION Box29:LstContourPointsX:Box30:lstPointX NumberOfControlPoints:0 CONNECTION @@ -892,15 +897,6 @@ CONNECTION Box70:Out2:Box06:LstControlPointsZ NumberOfControlPoints:0 CONNECTION -Box70:Out0:Box29:LstControlPointsX -NumberOfControlPoints:0 -CONNECTION -Box70:Out1:Box29:LstControlPointsY -NumberOfControlPoints:0 -CONNECTION -Box70:Out2:Box29:LstControlPointsZ -NumberOfControlPoints:0 -CONNECTION Box78:Out:Box77:Operation NumberOfControlPoints:0 CONNECTION @@ -1359,4 +1355,31 @@ NumberOfControlPoints:0 CONNECTION Box04:BoxChange:Box149:BoxExecute NumberOfControlPoints:0 +CONNECTION +Box70:Out0:Box150:In0 +NumberOfControlPoints:0 +CONNECTION +Box70:Out1:Box150:In1 +NumberOfControlPoints:0 +CONNECTION +Box70:Out2:Box150:In2 +NumberOfControlPoints:0 +CONNECTION +Box150:Out0:Box29:LstControlPointsX +NumberOfControlPoints:0 +CONNECTION +Box150:Out1:Box29:LstControlPointsY +NumberOfControlPoints:0 +CONNECTION +Box150:Out2:Box29:LstControlPointsZ +NumberOfControlPoints:0 +CONNECTION +Box150:Out3:Box29:LstIndexsIn +NumberOfControlPoints:0 +CONNECTION +showNpoints:lstSelectedIndexs:Box150:k1 +NumberOfControlPoints:0 +CONNECTION +showNpoints:lstIndexs:Box150:In3 +NumberOfControlPoints:0 APP_END diff --git a/bbtk/bbs/boxes/Mesh_tool_ApplyPatch.bbs b/bbtk/bbs/boxes/Mesh_tool_ApplyPatch.bbs index 530d9a1..e6826e0 100644 --- a/bbtk/bbs/boxes/Mesh_tool_ApplyPatch.bbs +++ b/bbtk/bbs/boxes/Mesh_tool_ApplyPatch.bbs @@ -303,6 +303,9 @@ new creaMaracasVisu:ShowNPoints_Tools Box149 set Box149.Params "0" set Box149.Type "250" +new std:VectorFilterDouble Box150 + set Box150.Type "14" + connect Box06.LstContourPointsX Box04.LstX connect showNpoints.lstIndexs Box06.LstIndexsIn @@ -310,7 +313,6 @@ connect Box06.LstContourPointsY Box04.LstY connect Box06.LstContourPointsZ Box04.LstZ connect Box06.LstIndexsOut Box04.LstIndexs connect Box30.BoxChange Box31.In4 -connect showNpoints.lstIndexs Box29.LstIndexsIn connect Box29.LstContourPointsX Box30.lstPointX connect Box29.LstContourPointsY Box30.lstPointY connect Box29.LstContourPointsZ Box30.lstPointZ @@ -325,9 +327,6 @@ connect showNpoints.lstPointsZ Box70.In2 connect Box70.Out0 Box06.LstControlPointsX connect Box70.Out1 Box06.LstControlPointsY connect Box70.Out2 Box06.LstControlPointsZ -connect Box70.Out0 Box29.LstControlPointsX -connect Box70.Out1 Box29.LstControlPointsY -connect Box70.Out2 Box29.LstControlPointsZ connect Box78.Out Box77.Operation connect Box66.Out Box11.Renderer connect Box66.Out Box30.Renderer @@ -466,6 +465,15 @@ connect Box95.Out Box149.Mesh connect showNpoints.WidgetShowNPoints Box149.WidgetShowNPoints connect Box68.Spacing Box149.Spacing connect Box04.BoxChange Box149.BoxExecute +connect Box70.Out0 Box150.In0 +connect Box70.Out1 Box150.In1 +connect Box70.Out2 Box150.In2 +connect Box150.Out0 Box29.LstControlPointsX +connect Box150.Out1 Box29.LstControlPointsY +connect Box150.Out2 Box29.LstControlPointsZ +connect Box150.Out3 Box29.LstIndexsIn +connect showNpoints.lstSelectedIndexs Box150.k1 +connect showNpoints.lstIndexs Box150.In3 # Complex input ports input point showNpoints.In " " diff --git a/bbtk/bbs/boxes/Mesh_tool_ApplyPatchSimple.bbg b/bbtk/bbs/boxes/Mesh_tool_ApplyPatchSimple.bbg index 8cdf798..ad5f7e6 100644 --- a/bbtk/bbs/boxes/Mesh_tool_ApplyPatchSimple.bbg +++ b/bbtk/bbs/boxes/Mesh_tool_ApplyPatchSimple.bbg @@ -72,7 +72,7 @@ COMPLEX_PORT meshmanagermodel -150.374274:130.740991:-900.000000 FIN_COMPLEX_PORT -BOXES:85 +BOXES:86 BOX creaMaracasVisu:ShowNPoints:showNpoints ISEXEC:FALSE @@ -757,7 +757,15 @@ ISEXEC:FALSE 64.038173:-10.778224:-900.000000 86.443173:-13.278224:-900.000000 FIN_BOX -CONNECTIONS:174 +BOX +std:VectorFilterDouble:Box160 +ISEXEC:FALSE +74.629682:44.724702:-900.000000 +100.909682:42.224702:-900.000000 +PORT +Type:"14" +FIN_BOX +CONNECTIONS:179 CONNECTION Box06:LstContourPointsX:Box04:LstX NumberOfControlPoints:0 @@ -777,9 +785,6 @@ CONNECTION Box30:BoxChange:Box31:In4 NumberOfControlPoints:0 CONNECTION -showNpoints:lstIndexs:Box29:LstIndexsIn -NumberOfControlPoints:0 -CONNECTION Box29:LstContourPointsX:Box30:lstPointX NumberOfControlPoints:0 CONNECTION @@ -822,15 +827,6 @@ CONNECTION Box70:Out2:Box06:LstControlPointsZ NumberOfControlPoints:0 CONNECTION -Box70:Out0:Box29:LstControlPointsX -NumberOfControlPoints:0 -CONNECTION -Box70:Out1:Box29:LstControlPointsY -NumberOfControlPoints:0 -CONNECTION -Box70:Out2:Box29:LstControlPointsZ -NumberOfControlPoints:0 -CONNECTION Box08:Widget:widget:widget NumberOfControlPoints:0 CONNECTION @@ -1280,4 +1276,31 @@ NumberOfControlPoints:0 CONNECTION Box143:Out:Box157:In NumberOfControlPoints:0 +CONNECTION +showNpoints:lstSelectedIndexs:Box160:k1 +NumberOfControlPoints:0 +CONNECTION +Box70:Out0:Box160:In0 +NumberOfControlPoints:0 +CONNECTION +Box70:Out1:Box160:In1 +NumberOfControlPoints:0 +CONNECTION +Box70:Out2:Box160:In2 +NumberOfControlPoints:0 +CONNECTION +Box160:Out0:Box29:LstControlPointsX +NumberOfControlPoints:0 +CONNECTION +Box160:Out1:Box29:LstControlPointsY +NumberOfControlPoints:0 +CONNECTION +Box160:Out2:Box29:LstControlPointsZ +NumberOfControlPoints:0 +CONNECTION +Box160:Out3:Box29:LstIndexsIn +NumberOfControlPoints:0 +CONNECTION +showNpoints:lstIndexs:Box160:In3 +NumberOfControlPoints:0 APP_END diff --git a/bbtk/bbs/boxes/Mesh_tool_ApplyPatchSimple.bbs b/bbtk/bbs/boxes/Mesh_tool_ApplyPatchSimple.bbs index 62cf766..7ec4e32 100644 --- a/bbtk/bbs/boxes/Mesh_tool_ApplyPatchSimple.bbs +++ b/bbtk/bbs/boxes/Mesh_tool_ApplyPatchSimple.bbs @@ -275,6 +275,9 @@ new creaMaracasVisu:ShowNPoints_Tools Box158 new creaVtk:PolyDataNormals Box159 +new std:VectorFilterDouble Box160 + set Box160.Type "14" + connect Box06.LstContourPointsX Box04.LstX connect showNpoints.lstIndexs Box06.LstIndexsIn @@ -282,7 +285,6 @@ connect Box06.LstContourPointsY Box04.LstY connect Box06.LstContourPointsZ Box04.LstZ connect Box06.LstIndexsOut Box04.LstIndexs connect Box30.BoxChange Box31.In4 -connect showNpoints.lstIndexs Box29.LstIndexsIn connect Box29.LstContourPointsX Box30.lstPointX connect Box29.LstContourPointsY Box30.lstPointY connect Box29.LstContourPointsZ Box30.lstPointZ @@ -297,9 +299,6 @@ connect showNpoints.lstPointsZ Box70.In2 connect Box70.Out0 Box06.LstControlPointsX connect Box70.Out1 Box06.LstControlPointsY connect Box70.Out2 Box06.LstControlPointsZ -connect Box70.Out0 Box29.LstControlPointsX -connect Box70.Out1 Box29.LstControlPointsY -connect Box70.Out2 Box29.LstControlPointsZ connect Box66.Out Box11.Renderer connect Box66.Out Box30.Renderer connect Box66.Out showNpoints.Renderer @@ -435,6 +434,15 @@ connect Box68.Spacing Box158.Spacing connect Box04.Out Box159.In connect Box159.Out Box158.Mesh connect Box143.Out Box157.In +connect showNpoints.lstSelectedIndexs Box160.k1 +connect Box70.Out0 Box160.In0 +connect Box70.Out1 Box160.In1 +connect Box70.Out2 Box160.In2 +connect Box160.Out0 Box29.LstControlPointsX +connect Box160.Out1 Box29.LstControlPointsY +connect Box160.Out2 Box29.LstControlPointsZ +connect Box160.Out3 Box29.LstIndexsIn +connect showNpoints.lstIndexs Box160.In3 # Complex input ports input point showNpoints.In " " diff --git a/bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbg b/bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbg index aa29dc3..b7b403b 100644 --- a/bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbg +++ b/bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbg @@ -1,6 +1,6 @@ # ---------------------------------- # - BBTKGEditor v 1.5 BBG BlackBox Diagram file -# - /home/garzon/Creatis/C23/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbg +# - /Users/davila/Creatis/C23/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbg # ---------------------------------- APP_START @@ -31,7 +31,7 @@ COMPLEX_PORT interactorStyleMaracas4 -285.985042:-186.124821:-900.000000 FIN_COMPLEX_PORT -COMPLEXINPUTS:10 +COMPLEXINPUTS:12 COMPLEX_PORT boxChange -6.086529:137.355528:-900.000000 @@ -72,7 +72,15 @@ COMPLEX_PORT meshmanagermodel -150.374274:130.740991:-900.000000 FIN_COMPLEX_PORT -BOXES:88 +COMPLEX_PORT +freeplane_transform +-362.961747:124.482960:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +freeplane_point +-349.159524:124.829268:-900.000000 +FIN_COMPLEX_PORT +BOXES:92 BOX creaMaracasVisu:ShowNPoints:showNpoints ISEXEC:FALSE @@ -132,8 +140,8 @@ FIN_BOX BOX creaMaracasVisu:ManualContourModel_Box:Box29 ISEXEC:FALSE -52.918677:14.139324:-900.000000 -77.438677:11.639324:-900.000000 +73.068248:11.504380:-900.000000 +97.588248:9.004380:-900.000000 PORT NbPoints:"40" FIN_BOX @@ -174,10 +182,8 @@ FIN_BOX BOX creaMaracasVisu:ShowNPoints_Tools:Box60 ISEXEC:FALSE --271.434991:53.686536:-900.000000 --248.999991:51.186536:-900.000000 -PORT -Params:"156 276 97 0 0 1" +-347.228377:43.301757:-900.000000 +-324.793377:40.801757:-900.000000 FIN_BOX BOX vtk:ImageVtkProperties:Box68 @@ -522,8 +528,8 @@ FIN_BOX BOX std:VectorFilterString:Box100 ISEXEC:FALSE --265.790737:67.872984:-900.000000 --237.750737:65.372984:-900.000000 +-331.974328:66.943004:-900.000000 +-303.934328:64.443004:-900.000000 PORT In0:"0 1 2 3 4 5 6 7 8 9 10 11 12 13" PORT @@ -534,8 +540,8 @@ FIN_BOX BOX std:ConcatStrings:Box101 ISEXEC:FALSE --265.899318:61.380437:-900.000000 --243.139318:58.880437:-900.000000 +-332.082909:60.450457:-900.000000 +-309.322909:57.950457:-900.000000 FIN_BOX BOX wx:CheckBox:Box103 @@ -784,12 +790,48 @@ FIN_BOX BOX std:VectorFilterDouble:Box140 ISEXEC:FALSE -91.473998:30.841320:-900.000000 -117.753998:28.341320:-900.000000 +87.289087:26.966402:-900.000000 +113.569087:24.466402:-900.000000 PORT Type:"14" FIN_BOX -CONNECTIONS:177 +BOX +std:MagicBox:Box141 +ISEXEC:FALSE +-379.690365:113.117077:-900.000000 +-357.980365:110.617077:-900.000000 +FIN_BOX +BOX +std:MagicBox:Box142 +ISEXEC:FALSE +-353.346525:113.061609:-900.000000 +-331.636525:110.561609:-900.000000 +FIN_BOX +BOX +std:ConcatStrings:Box143 +ISEXEC:FALSE +-388.450292:99.312418:-900.000000 +-365.690292:96.812418:-900.000000 +PORT +In2:" " +PORT +In4:" " +PORT +In6:" " +FIN_BOX +BOX +creaVtk:TransformVector:Box144 +ISEXEC:FALSE +-388.799646:107.580462:-900.000000 +-366.479646:105.080462:-900.000000 +PORT +InX:"0" +PORT +InY:"1" +PORT +InZ:"0" +FIN_BOX +CONNECTIONS:185 CONNECTION Box06:LstContourPointsX:Box04:LstX NumberOfControlPoints:0 @@ -1321,4 +1363,28 @@ NumberOfControlPoints:0 CONNECTION Box140:Out3:Box29:LstIndexsIn NumberOfControlPoints:0 +CONNECTION +freeplane_transform:freeplane_transform:Box141:In +NumberOfControlPoints:0 +CONNECTION +freeplane_point:freeplane_point:Box142:In +NumberOfControlPoints:0 +CONNECTION +Box142:Out:Box143:In1 +NumberOfControlPoints:0 +CONNECTION +Box141:Out:Box144:Transform +NumberOfControlPoints:0 +CONNECTION +Box144:OutX:Box143:In3 +NumberOfControlPoints:0 +CONNECTION +Box144:OutY:Box143:In5 +NumberOfControlPoints:0 +CONNECTION +Box144:OutZ:Box143:In7 +NumberOfControlPoints:0 +CONNECTION +Box143:Out:Box60:Params +NumberOfControlPoints:0 APP_END diff --git a/bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbs b/bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbs index 90eaffd..ce86fea 100644 --- a/bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbs +++ b/bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbs @@ -1,6 +1,6 @@ # ---------------------------------- # - BBTKGEditor v 1.5 BBS BlackBox Script (Complex Box) -# - /home/garzon/Creatis/C23/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbs +# - /Users/davila/Creatis/C23/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbs # ---------------------------------- include std @@ -58,7 +58,6 @@ new std:AddStringToVector Box58 set Box58.In9 "Tool - Create Volume Surface from 3 or 4 points (use Close Spline 2 - Close Surface Off)" new creaMaracasVisu:ShowNPoints_Tools Box60 - set Box60.Params "156 276 97 0 0 1" new vtk:ImageVtkProperties Box68 @@ -288,6 +287,20 @@ new wx:OutputText Box139 new std:VectorFilterDouble Box140 set Box140.Type "14" +new std:MagicBox Box141 + +new std:MagicBox Box142 + +new std:ConcatStrings Box143 + set Box143.In2 " " + set Box143.In4 " " + set Box143.In6 " " + +new creaVtk:TransformVector Box144 + set Box144.InX "0" + set Box144.InY "1" + set Box144.InZ "0" + connect Box06.LstContourPointsX Box04.LstX connect showNpoints.lstIndexs Box06.LstIndexsIn @@ -451,6 +464,12 @@ connect Box140.Out0 Box29.LstControlPointsX connect Box140.Out1 Box29.LstControlPointsY connect Box140.Out2 Box29.LstControlPointsZ connect Box140.Out3 Box29.LstIndexsIn +connect Box142.Out Box143.In1 +connect Box141.Out Box144.Transform +connect Box144.OutX Box143.In3 +connect Box144.OutY Box143.In5 +connect Box144.OutZ Box143.In7 +connect Box143.Out Box60.Params # Complex input ports input point showNpoints.In " " @@ -463,6 +482,8 @@ input wxvtkbaseview2 Box64.In " " input wxvtkbaseview3 Box65.In " " input wxvtkbaseview4 Box69.In " " input wxvtkbaseview1 Box71.In " " +input freeplane_transform Box141.In " " +input freeplane_point Box142.In " " # Complex output ports output widget Box08.Widget " " diff --git a/bbtk/src/bbcreaMaracasVisuTransformWidget2.cxx b/bbtk/src/bbcreaMaracasVisuTransformWidget2.cxx index aed6670..b632bc5 100644 --- a/bbtk/src/bbcreaMaracasVisuTransformWidget2.cxx +++ b/bbtk/src/bbcreaMaracasVisuTransformWidget2.cxx @@ -38,6 +38,8 @@ public: void OnReset(wxCommandEvent& event); void OnMoveDown(wxCommandEvent& event); void OnMoveUp(wxCommandEvent& event); + void OnMemory(wxCommandEvent& event); + void OnMemoryGoBack(wxCommandEvent& event); void OnSliderGeneralTrack(wxScrollEvent& event); void OnSliderGeneralRelease(wxScrollEvent& event); @@ -48,6 +50,8 @@ private: std::vector mPossiblePoint; std::vector mLastPossiblePoint_localReference; std::vector mActualPoint; + std::vector mMemoryPoint; + vtkMatrix4x4 *mMemoryMatrix; TransformWidget2 *mBox; // Type : Module A @@ -68,8 +72,9 @@ TransformWidgetPanel::TransformWidgetPanel(TransformWidget2* box, wxWindow *pare : wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL), mBox(box) { - t = vtkTransform::New(); - tt = vtkTransform::New(); + t = vtkTransform::New(); // Transoform activa + tt = vtkTransform::New(); // Transform temporal para el slider + mMemoryMatrix = vtkMatrix4x4::New(); mttActualPoint.push_back(0); mttActualPoint.push_back(0); mttActualPoint.push_back(0); @@ -113,28 +118,32 @@ TransformWidgetPanel::TransformWidgetPanel(TransformWidget2* box, wxWindow *pare if (mBox->bbGetInputType()==1) { - sizeSliderWidget.Set(250,-1 ); - sizeButton.Set( 45 , -1 ); - wxRadioButton *rBtnX = new wxRadioButton( this, -1, _T("ri") , wxDefaultPosition , wxDefaultSize , wxRB_GROUP); - wxRadioButton *rBtnY = new wxRadioButton( this, -1, _T("rj") , wxDefaultPosition , wxDefaultSize , 0); - wxRadioButton *rBtnZ = new wxRadioButton( this, -1, _T("rk") , wxDefaultPosition , wxDefaultSize , 0); - wxRadioButton *rBtnC = new wxRadioButton( this, -1, _T("Cen") , wxDefaultPosition , wxDefaultSize , 0); + sizeSliderWidget.Set( 160 , -1 ); + sizeButton.Set( 20 , -1 ); + wxRadioButton *rBtnX = new wxRadioButton( this, -1, _T("ri") , wxDefaultPosition , wxDefaultSize , wxRB_GROUP ); + wxRadioButton *rBtnY = new wxRadioButton( this, -1, _T("rj") , wxDefaultPosition , wxDefaultSize , 0 ); + wxRadioButton *rBtnZ = new wxRadioButton( this, -1, _T("rk") , wxDefaultPosition , wxDefaultSize , 0 ); + wxRadioButton *rBtnC = new wxRadioButton( this, -1, _T("Cen") , wxDefaultPosition , wxDefaultSize , 0) ; rBtnC->SetValue(true); mTool = 3; - mSliderGeneral = new wxSlider ( this, -1, 0 , -180, 180 , wxDefaultPosition,sizeSliderWidget ,wxSL_HORIZONTAL, wxDefaultValidator ); - cbLocalReference = new wxCheckBox ( this,-1, _T("Loc Ref") , wxDefaultPosition,wxDefaultSize ,wxCHK_2STATE | wxALIGN_RIGHT ); - wxButton *mBtnMoveDown = new wxButton ( this, -1, _T("-") , wxDefaultPosition, sizeButton ); - wxButton *mBtnMoveUp = new wxButton ( this, -1, _T("+") , wxDefaultPosition, sizeButton ); - wxButton *mBtnReset = new wxButton ( this, -1, _T("Reset") , wxDefaultPosition, sizeButton ); - Connect( rBtnX->GetId() , wxEVT_COMMAND_RADIOBUTTON_SELECTED , (wxObjectEventFunction)(void (wxPanel::*)(wxEvent&)) &TransformWidgetPanel::OnRadioButtonX ); - Connect( rBtnY->GetId() , wxEVT_COMMAND_RADIOBUTTON_SELECTED , (wxObjectEventFunction)(void (wxPanel::*)(wxEvent&)) &TransformWidgetPanel::OnRadioButtonY ); - Connect( rBtnZ->GetId() , wxEVT_COMMAND_RADIOBUTTON_SELECTED , (wxObjectEventFunction)(void (wxPanel::*)(wxEvent&)) &TransformWidgetPanel::OnRadioButtonZ ); - Connect( rBtnC->GetId() , wxEVT_COMMAND_RADIOBUTTON_SELECTED , (wxObjectEventFunction)(void (wxPanel::*)(wxEvent&)) &TransformWidgetPanel::OnRadioButtonN ); - Connect(mBtnReset->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnReset ); - Connect(mBtnMoveDown->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnMoveDown ); - Connect(mBtnMoveUp->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnMoveUp ); - Connect( mSliderGeneral->GetId(), wxEVT_SCROLL_THUMBRELEASE , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnSliderGeneralRelease ); - Connect( mSliderGeneral->GetId(), wxEVT_SCROLL_THUMBTRACK , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnSliderGeneralTrack ); - Connect( mSliderGeneral->GetId(), wxEVT_SCROLL_CHANGED , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnSliderGeneralTrack ); + mSliderGeneral = new wxSlider ( this, -1, 0 , -180, 180 , wxDefaultPosition,sizeSliderWidget ,wxSL_HORIZONTAL, wxDefaultValidator ); + cbLocalReference = new wxCheckBox ( this,-1, _T("Loc Ref") , wxDefaultPosition,wxDefaultSize ,wxCHK_2STATE | wxALIGN_RIGHT ); + wxButton *BtnMoveDown = new wxButton ( this, -1, _T("-") , wxDefaultPosition, sizeButton ); + wxButton *BtnMoveUp = new wxButton ( this, -1, _T("+") , wxDefaultPosition, sizeButton ); + wxButton *BtnReset = new wxButton ( this, -1, _T("Init") , wxDefaultPosition, sizeButton ); + wxButton *BtnMemory = new wxButton ( this, -1, _T("Set") , wxDefaultPosition, sizeButton ); + wxButton *BtnMemoryGoBack= new wxButton ( this, -1, _T("Reset") , wxDefaultPosition, sizeButton ); + Connect( rBtnX->GetId() , wxEVT_COMMAND_RADIOBUTTON_SELECTED , (wxObjectEventFunction)(void (wxPanel::*)(wxEvent&)) &TransformWidgetPanel::OnRadioButtonX ); + Connect( rBtnY->GetId() , wxEVT_COMMAND_RADIOBUTTON_SELECTED , (wxObjectEventFunction)(void (wxPanel::*)(wxEvent&)) &TransformWidgetPanel::OnRadioButtonY ); + Connect( rBtnZ->GetId() , wxEVT_COMMAND_RADIOBUTTON_SELECTED , (wxObjectEventFunction)(void (wxPanel::*)(wxEvent&)) &TransformWidgetPanel::OnRadioButtonZ ); + Connect( rBtnC->GetId() , wxEVT_COMMAND_RADIOBUTTON_SELECTED , (wxObjectEventFunction)(void (wxPanel::*)(wxEvent&)) &TransformWidgetPanel::OnRadioButtonN ); + Connect( BtnReset->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnReset ); + Connect( BtnMoveDown->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnMoveDown ); + Connect( BtnMoveUp->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnMoveUp ); + Connect( BtnMemory->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnMemory ); + Connect( BtnMemoryGoBack->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnMemoryGoBack ); + Connect( mSliderGeneral->GetId() , wxEVT_SCROLL_THUMBRELEASE , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnSliderGeneralRelease ); + Connect( mSliderGeneral->GetId() , wxEVT_SCROLL_THUMBTRACK , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnSliderGeneralTrack ); + Connect( mSliderGeneral->GetId() , wxEVT_SCROLL_CHANGED , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnSliderGeneralTrack ); wxBoxSizer *sizerA = new wxBoxSizer(wxHORIZONTAL); sizerA->Add( rBtnC , 1 ); @@ -142,12 +151,14 @@ TransformWidgetPanel::TransformWidgetPanel(TransformWidget2* box, wxWindow *pare sizerA->Add( rBtnY , 1 ); sizerA->Add( rBtnZ , 1 ); wxBoxSizer *sizerB = new wxBoxSizer(wxHORIZONTAL); - sizerB->Add( mSliderGeneral , 0 ); + sizerB->Add( mSliderGeneral , 1 ); + sizerB->Add( BtnMoveDown , 0 ); + sizerB->Add( BtnMoveUp , 0 ); wxBoxSizer *sizerC = new wxBoxSizer(wxHORIZONTAL); sizerC->Add( cbLocalReference , 1 ); - sizerC->Add( mBtnReset , 1 ); - sizerC->Add( mBtnMoveDown , 1 ); - sizerC->Add( mBtnMoveUp , 1 ); + sizerC->Add( BtnReset , 1 ); + sizerC->Add( BtnMemory , 1 ); + sizerC->Add( BtnMemoryGoBack , 1 ); wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL); sizer->Add( sizerA , 0 ); sizer->Add( sizerB , 0 ); @@ -374,6 +385,27 @@ void TransformWidgetPanel::OnMoveUp(wxCommandEvent& event) } // if mTool == 3 } +void TransformWidgetPanel::OnMemory(wxCommandEvent& event) +{ + mMemoryPoint = mActualPoint; + mMemoryMatrix->DeepCopy( t->GetMatrix() ); +} + +void TransformWidgetPanel::OnMemoryGoBack(wxCommandEvent& event) +{ + mActualPoint = mMemoryPoint; + t->GetMatrix()->Identity(); + vtkMatrix4x4 *m = vtkMatrix4x4::New(); + m->DeepCopy( mMemoryMatrix ); + t->SetMatrix( m ); + mBox->bbSetOutputActualPoint( mActualPoint ); + mBox->bbSignalOutputModification(std::string("ActualPoint")); + mBox->bbSetOutputOut( t ); + mBox->bbSignalOutputModification(std::string("Out")); +} + + + void TransformWidgetPanel::OnSliderGeneralRelease(wxScrollEvent& event) { if ((mTool>=0) && (mTool<=2)) diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ViewShowNPoints.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ViewShowNPoints.cxx index b4ba379..b5ed682 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ViewShowNPoints.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ViewShowNPoints.cxx @@ -90,7 +90,8 @@ void ViewShowNPoints::AddVtkPoint() printf("EED ShowNPoints Warning: Renderer Not Set\n"); return; } - + + lstActorAdded.push_back(true); renderer->AddActor( sphereActor ); // Actor vtkTextActor3D *textActor = vtkTextActor3D::New(); @@ -127,6 +128,7 @@ void ViewShowNPoints::ErasePoint(int id) lstActorsSphere.erase( lstActorsSphere.begin()+id ); lstActorsText.erase( lstActorsText.begin()+id ); lstSourceSphere.erase( lstSourceSphere.begin()+id ); + lstActorAdded.erase( lstActorAdded.begin()+id ); } // if id } // if renderer } @@ -142,3 +144,34 @@ void ViewShowNPoints::SetModelShowNPoints( ModelShowNPoints* modelShowNPoints) { mmodelShowNPoints = modelShowNPoints; } + +//------------------------------------------------------------------------ +void ViewShowNPoints::TryToShowActorInRender( int id, bool show ) +{ + if (show==false) // try to remove actor to render + { + if (lstActorAdded[id]==true) + { + lstActorAdded[id]=false; + renderer->RemoveActor( lstActorsSphere[id] ); + renderer->RemoveActor( lstActorsText[id] ); + } // if lstActorAdded true + } else { // try to add actor to render + if (lstActorAdded[id]==false) + { + lstActorAdded[id]=true; + renderer->AddActor( lstActorsSphere[id] ); + renderer->AddActor( lstActorsText[id] ); + } // if lstActorAdded false + } // if show +} + +//------------------------------------------------------------------------ +void ViewShowNPoints::TryToShowActorsInRender( bool show ) +{ + int id,size=lstActorsSphere.size(); + for (id=0;id lstActorsSphere;//NTU changed from prop3D to Actor std::vector lstActorsText; std::vector lstSourceSphere; + std::vector lstActorAdded; std::vector mcolour; double mopacity; double ratioRadio; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx index c5b0808..36c6a84 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx @@ -104,7 +104,7 @@ wxDefaultSize, wxNB_TOP ); panel2 = new wxPanel(bookGroupManager); - cbVisuActualCollection = new wxCheckBox ( panel2,-1, _T("A.V.") , wxDefaultPosition, sizeButton ); + cbVisuActualCollection = new wxCheckBox ( panel2,-1, _T("Cur.") , wxDefaultPosition, sizeButton ); txtNrCollections = new wxStaticText ( panel2,-1, _T(" 1/1 ")); wxButton *btnBackCollection = new wxButton ( panel2, -1, _T("<") , wxDefaultPosition, sizeButton ); wxButton *btnNextCollection = new wxButton ( panel2, -1, _T(">") , wxDefaultPosition, sizeButton ); @@ -134,7 +134,7 @@ wxFlexGridSizer *sizer7 = new wxFlexGridSizer(2); wxFlexGridSizer *sizer8 = new wxFlexGridSizer(2); - cbVisuActualCollection -> SetToolTip( _T("Visu actual collection") ); + cbVisuActualCollection -> SetToolTip( _T("Current group") ); btnInsertCollectionBefore -> SetToolTip( _T("+ Add group before") ); btnInsertCollectionAfter -> SetToolTip( _T("+> Add group after") ); btnDeleteCollection -> SetToolTip( _T("- Erase group") ); @@ -668,10 +668,12 @@ void WidgetShowNPoints::OnInsertPoint_() StopAutoAddPoints(); StopTrackPoint(); + if (GetViewShowNPoints()->renderer==NULL) { return; } + UndoRedo_SaveCollection(); //A std::vector point = GetModelShowNPoints()->GetReferencePoint(); if (point.size()==3) { @@ -682,7 +684,7 @@ void WidgetShowNPoints::OnInsertPoint_() } RefreshCollectionText(); RefreshColourCollection(); - UndoRedo_SaveCollection(); + UndoRedo_SaveCollection(); //B } //------------------------------------------------------------------------ @@ -703,12 +705,13 @@ void WidgetShowNPoints::OnAddPoint__() std::vector point = GetModelShowNPoints()->GetReferencePoint(); if (point.size()==3) { + UndoRedo_SaveCollection(); //A AddPoint(point[0],point[1],point[2], (const char*) ( textCtrl->GetValue().mb_str() ) ); SetOutputBox(); // EED 2022-05-19 //renderer->GetRenderWindow()->Render(); GetViewShowNPoints()->Render(); - UndoRedo_SaveCollection(); + UndoRedo_SaveCollection(); //B } else {//mpoint.size printf("creaMaracasVisu::ShowNPoints (not match point) \n"); } @@ -867,6 +870,8 @@ void WidgetShowNPoints::StopAutoAddPoints( ) //------------------------------------------------------------------------ void WidgetShowNPoints::OnSetPoint_() { + UndoRedo_SaveCollection(); //A + StopAutoAddPoints(); StopTrackPoint(); @@ -891,7 +896,7 @@ void WidgetShowNPoints::OnSetPoint_() RefreshCollectionText(); RefreshColourCollection(); SetOutputBox(); - UndoRedo_SaveCollection(); + UndoRedo_SaveCollection(); //B } //------------------------------------------------------------------------ @@ -935,7 +940,6 @@ void WidgetShowNPoints::MovePoint_(double step) if (dataArrayNormals!=NULL) { dataArrayNormals->GetTuple(idMeshPoint, normal); - int direction = step; // pN[0] = p[0] / spc[0] + direction*normal[0]; // pN[1] = p[1] / spc[1] + direction*normal[1]; @@ -943,12 +947,13 @@ void WidgetShowNPoints::MovePoint_(double step) pN[0] = x + (direction * normal[0]); pN[1] = y + (direction * normal[1]); pN[2] = z + (direction * normal[2]); + UndoRedo_SaveCollection(); //A GetModelShowNPoints()->SetPointById(idControlPoint, pN); // GetViewShowNPoints()->RefreshPoint(idControlPoint); // RefreshCollectionText(); // RefreshColourCollection(); // SetOutputBox(); - UndoRedo_SaveCollection(); + UndoRedo_SaveCollection(); //B } else { printf("Error! WidgetShowNPoints::MovePoint_ Missing normals in aux_mesh \n"); } @@ -999,11 +1004,12 @@ void WidgetShowNPoints::MovePoint_(double step) v[1] = 0; v[2] = 0; }// if mag + UndoRedo_SaveCollection(); //A point.push_back( p[0] + step*v[0] ); point.push_back( p[1] + step*v[1] ); point.push_back( p[2] + step*v[2] ); GetModelShowNPoints()->SetPointById(id,point); - UndoRedo_SaveCollection(); + UndoRedo_SaveCollection(); //B } // if id } // if aux_mesh RefreshCollectionText(); @@ -1039,6 +1045,7 @@ void WidgetShowNPoints::TrackingPoint( ) if (idTrack>=0) { + UndoRedo_SaveCollection(); //A GetModelShowNPoints()->SetPointId_mReferencePoint(idTrack); RefreshCollectionText(); @@ -1046,7 +1053,7 @@ void WidgetShowNPoints::TrackingPoint( ) // GetViewShowNPoints()->RefreshPoint(idTrack); // GetViewShowNPoints()->Render(); - UndoRedo_SaveCollection(); + UndoRedo_SaveCollection(); //B } // if id } // if trackPointFlag } @@ -1094,10 +1101,11 @@ void WidgetShowNPoints::StopTrackPoint( ) // EED 2022-05-19 //lstActorsText[id]->SetInput( (const char*) ( textCtrl->GetValue().mb_str() ) ); //renderer->GetRenderWindow()->Render(); + UndoRedo_SaveCollection(); //A GetViewShowNPoints()->lstActorsText[id]->SetInput( (const char*) ( textCtrl->GetValue().mb_str() ) ); GetViewShowNPoints()->Render(); SetOutputBox(); - UndoRedo_SaveCollection(); + UndoRedo_SaveCollection(); //B } // if id } @@ -1135,6 +1143,7 @@ void WidgetShowNPoints::StopTrackPoint( ) StopTrackPoint(); //ErasePoint( GetModelShowNPoints()->IdInsidePoint() ); + UndoRedo_SaveCollection(); //A if (ErasePoint( GetModelShowNPoints()->GetIdCurrentPoint() ) == true) { SetOutputBox(); @@ -1144,7 +1153,7 @@ void WidgetShowNPoints::StopTrackPoint( ) RefreshCollectionText(); RefreshColourCollection(); StopTrackPoint(); - UndoRedo_SaveCollection(); + UndoRedo_SaveCollection(); //B } } @@ -1163,13 +1172,14 @@ void WidgetShowNPoints::StopTrackPoint( ) StopAutoAddPoints(); StopTrackPoint(); + UndoRedo_SaveCollection(); //A int id = GetViewShowNPoints()->lstActorsSphere.size()-1; ErasePoint( id ); RefreshCollectionText(); RefreshColourCollection(); - UndoRedo_SaveCollection(); + UndoRedo_SaveCollection(); //B GetViewShowNPoints()->Render(); SetOutputBox(); StopTrackPoint(); @@ -1192,8 +1202,9 @@ void WidgetShowNPoints::OnDeleteAllPoints_() StopAutoAddPoints(); StopTrackPoint(); + UndoRedo_SaveCollection(); //A DeleteAllPoints_(); - UndoRedo_SaveCollection(); + UndoRedo_SaveCollection(); //B } //------------------------------------------------------------------------ @@ -1407,9 +1418,10 @@ void WidgetShowNPoints::InsertCollectionBefore_() //------------------------------------------------------------------------ void WidgetShowNPoints::OnInsertCollectionBefore_() { + UndoRedo_SaveCollection(); //A InsertCollectionBefore_(); CreatePointsIntoNewCollection(); - UndoRedo_SaveCollection(); + UndoRedo_SaveCollection(); //B } @@ -1434,9 +1446,10 @@ void WidgetShowNPoints::InsertCollectionAfter_() //------------------------------------------------------------------------ void WidgetShowNPoints::OnInsertCollectionAfter_() { + UndoRedo_SaveCollection(); //A InsertCollectionAfter_(); CreatePointsIntoNewCollection(); - UndoRedo_SaveCollection(); + UndoRedo_SaveCollection(); //B } //------------------------------------------------------------------------ @@ -1576,13 +1589,14 @@ void WidgetShowNPoints::DeleteCollection_() //------------------------------------------------------------------------ void WidgetShowNPoints::OnDeleteCollection_() { + UndoRedo_SaveCollection(); //A DeleteCollection_(); SetOutputBox(); GetViewShowNPoints()->Render(); RefreshCollectionText(); RefreshColourCollection(); StopTrackPoint(); - UndoRedo_SaveCollection(); + UndoRedo_SaveCollection(); //B } //------------------------------------------------------------------------ @@ -1609,8 +1623,9 @@ void WidgetShowNPoints::ResetCollections_() //------------------------------------------------------------------------ void WidgetShowNPoints::OnResetCollections_() { + UndoRedo_SaveCollection(); //A ResetCollections_(); - UndoRedo_SaveCollection(); + UndoRedo_SaveCollection(); //B } @@ -1632,7 +1647,7 @@ void WidgetShowNPoints::OnBackCollection(wxCommandEvent &event) RefreshCollectionText(); RefreshColourCollection(); StopTrackPoint(); - UndoRedo_SaveCollection(); +// UndoRedo_SaveCollection(); } //------------------------------------------------------------------------ @@ -1647,7 +1662,7 @@ void WidgetShowNPoints::OnNextCollection(wxCommandEvent &event) RefreshCollectionText(); RefreshColourCollection(); StopTrackPoint(); - UndoRedo_SaveCollection(); +// UndoRedo_SaveCollection(); } //------------------------------------------------------------------------ @@ -1667,55 +1682,64 @@ void WidgetShowNPoints::DetectCollectionActive() RefreshColourCollection(); } + + + //------------------------------------------------------------------------ void WidgetShowNPoints::RefreshColourCollection() { UpdatePoints_(); std::vector colourAll; - colourAll.push_back(1); - colourAll.push_back(0); colourAll.push_back(0); + colourAll.push_back(1); + colourAll.push_back(1); std::vector colourActualGroup; colourActualGroup.push_back(1); - colourActualGroup.push_back(1); colourActualGroup.push_back(0); - + colourActualGroup.push_back(0); // For all collections SetColour( colourAll ); - int i,size=lstViewShowNPoints.size(); - for (i=0;i mcolour = colourAll; - lstViewShowNPoints[i] -> ratioRadio = 1; - if ((cbVisuActualCollection!=NULL) && (cbVisuActualCollection->GetValue()==true)) + if (iCollection==mActualCollection) { - lstViewShowNPoints[i] -> mopacity = 0.0; + // Actual collection + lstViewShowNPoints[mActualCollection] -> mcolour = colourActualGroup; + lstViewShowNPoints[mActualCollection] -> mopacity = sCtrlOpacity->GetValue()*10.0/100.0; + lstViewShowNPoints[mActualCollection] -> ratioRadio = 1.2; + lstViewShowNPoints[mActualCollection] -> RefreshEachPoint(); + + //Actual Point + int curPnt = lstModelShowNPoints[mActualCollection]->GetIdCurrentPoint(); + sizeLstPoints = lstModelShowNPoints[mActualCollection]->GetLstPointsSize(); + if ((curPnt>=0) && (curPnt colourActualPoint; + colourActualPoint.push_back(1); + colourActualPoint.push_back(1); + colourActualPoint.push_back(0); + double radio = GetModelShowNPoints()->GetRadio(); + lstViewShowNPoints[mActualCollection] -> mcolour = colourActualPoint; + lstViewShowNPoints[mActualCollection]->RefreshPoint( curPnt ); + lstViewShowNPoints[mActualCollection] -> mcolour = colourActualGroup; + } // if + lstViewShowNPoints[mActualCollection]->TryToShowActorsInRender(true); } else { - lstViewShowNPoints[i] -> mopacity = sCtrlOpacity->GetValue()*10.0/100.0; - } - lstViewShowNPoints[i]->RefreshEachPoint(); + lstViewShowNPoints[iCollection] -> mcolour = colourAll; + lstViewShowNPoints[iCollection] -> ratioRadio = 1; + if ((cbVisuActualCollection!=NULL) && (cbVisuActualCollection->GetValue()==true)) + { + lstViewShowNPoints[iCollection]->TryToShowActorsInRender(false); + // lstViewShowNPoints[i] -> mopacity = 0.0; + } else { + lstViewShowNPoints[iCollection]->TryToShowActorsInRender(true); + // lstViewShowNPoints[i] -> mopacity = sCtrlOpacity->GetValue()*10.0/100.0; + } + lstViewShowNPoints[iCollection]->RefreshEachPoint(); + }// if mActualCollection } // for i - - // Actual collection - lstViewShowNPoints[mActualCollection] -> mcolour = colourActualGroup; - lstViewShowNPoints[mActualCollection] -> mopacity = sCtrlOpacity->GetValue()*10.0/100.0; - lstViewShowNPoints[mActualCollection] -> ratioRadio = 1.1; - lstViewShowNPoints[mActualCollection] -> RefreshEachPoint(); - - //Actual Point - int curPnt = lstModelShowNPoints[mActualCollection] -> GetIdCurrentPoint(); - size=lstModelShowNPoints[mActualCollection]->GetLstPointsSize(); - if ((curPnt>=0) && (curPnt colourActualPoint; - colourActualPoint.push_back(0); - colourActualPoint.push_back(0); - colourActualPoint.push_back(1); - double radio = GetModelShowNPoints()->GetRadio(); - lstViewShowNPoints[mActualCollection] -> mcolour = colourActualPoint; - lstViewShowNPoints[mActualCollection]->RefreshPoint( curPnt ); - lstViewShowNPoints[mActualCollection] -> mcolour = colourActualGroup; - } // if lstViewShowNPoints[mActualCollection] -> renderer->GetRenderWindow()->Render(); } @@ -1752,6 +1776,25 @@ void WidgetShowNPoints::OnSaveCollections_( std::string filename ) } +//------------------------------------------------------------------------ +void WidgetShowNPoints::OnSaveCollectionsIdsCurrent_( std::string filename ) +{ + FILE *ff; + ff = fopen( filename.c_str() , "w+" ); + if (ff!=NULL) + { + int i,size = lstModelShowNPoints.size(); + fprintf(ff,"ActualCollection %d \n",mActualCollection); + fprintf(ff,"NumberOfGroups %d \n",size); + for (i=0 ; iGetIdCurrentPoint()); + } // for i + fclose(ff); + } else { // else ff + printf("WidgetShowNPoints::Save Groups Points ...Error... creating file \n"); + } //ff +} //------------------------------------------------------------------------ void WidgetShowNPoints::OnSaveCollections(wxCommandEvent &event) @@ -1831,6 +1874,31 @@ void WidgetShowNPoints::OnLoadCollections_( std::string filename ) StopTrackPoint(); } + +//------------------------------------------------------------------------ +void WidgetShowNPoints::OnLoadCollectionsIdsCurrent_( std::string filename ) +{ + FILE *ff = fopen( filename.c_str() , "r+" ); + int iGroup,sizeGroups; + int IdCurrentPoint; + char chartmp[256]; + fscanf(ff," %s %d",chartmp,&mActualCollection); // ActualCollection + fscanf(ff," %s %d",chartmp,&sizeGroups); // NumberOfGroups + for (iGroup=0;iGroupSetIdCurrentPoint( IdCurrentPoint ); + } // for iGroup + + GetViewShowNPoints()->Render(); + RefreshCollectionText(); + RefreshColourCollection(); + +} + + + + //------------------------------------------------------------------------ void WidgetShowNPoints::OnLoadCollections(wxCommandEvent &event) { @@ -1858,8 +1926,9 @@ void WidgetShowNPoints::OnLoadCollections(wxCommandEvent &event) if (FD->GetReturnCode()==wxID_OK) { std::string filename= (const char*) ( FD->GetPath().mb_str() ); + UndoRedo_SaveCollection(); // A OnLoadCollections_( filename ); - UndoRedo_SaveCollection(); + UndoRedo_SaveCollection(); // B } // dialog box } @@ -2036,11 +2105,12 @@ void WidgetShowNPoints::InvertLstPoints_() //------------------------------------------------------------------------ void WidgetShowNPoints::OnInvertLstPoints_() { + UndoRedo_SaveCollection(); // A StopAutoAddPoints(); StopTrackPoint(); InvertLstPoints_(); SetOutputBox(); - UndoRedo_SaveCollection(); + UndoRedo_SaveCollection(); // B } @@ -2068,6 +2138,7 @@ void WidgetShowNPoints::OnUndo(wxCommandEvent &event) idUndoRedo=-1; } else { OnLoadCollections_( GetUndoRedoFileName() ); + OnLoadCollectionsIdsCurrent_( GetUndoRedoFileName()+".current" ); }// if idUndoRedo idUndoRedo++; @@ -2082,6 +2153,7 @@ void WidgetShowNPoints::OnRedo(wxCommandEvent &event) } else { ResetCollections_(); OnLoadCollections_( GetUndoRedoFileName() ); + OnLoadCollectionsIdsCurrent_( GetUndoRedoFileName()+".current" ); idUndoRedo++; }// if idUndoRedo } @@ -2090,6 +2162,7 @@ void WidgetShowNPoints::OnRedo(wxCommandEvent &event) void WidgetShowNPoints::UndoRedo_SaveCollection() { OnSaveCollections_( GetUndoRedoFileName() ); + OnSaveCollectionsIdsCurrent_( GetUndoRedoFileName()+".current" ); maxUndoRedo = idUndoRedo; idUndoRedo++; } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.h index 5ed2ea1..79c111a 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.h @@ -72,8 +72,10 @@ class WidgetShowNPoints : public wxPanel void OnNextCollection(wxCommandEvent &event); void OnSaveCollections(wxCommandEvent &event); void OnSaveCollections_( std::string filename ); + void OnSaveCollectionsIdsCurrent_( std::string filename ); void OnLoadCollections(wxCommandEvent &event); void OnLoadCollections_( std::string filename ); + void OnLoadCollectionsIdsCurrent_( std::string filename ); void ResetCollections_(); void OnResetCollections_(); void OnResetCollections(wxCommandEvent &event); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourBaseControler.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourBaseControler.cpp index 5b561fb..d0e98d0 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourBaseControler.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourBaseControler.cpp @@ -317,17 +317,14 @@ void manualContourBaseControler::MouseDLeft(int x, int y ) { if (_state==0) { - int z=GetZ(); /*bool temp = */ _manViewBaseCont->SelectPosibleContour(x,y,z); - _manViewBaseCont->SelectPosiblePoint(x,y,z); - if ( _manViewBaseCont->GetPosibleSelected() ) { _editable = true; } - } + } // if _state==0 } // ---------------------------------------------------------------------------- void manualContourBaseControler::MouseMove(int x, int y) // virtual diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.cpp index b5b93b4..c2008f4 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.cpp @@ -587,32 +587,49 @@ bool manualViewBaseContour::SelectPosibleContour(int x, int y, int z) bool result=false; SetPosibleSelected(result); int id = GetIdPoint(x,y,z); - - if( !GetEditable() && !_selected && id!= -1) - { - result=true; - _posibleSelected=true; - } - else + +/* EED 2023-07-29 + if( !GetEditable() && !_selected && id!= -1) { - if ( (GetEditable()==true) && (id==-1 ) && (this->_lstViewPoints.size()>=2) ) + result = true; + _posibleSelected = true; + }else{ + if ( (GetEditable()==true) && (id==-1 ) && (this->_lstViewPoints.size()>=2) ) { if (ifTouchContour(x,y,z)==true) { - result=true; + result = true; SetPosibleSelected(result); - } + } // ifTouchContour } - if (GetEditable()==false) { if (ifTouchContour(x,y,z)==true) { - result=true; + result = true; SetPosibleSelected(result); - } - } - } + } // ifTouchContor + } // if GetEditable + } // if !GetEditable() && !_selected && id!= -1 +*/ + + if ( (GetEditable()==true) && (id==-1 ) && (this->_lstViewPoints.size()>=2) ) + { + if (ifTouchContour(x,y,z)==true) + { + result = true; + SetPosibleSelected(result); + } // ifTouchContour + } + if (GetEditable()==false) + { + if (ifTouchContour(x,y,z)==true) + { + result = true; + SetPosibleSelected(result); + } // ifTouchContor + } // if GetEditable + return result; } // ---------------------------------------------------------------------------- @@ -632,7 +649,8 @@ void manualViewBaseContour::UnSelectLstPoints(){ // ---------------------------------------------------------------------------- void manualViewBaseContour::UnSelectAllPoints(){ int i,size=_lstViewPoints.size(); - for (i=0;i=d3) && ((d1+d2)<=d3*1.3) ) + if ( ((d1+d2)>=d3) && ((d1+d2)<=d3*1.3) ) { result = true; i = nps; } // if + if ( (d1<0.75*_spc[0]) || (d2<0.75*_spc[0]) ) + { + result = true; + i = nps; + } // if + } // for i } // if GetSizeLstPoints()==2 } // if min max + return result; }