leaf-node-capsule.h
Go to the documentation of this file.
1 //
2 // leaf-node-capsule.h
3 // gepetto-viewer
4 //
5 // Created by Justin Carpentier, Mathieu Geisert in November 2014.
6 // Copyright (c) 2014 LAAS-CNRS. All rights reserved.
7 //
8 
9 #ifndef GEPETTO_VIEWER_LEAFNODECAPSULE_HH
10 #define GEPETTO_VIEWER_LEAFNODECAPSULE_HH
11 
13 
14 namespace gepetto {
15 namespace viewer {
16  DEF_CLASS_SMART_PTR(LeafNodeCapsule)
17 
18 
22  {
23  private:
25  LeafNodeCapsuleWeakPtr weak_ptr_;
27  ::osg::CapsuleRefPtr capsule_ptr_;
28 
29  void init();
30 
31  /* Default constructor */
32  LeafNodeCapsule(const std::string& name, const float& radius, const float& height);
33  LeafNodeCapsule(const std::string& name, const float& radius, const float& height, const osgVector4& color);
34 
35  /* Copy constructor */
36  LeafNodeCapsule(const LeafNodeCapsule& other);
37 
39  void initWeakPtr (LeafNodeCapsuleWeakPtr other_weak_ptr);
40 
41  protected:
42  public:
45  static LeafNodeCapsulePtr_t create(const std::string& name, const float &radius, const float& height);
46  static LeafNodeCapsulePtr_t create(const std::string& name, const float &radius, const float& height, const osgVector4& color);
47 
50  static LeafNodeCapsulePtr_t createCopy(const LeafNodeCapsulePtr_t& other);
51 
54  virtual LeafNodeCapsulePtr_t clone(void) const;
55 
59  virtual LeafNodeCapsulePtr_t copy() const { return clone(); }
60 
63  LeafNodeCapsulePtr_t self(void) const;
64 
65 
69  virtual void setRadius (const float& radius);
70 
71  float getRadius() const
72  {
73  return capsule_ptr_->getRadius();
74  }
75 
76 
77 
81  virtual void setHeight (const float& height);
82  float getHeight() const
83  {
84  return capsule_ptr_->getHeight();
85  }
86 
88 
90  virtual ~LeafNodeCapsule();
91  };
92 } /* namespace viewer */
93 } /* namespace gepetto */
94 
95 #endif /* GEPETTO_VIEWER_LEAFNODECAPSULE_HH */
Definition: node-drawable.h:19
::osg::Vec4f osgVector4
Definition: config-osg.h:110
virtual LeafNodeCapsulePtr_t copy() const
Proceed to a copy of the currend object as clone.
Definition: leaf-node-capsule.h:59
Definition: action-search-bar.hh:27
float getRadius() const
Definition: leaf-node-capsule.h:71
float getHeight() const
Definition: leaf-node-capsule.h:82
Definition: leaf-node-capsule.h:21
#define DEF_CLASS_SMART_PTR(className)
Definition: macros.h:50
SCENE_VIEWER_ACCEPT_VISITOR
Definition: leaf-node-capsule.h:87