Commit 3e61defa authored by Emilie Harquel's avatar Emilie Harquel
Browse files

Support for vtk 6.0

--HG--
branch : fw4spl_0.10.0
parent f0decb16
TYPE = 'bundle'
VERSION = '0-1'
USE = ['boost', 'boostFilesystem','vtkHybrid']
USE = ['boost', 'boostFilesystem','vtk6IOImport']
LIB = [
'fwTools_0-1',
'fwRuntime_0-3',
......
TYPE = 'bundle'
VERSION = '0-1'
USE = ['vtkWidgets','boost']
USE = ['vtk6InteractionWidgets','boost']
LIB = [
'fwTools_0-1',
'fwCore_0-1',
......
......@@ -113,7 +113,7 @@ void SVTKMesher::updating() throw ( ::fwTools::Failed )
// contour filter
vtkSmartPointer< vtkDiscreteMarchingCubes > contourFilter = vtkSmartPointer< vtkDiscreteMarchingCubes >::New();
contourFilter->SetInput(vtkImage);
contourFilter->SetInputData(vtkImage);
contourFilter->SetValue(0, 255);
contourFilter->ComputeScalarsOn();
contourFilter->ComputeNormalsOn();
......@@ -121,7 +121,7 @@ void SVTKMesher::updating() throw ( ::fwTools::Failed )
// smooth filter
vtkSmartPointer< vtkWindowedSincPolyDataFilter > smoothFilter = vtkSmartPointer< vtkWindowedSincPolyDataFilter >::New();
smoothFilter->SetInput(contourFilter->GetOutput());
smoothFilter->SetInputConnection(contourFilter->GetOutputPort());
smoothFilter->SetNumberOfIterations( 50 );
smoothFilter->BoundarySmoothingOn();
smoothFilter->SetPassBand ( 0.1 );
......@@ -139,7 +139,7 @@ void SVTKMesher::updating() throw ( ::fwTools::Failed )
if( reduction > 0 )
{
vtkSmartPointer< vtkDecimatePro > decimate = vtkSmartPointer< vtkDecimatePro >::New();
decimate->SetInput( smoothFilter->GetOutput() );
decimate->SetInputConnection( smoothFilter->GetOutputPort() );
decimate->SetTargetReduction( reduction/100.0 );
decimate->PreserveTopologyOff();
decimate->SplittingOn();
......
......@@ -117,7 +117,7 @@ void VTKMeshCreation::updating() throw ( ::fwTools::Failed )
// contour filter
vtkSmartPointer< vtkDiscreteMarchingCubes > contourFilter = vtkSmartPointer< vtkDiscreteMarchingCubes >::New();
contourFilter->SetInput(vtkImage);
contourFilter->SetInputData(vtkImage);
contourFilter->SetValue(0, 255);
contourFilter->ComputeScalarsOn();
contourFilter->ComputeNormalsOn();
......@@ -125,7 +125,7 @@ void VTKMeshCreation::updating() throw ( ::fwTools::Failed )
// smooth filter
vtkSmartPointer< vtkWindowedSincPolyDataFilter > smoothFilter = vtkSmartPointer< vtkWindowedSincPolyDataFilter >::New();
smoothFilter->SetInput(contourFilter->GetOutput());
smoothFilter->SetInputConnection(contourFilter->GetOutputPort());
smoothFilter->SetNumberOfIterations( 50 );
smoothFilter->BoundarySmoothingOn();
smoothFilter->SetPassBand ( 0.1 );
......@@ -143,7 +143,7 @@ void VTKMeshCreation::updating() throw ( ::fwTools::Failed )
if( reduction > 0 )
{
vtkSmartPointer< vtkDecimatePro > decimate = vtkSmartPointer< vtkDecimatePro >::New();
decimate->SetInput( smoothFilter->GetOutput() );
decimate->SetInputConnection( smoothFilter->GetOutputPort() );
decimate->SetTargetReduction( reduction/100.0 );
decimate->PreserveTopologyOff();
decimate->SplittingOn();
......
......@@ -2,7 +2,11 @@
TYPE = 'bundle'
VERSION = '0-1'
USE = ['vtkWidgets', 'boost']
USE = [
'boost',
'vtk6InteractionWidgets',
'vtk6InteractionStyle',
]
LIB = [
'fwComEd_0-1',
'fwCore_0-1',
......
......@@ -7,6 +7,7 @@
#ifndef _VISUVTKADAPTOR_CONFIG_HPP_
#define _VISUVTKADAPTOR_CONFIG_HPP_
#define vtkRenderingCore_AUTOINIT 4(vtkInteractionStyle,vtkRenderingFreeType,vtkRenderingFreeTypeOpenGL,vtkRenderingOpenGL)
#ifdef _WIN32
......
......@@ -25,7 +25,7 @@ void Cube::doStart() throw(fwTools::Failed)
{
vtkCubeSource *cube = vtkCubeSource::New();
vtkPolyDataMapper *mapper = vtkPolyDataMapper::New();
mapper->SetInput(cube->GetOutput());
mapper->SetInputConnection(cube->GetOutputPort());
vtkActor *actor = vtkActor::New();
actor->SetMapper(mapper);
this->addToRenderer(actor);
......
......@@ -49,7 +49,7 @@ Distance::Distance() throw():
m_lineSource = vtkLineSource::New();
m_lineSource->SetResolution(1);
LineMapper = vtkPolyDataMapper::New();
LineMapper->SetInput(m_lineSource->GetOutput());
LineMapper->SetInputConnection(m_lineSource->GetOutputPort());
m_lineActor = vtkActor::New();
m_lineActor->SetMapper(LineMapper);
m_lineActor->GetProperty()->SetLineWidth(5.);
......
......@@ -263,7 +263,7 @@ void Image::updateImageOpacity()
void Image::buildPipeline( )
{
SLM_TRACE_FUNC();
m_map2colors->SetInput(m_imageData);
m_map2colors->SetInputData(m_imageData);
m_map2colors->SetLookupTable(m_lut);
m_map2colors->SetOutputFormatToRGBA();
......@@ -296,6 +296,7 @@ void Image::buildPipeline( )
{
SLM_TRACE("Register is a vtkImageData");
m_map2colors->SetOutput(imageData);
m_map2colors->Update();
}
this->setVtkPipelineModified();
......
......@@ -103,7 +103,7 @@ void Image3DCursor::doStart() throw(fwTools::Failed)
m_cursorActor->GetProperty()->SetColor(1,1,1);
}
m_cursorMapper->SetInput( m_cursorPolyData );
m_cursorMapper->SetInputData( m_cursorPolyData );
m_cursorActor->SetMapper(m_cursorMapper);
if(!this->getTransformId().empty())
......@@ -177,7 +177,7 @@ void Image3DCursor::doReceive( ::fwServices::ObjectMsg::csptr msg) throw(fwTools
m_cursorActor->GetProperty()->SetColor( color->red(), color->green(), color->blue());
buildPolyData(radius->value());
m_cursorMapper->SetInput( m_cursorPolyData );
m_cursorMapper->SetInputData( m_cursorPolyData );
this->setVtkPipelineModified();
}
}
......
......@@ -29,6 +29,7 @@
#include <vtkProperty.h>
#include <vtkRenderer.h>
#include <vtkTransform.h>
#include <vtkImageMapper3D.h>
#include "visuVTKAdaptor/ImageSlice.hpp"
......@@ -319,7 +320,7 @@ void ImageSlice::buildPipeline( )
if (algorithm)
{
SLM_TRACE("Input is a vtkImageAlgorithm");
m_imageActor->SetInput(algorithm->GetOutput());
m_imageActor->GetMapper()->SetInputConnection(algorithm->GetOutputPort());
//if (imageBlend)
//{
//imageBlend->SetBlendModeToCompound();
......@@ -329,7 +330,7 @@ void ImageSlice::buildPipeline( )
else if (imageData)
{
SLM_TRACE("Input is a vtkImageData");
m_imageActor->SetInput(imageData);
m_imageActor->SetInputData(imageData);
}
if(!this->getTransformId().empty())
......@@ -375,7 +376,7 @@ void ImageSlice::buildOutline()
cells = NULL;
m_planeOutlineMapper = vtkPolyDataMapper::New();
m_planeOutlineMapper->SetInput( m_planeOutlinePolyData );
m_planeOutlineMapper->SetInputData( m_planeOutlinePolyData );
m_planeOutlineMapper->SetResolveCoincidentTopologyToPolygonOffset();
m_planeOutlineActor->SetMapper(m_planeOutlineMapper);
m_planeOutlineActor->PickableOff();
......
......@@ -253,7 +253,7 @@ void ImagesProbeCursor::doStart() throw(fwTools::Failed)
this->addToRenderer(m_textActor );
buildPolyData();
m_cursorMapper->SetInput( m_cursorPolyData );
m_cursorMapper->SetInputData( m_cursorPolyData );
m_cursorActor->SetMapper(m_cursorMapper);
m_cursorActor->GetProperty()->SetColor(1,0,0);
if(!this->getTransformId().empty())
......
......@@ -802,7 +802,7 @@ void Mesh::updateMesh( ::fwData::Mesh::sptr mesh )
}
m_polyData = vtkPolyData::New();
::fwVtkIO::helper::Mesh::toVTKMesh(mesh, m_polyData);
m_mapper->SetInput(m_polyData);
m_mapper->SetInputData(m_polyData);
if (m_autoResetCamera)
{
......@@ -816,7 +816,7 @@ void Mesh::updateMesh( ::fwData::Mesh::sptr mesh )
vtkActor *Mesh::newActor()
{
vtkActor *actor = vtkActor::New();
m_mapper->SetInput(m_polyData);
m_mapper->SetInputData(m_polyData);
if (m_clippingPlanes)
{
......
......@@ -60,7 +60,7 @@ void MeshFactory::updateTriangulaMesh( ::fwData::TriangularMesh::sptr mesh)
vtkPolyData * polyData = ::fwVtkIO::toVTKMesh(mesh);
vtkPolyDataMapper * mapper = vtkPolyDataMapper::New();
m_normals->SetInput(polyData);
m_normals->SetInputData(polyData);
m_normals->ComputePointNormalsOn ();
m_normals->ComputeCellNormalsOff ();
m_normals->ConsistencyOn ();
......
......@@ -151,7 +151,7 @@ void MeshNormals::updateMeshNormals()
algo = ptMask;
}
algo->SetInput(m_polyData);
algo->SetInputData(m_polyData);
//vtkSmartPointer<vtkArrowSource> arrow = vtkSmartPointer<vtkArrowSource>::New();
vtkSmartPointer<vtkGlyphSource2D> arrow = vtkSmartPointer<vtkGlyphSource2D>::New();
......@@ -173,7 +173,7 @@ void MeshNormals::updateMeshNormals()
vtkSmartPointer<vtkGlyph3D> glyph = vtkSmartPointer<vtkGlyph3D>::New();
glyph->SetInputConnection(algo->GetOutputPort());
glyph->SetSource(arrow->GetOutput());
glyph->SetSourceConnection(arrow->GetOutputPort());
glyph->SetVectorModeToUseNormal();
glyph->SetScaleModeToScaleByVector();
glyph->SetScaleFactor(10.0);
......
......@@ -273,7 +273,7 @@ void MeshesBoxWidget::updateMeshMapFromComposite(::fwData::Composite::sptr compo
}
vtkSmartPointer<vtkPolyDataMapper> meshMapper = vtkSmartPointer<vtkPolyDataMapper>::New();
meshMapper->SetInput(vtkMesh);
meshMapper->SetInputData(vtkMesh);
vtkActor *meshActor = vtkActor::New();
meshActor->SetMapper(meshMapper);
......
......@@ -17,6 +17,7 @@
#include <fwVtkIO/vtk.hpp>
#include <vtkImageData.h>
#include <vtkImageMapToColors.h>
#include <vtkImageBlend.h>
#include "visuVTKAdaptor/Image.hpp"
......@@ -69,7 +70,7 @@ vtkObject* NegatoOneSlice::getImageSource()
}
else
{
m_imageSource = vtkImageData::New();
m_imageSource = vtkImageMapToColors::New();
m_manageImageSource = true;
}
}
......
......@@ -168,7 +168,7 @@ void Normals::updateNormals()
vtkGlyph3D* glyph = vtkGlyph3D::New();
glyph->SetInputConnection(ptMask->GetOutputPort());
glyph->SetSource(arrow->GetOutput());
glyph->SetSourceConnection(arrow->GetOutputPort());
glyph->SetVectorModeToUseNormal();
glyph->SetScaleModeToScaleByVector();
glyph->SetScaleFactor(10.0);
......
......@@ -243,7 +243,7 @@ void ProbeCursor::doStart() throw(fwTools::Failed)
this->addToRenderer(m_textActor );
this->buildPolyData();
m_cursorMapper->SetInput( m_cursorPolyData );
m_cursorMapper->SetInputData( m_cursorPolyData );
m_cursorActor->SetMapper(m_cursorMapper);
m_cursorActor->GetProperty()->SetColor(1,0,0);
if(!this->getTransformId().empty())
......
......@@ -173,7 +173,7 @@ void SliceFollowerCamera::initializeCamera()
double size = imageSize[ orientation ];
double distance = (1.1 * size)
/ ( std::tan( m_camera->GetViewAngle() * (vtkMath::DoublePi() / 180.0) ) );
/ ( std::tan( m_camera->GetViewAngle() * (vtkMath::Pi() / 180.0) ) );
m_camera->ParallelProjectionOn();
setVtkPipelineModified();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment