##

ModelRightMenu.hh
Go to the documentation of this file.
/*
* Copyright (C) 2012 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 _MODELRIGHTMENU_HH_
#define _MODELRIGHTMENU_HH_
#include <map>
#include <vector>
#include <string>
#include <ignition/transport/Node.hh>
#include "gazebo/common/KeyEvent.hh"
#include "gazebo/gui/qt.h"
#include "gazebo/gui/ApplyWrenchDialog.hh"
#include "gazebo/msgs/msgs.hh"
#include "gazebo/transport/TransportTypes.hh"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace gui
{
class ViewState;
class GZ_GUI_VISIBLE ModelRightMenu : public QObject
{
Q_OBJECT
public: enum EntityTypes {
MODEL,
LIGHT,
LINK
};
public: ModelRightMenu();
public: virtual ~ModelRightMenu();
public: bool Init();
public: void Run(const std::string &_entityName, const QPoint &_pt,
EntityTypes _type = MODEL);
private slots: void OnMoveTo();
private slots: void OnFollow();
private slots: void OnEdit();
private slots: void OnApplyWrench();
private slots: void OnDelete(const std::string &_name="");
// private slots: void OnSnapBelow();
private: bool OnKeyRelease(const common::KeyEvent &_event);
private: void OnRequest(ConstRequestPtr &_msg);
private: void OnWindowMode(const std::string &_mode);
private: transport::NodePtr node;
private: transport::SubscriberPtr requestSub;
private: std::string entityName;
private: QAction *moveToAct;
private: QAction *followAct;
private: QAction *editAct;
private: QAction *applyWrenchAct;
private: std::vector<event::ConnectionPtr> connections;
private: std::string windowMode;
// private: QAction *snapBelowAct;
private: std::vector<ViewState*> viewStates;
// The view state class is a friend for convenience
private: friend class ViewState;
};
class GZ_GUI_VISIBLE ViewState : public QObject
{
Q_OBJECT
public: ViewState(ModelRightMenu *_parent,
const std::string &_checkRequest,
const std::string &_uncheckRequest);
public: std::map<std::string, bool> modelStates;
public: QAction *action;
public: bool globalEnable;
public: ModelRightMenu *parent;
public: std::string checkRequest;
public: std::string uncheckRequest;
public slots: void Callback();
// Place ignition::transport objects at the end of this file to
// guarantee they are destructed first.
private: ignition::transport::Node nodeIgn;
};
}
}
#endif
gazebo::gui::ViewState::Callback
void Callback()
QT callback for the QAction.
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
qt.h
TransportTypes.hh
Forward declarations for transport.
system.hh
msgs.hh
gazebo::transport::SubscriberPtr
boost::shared_ptr< Subscriber > SubscriberPtr
Definition: TransportTypes.hh:53
gazebo::transport::NodePtr
boost::shared_ptr< Node > NodePtr
Definition: TransportTypes.hh:57
gazebo::gui::ViewState::ViewState
ViewState(ModelRightMenu *_parent, const std::string &_checkRequest, const std::string &_uncheckRequest)
Constructor.
gazebo::gui::ViewState::action
QAction * action
Action for this view.
Definition: ModelRightMenu.hh:163
gazebo::gui::ViewState::globalEnable
bool globalEnable
True if the view visualization is enabled globally.
Definition: ModelRightMenu.hh:166
ApplyWrenchDialog.hh
gazebo::gui::ViewState::parent
ModelRightMenu * parent
Pointer to the ModelRightMenu.
Definition: ModelRightMenu.hh:169
gazebo::common::KeyEvent
Generic description of a keyboard event.
Definition: KeyEvent.hh:32
gazebo::gui::ViewState::modelStates
std::map< std::string, bool > modelStates
State of all the models for this view.
Definition: ModelRightMenu.hh:160
gazebo::msgs::Init
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
gazebo::gui::ViewState
A class for managing view visualization states. Used by ModelRightMenu.
Definition: ModelRightMenu.hh:147
gui
gui
Definition: KeyEventHandler.hh:29
KeyEvent.hh
gazebo::gui::ViewState::checkRequest
std::string checkRequest
Name of the request to send when checked.
Definition: ModelRightMenu.hh:172
gazebo::gui::ViewState::uncheckRequest
std::string uncheckRequest
Name of the request to send when unchecked.
Definition: ModelRightMenu.hh:175