From: eduardo.davila@creatis.insa-lyon.fr Date: Mon, 9 Dec 2024 17:11:54 +0000 (+0100) Subject: #3532 Plane xy xz yz Vectors visu X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=refs%2Fheads%2Fvtk9itk5wx3-macos;p=creaVtk.git #3532 Plane xy xz yz Vectors visu --- diff --git a/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Widget.bbg b/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Widget.bbg index c5e1036..09439d2 100644 --- a/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Widget.bbg +++ b/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Widget.bbg @@ -37,7 +37,7 @@ COMPLEX_PORT _point -100.903572:70.586075:-900.000000 FIN_COMPLEX_PORT -BOXES:35 +BOXES:36 BOX creaVtk:VectorsVisu:Box00 ISEXEC:FALSE @@ -155,24 +155,24 @@ FIN_BOX BOX std:GetVectorDoubleElement:Box20 ISEXEC:FALSE --164.263776:18.544701:-900.000000 --141.138776:16.044701:-900.000000 +-162.475962:17.994604:-900.000000 +-139.350962:15.494604:-900.000000 PORT -I:"0" +I:"1" FIN_BOX BOX std:GetVectorDoubleElement:Box21 ISEXEC:FALSE --152.139105:12.292551:-900.000000 --129.014105:9.792551:-900.000000 +-152.826726:13.255220:-900.000000 +-129.701726:10.755220:-900.000000 PORT -I:"0" +I:"2" FIN_BOX BOX std:ConcatStrings:Box22 ISEXEC:FALSE --202.656805:-24.280510:-900.000000 --179.896805:-26.780510:-900.000000 +-201.969184:-23.042793:-900.000000 +-179.209184:-25.542793:-900.000000 PORT In2:" " PORT @@ -197,8 +197,8 @@ FIN_BOX BOX std:MagicBox:Box25 ISEXEC:FALSE --132.380726:1.542771:-900.000000 --110.780726:-0.957229:-900.000000 +-129.630243:-1.345236:-900.000000 +-108.030243:-3.845236:-900.000000 FIN_BOX BOX vtk:ProbeFilter:Box26 @@ -209,8 +209,8 @@ FIN_BOX BOX creaVtk:VectorsVisu:Box27 ISEXEC:FALSE --206.186175:-58.076439:-900.000000 --184.416175:-60.576439:-900.000000 +-206.598747:-60.964446:-900.000000 +-184.828747:-63.464446:-900.000000 FIN_BOX BOX std:MultipleInputs:Box28 @@ -221,8 +221,8 @@ FIN_BOX BOX std:ConcatStrings:Box29 ISEXEC:FALSE --147.262043:-24.249057:-900.000000 --124.502043:-26.749057:-900.000000 +-147.262043:-18.473044:-900.000000 +-124.502043:-20.973044:-900.000000 PORT In2:" " PORT @@ -231,36 +231,36 @@ FIN_BOX BOX std:MathOperationVector:Box30 ISEXEC:FALSE --148.139653:-31.501382:-900.000000 --123.619653:-34.001382:-900.000000 +-148.277177:-33.014147:-900.000000 +-123.757177:-35.514147:-900.000000 PORT Type:"2" FIN_BOX BOX creaVtk:PlaneSource:Box31 ISEXEC:FALSE --149.222387:-41.897153:-900.000000 --127.377387:-44.397153:-900.000000 +-151.147725:-41.759629:-900.000000 +-129.302725:-44.259629:-900.000000 PORT Normal:"0 1 0" FIN_BOX BOX vtk:ProbeFilter:Box32 ISEXEC:FALSE --146.011824:-49.753532:-900.000000 --124.371824:-52.253532:-900.000000 +-150.962693:-49.616008:-900.000000 +-129.322693:-52.116008:-900.000000 FIN_BOX BOX creaVtk:VectorsVisu:Box33 ISEXEC:FALSE --149.182380:-58.897636:-900.000000 --127.412380:-61.397636:-900.000000 +-152.070387:-60.135353:-900.000000 +-130.300387:-62.635353:-900.000000 FIN_BOX BOX std:ConcatStrings:Box34 ISEXEC:FALSE --100.283757:-19.307993:-900.000000 --77.523757:-21.807993:-900.000000 +-100.283757:-13.807028:-900.000000 +-77.523757:-16.307028:-900.000000 PORT In2:" " PORT @@ -269,16 +269,16 @@ FIN_BOX BOX std:MathOperationVector:Box35 ISEXEC:FALSE --101.161367:-26.560318:-900.000000 --76.641367:-29.060318:-900.000000 +-100.886319:-28.210608:-900.000000 +-76.366319:-30.710608:-900.000000 PORT Type:"2" FIN_BOX BOX creaVtk:PlaneSource:Box36 ISEXEC:FALSE --101.033889:-37.561195:-900.000000 --79.188889:-40.061195:-900.000000 +-101.446461:-38.111292:-900.000000 +-79.601461:-40.611292:-900.000000 PORT Normal:"1 0 0" FIN_BOX @@ -294,7 +294,15 @@ ISEXEC:FALSE -102.506647:-58.646145:-900.000000 -80.736647:-61.146145:-900.000000 FIN_BOX -CONNECTIONS:86 +BOX +std:MathOperationVector:Box41 +ISEXEC:FALSE +-168.025554:-1.857037:-900.000000 +-143.505554:-4.357037:-900.000000 +PORT +Type:"2" +FIN_BOX +CONNECTIONS:91 CONNECTION Box03:Out:Box00:In NumberOfControlPoints:0 @@ -553,4 +561,19 @@ NumberOfControlPoints:0 CONNECTION Box06:active_yz:Box38:Active NumberOfControlPoints:0 +CONNECTION +Box10:Size:Box41:In0 +NumberOfControlPoints:0 +CONNECTION +Box10:Spacing:Box41:In1 +NumberOfControlPoints:0 +CONNECTION +Box41:Out:Box31:VolumeSize +NumberOfControlPoints:0 +CONNECTION +Box41:Out:Box36:VolumeSize +NumberOfControlPoints:0 +CONNECTION +Box41:Out:Box24:VolumeSize +NumberOfControlPoints:0 APP_END diff --git a/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Widget.bbs b/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Widget.bbs index e8e6876..49f336f 100644 --- a/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Widget.bbs +++ b/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Widget.bbs @@ -58,10 +58,10 @@ new std:GetVectorDoubleElement Box19 set Box19.I "0" new std:GetVectorDoubleElement Box20 - set Box20.I "0" + set Box20.I "1" new std:GetVectorDoubleElement Box21 - set Box21.I "0" + set Box21.I "2" new std:ConcatStrings Box22 set Box22.In2 " " @@ -109,6 +109,9 @@ new vtk:ProbeFilter Box37 new creaVtk:VectorsVisu Box38 +new std:MathOperationVector Box41 + set Box41.Type "2" + connect Box03.Out Box00.In connect Box01.Out Box03.Input @@ -190,6 +193,11 @@ connect Box06.typeForm Box38.TypeForm connect Box05.Out Box38.Renderer connect Box06.avtive_xz Box33.Active connect Box06.active_yz Box38.Active +connect Box10.Size Box41.In0 +connect Box10.Spacing Box41.In1 +connect Box41.Out Box31.VolumeSize +connect Box41.Out Box36.VolumeSize +connect Box41.Out Box24.VolumeSize # Complex input ports input vtkImageData Box04.In " " diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkPlaneSource.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkPlaneSource.cxx index a7ed64b..3c29a25 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkPlaneSource.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkPlaneSource.cxx @@ -16,7 +16,10 @@ BBTK_BLACK_BOX_IMPLEMENTATION(PlaneSource,bbtk::AtomicBlackBox); //===== void PlaneSource::Process() { - double c[3]; + double sizeX; + double sizeY; + double sizeZ; + double c[3]; double p0[3]; double p1[3]; double p2[3]; @@ -29,20 +32,28 @@ void PlaneSource::Process() p0[1] = 0; p0[2] = 0; - bool byNormal = true; - double size = 350; -// bbGetInputVolumeSize ????????? + + if (bbGetInputVolumeSize().size()==3) + { + sizeX = bbGetInputVolumeSize()[0]-10; + sizeY = bbGetInputVolumeSize()[1]-10; + sizeZ = bbGetInputVolumeSize()[2]-10; + } else { + sizeX = 40; + sizeY = 40; + sizeZ = 40; + } // xy if ((bbGetInputNormal()[0]==0) && (bbGetInputNormal()[1]==0) && (bbGetInputNormal()[2]==1) ) { byNormal= false; - p1[0] = size; + p1[0] = sizeX; p1[1] = 0; p1[2] = 0; p2[0] = 0; - p2[1] = size; + p2[1] = sizeY; p2[2] = 0; } @@ -50,12 +61,12 @@ void PlaneSource::Process() if ((bbGetInputNormal()[0]==0) && (bbGetInputNormal()[1]==1) && (bbGetInputNormal()[2]==0) ) { byNormal= false; - p1[0] = size; + p1[0] = sizeZ; p1[1] = 0; p1[2] = 0; p2[0] = 0; p2[1] = 0; - p2[2] = size; + p2[2] = sizeX; } // yz @@ -63,11 +74,11 @@ void PlaneSource::Process() { byNormal= false; p1[0] = 0; - p1[1] = size; - p1[2] = 0; + p1[1] = sizeY; + p1[2] = 0; p2[0] = 0; p2[1] = 0; - p2[2] = size; + p2[2] = sizeZ; } /* @@ -116,9 +127,9 @@ void PlaneSource::bbUserSetDefaultValues() n.push_back(0); bbSetInputNormal( n ); std::vector volSize; - volSize.push_back(350); - volSize.push_back(350); - volSize.push_back(350); + volSize.push_back(40); + volSize.push_back(40); + volSize.push_back(40); bbSetInputVolumeSize( volSize ); bbSetInputXResolution(100); bbSetInputYResolution(100);