leaf-node-cone.h
Go to the documentation of this file.
1 //
2 // leaf-node-cone.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_LEAFNODECONE_HH
10 #define GEPETTO_VIEWER_LEAFNODECONE_HH
11 
13 
14 namespace gepetto {
15 namespace viewer {
16  DEF_CLASS_SMART_PTR(LeafNodeCone)
17 
18 
19  class LeafNodeCone : public NodeDrawable
20  {
21  private:
23  LeafNodeConeWeakPtr weak_ptr_;
24 
26  ::osg::ConeRefPtr cone_ptr_;
27 
28  void init();
29 
30  /* Default constructor */
31  LeafNodeCone(const std::string& name, const float& radius, const float& height);
32  LeafNodeCone(const std::string& name, const float& radius, const float& height, const osgVector4& color);
33 
34  /* Copy constructor */
35  LeafNodeCone(const LeafNodeCone& other);
36 
38  void initWeakPtr (LeafNodeConeWeakPtr other_weak_ptr);
39 
40  protected:
41  public:
44  static LeafNodeConePtr_t create(const std::string& name, const float &radius, const float& height);
45  static LeafNodeConePtr_t create(const std::string& name, const float &radius, const float& height, const osgVector4& color);
46 
49  static LeafNodeConePtr_t createCopy(LeafNodeConePtr_t other);
50 
53  virtual LeafNodeConePtr_t clone(void) const;
54 
58  virtual LeafNodeConePtr_t copy() const { return clone(); }
59 
62  LeafNodeConePtr_t self(void) const;
63 
67  virtual void setRadius (const float& radius);
68 
69  float getRadius() const
70  {
71  return cone_ptr_->getRadius();
72  }
73 
77  virtual void setHeight (const float& height);
78 
79  float getHeight() const
80  {
81  return cone_ptr_->getHeight();
82  }
83 
85 
87  virtual ~LeafNodeCone();
88 
89  };
90 } /* namespace viewer */
91 } /* namespace gepetto */
92 
93 #endif /* GEPETTO_VIEWER_LEAFNODECONE_HH */
Definition: node-drawable.h:19
Definition: leaf-node-cone.h:19
::osg::Vec4f osgVector4
Definition: config-osg.h:110
float getRadius() const
Definition: leaf-node-cone.h:69
Definition: action-search-bar.hh:27
virtual LeafNodeConePtr_t copy() const
Proceed to a copy of the currend object as clone.
Definition: leaf-node-cone.h:58
#define DEF_CLASS_SMART_PTR(className)
Definition: macros.h:50
SCENE_VIEWER_ACCEPT_VISITOR
Definition: leaf-node-cone.h:84
float getHeight() const
Definition: leaf-node-cone.h:79