void PieChartDisplay::onInitialize()
 {
   static int count = 0;
   rviz::UniformStringStream ss;
   ss << "PieChartDisplayObject" << count++;
   overlay_.reset(new OverlayObject(ss.str()));
   onEnable();
   updateSize();
   updateLeft();
   updateTop();
   updateFGColor();
   updateBGColor();
   updateFGAlpha();
   updateFGAlpha2();
   updateBGAlpha();
   updateMinValue();
   updateMaxValue();
   updateTextColor();
   updateTextAlpha();
   updateTextSize();
   updateShowCaption();
   updateAutoColorChange();
   updateMaxColor();
   overlay_->updateTextureSize(texture_size_, texture_size_ + caption_offset_);
   overlay_->hide();
 }
Пример #2
0
void QcNumberBox::setLocked( bool locked )
{
  if( locked ) {
    setReadOnly( true );
    setSelection( 0, 0 );
  }
  else {
    setReadOnly( false );
  }
  updateTextColor();
}
Пример #3
0
void QcNumberBox::setEditedTextColor( const QColor& c ) {
  if( c.isValid() ) {
    editedTextColor = c;
    updateTextColor();
  }
}
Пример #4
0
void QcNumberBox::setTextColor( const QColor& c ) {
  if( c.isValid() ) {
    normalTextColor = c;
    updateTextColor();
  }
}
  PieChartDisplay::PieChartDisplay()
    : rviz::Display()
  {
    update_topic_property_ = new rviz::RosTopicProperty(
      "Topic", "",
      ros::message_traits::datatype<std_msgs::Float32>(),
      "std_msgs::Float32 topic to subscribe to.",
      this, SLOT( updateTopic() ));
    size_property_ = new rviz::IntProperty("size", 128,
                                           "size of the plotter window",
                                           this, SLOT(updateSize()));
    left_property_ = new rviz::IntProperty("left", 128,
                                           "left of the plotter window",
                                           this, SLOT(updateLeft()));
    top_property_ = new rviz::IntProperty("top", 128,
                                          "top of the plotter window",
                                          this, SLOT(updateTop()));
    fg_color_property_ = new rviz::ColorProperty("foreground color",
                                                 QColor(25, 255, 240),
                                                 "color to draw line",
                                                 this, SLOT(updateFGColor()));
    fg_alpha_property_
      = new rviz::FloatProperty("foreground alpha", 0.7,
                                "alpha belnding value for foreground",
                                this, SLOT(updateFGAlpha()));
    fg_alpha2_property_
      = new rviz::FloatProperty("foreground alpha 2", 0.4,
                                "alpha belnding value for foreground for indicator",
                                this, SLOT(updateFGAlpha2()));
    bg_color_property_ = new rviz::ColorProperty("background color",
                                                 QColor(0, 0, 0),
                                                 "background color",
                                                 this, SLOT(updateBGColor()));
    bg_alpha_property_
      = new rviz::FloatProperty("backround alpha", 0.0,
                                "alpha belnding value for background",
                                this, SLOT(updateBGAlpha()));
    text_color_property_
      = new rviz::ColorProperty("text color",
                                QColor(25, 255, 240),
                                "text color",
                                this, SLOT(updateTextColor()));
    text_alpha_property_
      = new rviz::FloatProperty("text alpha", 1.0,
                                "alpha belnding value for text",
                                this, SLOT(updateTextAlpha()));
    text_size_property_
      = new rviz::IntProperty("text size", 14,
                              "text size",
                              this, SLOT(updateTextSize()));
    show_caption_property_
      = new rviz::BoolProperty("show caption", true,
                                "show caption",
                                this, SLOT(updateShowCaption()));
    max_value_property_
      = new rviz::FloatProperty("max value", 1.0,
                                "max value of pie chart",
                                this, SLOT(updateMaxValue()));
    min_value_property_
      = new rviz::FloatProperty("min value", 0.0,
                                "min value of pie chart",
                                this, SLOT(updateMinValue()));
    auto_color_change_property_
      = new rviz::BoolProperty("auto color change",
                               false,
                               "change the color automatically",
                               this, SLOT(updateAutoColorChange()));
    max_color_property_
      = new rviz::ColorProperty("max color",
                                QColor(255, 0, 0),
                                "only used if auto color change is set to True.",
                                this, SLOT(updateMaxColor()));

  }