void moveit_rviz_plugin::PropertyHolder::createProperty(
      rviz::Property *parent_property,
      const std::string& descr,
      QVariant value)
{
  switch(type_)
  {
    case PT_EMPTY:
      property_ = new rviz::Property(
                             name_.c_str(),
                             QVariant(),
                             descr.c_str(),
                             parent_property);
      break;
    case PT_INT:
      property_ = new rviz::IntProperty(
                             name_.c_str(),
                             value.toInt(),
                             descr.c_str(),
                             parent_property,
                             SLOT( changedSlot() ),
                             this );
      break;
    case PT_FLOAT:
      property_ = new rviz::FloatProperty(
                             name_.c_str(),
                             value.toDouble(),
                             descr.c_str(),
                             parent_property,
                             SLOT( changedSlot() ),
                             this );
      break;
    case PT_BOOL:
    default:
      type_ = PT_BOOL;
      property_ = new rviz::BoolProperty(
                             name_.c_str(),
                             value.toBool(),
                             descr.c_str(),
                             parent_property,
                             SLOT( changedSlot() ),
                             this );
      break;
  }
logInform(" createProperty %08lx",long(property_));
  if (flags_ & PF_READ_ONLY)
    property_->setReadOnly(true);
}
Exemplo n.º 2
0
void SlicePlaneClipper::setSlicer(SliceProxyPtr slicer)
{
	if (mSlicer==slicer)
		return;
	if (mSlicer)
	{
		disconnect(mSlicer.get(), SIGNAL(transformChanged(Transform3D)), this, SLOT(changedSlot()));
	}
	mSlicer = slicer;
	if (mSlicer)
	{
		connect(mSlicer.get(), SIGNAL(transformChanged(Transform3D)), this, SLOT(changedSlot()));
	}

	this->updateClipPlane();
	this->changedSlot();
}
moveit_rviz_plugin::PerLinkObjBase::PerLinkObjBase(
                rviz::Property *parent,
                const std::string& name,
                const std::string& descrip,
                const QColor& default_color,
                double default_alpha,
                Style style,
                double size,
                bool update_with_state)
  : style_(style)
  , avoid_enable_update_(false)
  , rviz::BoolProperty(name.c_str(), false, descrip.c_str(), parent)
  , update_with_state_(update_with_state)
{
  connect(this, SIGNAL( changed() ), this, SLOT( changedEnableSlot() ) );

  color_ = new rviz::ColorProperty(
                      ("Color for " + name).c_str(),
                      default_color,
                      ("Color for " + name).c_str(),
                      this,
                      SLOT( changedSlot() ),
                      this );
  alpha_ = new rviz::FloatProperty(
                      ("Alpha for " + name).c_str(),
                      default_alpha,
                      ("Alpha (transparency) for " + name).c_str(),
                      this,
                      SLOT( changedSlot() ),
                      this );
  alpha_->setMin( 0.0 );
  alpha_->setMax( 1.0 );
  size_ = new rviz::FloatProperty(
                      ("Pointsize for " + name).c_str(),
                      size,
                      ("Size of points displayed for " + name).c_str(),
                      this,
                      SLOT( changedSlot() ),
                      this );
  setStyle(style_);
}
Exemplo n.º 4
0
Action::Action(ActionDescription *description, ActionContext *context, QObject *parent)
        : QAction(parent), Description(description), Context(context)
{
    setText(Description->Text);
    setCheckable(Description->Checkable);

    connect(this, SIGNAL(changed()), this, SLOT(changedSlot()));
    connect(this, SIGNAL(hovered()), this, SLOT(hoveredSlot()));
    connect(this, SIGNAL(triggered(bool)), this, SLOT(triggeredSlot(bool)));

    connect(context, SIGNAL(changed()), this, SLOT(checkState()));
}
Exemplo n.º 5
0
StringPropertyFusedInputOutputSelectData::StringPropertyFusedInputOutputSelectData(PatientModelServicePtr patientModelService,
																						 SelectDataStringPropertyBasePtr base,
																						 SelectDataStringPropertyBasePtr input) :
	SelectDataStringPropertyBase(patientModelService)
{
	mBase = base;
	mInput = input;
	connect(mInput.get(), SIGNAL(changed()), this, SLOT(inputDataChangedSlot()));
	//    connect(mInput.get(), SIGNAL(dataChanged(QString)), this, SLOT(inputDataChangedSlot()));
	connect(mBase.get(), SIGNAL(dataChanged(QString)), this, SIGNAL(dataChanged(QString)));
	connect(mBase.get(), SIGNAL(changed()), this, SLOT(changedSlot()));
	connect(mBase.get(), SIGNAL(changed()), this, SIGNAL(changed()));
}
void moveit_rviz_plugin::PerLinkObjBase::addBoolProperty(
      const std::string& name,
      bool value,
      const std::string& descrip)
{
  rviz::BoolProperty* prop = new rviz::BoolProperty(
                      name.c_str(),
                      value,
                      descrip.c_str(),
                      this,
                      SLOT( changedSlot() ),
                      this );
  extra_property_map_[name] = prop;
}
Exemplo n.º 7
0
AxisConnector::AxisConnector(CoordinateSystem space, SpaceProviderPtr spaceProvider)
{
	mSpaceProvider = spaceProvider;
	mListener = mSpaceProvider->createListener();
	mListener->setSpace(space);
	connect(mListener.get(), SIGNAL(changed()), this, SLOT(changedSlot()));

	mRep = AxesRep::New(space.toString() + "_axis");
	mRep->setCaption(space.toString(), Vector3D(1, 0, 0));
	mRep->setShowAxesLabels(false);
	mRep->setFontSize(0.08);
	mRep->setAxisLength(0.03);
	this->changedSlot();
}
Exemplo n.º 8
0
void MainWindow::createPictureWidget()
{
    pictureWidget = new TPictureWidget(0);
    pictureWidget->setAttribute(Qt::WA_DeleteOnClose);

    connect(pictureWidget, SIGNAL(closeSignal()),
            this, SLOT(closePictureWidgetSlot()));
    connect(pictureWidget, SIGNAL(needNextPicture(IPictureEditor*&)),
            this, SLOT(getNextPicture(IPictureEditor *&)));
    connect(pictureWidget, SIGNAL(changed()),
            this, SLOT(changedSlot()));

    connect(this, SIGNAL(closeSignal()),
            pictureWidget, SLOT(close()));

    pictureWidget->show();

}
Exemplo n.º 9
0
void Transform3DWidget::addTranslationControls(QString uid, QString name, int index, QVBoxLayout* layout)
{
  QHBoxLayout* hLayout = new QHBoxLayout;

  DoublePropertyPtr adapter = DoubleProperty::initialize(uid, name, "", 0, DoubleRange(-10000,10000,0.1),1);
  connect(adapter.get(), SIGNAL(changed()), this, SLOT(changedSlot()));
  adapter->setInternal2Display(1.0);
  hLayout->addWidget(new SpinBoxGroupWidget(this, adapter));

  QSize mMinBarSize = QSize(20,20);
  MousePadWidget* pad = new MousePadWidget(this, mMinBarSize);
  pad->setFixedYPos(true);
  hLayout->addWidget(pad);

  // use QtSignalAdapters library to work magic:
  QtSignalAdapters::connect1<void(QPointF)>(pad, SIGNAL(mouseMoved(QPointF)),
      boost::bind(&Transform3DWidget::translateSlot, this, _1, index));

  layout->addLayout(hLayout);
  mTranslationAdapter[index] = adapter;
}
Exemplo n.º 10
0
void SlicePlaneClipper::setInvertPlane(bool on)
{
	mInvertPlane = on;
	changedSlot();
}
Exemplo n.º 11
0
void AxisConnector::mergeWith(SpaceListenerPtr base)
{
	mBase = base;
	connect(mBase.get(), SIGNAL(changed()), this, SLOT(changedSlot()));
	this->changedSlot();
}