leaf-node-sphere.h
Go to the documentation of this file.
1 //
2 // leaf-node-sphere.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_LEAFNODESPHERE_HH
10 #define GEPETTO_VIEWER_LEAFNODESPHERE_HH
11 
13 
14 namespace gepetto {
15 namespace viewer {
16  DEF_CLASS_SMART_PTR(LeafNodeSphere)
17 
18 
20  {
21  private:
23  LeafNodeSphereWeakPtr weak_ptr_;
24 
26  ::osg::SphereRefPtr sphere_ptr_;
27 
28  void init();
29 
30  protected:
31  /* Default constructor */
32  LeafNodeSphere(const std::string& name, const float& radius);
33  LeafNodeSphere(const std::string& name, const float& radius, const osgVector4& color);
34 
35  /* Copy constructor */
36  LeafNodeSphere(const std::string& name, const LeafNodeSphere& other);
37 
39  void initWeakPtr (LeafNodeSphereWeakPtr other_weak_ptr);
40 
41  public:
44  static LeafNodeSpherePtr_t create(const std::string& name, const float &radius);
45  static LeafNodeSpherePtr_t create(const std::string& name, const float &radius, const osgVector4& color);
46 
49  static LeafNodeSpherePtr_t createCopy(LeafNodeSpherePtr_t other);
50 
53  LeafNodeSpherePtr_t clone(void) const;
54 
58  LeafNodeSpherePtr_t copy() const { return clone(); }
59 
62  LeafNodeSpherePtr_t self(void) const;
63 
64 
68  void setRadius (const float& radius);
69  float getRadius() const
70  {
71  return sphere_ptr_->getRadius();
72  }
73 
75 
77  virtual ~LeafNodeSphere();
78 
79  };
80 } /* namespace viewer */
81 } /* namespace gepetto */
82 
83 #endif /* GEPETTO_VIEWER_LEAFNODESPHERE_HH */
Definition: node-drawable.h:19
::osg::Vec4f osgVector4
Definition: config-osg.h:110
float getRadius() const
Definition: leaf-node-sphere.h:69
Definition: action-search-bar.hh:27
Definition: leaf-node-sphere.h:19
SCENE_VIEWER_ACCEPT_VISITOR
Definition: leaf-node-sphere.h:74
#define DEF_CLASS_SMART_PTR(className)
Definition: macros.h:50
LeafNodeSpherePtr_t copy() const
Proceed to a copy of the currend object as clone.
Definition: leaf-node-sphere.h:58