Ignition Rendering

API Reference

0.1.0
BaseArrowVisual.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_BASEARROWVISUAL_HH_
18 #define IGNITION_RENDERING_BASE_BASEARROWVISUAL_HH_
19 
22 
23 namespace ignition
24 {
25  namespace rendering
26  {
27  template <class T>
28  class IGNITION_RENDERING_VISIBLE BaseArrowVisual :
29  public virtual ArrowVisual,
30  public virtual T
31  {
32  protected: BaseArrowVisual();
33 
34  public: virtual ~BaseArrowVisual();
35 
36  public: virtual VisualPtr Head() const;
37 
38  public: virtual VisualPtr Shaft() const;
39 
40  protected: virtual void Init();
41  };
42 
44  template <class T>
46  {
47  }
48 
50  template <class T>
52  {
53  }
54 
56  template <class T>
58  {
59  return nullptr;
60  }
61 
63  template <class T>
65  {
66  return nullptr;
67  }
68 
70  template <class T>
72  {
73  T::Init();
74 
75  VisualPtr cone = this->Scene()->CreateVisual();
76  cone->AddGeometry(this->Scene()->CreateCone());
77  cone->SetOrigin(0, 0, -0.5);
78  cone->SetLocalPosition(0, 0, 0);
79  cone->SetLocalScale(0.1, 0.1, 0.25);
80  this->AddChild(cone);
81 
82  VisualPtr cylinder = this->Scene()->CreateVisual();
83  cylinder->AddGeometry(this->Scene()->CreateCylinder());
84  cylinder->SetOrigin(0, 0, 0.5);
85  cylinder->SetLocalPosition(0, 0, 0);
86  cylinder->SetLocalScale(0.05, 0.05, 0.5);
87  this->AddChild(cylinder);
88 
89  this->SetOrigin(0, 0, -0.5);
90  }
91 
92  }
93 }
94 #endif
virtual VisualPtr Shaft() const
Get arrow-shaft visual.
Definition: BaseArrowVisual.hh:64
Represents a arrow composite visual.
Definition: ArrowVisual.hh:28
virtual VisualPtr Head() const
Get arrow-head visual.
Definition: BaseArrowVisual.hh:57
virtual void Init()
Definition: BaseArrowVisual.hh:71
BaseArrowVisual()
Definition: BaseArrowVisual.hh:45
Manages a single scene-graph. This class updates scene-wide properties and holds the root scene node...
Definition: Scene.hh:44
virtual ~BaseArrowVisual()
Definition: BaseArrowVisual.hh:51
Definition: ArrowVisual.hh:22
virtual VisualPtr CreateVisual()=0
Create new visual. A unique ID and name will automatically be assigned to the visual.
Definition: BaseArrowVisual.hh:28