Gazebo Rendering

API Reference

7.4.2
gz/rendering/ogre2/Ogre2Conversions.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 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_RENDERING_OGRE2_OGRE2CONVERSIONS_HH_
18 #define GZ_RENDERING_OGRE2_OGRE2CONVERSIONS_HH_
19 
20 #include <gz/math/Color.hh>
21 #include <gz/math/Matrix4.hh>
22 #include <gz/math/Quaternion.hh>
23 #include <gz/math/Vector3.hh>
24 
25 #include "gz/rendering/config.hh"
27 #include "gz/rendering/ogre2/Export.hh"
28 
29 #ifdef _MSC_VER
30  #pragma warning(push, 0)
31 #endif
32 
33 #include <OgreColourValue.h>
34 #include <OgreVector3.h>
35 #include <OgrePixelFormatGpu.h>
36 
37 #ifdef _MSC_VER
38  #pragma warning(pop)
39 #endif
40 
41 namespace gz
42 {
43  namespace rendering
44  {
45  inline namespace GZ_RENDERING_VERSION_NAMESPACE {
46  //
49 
53  class GZ_RENDERING_OGRE2_VISIBLE Ogre2Conversions
54  {
58  public: static Ogre::ColourValue Convert(
59  const math::Color &_color);
60 
64  public: static math::Color Convert(
65  const Ogre::ColourValue &_color);
66 
70  public: static Ogre::Vector3 Convert(const math::Vector3d &_vector);
71 
75  public: static math::Vector3d Convert(const Ogre::Vector3 &_vector);
76 
80  public: static Ogre::Quaternion Convert(const math::Quaterniond &_quat);
81 
85  public: static math::Quaterniond Convert(const Ogre::Quaternion &_quat);
86 
90  public: static Ogre::Radian Convert(const math::Angle &_angle);
91 
95  public: static math::Angle Convert(const Ogre::Radian &_angle);
96 
100  public: static math::Matrix4d Convert(const Ogre::Matrix4 &_m);
101 
105  public: static Ogre::Matrix4 Convert(const math::Matrix4d &_m);
106 
110  public: static Ogre::PixelFormatGpu Convert(PixelFormat _format);
111 
113  private: static const Ogre::PixelFormatGpu ogrePixelFormats[PF_COUNT];
114  };
116  }
117  }
118 }
119 #endif