[vtkusers] Question on vtkProgrammableFilter..
Rakesh Patil
rakeshthp at in.com
Mon Apr 19 06:28:46 EDT 2010
Hello,I am using vtkProgrammableFilter to drag a node of a mesh using mouse.. And i need this functionalityto be implemented at any cost.. Below is my code..// code to build unstructured grid is written before..// now follows main code.vtkDataSetSurfaceFilter *sf = vtkDataSetSurfaceFilter::New();sf>SetInput(uGrid);vtkProgrammableFilter *pgf = vtkProgrammableFilter::New();pgf>SetInputConnection( sf>GetOutputPort());// pgf>SetInput(uGrid);pgf>SetExecuteMethod( adjustPoints, pgf );vtkSmartPointer< vtkCallbackCommand> callback = vtkSmartPointer::New();callback>SetCallback(moveCBFunction);callback>SetClientData(pgf);renderWindowInteractor>AddObserver(vtkCommand::MouseMoveEvent, callback);vtkDataSetMapper *dmapp = vtkDataSetMapper::New();dmapp>SetInputConnection( pgf>GetOutputPort());vtkActor *pactor = vtkActor::New();pactor>SetMapper(dmapp);pRenderer>AddActor(pactor);Now this code works very well.. But after adding a new cell to this grid, and i say, pactor>Modified(), The new c
ell is not visible..If i uncomment this // pgf>SetInput(uGrid);statement, and commentpgf>SetInputConnection( sf>GetOutputPort());statement, then the new cell gets displayed..In other words, I want both functionalities to be implemented. i.e. After adding new cell, it should be displayed in renderwindow, and must be able to drag a vertex(node) in the meshSo how can i do this..?? Why does pgf behave like this..?? Is it because, uGrid is unstructured andoutput of "sf" is a polydata..?? Am confused...Someone guide me..ThanksRegardsRakesh PatilDear VTK ! Get Yourself a cool, short @in.com Email ID now!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100419/8c27038e/attachment.htm>
More information about the vtkusers
mailing list