[vtk-developers] [Paraview-developers] Moving vtkMemberFunctionCommand to VTK

David Doria daviddoria at gmail.com
Tue Oct 5 19:12:45 EDT 2010


On Tue, Oct 5, 2010 at 6:31 PM, David Gobbi <david.gobbi at gmail.com> wrote:
> In the example, is the <A> needed?
>
> object->AddObserver<A>(vtkCommand::AnyEvent, handler, &vtkSomeClass::OnEvent);
>
>   David

Well done Utkarsh!

I used it like this:
class CustomStyle : public vtkInteractorStyleImage
{
public:
...
  CustomStyle()
  {
    this->Tracer = vtkSmartPointer<vtkImageTracerWidget>::New();
    this->Tracer->AddObserver(vtkCommand::EndInteractionEvent, this,
&CustomStyle::CatchWidgetEvent);
  }

so David G is correct that you do not need the <A> in the AddObserver call.

The only issue is that there are hundreds of warnings like this when
building VTK:

/home/doriad/src/VTK/Common/vtkObject.h: In member function ‘virtual
void vtkObject::Callable<T>::operator()(vtkObject*, long unsigned int,
void*)’:
/home/doriad/src/VTK/Common/vtkObject.h:245: warning: declaration of
‘T* obj’ shadows a parameter
/home/doriad/src/VTK/Common/vtkObject.h:241: warning: shadowed
declaration is here

David



More information about the vtk-developers mailing list