##

ModelSnap.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_MODELSNAP_HH_
#define GAZEBO_GUI_MODELSNAP_HH_
#include <memory>
#include <vector>
#include <ignition/math/Quaternion.hh>
#include <ignition/math/Triangle3.hh>
#include "gazebo/common/SingletonT.hh"
#include "gazebo/rendering/RenderTypes.hh"
#include "gazebo/util/system.hh"
GZ_SINGLETON_DECLARE(GZ_GUI_VISIBLE, gazebo, gui, ModelSnap)
namespace gazebo
{
namespace common
{
class MouseEvent;
}
namespace gui
{
class ModelSnapPrivate;
class GZ_GUI_VISIBLE ModelSnap : public SingletonT<ModelSnap>
{
private: ModelSnap();
private: virtual ~ModelSnap();
public: void Init();
public: void Clear();
public: void Reset();
public: void Fini();
public: void Snap(
const ignition::math::Triangle3d &_triangleSrc,
const ignition::math::Triangle3d &_triangleDest,
rendering::VisualPtr _visualSrc);
public: static void SnapTransform(
const ignition::math::Triangle3d &_triangleSrc,
const ignition::math::Triangle3d &_triangleDest,
const ignition::math::Pose3d &_poseSrc,
ignition::math::Vector3d &_trans,
ignition::math::Quaterniond &_rot);
public: void OnMousePressEvent(const common::MouseEvent &_event);
public: void OnMouseMoveEvent(const common::MouseEvent &_event);
public: void OnMouseReleaseEvent(const common::MouseEvent &_event);
private: void PublishVisualPose(rendering::VisualPtr _vis);
private: void Update();
private: friend class SingletonT<ModelSnap>;
private: std::unique_ptr<ModelSnapPrivate> dataPtr;
};
}
}
#endif
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
SingletonT
Singleton template class.
Definition: SingletonT.hh:33
common
common
Definition: FuelModelDatabase.hh:37
system.hh
gazebo
gazebo
Definition: ModelSnap.hh:30
RenderTypes.hh
gazebo::msgs::Init
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
gui
gui
Definition: ModelSnap.hh:30
gazebo::rendering::VisualPtr
std::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:114
gazebo::gui::ModelSnap
A gui tool for snapping one model to another.
Definition: ModelSnap.hh:45
GZ_SINGLETON_DECLARE
#define GZ_SINGLETON_DECLARE(visibility, n1, n2, singletonType)
Helper to declare typed SingletonT.
Definition: SingletonT.hh:61
SingletonT.hh
gazebo::common::MouseEvent
Generic description of a mouse event.
Definition: MouseEvent.hh:35