gepetto-viewer  6.0.0
An user-friendly Graphical Interface
leaf-node-arrow.h
Go to the documentation of this file.
1 //
2 // leaf-node-arrow.h
3 // gepetto-viewer
4 //
5 // Created by Pierre Fernbach in june 2015.
6 // Copyright (c) 2014 LAAS-CNRS. All rights reserved
7 //
8 
9 #ifndef GEPETTO_VIEWER_LEAFNODEARROW_HH
10 #define GEPETTO_VIEWER_LEAFNODEARROW_HH
11 
13 
14 namespace gepetto {
15 namespace viewer {
16 
17 DEF_CLASS_SMART_PTR(LeafNodeArrow)
18 
19 
20 class LeafNodeArrow : public NodeDrawable {
21  private:
23  LeafNodeArrowWeakPtr weak_ptr_;
24 
26  float radius_;
28  float size_;
29  ::osg::ShapeDrawableRefPtr cylinder_drawable_;
30  ::osg::ShapeDrawableRefPtr cone_drawable_;
31 
32  osgVector4 color_;
33 
34  void init();
35 
36  void resetGeodeContent();
37 
38  /* Default constructor */
39  LeafNodeArrow(const std::string& name, const osgVector4& color,
40  float radiusCenter, float sizeAxis);
41 
42  /* Copy constructor */
43  LeafNodeArrow(const LeafNodeArrow& other);
44 
46  void initWeakPtr(LeafNodeArrowWeakPtr other_weak_ptr);
47 
48  protected:
49  public:
50  void addVertex(const osgVector3& vertex);
54  static LeafNodeArrowPtr_t create(const std::string& name,
55  const osgVector4& color, float radiusCenter,
56  float sizeAxis);
59  static LeafNodeArrowPtr_t create(const std::string& name,
60  const osgVector4& color, float radiusCenter);
61 
64  static LeafNodeArrowPtr_t createCopy(LeafNodeArrowPtr_t other);
65 
68  virtual LeafNodeArrowPtr_t clone(void) const;
69 
73  virtual NodePtr_t copy() const { return clone(); }
74 
77  LeafNodeArrowPtr_t self(void) const;
78 
79  // set color
80  void setColor(const osgVector4& color);
81  osgVector4 getColor() const { return color_; }
84  float getRadius() const;
85  void setRadius(const float& radius);
86  void setSize(const float& size);
89  float getSize() const;
90  void resize(float radius, float length);
91 
93 
95  virtual ~LeafNodeArrow();
96 };
97 } /* namespace viewer */
98 } /* namespace gepetto */
99 
100 #endif /* GEPETTO_VIEWER_LeafNodeArrow_HH */
Definition: leaf-node-arrow.h:20
osgVector4 getColor() const
Definition: leaf-node-arrow.h:81
void setSize(const float &size)
static LeafNodeArrowPtr_t create(const std::string &name, const osgVector4 &color, float radiusCenter)
void setColor(const osgVector4 &color)
void setRadius(const float &radius)
static LeafNodeArrowPtr_t create(const std::string &name, const osgVector4 &color, float radiusCenter, float sizeAxis)
static LeafNodeArrowPtr_t createCopy(LeafNodeArrowPtr_t other)
void resize(float radius, float length)
virtual NodePtr_t copy() const
Proceed to a copy of the currend object as clone.
Definition: leaf-node-arrow.h:73
SCENE_VIEWER_ACCEPT_VISITOR
Definition: leaf-node-arrow.h:92
virtual LeafNodeArrowPtr_t clone(void) const
void addVertex(const osgVector3 &vertex)
Definition: node-drawable.h:19
::osg::Vec3f osgVector3
Definition: config-osg.h:99
::osg::Vec4f osgVector4
Definition: config-osg.h:100
#define DEF_CLASS_SMART_PTR(className)
Definition: macros.h:51
viewer::NodePtr_t NodePtr_t
Definition: fwd.hh:50
Definition: action-search-bar.hh:27