Gazebo Sim

API Reference

8.7.0
WrenchVisualizer.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2023 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 #ifndef GZ_SIM_WRENCHVISUALIZER_HH_
18 #define GZ_SIM_WRENCHVISUALIZER_HH_
19 
20 #include <memory>
21 
22 #include <gz/sim/config.hh>
23 #include <gz/sim/rendering/Export.hh>
24 #include <gz/utils/ImplPtr.hh>
25 
26 #include <gz/math/Vector3.hh>
27 #include <gz/rendering/RenderTypes.hh>
28 
29 namespace gz
30 {
31 namespace sim
32 {
33 // Inline bracket to help doxygen filtering.
34 inline namespace GZ_SIM_VERSION_NAMESPACE
35 {
36 namespace detail
37 {
39  class GZ_SIM_RENDERING_VISIBLE WrenchVisualizer
40  {
42  public: WrenchVisualizer();
43 
45  public: ~WrenchVisualizer();
46 
50  bool Init(rendering::ScenePtr _scene);
51 
55  public: rendering::ArrowVisualPtr CreateForceVisual(
56  rendering::MaterialPtr _material);
57 
61  public: rendering::VisualPtr CreateTorqueVisual(
62  rendering::MaterialPtr _material);
63 
71  public: void UpdateVectorVisual(rendering::VisualPtr _visual,
72  const math::Vector3d &_direction,
73  const math::Vector3d &_position,
74  const double _size,
75  const bool _tip = false);
76 
79  GZ_UTILS_UNIQUE_IMPL_PTR(dataPtr)
80  };
81 }
82 }
83 }
84 }
85 #endif