X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvMeshActor.cxx;h=d8741aa5448cbc1e5cff6b5b4962267d3df0ba6d;hb=72c516346c3a550e2d34a7635f5f41061a16306c;hp=bfc5343f62484176c130c229e6a0491b910ea441;hpb=4efd93f02e07c2d8fe45f29f9579cabe27a93c1a;p=clitk.git diff --git a/vv/vvMeshActor.cxx b/vv/vvMeshActor.cxx index bfc5343..d8741aa 100644 --- a/vv/vvMeshActor.cxx +++ b/vv/vvMeshActor.cxx @@ -17,6 +17,7 @@ ===========================================================================**/ #include "vvMeshActor.h" #include "clitkCommon.h" +#include #include #include #include @@ -45,15 +46,28 @@ void vvMeshActor::Init(vvMesh::Pointer mesh,int time_slice,vvImage::Pointer vf) mMarching=vtkMarchingSquares::New(); mTimeSlice=time_slice; - if (static_cast(time_slice)GetNumberOfMeshes()) + if (static_cast(time_slice)GetNumberOfMeshes()) { +#if VTK_MAJOR_VERSION <= 5 mMarching->SetInput(mMesh->GetMask(time_slice)); - else +#else + mMarching->SetInputData(mMesh->GetMask(time_slice)); +#endif + } else { +#if VTK_MAJOR_VERSION <= 5 mMarching->SetInput(mMesh->GetMask(0)); +#else + mMarching->SetInputData(mMesh->GetMask(0)); +#endif + } mMarching->SetValue(0,0.5); //mMarching->Update(); mMapper=vtkPolyDataMapper::New(); +#if VTK_MAJOR_VERSION <= 5 mMapper->SetInput(mMarching->GetOutput()); +#else + mMapper->SetInputConnection(mMarching->GetOutputPort()); +#endif //The following line allows to display the contour over the image //(http://www.nabble.com/What-happens-when-two-actors-are-at-the-same-depth--td23175458.html) vtkMapper::SetResolveCoincidentTopologyToPolygonOffset(); @@ -67,8 +81,8 @@ void vvMeshActor::Init(vvMesh::Pointer mesh,int time_slice,vvImage::Pointer vf) void vvMeshActor::SetCutSlice(double slice) { - DD("SetCutSlice"); - DD(slice); + //DD("SetCutSlice"); + //DD(slice); mCutSlice=slice; vtkImageData* mask; if (static_cast(mTimeSlice)GetNumberOfMasks()) @@ -96,10 +110,19 @@ void vvMeshActor::SetCutSlice(double slice) void vvMeshActor::SetTimeSlice(int time) { mTimeSlice=time; - if (static_cast(time)GetNumberOfMasks()) + if (static_cast(time)GetNumberOfMasks()) { +#if VTK_MAJOR_VERSION <= 5 mMarching->SetInput(mMesh->GetMask(time)); - else +#else + mMarching->SetInputData(mMesh->GetMask(time)); +#endif + } else { +#if VTK_MAJOR_VERSION <= 5 mMarching->SetInput(mMesh->GetMask(0)); +#else + mMarching->SetInputData(mMesh->GetMask(0)); +#endif + } SetCutSlice(mCutSlice); //We need to find the new mask cut slice, //since masks do not all have the same origin }