Gazebo Rendering

API Reference

3.7.2
gz/rendering/base/BaseAxisVisual.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 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_BASE_BASEAXISVISUAL_HH_
18 #define GZ_RENDERING_BASE_BASEAXISVISUAL_HH_
19 
22 #include "gz/rendering/Scene.hh"
23 
24 namespace ignition
25 {
26  namespace rendering
27  {
28  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
29  //
30  template <class T>
32  public virtual AxisVisual,
33  public virtual T
34  {
35  protected: BaseAxisVisual();
36 
37  public: virtual ~BaseAxisVisual();
38 
39  public: virtual void Init();
40  };
41 
43  template <class T>
45  {
46  }
47 
49  template <class T>
51  {
52  }
53 
55  template <class T>
57  {
58  T::Init();
59 
60  ArrowVisualPtr xArrow = this->Scene()->CreateArrowVisual();
61  xArrow->SetLocalPosition(0, 0, 0);
62  xArrow->SetLocalRotation(0, IGN_PI / 2, 0);
63  xArrow->SetMaterial("Default/TransRed");
64  this->AddChild(xArrow);
65 
66  ArrowVisualPtr yArrow = this->Scene()->CreateArrowVisual();
67  yArrow->SetLocalPosition(0, 0, 0);
68  yArrow->SetLocalRotation(-IGN_PI / 2, 0, 0);
69  yArrow->SetMaterial("Default/TransGreen");
70  this->AddChild(yArrow);
71 
72  ArrowVisualPtr zArrow = this->Scene()->CreateArrowVisual();
73  zArrow->SetLocalPosition(0, 0, 0);
74  zArrow->SetLocalRotation(0, 0, 0);
75  zArrow->SetMaterial("Default/TransBlue");
76  this->AddChild(zArrow);
77  }
78  }
79  }
80 }
81 #endif
STL class.
#define IGN_PI
BaseAxisVisual()
Definition: gz/rendering/base/BaseAxisVisual.hh:44
virtual void Init()
Definition: gz/rendering/base/BaseAxisVisual.hh:56
Manages a single scene-graph. This class updates scene-wide properties and holds the root scene node....
Definition: gz/rendering/Scene.hh:48
Definition: gz/rendering/base/BaseAxisVisual.hh:31
Represents a axis composite visual.
Definition: gz/rendering/AxisVisual.hh:31
virtual ArrowVisualPtr CreateArrowVisual()=0
Create new arrow visual. A unique ID and name will automatically be assigned to the visual.
virtual ~BaseAxisVisual()
Definition: gz/rendering/base/BaseAxisVisual.hh:50