leaf-node-cylinder.h
Go to the documentation of this file.
1 //
2 // leaf-node-cylinder.h
3 // gepetto-viewer
4 //
5 // Created by Justin Carpentier, Mathieu Geisert November 2014.
6 // Copyright (c) 2014 LAAS-CNRS. All rights reserved.
7 //
8 
9 #ifndef GEPETTO_VIEWER_LEAFNODECYLINDER_HH
10 #define GEPETTO_VIEWER_LEAFNODECYLINDER_HH
11 
13 
14 namespace gepetto {
15 namespace viewer {
16  DEF_CLASS_SMART_PTR(LeafNodeCylinder)
17 
18 
20  {
21  private:
23  LeafNodeCylinderWeakPtr weak_ptr_;
24 
26  ::osg::CylinderRefPtr cylinder_ptr_;
27 
28  void init();
29 
30  /* Default constructor */
31  LeafNodeCylinder(const std::string &name, const float &radius, const float &height);
32  LeafNodeCylinder(const std::string &name, const float &radius, const float &height,const osgVector4 &color);
33 
34  /* Copy constructor */
35  LeafNodeCylinder(const LeafNodeCylinder& other);
36 
38  void initWeakPtr (LeafNodeCylinderWeakPtr other_weak_ptr);
39 
40  protected:
41  public:
44  static LeafNodeCylinderPtr_t create(const std::string &name, const float &radius, const float& height);
45  static LeafNodeCylinderPtr_t create(const std::string &name, const float &radius, const float& height, const osgVector4 &color);
46 
49  static LeafNodeCylinderPtr_t createCopy(LeafNodeCylinderPtr_t other);
50 
53  virtual LeafNodeCylinderPtr_t clone(void) const;
54 
58  virtual NodePtr_t copy() const { return clone(); }
59 
62  LeafNodeCylinderPtr_t self(void) const;
63 
67  void setRadius (const float& radius);
68 
69  float getRadius () const
70  {
71  return cylinder_ptr_->getRadius();
72  }
73 
74 
78  void setHeight (const float& height);
79 
80  float getHeight () const
81  {
82  return cylinder_ptr_->getHeight();
83  }
84 
86 
88  virtual ~LeafNodeCylinder();
89 
90  };
91 } /* namespace viewer */
92 } /* namespace gepetto */
93 
94 #endif /* GEPETTO_VIEWER_LEAFNODECYLINDER_HH */
float getHeight() const
Definition: leaf-node-cylinder.h:80
float getRadius() const
Definition: leaf-node-cylinder.h:69
Definition: node-drawable.h:19
virtual NodePtr_t copy() const
Proceed to a copy of the currend object as clone.
Definition: leaf-node-cylinder.h:58
::osg::Vec4f osgVector4
Definition: config-osg.h:110
viewer::NodePtr_t NodePtr_t
Definition: fwd.hh:47
Definition: action-search-bar.hh:27
Definition: leaf-node-cylinder.h:19
SCENE_VIEWER_ACCEPT_VISITOR
Definition: leaf-node-cylinder.h:85
#define DEF_CLASS_SMART_PTR(className)
Definition: macros.h:50