Gazebo Rendering

API Reference

6.6.4
gz/rendering/ogre2/Ogre2Heightmap.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021 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 IGNITION_RENDERING_OGRE2_OGRE2HEIGHTMAP_HH_
19 #define IGNITION_RENDERING_OGRE2_OGRE2HEIGHTMAP_HH_
20 
21 #include <memory>
22 
25 
26 // Ignoring warning: "non dll-interface class
27 // 'ignition::rendering::v5::Heightmap' used as base for dll-interface class"
28 // because `Heightmap` and `BaseHeightmap` are header-only
29 #ifdef _MSC_VER
30  #pragma warning(push)
31  #pragma warning(disable:4275)
32 #endif
33 
34 namespace Ogre
35 {
36  class Camera;
37  class Terra;
38 }
39 
40 namespace ignition
41 {
42  namespace rendering
43  {
44  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
45  //
46  // Forward declaration
47  class Ogre2HeightmapPrivate;
48 
50  class IGNITION_RENDERING_OGRE2_VISIBLE Ogre2Heightmap
51  : public BaseHeightmap<Ogre2Geometry>
52  {
56  public: explicit Ogre2Heightmap(const HeightmapDescriptor &_desc);
57 
59  public: virtual ~Ogre2Heightmap() override;
60 
61  // Documentation inherited.
62  public: virtual void Init() override;
63 
64  // Documentation inherited.
65  public: virtual void PreRender() override;
66 
71  public: virtual Ogre::MovableObject *OgreObject() const override;
72 
76  public: virtual MaterialPtr Material() const override;
77 
82  public: virtual void SetMaterial(MaterialPtr _material, bool _unique)
83  override;
84 
88  public: Ogre::Terra* Terra();
89 
96  public: void UpdateForRender(Ogre::Camera *_activeCamera);
97 
98  // Documentation inherited.
99  // \todo(iche033) rename this to Destroy and
100  // make this function public and virtual
101  private: void DestroyImpl();
102 
104  private: friend class OgreScene;
105 
108  };
109  }
110  }
111 }
112 #ifdef _MSC_VER
113  #pragma warning(pop)
114 #endif
115 
116 #endif
Definition: gz/rendering/base/BaseHeightmap.hh:33
Describes how a Heightmap should be loaded.
Definition: gz/rendering/HeightmapDescriptor.hh:147
Ogre implementation of a heightmap geometry.
Definition: gz/rendering/ogre2/Ogre2Heightmap.hh:52
virtual Ogre::MovableObject * OgreObject() const override
Returns the Terra pointer as it is a movable object that must be attached to a regular SceneNode.
virtual void SetMaterial(MaterialPtr _material, bool _unique) override
Has no effect for heightmaps. The material is set through a HeightmapDescriptor.
virtual void PreRender() override
Prepare this object and any of its children for rendering. This should be called for each object in a...
virtual MaterialPtr Material() const override
Returns NULL, heightmap materials don't inherit from MaterialPtr.
void UpdateForRender(Ogre::Camera *_activeCamera)
Ogre2Heightmap(const HeightmapDescriptor &_desc)
Constructor.
virtual ~Ogre2Heightmap() override
Destructor.
virtual void Init() override
Definition: gz/rendering/ogre/OgreScene.hh:41
Definition: gz/rendering/ogre/OgreCamera.hh:28