51 , render_panel_(nullptr)
97 if (source_view ==
nullptr)
103 if (source_view != previous)
127 new_current->
mimic(previous);
133 disconnect(previous, SIGNAL(destroyed(QObject*)),
this, SLOT(
onCurrentDestroyed(QObject*)));
135 new_current->
setName(
"Current View");
136 connect(new_current, SIGNAL(destroyed(QObject*)),
this, SLOT(
onCurrentDestroyed(QObject*)));
231 new_current->
load(current_config);
237 int num_saved = saved_views_config.
listLength();
238 for (
int i = 0; i < num_saved; i++)
245 view->
load(view_config);
265 source->
save(config);
268 copy_of_source->
load(config);
270 return copy_of_source;
ViewController * takeAt(int index)
Remove the ViewController at the given index from the list and return it. If the index is not valid...
RenderPanel * render_panel_
ViewController * getCurrent() const
Return the current ViewController in use for the main RenderWindow.
PluginlibFactory< ViewController > * factory_
void setCurrent(ViewController *new_current, bool mimic_view)
Set new_current as current.
ViewController * getViewAt(int index) const
void setCurrentFrom(ViewController *view_to_copy)
Make a copy of view_to_copy and install that as the new current ViewController.
virtual void transitionFrom(ViewController *previous_view)
Called by ViewManager when this ViewController is being made current.
void currentChanged()
Emitted just after the current view controller changes.
Container property for ViewControllers which gets the drag/drop right for the funky way Current-View ...
A single element of a property tree, with a name, value, description, and possibly children...
virtual void setName(const QString &name)
Set the name.
void setViewController(ViewController *controller)
Set the ViewController which should control the camera position for this view.
int listLength() const
Returns the length of the List in this Node, or 0 if this Node does not have type List...
Config mapGetChild(const QString &key) const
If the referenced Node is a Map and it has a child with the given key, return a reference to the chil...
Qt::ItemFlags getViewFlags(int column) const override
Return item flags appropriate for the given column (0 or 1) for this Property.
ViewController * copy(ViewController *source)
Return a copy of source, made by saving source to a Config and instantiating and loading a new one fr...
bool mapGetString(const QString &key, QString *value_out) const
Convenience function for looking up a named string.
virtual void update(float dt, float ros_dt)
Called at 30Hz by ViewManager::update() while this view is active. Override with code that needs to r...
void addChildToFront(Property *child)
virtual void mimic(ViewController *source_view)
Configure the settings of this view controller to give, as much as possible, a similar view as that g...
virtual QString getClassId() const
Return the class identifier which was used to create this instance. This version just returns whateve...
void save(Config config) const override
Write the value of this property and/or its children into the given Config reference.
void addChild(Property *child, int index=-1) override
Add a child ViewController.
Configuration data storage class.
PropertyTreeModel * property_model_
virtual void removeChildren(int start_index=0, int count=-1)
Remove and delete some or all child Properties. Does not change the value of this Property...
Pure-virtual base class for objects which give Display subclasses context in which to work...
ViewController * current_
ViewManager(DisplayContext *context)
virtual Qt::ItemFlags getViewFlags(int column) const
Return item flags appropriate for the given column (0 or 1) for this Property.
void copyCurrentToList()
Make a copy of the current ViewController and add it to the end of the list of saved views...
Property * getRoot() const
void onCurrentDestroyed(QObject *obj)
void setRenderPanel(RenderPanel *render_panel)
Set the 3D view widget whose view will be controlled by ViewController instances from by this ViewMan...
Config mapMakeChild(const QString &key)
Create a child node stored with the given key, and return the child.
void add(ViewController *view, int index=-1)
void update(float wall_dt, float ros_dt)
A FailedViewController instance represents a ViewController class we tried and failed to instantiate...
ViewControllerContainer * root_property_
void load(const Config &config) override
Load the value of this property and/or its children from the given Config reference.
DisplayContext * context_
ViewController * create(const QString &type)
virtual Property * takeChildAt(int index)
Take a child out of the child list, but don't destroy it.
void setDragDropClass(const QString &drag_drop_class)
ViewController * take(ViewController *view)
Remove the given ViewController from the list and return it. If it is not in the list, NULL is returned and nothing changes.
virtual int numChildren() const
Return the number of child objects (Property or otherwise).
Config listAppendNew()
Ensure the referenced Node is of type List, append a new Empty Node to the end of the list...
Property * childAt(int index) const
Return the child Property with the given index, or NULL if the index is out of bounds or if the child...
Config listChildAt(int i) const
Return the i'th child in the list, if the referenced Node has type List. Returns an Invalid Config if...
virtual void addChild(Property *child, int index=-1)
Add a child property.
void initialize(DisplayContext *context)
Do all setup that can't be done in the constructor.
void setCurrentViewControllerType(const QString &new_class_id)
Create a new view controller of the given type and set it up to mimic and replace the previous curren...
void save(Config config) const
void load(const Config &config)