[vtkusers] pipeline execution problem - SOLVED
Dean Inglis
dean.inglis at sympatico.ca
Tue Oct 27 19:26:07 EDT 2009
never mind, just a daft mistake...need to start
drinking coffee again...:)
Dean
-----Original Message-----
Sent: October-27-09 5:32 PM
To: 'vtkusers at vtk.org'
Subject: RE: pipeline execution problem
do I need to include a vtkTrivialProducer in
myFoo class?
Dean
-----Original Message-----
Sent: October-27-09 5:20 PM
To: 'vtkusers at vtk.org'
Subject: pipeline execution problem
I have the following scenario:
class myFoo: vtkObject
{
vtkPolyData* GetmyLine(){return myLine;}
void SomehowBuildmyLine();
void SomehowBuildmyLineDifferently();
private:
vtkPolyData* myLine;
}
void main()
{
myFoo* foo = myFoo::New();
foo->SomehowBuildmyLine();
vtkActor* actor = vtkActor::New();
vtkPolyDataMapper* mapper = vtkPolyDataMapper::New();
mapper->SetInput( foo->GetmyLine() );
actor->SetMapper( mapper);
// place the actor in a renderer and render it
//
vtkRenderer* ren = vtkRenderer::New();
ren->AddViewProp( actor );
ren->Render();
// change the points and cells that make myLine without
// deleting myLine
//
foo->SomehowBuildmyLineDifferently();
// try and render to see the changes
//
ren->Render();
At this point, I don't see any changes, even if myLine
has calls Modified() during its second build method.
I have tried
mapper->Modified();
mapper->Update()
ren->Render();
but I don't see the changes. In fact, if I do a check:
bool match = mapper->GetInput() == foo->GetmyLine();
match evaluates to false.
Since myLine is not generated by a vtkAlgorithm, how do I keep
the pipeline connected without having to explicitly to call
mapper->SetInput( foo->GetmyLine() );
every time a change is made to myLine???
Dean
More information about the vtkusers
mailing list