Commit e31eecc5 authored by Sankhesh Jhaveri's avatar Sankhesh Jhaveri 💬
Browse files

FIX: Compile errors due to recent API changes

parent d5d34f3b
......@@ -82,16 +82,16 @@ int main( int argc, char * argv [] )
table->SetValue(i, 2, sin(i * inc) + 0.0);
}
table->Update();
// table->Update();
// Add multiple line plots, setting the colors etc
vtkSmartPointer<vtkChartXY> chart = vtkSmartPointer<vtkChartXY>::New();
view->GetScene()->AddItem(chart);
vtkPlot *line = chart->AddPlot(vtkChart::LINE);
line->SetInput(table, 0, 1);
line->SetInputData(table, 0, 1);
line->SetColor(255, 0, 0, 255);
line = chart->AddPlot(vtkChart::LINE);
line->SetInput(table, 0, 2);
line->SetInputData(table, 0, 2);
line->SetColor(0, 255, 0, 255);
line->SetWidth(2.0);
......
......@@ -90,7 +90,7 @@ GUI4::GUI4()
// put cone in one window
vtkConeSource* cone = vtkConeSource::New();
vtkPolyDataMapper* mapper = vtkPolyDataMapper::New();
mapper->SetInput(cone->GetOutput());
mapper->SetInputConnection(cone->GetOutputPort());
vtkActor* actor = vtkActor::New();
actor->SetMapper(mapper);
Ren1->AddViewProp(actor);
......@@ -126,7 +126,7 @@ GUI4::GUI4()
// put sphere in other window
vtkSphereSource* sphere = vtkSphereSource::New();
mapper = vtkPolyDataMapper::New();
mapper->SetInput(sphere->GetOutput());
mapper->SetInputConnection(sphere->GetOutputPort());
actor = vtkActor::New();
actor->SetMapper(mapper);
Ren2->AddViewProp(actor);
......
......@@ -157,7 +157,7 @@ QtVTKRenderWindows::QtVTKRenderWindows( int argc, char *argv[])
rep->GetResliceCursorActor()->
GetCursorAlgorithm()->SetReslicePlaneNormal(i);
riw[i]->SetInput(reader->GetOutput());
riw[i]->SetInputConnection(reader->GetOutputPort());
riw[i]->SetSliceOrientation(i);
riw[i]->SetResliceModeToAxisAligned();
}
......
......@@ -97,7 +97,6 @@ QVTKWidget::QVTKWidget(QWidget* p, Qt::WFlags f)
mPaintEngine = new QVTKPaintEngine;
this->mCachedImage = vtkImageData::New();
this->mCachedImage->SetScalarTypeToUnsignedChar();
this->mCachedImage->SetOrigin(0,0,0);
this->mCachedImage->SetSpacing(1,1,1);
......@@ -315,9 +314,8 @@ void QVTKWidget::saveImageToCache()
int w = this->width();
int h = this->height();
this->mCachedImage->SetNumberOfScalarComponents(3);
this->mCachedImage->SetExtent(0, w-1, 0, h-1, 0, 0);
this->mCachedImage->AllocateScalars();
this->mCachedImage->AllocateScalars(VTK_UNSIGNED_CHAR, 3);
vtkUnsignedCharArray* array = vtkUnsignedCharArray::SafeDownCast(
this->mCachedImage->GetPointData()->GetScalars());
// We use back-buffer if
......@@ -333,7 +331,6 @@ void QVTKWidget::setAutomaticImageCacheEnabled(bool flag)
if (!flag)
{
this->mCachedImage->Initialize();
this->mCachedImage->SetScalarTypeToUnsignedChar();
this->mCachedImage->SetOrigin(0,0,0);
this->mCachedImage->SetSpacing(1,1,1);
}
......
......@@ -38,7 +38,7 @@ int TestVtkQtTableView(int argc, char* argv[])
// Create a sphere and create a vtkTable from its point data (normal vectors)
VTK_CREATE(vtkSphereSource, sphereSource);
VTK_CREATE(vtkDataObjectToTable, tableConverter);
tableConverter->SetInput(sphereSource->GetOutput());
tableConverter->SetInputConnection(sphereSource->GetOutputPort());
tableConverter->SetFieldType(vtkDataObjectToTable::POINT_DATA);
tableConverter->Update();
vtkTable* pointTable = tableConverter->GetOutput();
......
......@@ -268,7 +268,7 @@ void vtkQtTableView::AddRepresentationInternal(vtkDataRepresentation* rep)
vtkSmartPointer<vtkIdTypeArray>::New();
emptyNode->SetSelectionList(arr);
empty->AddNode(emptyNode);
this->AddSelectedColumn->SetInput(1, empty);
this->AddSelectedColumn->SetInputData(1, empty);
}
if(annConn)
......
......@@ -76,10 +76,8 @@ int vtkQImageToImageSource::RequestData( vtkInformation *vtkNotUsed(request),
unsigned char* data = new unsigned char[4*width*height];
memcpy( data, data2, 4*width*height );
output->SetNumberOfScalarComponents( 4 );
output->SetScalarTypeToUnsignedChar();
output->SetExtent(this->DataExtent);
output->AllocateScalars();
output->AllocateScalars(VTK_UNSIGNED_CHAR, 4);
vtkUnsignedCharArray* array = vtkUnsignedCharArray::SafeDownCast( output->GetPointData()->GetScalars() );
......
......@@ -103,7 +103,7 @@ vtkQtTreeRingLabelMapper::vtkQtTreeRingLabelMapper()
painter.setCompositionMode( QPainter::CompositionMode_SourceOver );
this->QtImageSource->SetQImage( this->QtImage );
this->LabelTexture->SetInput(this->QtImageSource->GetOutput());
this->LabelTexture->SetInputConnection(this->QtImageSource->GetOutputPort());
this->LabelTexture->PremultipliedAlphaOn();
this->TextureMapToPlane->SetSRange( 0., 1. );
......@@ -287,7 +287,7 @@ void vtkQtTreeRingLabelMapper::RenderOpaqueGeometry(vtkViewport *viewport,
VTK_CREATE( vtkQImageToImageSource, qis );
qis->SetQImage( this->QtImage );
this->LabelTexture->SetInput( qis->GetOutput() );
this->LabelTexture->SetInputConnection( qis->GetOutputPort() );
this->LabelTexture->PremultipliedAlphaOn();
this->PlaneSource->SetOrigin( 0, 0, 0 );
......
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