overlay_menu_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_PLUGIN_OVERLAY_MENU_DISPLAY_H_
36 #define JSK_RVIZ_PLUGIN_OVERLAY_MENU_DISPLAY_H_
37 
38 #ifndef Q_MOC_RUN
39 #include <rviz/display.h>
40 #include <OGRE/OgreTexture.h>
41 #include <OGRE/OgreColourValue.h>
42 #include <OGRE/OgreMaterial.h>
43 
44 #include <QPainter>
45 
51 
52 #include <std_msgs/ColorRGBA.h>
53 #include <jsk_rviz_plugins/OverlayMenu.h>
54 
55 #include "overlay_utils.h"
56 #endif
57 
58 namespace jsk_rviz_plugins
59 {
61  {
62  Q_OBJECT
63  public:
65  virtual ~OverlayMenuDisplay();
66 
68  {
73  };
74 
75  // methods for OverlayPickerTool
76  virtual bool isInRegion(int x, int y);
77  virtual void movePosition(int x, int y);
78  virtual void setPosition(int x, int y);
79  virtual int getX() { return left_; };
80  virtual int getY() { return top_; };
81 
82  protected:
83  boost::mutex mutex_;
99  int left_, top_;
100  jsk_rviz_plugins::OverlayMenu::ConstPtr current_menu_;
101  jsk_rviz_plugins::OverlayMenu::ConstPtr next_menu_;
102  double animation_t_;
105  QColor bg_color_;
106  QColor fg_color_;
107 
108  virtual void prepareOverlay();
109  virtual void openingAnimation();
110  virtual std::string getMenuString(
111  const jsk_rviz_plugins::OverlayMenu::ConstPtr& msg,
112  size_t index);
113  virtual QFont font();
114  virtual QFontMetrics fontMetrics();
115  virtual int drawAreaWidth(
116  const jsk_rviz_plugins::OverlayMenu::ConstPtr& msg);
117  virtual int drawAreaHeight(
118  const jsk_rviz_plugins::OverlayMenu::ConstPtr& msg);
119  virtual bool isNeedToResize();
120  virtual bool isNeedToRedraw();
121  virtual void redraw();
122  virtual void onInitialize();
123  virtual void onEnable();
124  virtual void onDisable();
125  virtual void update(float wall_dt, float ros_dt);
126  virtual void subscribe();
127  virtual void unsubscribe();
128  virtual void processMessage
129  (const jsk_rviz_plugins::OverlayMenu::ConstPtr& msg);
130  virtual void setMenuLocation();
131  protected Q_SLOTS:
132  void updateTopic();
133  void updateLeft();
134  void updateTop();
135  void updateKeepCentered();
138  void updateFGColor();
139  void updateFGAlpha();
140  void updateBGColor();
141  void updateBGAlpha();
142  };
143 
144 }
145 
146 #endif
147 
virtual int drawAreaWidth(const jsk_rviz_plugins::OverlayMenu::ConstPtr &msg)
jsk_rviz_plugins::OverlayMenu::ConstPtr current_menu_
rviz::RosTopicProperty * update_topic_property_
rviz::BoolProperty * overtake_bg_color_properties_property_
virtual int drawAreaHeight(const jsk_rviz_plugins::OverlayMenu::ConstPtr &msg)
jsk_rviz_plugins::OverlayMenu::ConstPtr next_menu_
virtual void update(float wall_dt, float ros_dt)
rviz::BoolProperty * overtake_fg_color_properties_property_
virtual void processMessage(const jsk_rviz_plugins::OverlayMenu::ConstPtr &msg)
virtual std::string getMenuString(const jsk_rviz_plugins::OverlayMenu::ConstPtr &msg, size_t index)


jsk_rviz_plugins
Author(s): Kei Okada , Yohei Kakiuchi , Shohei Fujii , Ryohei Ueda
autogenerated on Thu Jun 1 2023 02:45:58