##

ImportImageView.hh
Go to the documentation of this file.
/*
* Copyright (C) 2014 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_BUILDING_IMPORTIMAGEVIEW_HH_
#define GAZEBO_GUI_BUILDING_IMPORTIMAGEVIEW_HH_
#include <memory>
#include <string>
#include "gazebo/gui/qt.h"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace gui
{
// Forward declare friend class.
class ImportImageDialog;
// Forward declare provate data.
class ImportImageViewPrivate;
class GZ_GUI_VISIBLE ImportImageView : public QGraphicsView
{
friend class ImportImageDialog;
Q_OBJECT
public: explicit ImportImageView(ImportImageDialog *_parent = 0);
public: ~ImportImageView();
public: void SetImage(const std::string &_filename);
public: void RefreshDistance(double _distance);
public: void EnableDrawDistance(bool _enable);
private: void resizeEvent(QResizeEvent *_event);
private: void mouseMoveEvent(QMouseEvent *_event);
private: void mousePressEvent(QMouseEvent *_event);
private: void mouseReleaseEvent(QMouseEvent *_event);
private: void keyPressEvent(QKeyEvent *_event);
private: void DrawMeasure(const QPoint &_pos);
private: std::unique_ptr<ImportImageViewPrivate> dataPtr;
};
}
}
#endif
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
qt.h
system.hh
gazebo::gui::ImportImageView::ImportImageView
ImportImageView(ImportImageDialog *_parent=0)
Constructor.
gazebo::gui::ImportImageView::~ImportImageView
~ImportImageView()
Destructor.
gazebo::gui::ImportImageView::SetImage
void SetImage(const std::string &_filename)
Set the currently selected image.
gui
gui
Definition: KeyEventHandler.hh:29
gazebo::gui::ImportImageDialog
Definition: ImportImageDialog.hh:37
gazebo::gui::ImportImageView
Control the import image view and manage contents in the scene.
Definition: ImportImageView.hh:41
gazebo::gui::ImportImageView::EnableDrawDistance
void EnableDrawDistance(bool _enable)
Set whether or not it is allowed to draw on the view.
gazebo::gui::ImportImageView::RefreshDistance
void RefreshDistance(double _distance)
Refresh the distance displayed on the scene.