
#ifndef _pqFFDTransformPanel_h
#define _pqFFDTransformPanel_h

#include "pqAutoGeneratedObjectPanel.h"
#include "pqObjectPanelInterface.h"

#include <QLabel>
#include <QComboBox>
#include <QLayout>

#include "pqPropertyManager.h"
#include "pqNamedWidgets.h"


class pqFFDTransformPanel : public pqAutoGeneratedObjectPanel
{
  Q_OBJECT 

    public:

  pqFFDTransformPanel(pqProxy* pxy, QWidget* p)
    : pqAutoGeneratedObjectPanel(pxy,p)
    {
    
      printf("Je suis passe par ici\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n");

      //find the widget that were automatically generated for
      //the Axis property. Then, unlink them from the server
      //manager properties they control and hide them.

      QWidget *widget = this->findChild<QWidget*>("Axis_Label");
      widget->hide();

      widget = this->findChild<QWidget*>("Axis");
      pqNamedWidgets::unlinkObject(widget,this->proxy(), "Axis", this->propertyManager());
      widget->hide();

  
      widget = this->findChild<QWidget*>("Axis_Slider");
      pqNamedWidgets::unlinkObject(widget,this->proxy(), "Axis", this->propertyManager());
      widget->hide();


      // Make a new Widget
      QLabel *newlabel = new QLabel("Axis of Rotation");
      QComboBox *newwidget = new QComboBox();
      newwidget->addItem("X");
      newwidget->addItem("Y");
      newwidget->addItem("Z");

  
      //tell ParaView that the new widget controls the axis property
      this->propertyManager()->registerLink(
					    newwidget, "currentIndex",
					    SIGNAL(currentIndexChanged(int)),
					    this->proxy(),this->proxy()->GetProperty("Axis"));

      //put the new widget onto the top of the panel where the original widgets were
      this->PanelLayout->addWidget(newlabel, 0, 0);  
      this->PanelLayout->addWidget(newwidget, 0, 1);
    };


  ~pqFFDTransformPanel() {};
};

#endif


