Hi,
I managed to upgrad from vtk 5.5 to vtk 9.3 with my 32bit application (now 64bit application).
But there seems to be a problem, I am trying to push points into the cloud and want to show them, as they are shown in vtk 5.5. But the screen is black.
Maybe I missing illumination? Camera stuff?
In vtk5.5 there is no code hinting to this:
m_strLegendLabelPrefix = "-";
m_LegendLabelWidth = 6;
m_LegendLabelDigits = 2;
m_showPointStatistics = TRUE;
m_printSelfAlone = TRUE;
SetVTKEnable(TRUE);
// Colors of the Image Mapping (no need of more than one we need one for all)
m_pColorTransferFunction = vtkSmartPointer<CvtkTransparentUndefColorTransferFunction>::New();
// The interactor is needed for moving the Camera around some *Actors using mouse and keyboard
// one is enough
m_pAxes = vtkSmartPointer<vtkCubeAxesActor2D>::New();
SetAxesLabelDigits(2);
m_pAxes->SetFontFactor(1.7);
m_pAxes->SetCornerOffset(0);
m_pAxes->UseRangesOn();
m_pAxes->SetScaling(FALSE); // No Changing of axes with zooming
// To set the text color to black
m_pAxes->GetAxisLabelTextProperty()->SetColor(0.1, 0.1, 0.1);
m_pAxes->GetAxisTitleTextProperty()->SetColor(0.1, 0.1, 0.1);
// the legend should be one of course
m_pLegend = vtkSmartPointer<vtkScalarBarActor>::New();
SetLegendLabelDigits(2);
SetLegendLabelWidth(6);
SetLegendLabelPrefix("-");
// To set the text color to black
m_pLegend->GetLabelTextProperty()->SetColor(0.1, 0.1, 0.1);
m_pLegend->GetTitleTextProperty()->SetColor(0.1, 0.1, 0.1);
// the legend Lookup Table also
m_pLegendLut = vtkSmartPointer<vtkColorTransferFunction>::New();
m_pLegend->SetLookupTable(m_pLegendLut);
SetStandardLUT();
// wafer
m_pDiskMapper = vtkSmartPointer<vtkPolyDataMapper>::New();
m_pCircle = vtkSmartPointer<vtkActor>::New();
m_pDisk = vtkSmartPointer<vtkDiskSource>::New();
//Titel
m_pTitle = vtkSmartPointer<vtkTextActor>::New();
m_pTitle->GetTextProperty()->SetFontSize(24);
m_pTitle->SetDisplayPosition(10, 10);
// To set the title color to black
m_pTitle->GetTextProperty()->SetColor (0.1, 0.1, 0.1);
for ( int i=0; i<6; i++ )
{
m_bUsePropBounds[i] = FALSE;
Undefine(m_UserRange[i]);
}
m_bManualAxisLabels = false;
m_LabelX = "";
m_LabelY = "";
m_LabelZ = "";
Here I pushing some Points into the sepcified vtk objects.
FLOAT32 z = 0;
m_pCellArray->InsertNextCell(4);
MakePointData(pX[i], pY[i], Valids, CellPointIdx, PointX, PointY);
for (UINT32 k=0; k<4; k++)
{
m_pPoints->InsertPoint(CellPointIdx[k], PointX[k], PointY[k], z);
m_pCellArray->InsertCellPoint(CellPointIdx[k]);
m_pScalars->InsertNextValue(pScalars[i]);
}
Am I missing something? I’ve done some stuff like:
SetInput to SetInputData as mentioned in the wiki.
Rendering is done by:
m_pRenderWindow->Render(); // vtkWin32OpenGLRenderWindow