display_context.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012, Willow Garage, Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * * Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * * Neither the name of the Willow Garage, Inc. nor the names of its
14  * contributors may be used to endorse or promote products derived from
15  * this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  * POSSIBILITY OF SUCH DAMAGE.
28  */
29 #ifndef DISPLAY_CONTEXT_H
30 #define DISPLAY_CONTEXT_H
31 
32 #include <cstdint> // for uint64_t
33 #include <memory>
34 
35 #include <QObject>
36 #include <QString>
37 #include "frame_manager.h"
38 
39 class QKeyEvent;
40 
41 namespace Ogre
42 {
43 class SceneManager;
44 }
45 
46 namespace ros
47 {
48 class CallbackQueueInterface;
49 }
50 
51 namespace tf
52 {
53 class TransformListener;
54 }
55 
56 namespace tf2_ros
57 {
58 class Buffer;
59 }
60 
61 namespace rviz
62 {
63 class BitAllocator;
64 class DisplayFactory;
65 class DisplayGroup;
66 class RenderPanel;
67 class SelectionManager;
68 class ToolManager;
69 class ViewController;
70 class ViewportMouseEvent;
71 class ViewManager;
72 class WindowManagerInterface;
73 
81 class DisplayContext : public QObject
82 {
83  Q_OBJECT
84 public:
86  virtual Ogre::SceneManager* getSceneManager() const = 0;
87 
89  virtual WindowManagerInterface* getWindowManager() const = 0;
90 
92  virtual SelectionManager* getSelectionManager() const = 0;
93 
95  virtual FrameManager* getFrameManager() const = 0;
96 
98  std::shared_ptr<tf2_ros::Buffer> getTF2BufferPtr() const
99  {
100  return getFrameManager()->getTF2BufferPtr();
101  }
102 
104  virtual QString getFixedFrame() const = 0;
105 
111  virtual uint64_t getFrameCount() const = 0;
112 
114  virtual DisplayFactory* getDisplayFactory() const = 0;
115 
118 
121 
123  virtual void handleChar(QKeyEvent* event, RenderPanel* panel) = 0;
124 
126  virtual void handleMouseEvent(const ViewportMouseEvent& event) = 0;
127 
129  virtual ToolManager* getToolManager() const = 0;
130 
132  virtual ViewManager* getViewManager() const = 0;
133 
134  virtual DisplayGroup* getRootDisplayGroup() const = 0;
135 
136  virtual uint32_t getDefaultVisibilityBit() const = 0;
137 
138  virtual BitAllocator* visibilityBits() = 0;
139 
141  virtual void setStatus(const QString& message) = 0;
142 
143 public Q_SLOTS:
146  virtual void queueRender() = 0;
147 };
148 
149 } // end namespace rviz
150 
151 #endif // DISPLAY_CONTEXT_H
rviz::FrameManager::getTF2BufferPtr
const std::shared_ptr< tf2_ros::Buffer > getTF2BufferPtr()
Definition: frame_manager.h:209
rviz::FrameManager
Helper class for transforming data into Ogre's world frame (the fixed frame).
Definition: frame_manager.h:64
rviz::DisplayContext::getUpdateQueue
virtual ros::CallbackQueueInterface * getUpdateQueue()=0
Return the CallbackQueue using the main GUI thread.
Ogre
Definition: axes_display.h:35
frame_manager.h
rviz::DisplayContext::queueRender
virtual void queueRender()=0
Queues a render. Multiple calls before a render happens will only cause a single render.
rviz::ToolManager
Definition: tool_manager.h:48
ros
rviz::ViewportMouseEvent
Definition: viewport_mouse_event.h:45
rviz::DisplayContext::getDisplayFactory
virtual DisplayFactory * getDisplayFactory() const =0
Return a factory for creating Display subclasses based on a class id string.
rviz::DisplayContext::getThreadedQueue
virtual ros::CallbackQueueInterface * getThreadedQueue()=0
Return a CallbackQueue using a different thread than the main GUI one.
rviz::DisplayContext::handleChar
virtual void handleChar(QKeyEvent *event, RenderPanel *panel)=0
Handle a single key event for a given RenderPanel.
rviz::BitAllocator
Allocation manager for bit positions within a 32-bit word.
Definition: bit_allocator.h:37
rviz::DisplayContext::getSceneManager
virtual Ogre::SceneManager * getSceneManager() const =0
Returns the Ogre::SceneManager used for the main RenderPanel.
rviz::DisplayContext::getViewManager
virtual ViewManager * getViewManager() const =0
Return the ViewManager.
tf2_ros
rviz::DisplayContext::setStatus
virtual void setStatus(const QString &message)=0
rviz
Definition: add_display_dialog.cpp:54
rviz::DisplayContext::getToolManager
virtual ToolManager * getToolManager() const =0
Return the ToolManager.
rviz::DisplayContext::getDefaultVisibilityBit
virtual uint32_t getDefaultVisibilityBit() const =0
rviz::DisplayContext::getFixedFrame
virtual QString getFixedFrame() const =0
Return the fixed frame name.
rviz::DisplayContext::getRootDisplayGroup
virtual DisplayGroup * getRootDisplayGroup() const =0
rviz::DisplayContext
Pure-virtual base class for objects which give Display subclasses context in which to work.
Definition: display_context.h:81
rviz::DisplayContext::getFrameManager
virtual FrameManager * getFrameManager() const =0
Return the FrameManager instance.
rviz::ViewManager
Definition: view_manager.h:53
rviz::DisplayContext::visibilityBits
virtual BitAllocator * visibilityBits()=0
rviz::DisplayFactory
Definition: display_factory.h:42
rviz::DisplayContext::getWindowManager
virtual WindowManagerInterface * getWindowManager() const =0
Return the window manager, if any.
rviz::SelectionManager
Definition: selection_manager.h:81
tf
rviz::DisplayContext::getSelectionManager
virtual SelectionManager * getSelectionManager() const =0
Return a pointer to the SelectionManager.
rviz::WindowManagerInterface
Definition: window_manager_interface.h:40
rviz::RenderPanel
Definition: render_panel.h:74
rviz::DisplayContext::getFrameCount
virtual uint64_t getFrameCount() const =0
Return the current value of the frame count.
rviz::DisplayContext::handleMouseEvent
virtual void handleMouseEvent(const ViewportMouseEvent &event)=0
Handle a mouse event.
rviz::DisplayContext::getTF2BufferPtr
std::shared_ptr< tf2_ros::Buffer > getTF2BufferPtr() const
Convenience function: returns getFrameManager()->getTF2BufferPtr().
Definition: display_context.h:98
rviz::DisplayGroup
A Display object which stores other Displays as children.
Definition: display_group.h:47
ros::CallbackQueueInterface


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust, William Woodall
autogenerated on Fri May 10 2024 02:32:22