Ignition Rendering

API Reference

5.0.0
BaseCapsule.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_BASECAPSULE_HH_
19 #define IGNITION_RENDERING_BASECAPSULE_HH_
20 
23 
24 namespace ignition
25 {
26  namespace rendering
27  {
28  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
30  template <class T>
31  class BaseCapsule :
32  public virtual Capsule,
33  public virtual T
34  {
35  // Documentation inherited
36  protected: BaseCapsule();
37 
38  // Documentation inherited
39  public: virtual ~BaseCapsule();
40 
41  // Documentation inherited
42  public: virtual void SetRadius(double _radius) override;
43 
44  // Documentation inherited
45  public: virtual void SetLength(double _length) override;
46 
47  // Documentation inherited
48  public: virtual double Radius() const override;
49 
50  // Documentation inherited
51  public: virtual double Length() const override;
52 
54  protected: double radius = 0.5;
55 
57  protected: double length = 0.5;
58 
60  protected: bool capsuleDirty = false;
61  };
62 
64  // BaseCapsule
66  template <class T>
68  {
69  }
70 
72  template <class T>
74  {
75  }
76 
78  template <class T>
79  void BaseCapsule<T>::SetRadius(double _radius)
80  {
81  this->radius = _radius;
82  this->capsuleDirty = true;
83  }
84 
86  template <class T>
87  double BaseCapsule<T>::Radius() const
88  {
89  return this->radius;
90  }
91 
93  template <class T>
94  void BaseCapsule<T>::SetLength(double _length)
95  {
96  this->length = _length;
97  this->capsuleDirty = true;
98  }
99 
101  template <class T>
102  double BaseCapsule<T>::Length() const
103  {
104  return this->length;
105  }
106  }
107  }
108 }
109 #endif
virtual ~BaseCapsule()
Definition: BaseCapsule.hh:73
Geometry for a capsule shape.
Definition: Capsule.hh:32
virtual double Radius() const override
Get the radius of the capsule.
Definition: BaseCapsule.hh:87
BaseCapsule()
Definition: BaseCapsule.hh:67
virtual void SetRadius(double _radius) override
Set the radius of the capsule.
Definition: BaseCapsule.hh:79
Base implementation of a Capsule Geometry.
Definition: BaseCapsule.hh:31
virtual double Length() const override
Get the length of the capsule.
Definition: BaseCapsule.hh:102
virtual void SetLength(double _length) override
Set the length of the capsule.
Definition: BaseCapsule.hh:94