node-rod.h
Go to the documentation of this file.
1 //
2 // node-rod.cpp
3 // gepetto-viewer
4 //
5 // Created by Pierre Fernbach in may 2015.
6 // Copyright (c) 2015 LAAS-CNRS. All rights reserved.
7 //
8 
9 
10 #ifndef ROD_HH
11 #define ROD_HH
12 
16 #include <vector>
17 
18 namespace gepetto {
19 namespace viewer {
20 
21  DEF_CLASS_SMART_PTR(NodeRod)
22 
23  class NodeRod : public Node
24  {
25  private :
26  std::vector<LeafNodeCapsulePtr_t> list_of_capsule_;
27  NodeRodWeakPtr weak_ptr_;
28  void initWeakPtr(NodeRodWeakPtr other_weak_ptr);
29  osgVector4 color_;
30  float radius_;
31  float totalLength_;
32  size_t maxCapsule_; // max number of capsule for this rod
33  protected:
34 
36  NodeRod (const std::string& name,osgVector4 color, float radius,
37  float totalLength, size_t maxCapsule);
38 
40  NodeRod (const NodeRod& other);
41 
42 
43  public:
44  typedef osg::Vec3f::value_type value_type;
46  static NodeRodPtr_t create(const std::string& name,osgVector4 color, float radius, float totalLength,short maxCapsule);
47 
49  virtual std::string getCapsuleName(size_t i);
50 
51  virtual LeafNodeCapsulePtr_t getCapsule(size_t i) const;
52 
54  static NodeRodPtr_t createCopy(NodeRodPtr_t other);
55 
56 
58  NodeRodPtr_t self(void) const;
59 
60  virtual float radius() const{
61  return radius_;
62  }
63 
64  virtual float totalLength() const{
65  return totalLength_;
66  }
67 
68  void setColor(const osgVector4& color) {
69  color_ = color;
70  }
71 
72  virtual osgVector4 color() const{
73  return color_;
74  }
75 
76  virtual size_t maxCapsule() const{
77  return maxCapsule_;
78  }
79 
80  virtual void applyConfiguration(std::vector<std::vector<value_type> > params);
81  };
82 } /* namespace viewer */
83 } /* namespace gepetto */
84 
85 #endif // ROD_HH
virtual osgVector4 color() const
Definition: node-rod.h:72
::osg::Vec4f osgVector4
Definition: config-osg.h:110
Definition: action-search-bar.hh:27
virtual size_t maxCapsule() const
Definition: node-rod.h:76
osg::Vec3f::value_type value_type
Definition: node-rod.h:44
Definition: node-rod.h:23
virtual float radius() const
Definition: node-rod.h:60
#define DEF_CLASS_SMART_PTR(className)
Definition: macros.h:50
void setColor(const osgVector4 &color)
Definition: node-rod.h:68
virtual float totalLength() const
Definition: node-rod.h:64
Abstract base class of 3D objects in a scene.
Definition: node.h:27