view_manager.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 VIEW_MANAGER_H
30 #define VIEW_MANAGER_H
31 
32 #include <QList>
33 #include <QObject>
34 #include <QStringList>
35 
36 #include "rviz/pluginlib_factory.h"
37 #include "rviz/view_controller.h"
38 
39 namespace Ogre
40 {
41 class SceneNode;
42 }
43 
44 namespace rviz
45 {
46 class DisplayContext;
47 class Property;
48 class PropertyTreeModel;
49 class ViewController;
50 class ViewControllerContainer;
51 
52 class ViewManager: public QObject
53 {
54 Q_OBJECT
55 public:
56  ViewManager( DisplayContext* context );
57  ~ViewManager();
58 
59  void initialize();
60 
61  void update( float wall_dt, float ros_dt );
62 
65  ViewController* getCurrent() const;
66 
67  ViewController* create( const QString& type );
68 
69  int getNumViews() const;
70 
71  ViewController* getViewAt( int index ) const;
72 
73  void add( ViewController* view, int index = -1 );
74 
78  ViewController* take( ViewController* view );
79 
83  ViewController* takeAt( int index );
84 
85  PropertyTreeModel* getPropertyModel() { return property_model_; }
86 
87  void load( const Config& config );
88  void save( Config config ) const;
89 
91  void setCurrentFrom( ViewController* view_to_copy );
92 
95  ViewController* copy( ViewController* source );
96 
97  PluginlibFactory<ViewController>* getFactory() const { return factory_; }
98 
101  void setRenderPanel( RenderPanel* render_panel );
102 
104  RenderPanel* getRenderPanel() const { return render_panel_; }
105 
106 public Q_SLOTS:
107 
109  void copyCurrentToList();
110 
113  void setCurrentViewControllerType( const QString& new_class_id );
114 
115 Q_SIGNALS:
116  void configChanged();
117 
119  void currentChanged();
120 
121 private Q_SLOTS:
122  void onCurrentDestroyed( QObject* obj );
123 
124 private:
131  void setCurrent( ViewController* new_current, bool mimic_view );
132 
139 };
140 
145 {
146 Q_OBJECT
147 public:
148  Qt::ItemFlags getViewFlags( int column ) const;
149 
160  virtual void addChild( Property* child, int index = -1 );
161 
162  void addChildToFront( Property* child );
163 };
164 
165 } // end namespace rviz
166 
167 #endif // VIEW_MANAGER_H
RenderPanel * render_panel_
Definition: view_manager.h:138
PluginlibFactory< ViewController > * factory_
Definition: view_manager.h:136
ROSCONSOLE_DECL void initialize()
Container property for ViewControllers which gets the drag/drop right for the funky way Current-View ...
Definition: view_manager.h:144
A single element of a property tree, with a name, value, description, and possibly children...
Definition: property.h:100
config
bool add(const actionlib::TwoIntsGoal &req, actionlib::TwoIntsResult &res)
void update(const std::string &key, const XmlRpc::XmlRpcValue &v)
Configuration data storage class.
Definition: config.h:125
PropertyTreeModel * property_model_
Definition: view_manager.h:135
Pure-virtual base class for objects which give Display subclasses context in which to work...
ViewController * current_
Definition: view_manager.h:137
PropertyTreeModel * getPropertyModel()
Definition: view_manager.h:85
ViewControllerContainer * root_property_
Definition: view_manager.h:134
PluginlibFactory< ViewController > * getFactory() const
Definition: view_manager.h:97
DisplayContext * context_
Definition: view_manager.h:133
RenderPanel * getRenderPanel() const
Return the 3D view widget managed by this ViewManager.
Definition: view_manager.h:104


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust
autogenerated on Sat Apr 27 2019 02:33:42