Hi experts,
I am new to developing paraview (pv) plug-in and am trying to display an object with a caption in the renderview. I was able to create the below image in python VTK where I added a cylinder and an “vtkCaptionActor2D()” actor to the renderer.
I need to create similar functionality in a plug-in in ParaView. However, I cannot figure out how to get access to the pv renderer and add the caption actor. Or may be, return a single object by “grouping” the cylinder and caption (not sure how to “combine” or “group”).
If it helps below is my “RequestData()” function.
1. int MyPlugin::RequestData(vtkInformation* vtkNotUsed(request),
2. vtkInformationVector** vtkNotUsed(inputVector), vtkInformationVector* outputVector)
3. {
4. auto cyl = vtkCylinderSource::New();
5. cyl->SetCenter(0, 0, 0);
6. cyl->SetHeight(100);
7. cyl->SetRadius(1);
8. cyl->SetResolution(50);
9. cyl->Update();
10. auto caption = vtkCaptionActor2D::New();
11. caption.SetCaption("Test Caption");
12. auto outInfo = outputVector->GetInformationObject(0);
13. auto outObj = outInfo->Get(vtkDataObject::DATA_OBJECT());
14. outObj->ShallowCopy(cyl->GetOutput());
15. return 1;
16. }
Any suggestions or example would be helpful.
Regards