leaf-node-xyzaxis.h
Go to the documentation of this file.
1 //
2 // leaf-node-xyzaxis.h
3 // gepetto-viewer
4 //
5 // Created by Justin Carpentier, Mathieu Geisert, Pierre Fernbach in avril 2015.
6 // Copyright (c) 2014 LAAS-CNRS. All rights reserved
7 //
8 
9 #ifndef GEPETTO_VIEWER_LEAFNODEXYZ_HH
10 #define GEPETTO_VIEWER_LEAFNODEXYZ_HH
11 
13 #include <osgDB/ReadFile>
14 
15 namespace gepetto {
16 namespace viewer {
17 
18  DEF_CLASS_SMART_PTR(LeafNodeXYZAxis)
19 
20 
22  {
23  private:
25  LeafNodeXYZAxisWeakPtr weak_ptr_;
26 
28  float radius_;
29  ::osg::SphereRefPtr sphere_ptr_;
30 
32  float sizeAxis_;
34  ::osg::Vec4ArrayRefPtr color_ptr_;
35 
36  void init ();
37 
38 
39  /* Default constructor */
40  LeafNodeXYZAxis(const std::string& name, const osgVector4& color, float radiusCenter, float sizeAxis);
41 
42 
43  /* Copy constructor */
44  LeafNodeXYZAxis(const LeafNodeXYZAxis& other);
45 
47  void initWeakPtr(LeafNodeXYZAxisWeakPtr other_weak_ptr);
48 
49  protected:
50  public:
51  void addVertex (const osgVector3& vertex);
54  static LeafNodeXYZAxisPtr_t create(const std::string& name, const osgVector4& color, float radiusCenter, float sizeAxis);
55  static LeafNodeXYZAxisPtr_t create (const std::string& name, const osgVector4& color, float radiusCenter);
56 
59  static LeafNodeXYZAxisPtr_t createCopy(LeafNodeXYZAxisPtr_t other);
60 
63  virtual LeafNodeXYZAxisPtr_t clone(void) const;
64 
68  virtual NodePtr_t copy() const { return clone(); }
69 
72  LeafNodeXYZAxisPtr_t self(void) const;
73 
74  // set color
75  float getRadius() const;
76  void setRadius (const float& radius);
77  void setSizeAxis(const float& sizeAxis);
78  float getSizeAxis() const;
79 
81 
83  virtual ~LeafNodeXYZAxis();
84 
85  };
86 } /* namespace viewer */
87 } /* namespace gepetto */
88 
89 #endif /* GEPETTO_VIEWER_LEAFNODEXYZAXIS_HH */
Definition: leaf-node-xyzaxis.h:21
Definition: node-drawable.h:19
::osg::Vec3f osgVector3
Definition: config-osg.h:109
::osg::Vec4f osgVector4
Definition: config-osg.h:110
SCENE_VIEWER_ACCEPT_VISITOR
Definition: leaf-node-xyzaxis.h:80
viewer::NodePtr_t NodePtr_t
Definition: fwd.hh:47
Definition: action-search-bar.hh:27
#define DEF_CLASS_SMART_PTR(className)
Definition: macros.h:50
virtual NodePtr_t copy() const
Proceed to a copy of the currend object as clone.
Definition: leaf-node-xyzaxis.h:68