Ignition Rendering

API Reference

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