ApplyWrenchVisual.hh
Go to the documentation of this file.
1/*
2 * Copyright (C) 2015 Open Source Robotics Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16*/
17
18#ifndef _GAZEBO_APPLYWRENCHVISUAL_HH_
19#define _GAZEBO_APPLYWRENCHVISUAL_HH_
20
21#include <string>
22
24
25namespace gazebo
26{
27 namespace rendering
28 {
31
35 {
38 public: enum Mode
39 {
41 NONE = 0,
43 FORCE = 1,
45 TORQUE = 2
46 };
47
51 public: ApplyWrenchVisual(const std::string &_name, VisualPtr _parentVis);
52
54 public: virtual ~ApplyWrenchVisual();
55
56 // Documentation inherited.
57 public: void Load();
58
59 // Documentation inherited.
60 public: virtual void Fini();
61
65 public: void SetCoM(const ignition::math::Vector3d &_comVector);
66
70 public: void SetForcePos(const ignition::math::Vector3d &_forcePosVector);
71
76 public: void SetForce(const ignition::math::Vector3d &_forceVector,
77 const bool _rotatedByMouse);
78
83 public: void SetTorque(const ignition::math::Vector3d &_torqueVector,
84 const bool _rotatedByMouse);
85
88 public: void UpdateForceVisual();
89
92 public: void UpdateTorqueVisual();
93
95 public: void Resize();
96
100
104
108
112 public: void SetMode(Mode _mode);
113 };
115 }
116}
117#endif
rendering
Definition RenderEngine.hh:31
Visualization for the apply wrench GUI.
Definition ApplyWrenchVisual.hh:35
void Resize()
Resize all children according to target link's size.
void SetForce(const ignition::math::Vector3d &_forceVector, const bool _rotatedByMouse)
Update force vector, force text and mode.
void SetForcePos(const ignition::math::Vector3d &_forcePosVector)
Set the force position vector and update the position of the force visual.
virtual void Fini()
Helper for the destructor.
rendering::VisualPtr GetTorqueVisual() const
Returns the torque visual.
ApplyWrenchVisual(const std::string &_name, VisualPtr _parentVis)
Constructor.
Mode
Definition ApplyWrenchVisual.hh:39
void UpdateForceVisual()
Update the force visual according to the force and force position vectors.
void SetTorque(const ignition::math::Vector3d &_torqueVector, const bool _rotatedByMouse)
Update torque vector, torque text and mode.
void SetMode(Mode _mode)
Set the mode to force, torque or none, update colors and visibility accordingly.
void UpdateTorqueVisual()
Update the torque visual according to the torque and CoM vectors.
rendering::SelectionObjPtr GetRotTool() const
Returns the rotation tool.
void Load()
Load the visual with default parameters.
void SetCoM(const ignition::math::Vector3d &_comVector)
Set the CoM vector and update the position of the torque visual.
virtual ~ApplyWrenchVisual()
Destructor.
rendering::VisualPtr GetForceVisual() const
Returns the force visual.
A renderable object.
Definition Visual.hh:61
std::shared_ptr< Visual > VisualPtr
Definition RenderTypes.hh:114
std::shared_ptr< SelectionObj > SelectionObjPtr
Definition RenderTypes.hh:190
Forward declarations for the common classes.
Definition Animation.hh:27
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition system.hh:59