ModelAlign.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014-2016 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_MODEL_ALIGN_HH_
18 #define _GAZEBO_GUI_MODEL_ALIGN_HH_
19 
20 #include <string>
21 #include <vector>
22 
26 
27 #include "gazebo/math/Box.hh"
28 #include "gazebo/math/Pose.hh"
29 #include "gazebo/math/Vector3.hh"
30 
32 
33 #include "gazebo/util/system.hh"
34 
35 namespace gazebo
36 {
37  namespace gui
38  {
39  class ModelAlignPrivate;
40 
43  class GZ_GUI_VISIBLE ModelAlign : public SingletonT<ModelAlign>
44  {
46  private: ModelAlign();
47 
49  private: virtual ~ModelAlign();
50 
52  public: void Init();
53 
56  public: void Clear();
57 
65  public: void AlignVisuals(std::vector<rendering::VisualPtr> _visuals,
66  const std::string &_axis, const std::string &_config,
67  const std::string &_target, const bool _publish = true,
68  const bool _inverted = false);
69 
74  private: void GetMinMax(std::vector<math::Vector3> _vertices,
75  math::Vector3 &_min, math::Vector3 &_max);
76 
82  private: void Transform(math::Box _bbox, math::Pose _worldPose,
83  std::vector<math::Vector3> &_vertices);
84 
90  private: void SetHighlighted(rendering::VisualPtr _vis, bool _highlight);
91 
93  private: friend class SingletonT<ModelAlign>;
94 
97  private: ModelAlignPrivate *dataPtr;
98  };
99  }
100 }
101 #endif
A gui tool for aligning models.
Definition: ModelAlign.hh:43
Forward declarations for the common classes.
Definition: Animation.hh:33
Encapsulates a position and rotation in three space.
Definition: Pose.hh:37
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:39
Mathematical representation of a box and related functions.
Definition: Box.hh:35
Singleton template class.
Definition: SingletonT.hh:33
std::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:112
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.