Gazebo Rendering

API Reference

6.6.3
gz/rendering/base/BaseHeightmap.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 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 IGNITION_RENDERING_BASE_BASEHEIGHTMAP_HH_
18 #define IGNITION_RENDERING_BASE_BASEHEIGHTMAP_HH_
19 
21 
22 namespace ignition
23 {
24  namespace rendering
25  {
26  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
27  //
29  template <class T>
30  class BaseHeightmap :
31  public virtual Heightmap,
32  public virtual T
33  {
36  protected: explicit BaseHeightmap(const HeightmapDescriptor &_desc);
37 
38  // Documentation inherited
39  public: virtual void PreRender() override;
40 
41  // Documentation inherited
42  public: virtual void Destroy() override;
43 
44  // Documentation inherited
45  public: virtual const HeightmapDescriptor &Descriptor() override;
46 
49  };
50 
52  template <class T>
54  : descriptor{_desc}
55  {
56  }
57 
59  template <class T>
61  {
62  T::PreRender();
63  }
64 
66  template <class T>
68  {
69  T::Destroy();
70  }
71 
73  template <class T>
75  {
76  return this->descriptor;
77  }
78  }
79  }
80 }
81 #endif
virtual void PreRender() override
Prepare this object and any of its children for rendering. This should be called for each object in a...
Definition: gz/rendering/base/BaseHeightmap.hh:60
Describes how a Heightmap should be loaded.
Definition: gz/rendering/HeightmapDescriptor.hh:146
virtual const HeightmapDescriptor & Descriptor() override
Get the immutable heightmap descriptor.
Definition: gz/rendering/base/BaseHeightmap.hh:74
A terrain defined by a heightfield.
Definition: gz/rendering/Heightmap.hh:32
BaseHeightmap(const HeightmapDescriptor &_desc)
Constructor.
Definition: gz/rendering/base/BaseHeightmap.hh:53
virtual void Destroy() override
Destroy any resources associated with this object. Invoking any other functions after destroying an o...
Definition: gz/rendering/base/BaseHeightmap.hh:67
Definition: gz/rendering/base/BaseHeightmap.hh:30
HeightmapDescriptor descriptor
Descriptor containing heightmap information.
Definition: gz/rendering/base/BaseHeightmap.hh:48