GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: include/gepetto/viewer/node-rod.h Lines: 0 11 0.0 %
Date: 2020-05-14 11:23:33 Branches: 0 0 - %

Line Branch Exec Source
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
13
#include <gepetto/viewer/group-node.h>
14
#include <gepetto/viewer/leaf-node-capsule.h>
15
#include <gepetto/viewer/config-osg.h>
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
35
            /** Default constructor */
36
            NodeRod (const std::string& name,osgVector4 color, float radius,
37
		     float totalLength, size_t maxCapsule);
38
39
            /** Copy constructor */
40
            NodeRod (const NodeRod& other);
41
42
43
        public:
44
            typedef osg::Vec3f::value_type value_type;
45
            /** Static method which create the new rod */
46
            static NodeRodPtr_t create(const std::string& name,osgVector4 color, float radius, float totalLength,short maxCapsule);
47
48
            /** Return the ID of the capsule at the index i */
49
            virtual std::string getCapsuleName(size_t i);
50
51
            virtual LeafNodeCapsulePtr_t getCapsule(size_t i) const;
52
53
            /** Static method for creating a clone of the rod other with the copy constructor        */
54
            static NodeRodPtr_t createCopy(NodeRodPtr_t other);
55
56
57
            /** Return a shared pointer of the current object      */
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