[vtkusers] (no subject)

Amy Henderson amy.henderson at kitware.com
Fri Feb 13 11:14:27 EST 2004


At 11:07 AM 2/13/2004, Vetria Byrd wrote:
>I am trying to convert a python program to C++.
>
>Python Code:
>
>outline = vtkOutlineFilter()
>outline.SetInput(reader.GetOutput())
>outlineMapper = vtkPolyDataMapper()
>outlineMapper.SetInput(outline.GetOutput())
>outlineActor = vtkActor()
>outlineActor.SetMapper(outlineMapper)
>outlineProp=outlineActor.GetProperty()
>outlineProp.SetColor(0,0,0)
>
>Converted C++ code:
>
>vtkOutlineFilter *outline = vtkOutlineFilter::New();
>    outline->SetInput( (vtkDataSet *) reader->GetOutput() );
>
>vtkPolyDataMapper *outlineMapper = vtkPolyDataMapper::New();
>    outlineMapper->SetInput(outline->GetOutput() );
>
>vtkActor *outlineActor = vtkActor::New();
>    outlineActor->SetMapper(outlineMapper);
>
>vtkActor *outlineProp = vtkActor::New();

outlineProp should be of type vtkProperty, not vtkActor, so change the 
above line to:

  vtkProperty *outlineProp;

- Amy

>// the following lines of code are generating error messages:
>
>    outlineProp=outlineActor->GetProperty();
>    outlineProp->SetColor(0,0,0);
>
>
>Error messages:
>type `vtkActor' is not a base type for type `vtkProperty'
>no matching function for call to `vtkActor::SetColor (int, int, int)'
>
>How do I convert these two lines of python code to C++?
>
>Thanks in advance,
>Vetria
>
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: 
><http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers






More information about the vtkusers mailing list