X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=vv%2FvvMeshActor.cxx;h=04ea49d70e7648404654a231b750cea03eba29fd;hb=3a823a03d4a2217e41e4dd3b05a8ea825bb762a5;hp=4ace9bb389239a1956477d035e51a8b7e8b48c95;hpb=abdae5f22ecae40608e0279729108b428c9dbc62;p=clitk.git diff --git a/vv/vvMeshActor.cxx b/vv/vvMeshActor.cxx index 4ace9bb..04ea49d 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->SetInputData(mMarching->GetOutput()); +#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(); @@ -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 }