pie_chart_display.h
Go to the documentation of this file.
1 // -*- mode: c++; -*-
2 /*********************************************************************
3  * Software License Agreement (BSD License)
4  *
5  * Copyright (c) 2014, JSK Lab
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  * * Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  * * Redistributions in binary form must reproduce the above
15  * copyright notice, this list of conditions and the following
16  * disclaimer in the documentation and/or other materials provided
17  * with the distribution.
18  * * Neither the name of the JSK Lab nor the names of its
19  * contributors may be used to endorse or promote products derived
20  * from this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33  * POSSIBILITY OF SUCH DAMAGE.
34  *********************************************************************/
35 #ifndef JSK_RVIZ_PLUGINS_PIE_CHART_DISPLAY_H_
36 #define JSK_RVIZ_PLUGINS_PIE_CHART_DISPLAY_H_
37 #include "std_msgs/Float32.h"
38 #ifndef Q_MOC_RUN
39 #include <rviz/display.h>
40 #include "overlay_utils.h"
41 #include <OGRE/OgreColourValue.h>
42 #include <OGRE/OgreTexture.h>
43 #include <OGRE/OgreMaterial.h>
49 #endif
50 
51 namespace jsk_rviz_plugins
52 {
53  class PieChartDisplay
54  : public rviz::Display
55  {
56  Q_OBJECT
57  public:
59  virtual ~PieChartDisplay();
60 
61  // methods for OverlayPickerTool
62  virtual bool isInRegion(int x, int y);
63  virtual void movePosition(int x, int y);
64  virtual void setPosition(int x, int y);
65  virtual int getX() { return left_; };
66  virtual int getY() { return top_; };
67 
68  protected:
69  virtual void subscribe();
70  virtual void unsubscribe();
71  virtual void onEnable();
72  virtual void onDisable();
73  virtual void onInitialize();
74  virtual void processMessage(const std_msgs::Float32::ConstPtr& msg);
75  virtual void drawPlot(double val);
76  virtual void update(float wall_dt, float ros_dt);
77  // properties
99 
101  int left_;
102  int top_;
103  uint16_t texture_size_;
104  QColor fg_color_;
105  QColor bg_color_;
106  QColor max_color_;
107  QColor med_color_;
108  int text_size_;
109  bool show_caption_;
110  bool auto_color_change_;
111  int caption_offset_;
112  double fg_alpha_;
113  double fg_alpha2_;
114  double bg_alpha_;
115  double max_value_;
116  double min_value_;
117  double max_color_threshold_;
118  double med_color_threshold_;
119  float data_;
120  bool update_required_;
121  bool first_time_;
123  bool clockwise_rotate_;
124 
125  boost::mutex mutex_;
126 
127  protected Q_SLOTS:
128  void updateTopic();
129  void updateSize();
130  void updateTop();
131  void updateLeft();
132  void updateBGColor();
133  void updateTextSize();
134  void updateFGColor();
135  void updateFGAlpha();
136  void updateFGAlpha2();
137  void updateBGAlpha();
138  void updateMinValue();
139  void updateMaxValue();
140  void updateShowCaption();
141  void updateAutoColorChange();
147 
148  private:
149  };
150 
151 }
152 
153 #endif
jsk_rviz_plugins::PieChartDisplay::overlay_
OverlayObject::Ptr overlay_
Definition: pie_chart_display.h:186
jsk_rviz_plugins::PieChartDisplay::getX
virtual int getX()
Definition: pie_chart_display.h:129
jsk_rviz_plugins::PieChartDisplay::min_value_property_
rviz::FloatProperty * min_value_property_
Definition: pie_chart_display.h:155
jsk_rviz_plugins::PieChartDisplay::bg_color_
QColor bg_color_
Definition: pie_chart_display.h:169
jsk_rviz_plugins::PieChartDisplay::data_
float data_
Definition: pie_chart_display.h:183
jsk_rviz_plugins::PieChartDisplay::updateTopic
void updateTopic()
Definition: pie_chart_display.cpp:462
jsk_rviz_plugins::PieChartDisplay::updateLeft
void updateLeft()
Definition: pie_chart_display.cpp:387
jsk_rviz_plugins::PieChartDisplay::bg_alpha_
double bg_alpha_
Definition: pie_chart_display.h:178
rviz::RosTopicProperty
jsk_rviz_plugins::PieChartDisplay::~PieChartDisplay
virtual ~PieChartDisplay()
Definition: pie_chart_display.cpp:169
jsk_rviz_plugins::PieChartDisplay::med_color_property_
rviz::ColorProperty * med_color_property_
Definition: pie_chart_display.h:159
jsk_rviz_plugins::PieChartDisplay::updateMinValue
void updateMinValue()
Definition: pie_chart_display.cpp:429
jsk_rviz_plugins::PieChartDisplay::drawPlot
virtual void drawPlot(double val)
Definition: pie_chart_display.cpp:246
jsk_rviz_plugins::PieChartDisplay::fg_alpha_property_
rviz::FloatProperty * fg_alpha_property_
Definition: pie_chart_display.h:149
jsk_rviz_plugins::PieChartDisplay::max_color_threshold_property_
rviz::FloatProperty * max_color_threshold_property_
Definition: pie_chart_display.h:160
jsk_rviz_plugins::PieChartDisplay::texture_size_
uint16_t texture_size_
Definition: pie_chart_display.h:167
jsk_rviz_plugins::PieChartDisplay::movePosition
virtual void movePosition(int x, int y)
Definition: pie_chart_display.cpp:526
jsk_rviz_plugins::PieChartDisplay::max_value_property_
rviz::FloatProperty * max_value_property_
Definition: pie_chart_display.h:154
boost::shared_ptr< OverlayObject >
jsk_rviz_plugins::PieChartDisplay::clockwise_rotate_property_
rviz::BoolProperty * clockwise_rotate_property_
Definition: pie_chart_display.h:162
jsk_rviz_plugins::PieChartDisplay::max_value_
double max_value_
Definition: pie_chart_display.h:179
jsk_rviz_plugins::PieChartDisplay::updateMaxColor
void updateMaxColor()
Definition: pie_chart_display.cpp:487
jsk_rviz_plugins::PieChartDisplay::max_color_threshold_
double max_color_threshold_
Definition: pie_chart_display.h:181
jsk_rviz_plugins::PieChartDisplay::mutex_
boost::mutex mutex_
Definition: pie_chart_display.h:189
rviz::BoolProperty
int_property.h
jsk_rviz_plugins::PieChartDisplay::bg_color_property_
rviz::ColorProperty * bg_color_property_
Definition: pie_chart_display.h:147
jsk_rviz_plugins::PieChartDisplay::size_property_
rviz::IntProperty * size_property_
Definition: pie_chart_display.h:143
jsk_rviz_plugins::PieChartDisplay::update_topic_property_
rviz::RosTopicProperty * update_topic_property_
Definition: pie_chart_display.h:142
jsk_rviz_plugins::PieChartDisplay::processMessage
virtual void processMessage(const std_msgs::Float32::ConstPtr &msg)
Definition: pie_chart_display.cpp:232
display.h
jsk_rviz_plugins::PieChartDisplay::fg_alpha_
double fg_alpha_
Definition: pie_chart_display.h:176
jsk_rviz_plugins::PieChartDisplay::updateTextSize
void updateTextSize()
Definition: pie_chart_display.cpp:443
float_property.h
rviz::ColorProperty
jsk_rviz_plugins::PieChartDisplay::updateBGColor
void updateBGColor()
Definition: pie_chart_display.cpp:393
jsk_rviz_plugins::PieChartDisplay::med_color_threshold_
double med_color_threshold_
Definition: pie_chart_display.h:182
rviz::Display
rviz::FloatProperty
jsk_rviz_plugins::PieChartDisplay::first_time_
bool first_time_
Definition: pie_chart_display.h:185
jsk_rviz_plugins::PieChartDisplay::caption_offset_
int caption_offset_
Definition: pie_chart_display.h:175
jsk_rviz_plugins::PieChartDisplay::top_
int top_
Definition: pie_chart_display.h:166
jsk_rviz_plugins::PieChartDisplay::updateMaxValue
void updateMaxValue()
Definition: pie_chart_display.cpp:436
overlay_utils.h
bool_property.h
jsk_rviz_plugins::PieChartDisplay::bg_alpha_property_
rviz::FloatProperty * bg_alpha_property_
Definition: pie_chart_display.h:151
jsk_rviz_plugins::PieChartDisplay::text_color_property_
rviz::ColorProperty * text_color_property_
Definition: pie_chart_display.h:148
jsk_rviz_plugins::PieChartDisplay::clockwise_rotate_
bool clockwise_rotate_
Definition: pie_chart_display.h:187
jsk_rviz_plugins::PieChartDisplay::updateClockwiseRotate
void updateClockwiseRotate()
Definition: pie_chart_display.cpp:513
jsk_rviz_plugins::PieChartDisplay::text_size_property_
rviz::IntProperty * text_size_property_
Definition: pie_chart_display.h:153
jsk_rviz_plugins::PieChartDisplay::auto_color_change_
bool auto_color_change_
Definition: pie_chart_display.h:174
jsk_rviz_plugins::PieChartDisplay::unsubscribe
virtual void unsubscribe()
Definition: pie_chart_display.cpp:356
jsk_rviz_plugins::PieChartDisplay::isInRegion
virtual bool isInRegion(int x, int y)
Definition: pie_chart_display.cpp:520
jsk_rviz_plugins::PieChartDisplay::updateMedColor
void updateMedColor()
Definition: pie_chart_display.cpp:494
bounding_box_sample.x
x
Definition: bounding_box_sample.py:30
jsk_rviz_plugins::PieChartDisplay::fg_color_property_
rviz::ColorProperty * fg_color_property_
Definition: pie_chart_display.h:146
jsk_rviz_plugins::PieChartDisplay::text_size_
int text_size_
Definition: pie_chart_display.h:172
jsk_rviz_plugins::PieChartDisplay::auto_color_change_property_
rviz::BoolProperty * auto_color_change_property_
Definition: pie_chart_display.h:157
jsk_rviz_plugins::PieChartDisplay::med_color_
QColor med_color_
Definition: pie_chart_display.h:171
jsk_rviz_plugins::PieChartDisplay::top_property_
rviz::IntProperty * top_property_
Definition: pie_chart_display.h:145
jsk_rviz_plugins::PieChartDisplay::min_value_
double min_value_
Definition: pie_chart_display.h:180
jsk_rviz_plugins::PieChartDisplay::updateTop
void updateTop()
Definition: pie_chart_display.cpp:381
jsk_rviz_plugins::PieChartDisplay::subscribe
virtual void subscribe()
Definition: pie_chart_display.cpp:346
jsk_rviz_plugins::PieChartDisplay::fg_alpha2_property_
rviz::FloatProperty * fg_alpha2_property_
Definition: pie_chart_display.h:150
jsk_rviz_plugins::PieChartDisplay::max_color_property_
rviz::ColorProperty * max_color_property_
Definition: pie_chart_display.h:158
jsk_rviz_plugins::PieChartDisplay::fg_alpha2_
double fg_alpha2_
Definition: pie_chart_display.h:177
bounding_box_sample.y
y
Definition: bounding_box_sample.py:31
jsk_rviz_plugins::PieChartDisplay::updateShowCaption
void updateShowCaption()
Definition: pie_chart_display.cpp:454
jsk_rviz_plugins::PieChartDisplay::updateBGAlpha
void updateBGAlpha()
Definition: pie_chart_display.cpp:422
jsk_rviz_plugins::PieChartDisplay::updateMedColorThreshold
void updateMedColorThreshold()
Definition: pie_chart_display.cpp:507
jsk_rviz_plugins::PieChartDisplay::updateFGAlpha2
void updateFGAlpha2()
Definition: pie_chart_display.cpp:414
jsk_rviz_plugins::PieChartDisplay::getY
virtual int getY()
Definition: pie_chart_display.h:130
jsk_rviz_plugins::PieChartDisplay::updateFGColor
void updateFGColor()
Definition: pie_chart_display.cpp:400
jsk_rviz_plugins::PieChartDisplay::setPosition
virtual void setPosition(int x, int y)
Definition: pie_chart_display.cpp:532
jsk_rviz_plugins::PieChartDisplay::updateAutoColorChange
void updateAutoColorChange()
Definition: pie_chart_display.cpp:468
jsk_rviz_plugins::PieChartDisplay::fg_color_
QColor fg_color_
Definition: pie_chart_display.h:168
jsk_rviz_plugins::PieChartDisplay::updateSize
void updateSize()
Definition: pie_chart_display.cpp:374
jsk_rviz_plugins::PieChartDisplay::show_caption_property_
rviz::BoolProperty * show_caption_property_
Definition: pie_chart_display.h:156
jsk_rviz_plugins::PieChartDisplay::updateMaxColorThreshold
void updateMaxColorThreshold()
Definition: pie_chart_display.cpp:501
jsk_rviz_plugins::PieChartDisplay::sub_
ros::Subscriber sub_
Definition: pie_chart_display.h:164
jsk_rviz_plugins::PieChartDisplay::left_property_
rviz::IntProperty * left_property_
Definition: pie_chart_display.h:144
jsk_rviz_plugins::PieChartDisplay::max_color_
QColor max_color_
Definition: pie_chart_display.h:170
jsk_rviz_plugins::PieChartDisplay::update
virtual void update(float wall_dt, float ros_dt)
Definition: pie_chart_display.cpp:220
jsk_rviz_plugins::PieChartDisplay::text_alpha_property_
rviz::FloatProperty * text_alpha_property_
Definition: pie_chart_display.h:152
jsk_rviz_plugins::PieChartDisplay::update_required_
bool update_required_
Definition: pie_chart_display.h:184
jsk_rviz_plugins::PieChartDisplay::med_color_threshold_property_
rviz::FloatProperty * med_color_threshold_property_
Definition: pie_chart_display.h:161
jsk_rviz_plugins::PieChartDisplay::onEnable
virtual void onEnable()
Definition: pie_chart_display.cpp:361
jsk_rviz_plugins
Definition: __init__.py:1
jsk_rviz_plugins::PieChartDisplay::PieChartDisplay
PieChartDisplay()
Definition: pie_chart_display.cpp:82
jsk_rviz_plugins::PieChartDisplay::show_caption_
bool show_caption_
Definition: pie_chart_display.h:173
color_property.h
jsk_rviz_plugins::PieChartDisplay::onDisable
virtual void onDisable()
Definition: pie_chart_display.cpp:368
jsk_rviz_plugins::PieChartDisplay::updateFGAlpha
void updateFGAlpha()
Definition: pie_chart_display.cpp:407
jsk_rviz_plugins::PieChartDisplay::onInitialize
virtual void onInitialize()
Definition: pie_chart_display.cpp:191
ros_topic_property.h
jsk_rviz_plugins::PieChartDisplay::left_
int left_
Definition: pie_chart_display.h:165
ros::Subscriber
rviz::IntProperty


jsk_rviz_plugins
Author(s): Kei Okada , Yohei Kakiuchi , Shohei Fujii , Ryohei Ueda
autogenerated on Fri Dec 13 2024 03:49:57