##

GraphScene.hh
Go to the documentation of this file.
/*
* Copyright (C) 2015 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef GAZEBO_GUI_MODEL_GRAPHSCENE_HH_
#define GAZEBO_GUI_MODEL_GRAPHSCENE_HH_
#include <string>
#include <ignition/math/Color.hh>
#include "gazebo/gui/qt.h"
#include "gazebo/gui/qgv/QGVScene.h"
namespace gazebo
{
namespace gui
{
class GZ_GUI_VISIBLE GraphScene : public QGVScene
{
Q_OBJECT
public: explicit GraphScene(QWidget *_parent = 0);
public: virtual ~GraphScene() = default;
public: QGVNode *AddNode(const std::string &_name);
public: void RemoveNode(const std::string &_name);
public: bool HasNode(const std::string &_name);
public: QGVNode *GetNode(const std::string &_name);
public: QGVEdge *AddEdge(const std::string &_id,
const std::string &_node1, const std::string &_node2);
public: void RemoveEdge(const std::string &_id);
public: void SetEdgeColor(const std::string &_id,
const ignition::math::Color &_color);
private: void drawBackground(QPainter *_painter, const QRectF &_rect);
};
}
}
#endif
gazebo::gui::GraphScene::GraphScene
GraphScene(QWidget *_parent=0)
Constructor.
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
qt.h
gazebo::gui::GraphScene::~GraphScene
virtual ~GraphScene()=default
Destructor.
gazebo::gui::GraphScene::AddEdge
QGVEdge * AddEdge(const std::string &_id, const std::string &_node1, const std::string &_node2)
Add an edge to connect two nodes.
gazebo::gui::GraphScene::HasNode
bool HasNode(const std::string &_name)
Check if a node exists in the scene.
gazebo::gui::GraphScene
A scene of 2D graph nodes and edges.
Definition: GraphScene.hh:33
gui
gui
Definition: KeyEventHandler.hh:29
gazebo::gui::GraphScene::GetNode
QGVNode * GetNode(const std::string &_name)
Get a node from the scene.
gazebo::gui::GraphScene::RemoveNode
void RemoveNode(const std::string &_name)
Remove a node from the scene.
gazebo::gui::GraphScene::SetEdgeColor
void SetEdgeColor(const std::string &_id, const ignition::math::Color &_color)
Set the color of an edge.
gazebo::gui::GraphScene::AddNode
QGVNode * AddNode(const std::string &_name)
Add a node to the scene.
gazebo::gui::GraphScene::RemoveEdge
void RemoveEdge(const std::string &_id)
Remove an edge between two nodes.