Thank you for your ongoing help! I understood and followed your suggestion.
I subclassed vtkCallbackCommand
. Inside its overridden Execute()
-function I got this far:
void HPvtkRenderCallback::Execute(
vtkObject* caller, unsigned long eventId, void* callData
)
{
std::cout << "Render callback" << std::endl;
std::cout << "Event: " << vtkCommand::GetStringFromEventId(eventId) << '\n';
auto* renderer = static_cast<vtkRenderer*>(caller);
double d1 = renderer->GetClippingRangeExpansion();
double d2 = renderer->GetClippingRangeExpansionMinValue();
double d3 = renderer->GetClippingRangeExpansionMaxValue();
vtkActorCollection* propCollection = renderer->GetActors();
propCollection->InitTraversal();
for (vtkIdType i = 0; i < propCollection->GetNumberOfItems(); ++i)
{
vtkActor* actor = propCollection->GetNextActor();
}
}
The calIback generally works. However, now I’m having problems getting the correct actor.
With this actor, I planned on:
- getting the actors mapper
- getting both mappers clipping planes (front and back as you said)
- calling
vtkPlane::Push(double distance)
with eitherd1
,d2
ord3
(not figured out yet)
I am using VTK-9.0, so SetObjectName()/GetObjectName()
is not an option.
How do I distinguish the correct actor from others?