[vtkusers] pb with Legend Box of vtkXYPlotActor on Alpha

Jerome Coloos jerome.coloos at samcef.com
Thu Aug 2 09:35:28 EDT 2001


Hi all,

I run this simple XY-Plot example on hpux, irix, linux, aix, sunOS but it
doesn't run on my Alpha OSF1 V4.0.

To run it, I need to put the LegendOff() only on Alpha.

Could somebody try to run it on this architecture ?


////////////////////////////////////////////////////////////////////////////
///
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkRenderer.h"
#include "vtkXYPlotActor.h"
#include "vtkRectilinearGrid.h"
#include "vtkFloatArray.h"

int main()
{
	// Create the rendering stuff
	vtkRenderWindow *renWin = vtkRenderWindow::New();
	vtkRenderWindowInteractor *iren   = vtkRenderWindowInteractor::New();
		iren->SetRenderWindow(renWin);
	vtkRenderer *ren = vtkRenderer::New();
	renWin->AddRenderer(ren);
	ren->SetBackground(0.87,0.87,0.87);

	vtkFloatArray *xCoords = vtkFloatArray::New();
	vtkFloatArray *yCoords = vtkFloatArray::New();

	int dataSize = 100;
	float *array = new float[dataSize];
	for (int i = 0; i < dataSize; i++) *(array + i ) = i;
	xCoords->SetArray(array, dataSize, 1);
	yCoords->SetArray(array, dataSize, 1);

	vtkXYPlotActor *xyplot = vtkXYPlotActor::New();
	   xyplot -> GetProperty()->SetColor(0,0,0);
 		xyplot -> SetXValuesToValue();
		xyplot -> LegendOn();

	vtkRectilinearGrid *curve  = vtkRectilinearGrid::New();
		curve -> SetDimensions(dataSize,1,1);
		curve -> SetXCoordinates(xCoords);
		curve -> GetPointData()->SetScalars(yCoords);
		xyplot-> AddInput(curve);

	ren->AddActor2D(xyplot);
  renWin->Render();

  // interact with data
  iren->Initialize();
  iren->Start();
  exit(1);
}
////////////////////////////////////////////////////////////////////////////
///


__________________________________________
   ___    Jérôme COLOOS
 @/   \@  Tel : 32-4/361.69.69
  \° °/   Fax : 32-4/361.69.80
 ==\ /==  mailto:jerome.coloos at samcef.com
    °     http://www.samcef.com
SAMTECH s.a.
Parc Scientifique du Sart-Tilman
rue des Chasseurs-Ardennais, 8
B-4031 Angleur-LIEGE
___________________________________________





More information about the vtkusers mailing list