ModelAlign.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 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 GAZEBO_GUI_MODELALIGN_HH_
18 #define GAZEBO_GUI_MODELALIGN_HH_
19 
20 #include <memory>
21 #include <string>
22 #include <vector>
23 
24 #include <ignition/math/Box.hh>
25 #include <ignition/math/Pose3.hh>
26 #include <ignition/math/Vector3.hh>
27 
31 
33 
34 #include "gazebo/util/system.hh"
35 
36 namespace gazebo
37 {
38  namespace gui
39  {
40  class ModelAlignPrivate;
41 
44  class GZ_GUI_VISIBLE ModelAlign : public SingletonT<ModelAlign>
45  {
47  private: ModelAlign();
48 
50  private: virtual ~ModelAlign();
51 
53  public: void Init();
54 
57  public: void Clear();
58 
66  public: void AlignVisuals(std::vector<rendering::VisualPtr> _visuals,
67  const std::string &_axis, const std::string &_config,
68  const std::string &_target, const bool _publish = true,
69  const bool _inverted = false);
70 
75  private: void MinMax(
76  const std::vector<ignition::math::Vector3d> &_vertices,
77  ignition::math::Vector3d &_min,
78  ignition::math::Vector3d &_max);
79 
85  private: void Transform(const ignition::math::Box &_bbox,
86  const ignition::math::Pose3d &_worldPose,
87  std::vector<ignition::math::Vector3d> &_vertices);
88 
94  private: void SetHighlighted(const rendering::VisualPtr &_vis,
95  const bool _highlight);
96 
98  private: friend class SingletonT<ModelAlign>;
99 
102  private: std::unique_ptr<ModelAlignPrivate> dataPtr;
103  };
104  }
105 }
106 #endif
A gui tool for aligning models.
Definition: ModelAlign.hh:44
Forward declarations for the common classes.
Definition: Animation.hh:26
Singleton template class.
Definition: SingletonT.hh:33
std::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:114
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.