From: Eduardo DAVILA Date: Mon, 6 Dec 2021 13:43:30 +0000 (+0100) Subject: #3472 MeshDeformation X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=c19e3463558e49c427281b2074eb9289e8f4251b;p=creaMaracasVisu.git #3472 MeshDeformation --- diff --git a/bbtk/bbs/appli/exampleMeshDeformation.bbg b/bbtk/bbs/appli/exampleMeshDeformation.bbg new file mode 100644 index 0000000..ce458f6 --- /dev/null +++ b/bbtk/bbs/appli/exampleMeshDeformation.bbg @@ -0,0 +1,383 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - /Users/davila/Creatis/C11/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleMeshDeformation.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:Author ?? +COMPLEXBOX:FALSE +COMPLEXINPUTS:0 +BOXES:27 +BOX +vtk:LoadHola:Box00 +ISEXEC:FALSE +41.753243:164.219077:-900.000000 +77.303243:154.219077:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:ViewerNV:Box01 +ISEXEC:FALSE +46.202085:35.327152:-900.000000 +113.002085:25.327152:-900.000000 +FIN_BOX +BOX +creaVtk:OutputWindow:Box02 +ISEXEC:TRUE +39.787895:-184.545777:-900.000000 +80.387895:-194.545777:-900.000000 +FIN_BOX +BOX +wx:LayoutSplit:Box03 +ISEXEC:TRUE +97.223001:-183.795519:-900.000000 +136.303001:-193.795519:-900.000000 +PORT +Orientation:"H" +FIN_BOX +BOX +wx:LayoutLine:Box04 +ISEXEC:FALSE +-98.519823:-84.186848:-900.000000 +-40.959823:-94.186848:-900.000000 +FIN_BOX +BOX +vtk:PolyDataToActor:Box06 +ISEXEC:FALSE +-12.906688:-9.541436:-900.000000 +32.333312:-19.541436:-900.000000 +FIN_BOX +BOX +wx:Slider:Box07 +ISEXEC:FALSE +-99.730636:73.177947:-900.000000 +-48.330636:63.177947:-900.000000 +PORT +Label:"true" +PORT +Max:"100" +PORT +ReactiveOnTrack:"true" +PORT +Title:"Opacity" +FIN_BOX +BOX +std:Div:Box08 +ISEXEC:FALSE +6.164017:40.935396:-900.000000 +35.489017:30.935396:-900.000000 +PORT +In2:"100" +FIN_BOX +BOX +vtk:UpdateRender:Box09 +ISEXEC:FALSE +0.227294:-145.868985:-900.000000 +40.552294:-155.868985:-900.000000 +PORT +Active:"true" +FIN_BOX +BOX +creaVtk:PointPicker:Box10 +ISEXEC:FALSE +42.793552:-43.061806:-900.000000 +79.743552:-53.061806:-900.000000 +PORT +TypeEvent:"2" +FIN_BOX +BOX +creaVtk:PlaneWidget:Box11 +ISEXEC:FALSE +-10.982291:-64.882180:-900.000000 +27.542709:-74.882180:-900.000000 +PORT +Active:"true" +PORT +Origin:"30 30 30" +PORT +Resolution:"10" +FIN_BOX +BOX +vtk:vtkImageDataPointerRelay:Box12 +ISEXEC:FALSE +39.801244:125.767709:-900.000000 +91.976244:115.767709:-900.000000 +FIN_BOX +BOX +wx:CheckBox:Box13 +ISEXEC:FALSE +-85.323644:15.751855:-900.000000 +-48.998644:5.751855:-900.000000 +PORT +In:"false" +PORT +Title:"Picker" +FIN_BOX +BOX +creaMaracasVisu:SetPosition:Box14 +ISEXEC:FALSE +48.157086:-136.326705:-900.000000 +84.707086:-146.326705:-900.000000 +FIN_BOX +BOX +std:MathOperationVector:Box16 +ISEXEC:FALSE +83.613689:-75.970874:-900.000000 +131.138689:-85.970874:-900.000000 +PORT +Type:"3" +FIN_BOX +BOX +vtk:ImageVtkProperties:Box17 +ISEXEC:FALSE +85.277107:-54.156204:-900.000000 +130.627107:-64.156204:-900.000000 +FIN_BOX +BOX +wx:CheckBox:Box18 +ISEXEC:FALSE +-70.908661:-10.460208:-900.000000 +-34.583661:-20.460208:-900.000000 +PORT +In:"false" +PORT +Title:"Plane" +FIN_BOX +BOX +wx:ComboBox:Box19 +ISEXEC:FALSE +-126.349291:43.032686:-900.000000 +-81.109291:33.032686:-900.000000 +PORT +In:"Outline Wireframe Surface" +PORT +Selection:"1" +FIN_BOX +BOX +std:MultipleInputs:Box20 +ISEXEC:FALSE +-71.597429:-38.406568:-900.000000 +-31.897429:-48.406568:-900.000000 +FIN_BOX +BOX +std:MultipleInputs:Box21 +ISEXEC:FALSE +-8.080687:-104.467523:-900.000000 +31.619313:-114.467523:-900.000000 +FIN_BOX +BOX +creaVtk:ImageThreshold:Box65 +ISEXEC:FALSE +-179.529863:52.174605:-900.000000 +-137.729863:42.174605:-900.000000 +PORT +InValue:"255" +PORT +Lower:"1200" +PORT +OutValue:"0" +PORT +Upper:"5000" +FIN_BOX +BOX +vtk:ImageGaussianSmooth:Box66 +ISEXEC:FALSE +-181.359743:34.779658:-900.000000 +-132.459743:24.779658:-900.000000 +PORT +StdDevX:"3" +PORT +StdDevY:"3" +PORT +StdDevZ:"3" +FIN_BOX +BOX +vtk:MarchingCubes:Box67 +ISEXEC:FALSE +-192.302439:14.823947:-900.000000 +-150.502439:4.823947:-900.000000 +PORT +Value:"128" +FIN_BOX +BOX +creaVtk:MeshDeformation:Box26 +ISEXEC:FALSE +-119.463553:-141.179388:-900.000000 +-76.088553:-151.179388:-900.000000 +PORT +TypeIn:"1" +FIN_BOX +BOX +wx:Slider:Box28 +ISEXEC:FALSE +-137.666923:-20.152662:-900.000000 +-86.266923:-30.152662:-900.000000 +PORT +In:"30" +PORT +Label:"true" +PORT +Max:"40" +PORT +ReactiveOnTrack:"true" +PORT +Title:"S" +FIN_BOX +BOX +wx:CheckBox:Box29 +ISEXEC:FALSE +-203.043827:-22.402295:-900.000000 +-166.718827:-32.402295:-900.000000 +PORT +Title:"Deformation ON/OFF" +FIN_BOX +BOX +wx:LayoutLine:Box30 +ISEXEC:FALSE +-209.450866:-55.766397:-900.000000 +-151.890866:-65.766397:-900.000000 +FIN_BOX +CONNECTIONS:47 +CONNECTION +Box01:Widget:Box03:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box04:Widget:Box03:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box01:Renderer1:Box06:Renderer +NumberOfControlPoints:0 +CONNECTION +Box07:Out:Box08:In1 +NumberOfControlPoints:0 +CONNECTION +Box08:Out:Box06:Opacity +NumberOfControlPoints:0 +CONNECTION +Box07:BoxChange:Box06:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box01:Renderer1:Box09:Renderer +NumberOfControlPoints:0 +CONNECTION +Box01:Renderer1:Box10:Renderer +NumberOfControlPoints:0 +CONNECTION +Box01:Renderer1:Box11:Renderer +NumberOfControlPoints:0 +CONNECTION +Box00:Out:Box12:In +NumberOfControlPoints:0 +CONNECTION +Box12:Out:Box01:In +NumberOfControlPoints:0 +CONNECTION +Box12:Out:Box11:In +NumberOfControlPoints:0 +CONNECTION +Box13:Widget:Box04:Widget4 +NumberOfControlPoints:0 +CONNECTION +Box07:Widget:Box04:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box13:Out:Box10:Active +NumberOfControlPoints:0 +CONNECTION +Box01:wxVtkBaseView1:Box14:wxVtkBaseView +NumberOfControlPoints:0 +CONNECTION +Box10:BoxChange:Box14:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box12:Out:Box17:In +NumberOfControlPoints:0 +CONNECTION +Box17:Spacing:Box16:In1 +NumberOfControlPoints:0 +CONNECTION +Box10:Point:Box16:In0 +NumberOfControlPoints:0 +CONNECTION +Box16:Out:Box14:Point +NumberOfControlPoints:0 +CONNECTION +Box18:Widget:Box04:Widget6 +NumberOfControlPoints:0 +CONNECTION +Box18:Out:Box11:Active +NumberOfControlPoints:0 +CONNECTION +Box06:Out:Box10:Prop3D +NumberOfControlPoints:0 +CONNECTION +Box19:Widget:Box04:Widget7 +NumberOfControlPoints:0 +CONNECTION +Box19:Out:Box11:Representation +NumberOfControlPoints:0 +CONNECTION +Box19:BoxChange:Box20:In1 +NumberOfControlPoints:0 +CONNECTION +Box18:BoxChange:Box20:In2 +NumberOfControlPoints:0 +CONNECTION +Box20:BoxChange:Box11:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box06:BoxChange:Box21:In2 +NumberOfControlPoints:0 +CONNECTION +Box11:BoxChange:Box21:In1 +NumberOfControlPoints:0 +CONNECTION +Box21:BoxChange:Box09:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box10:Point:Box11:Origin +NumberOfControlPoints:0 +CONNECTION +Box10:BoxChange:Box21:In3 +NumberOfControlPoints:0 +CONNECTION +Box12:Out:Box65:In +NumberOfControlPoints:0 +CONNECTION +Box65:Out:Box66:In +NumberOfControlPoints:0 +CONNECTION +Box66:Out:Box67:In +NumberOfControlPoints:0 +CONNECTION +Box67:Out:Box06:In +NumberOfControlPoints:0 +CONNECTION +Box67:Out:Box26:In +NumberOfControlPoints:0 +CONNECTION +Box11:BoxChange:Box26:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box10:PointId:Box26:EdgeId +NumberOfControlPoints:0 +CONNECTION +Box28:Out:Box26:S +NumberOfControlPoints:0 +CONNECTION +Box28:Widget:Box30:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box29:Widget:Box30:Widget4 +NumberOfControlPoints:0 +CONNECTION +Box30:Widget:Box04:Widget8 +NumberOfControlPoints:0 +CONNECTION +Box29:Out:Box26:Active +NumberOfControlPoints:0 +CONNECTION +Box11:Center:Box26:Center +NumberOfControlPoints:0 +APP_END diff --git a/bbtk/bbs/appli/exampleMeshDeformation.bbs b/bbtk/bbs/appli/exampleMeshDeformation.bbs new file mode 100644 index 0000000..0b07804 --- /dev/null +++ b/bbtk/bbs/appli/exampleMeshDeformation.bbs @@ -0,0 +1,207 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script +# - /Users/davila/Creatis/C11/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleMeshDeformation.bbs +# ---------------------------------- + +# BBTK GEditor Script +# ---------------------- + +include std +include itkvtk +include vtk +include creaMaracasVisu +include creaVtk +include wx +include std + +author "Author ??" +description "Description ??" +category "" + +new vtk:LoadHola Box00 + +new creaMaracasVisu:ViewerNV Box01 + +new creaVtk:OutputWindow Box02 + +new wx:LayoutSplit Box03 + set Box03.Orientation "H" + +new wx:LayoutLine Box04 + +new vtk:PolyDataToActor Box06 + +new wx:Slider Box07 + set Box07.Label "true" + set Box07.Max "100" + set Box07.ReactiveOnTrack "true" + set Box07.Title "Opacity" + +new std:Div Box08 + set Box08.In2 "100" + +new vtk:UpdateRender Box09 + set Box09.Active "true" + +new creaVtk:PointPicker Box10 + set Box10.TypeEvent "2" + +new creaVtk:PlaneWidget Box11 + set Box11.Active "true" + set Box11.Origin "30 30 30" + set Box11.Resolution "10" + +new vtk:vtkImageDataPointerRelay Box12 + +new wx:CheckBox Box13 + set Box13.In "false" + set Box13.Title "Picker" + +new creaMaracasVisu:SetPosition Box14 + +new std:MathOperationVector Box16 + set Box16.Type "3" + +new vtk:ImageVtkProperties Box17 + +new wx:CheckBox Box18 + set Box18.In "false" + set Box18.Title "Plane" + +new wx:ComboBox Box19 + set Box19.In "Outline Wireframe Surface" + set Box19.Selection "1" + +new std:MultipleInputs Box20 + +new std:MultipleInputs Box21 + +new creaVtk:ImageThreshold Box65 + set Box65.InValue "255" + set Box65.Lower "1200" + set Box65.OutValue "0" + set Box65.Upper "5000" + +new vtk:ImageGaussianSmooth Box66 + set Box66.StdDevX "3" + set Box66.StdDevY "3" + set Box66.StdDevZ "3" + +new vtk:MarchingCubes Box67 + set Box67.Value "128" + +new creaVtk:MeshDeformation Box26 + set Box26.TypeIn "1" + +new wx:Slider Box28 + set Box28.In "30" + set Box28.Label "true" + set Box28.Max "40" + set Box28.ReactiveOnTrack "true" + set Box28.Title "S" + +new wx:CheckBox Box29 + set Box29.Title "Deformation ON/OFF" + +new wx:LayoutLine Box30 + + +connect Box01.Widget Box03.Widget2 + +connect Box04.Widget Box03.Widget1 + +connect Box01.Renderer1 Box06.Renderer + +connect Box07.Out Box08.In1 + +connect Box08.Out Box06.Opacity + +connect Box07.BoxChange Box06.BoxExecute + +connect Box01.Renderer1 Box09.Renderer + +connect Box01.Renderer1 Box10.Renderer + +connect Box01.Renderer1 Box11.Renderer + +connect Box00.Out Box12.In + +connect Box12.Out Box01.In + +connect Box12.Out Box11.In + +connect Box13.Widget Box04.Widget4 + +connect Box07.Widget Box04.Widget2 + +connect Box13.Out Box10.Active + +connect Box01.wxVtkBaseView1 Box14.wxVtkBaseView + +connect Box10.BoxChange Box14.BoxExecute + +connect Box12.Out Box17.In + +connect Box17.Spacing Box16.In1 + +connect Box10.Point Box16.In0 + +connect Box16.Out Box14.Point + +connect Box18.Widget Box04.Widget6 + +connect Box18.Out Box11.Active + +connect Box06.Out Box10.Prop3D + +connect Box19.Widget Box04.Widget7 + +connect Box19.Out Box11.Representation + +connect Box19.BoxChange Box20.In1 + +connect Box18.BoxChange Box20.In2 + +connect Box20.BoxChange Box11.BoxExecute + +connect Box06.BoxChange Box21.In2 + +connect Box11.BoxChange Box21.In1 + +connect Box21.BoxChange Box09.BoxExecute + +connect Box10.Point Box11.Origin + +connect Box10.BoxChange Box21.In3 + +connect Box12.Out Box65.In + +connect Box65.Out Box66.In + +connect Box66.Out Box67.In + +connect Box67.Out Box06.In + +connect Box67.Out Box26.In + +connect Box11.BoxChange Box26.BoxExecute + +connect Box10.PointId Box26.EdgeId + +connect Box28.Out Box26.S + +connect Box28.Widget Box30.Widget2 + +connect Box29.Widget Box30.Widget4 + +connect Box30.Widget Box04.Widget8 + +connect Box29.Out Box26.Active + +connect Box11.Center Box26.Center + + + +# Complex input ports +exec Box02 +exec Box03 diff --git a/bbtk/src/bbcreaMaracasVisuwxVtkBaseView_Info.cxx b/bbtk/src/bbcreaMaracasVisuwxVtkBaseView_Info.cxx index 27a43f4..1c92d3b 100644 --- a/bbtk/src/bbcreaMaracasVisuwxVtkBaseView_Info.cxx +++ b/bbtk/src/bbcreaMaracasVisuwxVtkBaseView_Info.cxx @@ -36,7 +36,6 @@ void wxVtkBaseView_Info::Process() vtkBaseData *vtkbasedata = bbGetInputwxVtkBaseView()->GetVtkBaseData(); if (vtkbasedata!=NULL) { - printf(" wxVtkBaseView_Info::Process %f %f %f\n", vtkbasedata->GetX(), vtkbasedata->GetY(), vtkbasedata->GetZ() ); marImageData *marimagedata = vtkbasedata->GetMarImageData(); if (marimagedata!=NULL) { diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.cxx index 2dd9455..05ccfb1 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.cxx @@ -129,8 +129,13 @@ void wxVtk3DBaseView::SetStereo(int type) // VTK_STEREO_RIGHT 5 // VTK_STEREO_DRESDEN 6 // VTK_STEREO_ANAGLYPH 7 - // VTK_STEREO_CHECKERBOARD 8 - _renWin->SetStereoType(type); + // VTK_STEREO_CHECKERBOARD 8 + // VTK_STEREO_SPLITVIEWPORT_HORIZONTAL 9 + // VTK_STEREO_FAKE 10 + // VTK_STEREO_EMULATE 11 + + _renWin->SetStereoType(type); + } // if type } // _renWin } @@ -145,7 +150,8 @@ void wxVtk3DBaseView::Configure() //wxVtkBaseView::Configure(); _aRenderer = vtkRenderer::New(); _renWin = vtkRenderWindow::New(); - + + int supportopengl=_renWin->SupportsOpenGL(); printf("EED wxVtk3DBaseView::Configure >>>>> vtkRenderWindow SupportsOpenGL %d\n", supportopengl ); printf("EED wxVtk3DBaseView::Configure >>>>> vtkRenderWindow IsDirect %d\n", _renWin->IsDirect() ); @@ -226,6 +232,14 @@ void wxVtk3DBaseView::Configure() // } // Or CurrentPeel >= MaximumNumberOfPeels || TranslucentWrittenPixels <= OcclusionThreshold not coherent. Why ?? _aRenderer->UseDepthPeelingOff(); + + +/* +_renWin -> StereoRenderOn (); +_renWin -> StereoCapableWindowOn (); +_renWin -> SetStereoTypeToSplitViewportHorizontal(); +*/ + } // if _configure } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.cxx index 1b42594..1c01913 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.cxx @@ -128,6 +128,9 @@ wxVtkMPR3DViewCntrlPanel::wxVtkMPR3DViewCntrlPanel(wxWindow *parent, wxVtkMPR3DV _cbStereo->Append(_T(" STEREO DRESDEN")); _cbStereo->Append(_T(" * STEREO ANAGLYPH")); _cbStereo->Append(_T(" STEREO CHECKERBOARD")); + _cbStereo->Append(_T(" * STEREO SPLITVIEWPORT_HORIZONTAL")); + _cbStereo->Append(_T(" STEREO FAKE")); + _cbStereo->Append(_T(" STEREO EMULATE")); _cbStereo->Select(0); Connect(_ckBoxX->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnVisibleAxisX );