[Paraview-developers] object not displaying in the paraview window
Chiranjib Sur
sur.chiranjib at gmail.com
Fri Apr 17 06:34:24 EDT 2015
Hi All,
I want to apply the tranform filter while I create an object in paraview.
TO try with I have overloaded vtkCubeSource class and can create the object
which appears in the paraview pipeline and I can visualize the object in
the PV window.
Now I want to apply the transformation filter (vtkTransform) to the objct
when I create it. To do that I have overloaded the RequestData function
like the following.
The code is compiling and executing but when I create the object and apply
transform, nothing is appearing in the PV visualization window.
Can anybody help me pointing out what is going wrong with my implementation.
I cam copying my code below
Thanks,
Chiranjib
------
int MyOwnCubeSource::RequestData( vtkInformation *vtkNotUsed(request),
vtkInformationVector **vtkNotUsed(inputVector),
vtkInformationVector *outputVector)
{
// get the info object
vtkInformation *outInfo = outputVector->GetInformationObject(0);
// get the ouptut
vtkPolyData *output = vtkPolyData::SafeDownCast(
outInfo->Get(vtkDataObject::DATA_OBJECT()));
....
....
// output (type vtkPolyData) is already ready at this stage
// If I don’t appy transform operation afterwards, I can visualize the
object in the PV pipeline
// -----------------------------------------------//
// Implementation of vtkTransform starts here
double _rotationZ = 30.0;
// Define transform
vtkSmartPointer<vtkTransform> transform =
vtkSmartPointer<vtkTransform>::New();
// Define transformModel : transform filter
vtkSmartPointer<vtkTransformFilter> transformModel =
vtkSmartPointer<vtkTransformFilter>::New();
transformModel->SetTransform(transform);
//Decoupling the pipeline and asking the transformfilter to update the
newpipeline (created out of shallowcopy)
vtkNew<vtkPolyData> cubeCopy;
cubeCopy->ShallowCopy(output);
transformModel->SetInputData(cubeCopy.GetPointer());
// Describe all the transform operations
transform->PostMultiply();
transform->RotateZ(10*_rotationZ);
transform->Update();
// getting the transformed output
vtkSmartPointer<vtkDataSet> transformedOutput =
transformModel->GetOutput();
// Shallowcopy the transformed output to the old pipeline
output->ShallowCopy(transformedOutput);
// A this stage "output" should be updated and the visualization pipeline
should show the transformed object
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20150417/76864850/attachment.html>
More information about the Paraview-developers
mailing list