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

Line Branch Exec Source
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
12
#include <gepetto/viewer/node-drawable.h>
13
14
namespace gepetto {
15
namespace viewer {
16
17
    DEF_CLASS_SMART_PTR(LeafNodeArrow)
18
19
    /** Implementation of the XYZAxis GraphicalObject in OSG render */
20
    class LeafNodeArrow: public NodeDrawable
21
    {
22
    private:
23
        /** Associated weak pointer */
24
        LeafNodeArrowWeakPtr weak_ptr_;
25
26
        /** Sphere component */
27
        float radius_;
28
        /** axis components : */
29
        float size_;
30
        ::osg::ShapeDrawableRefPtr cylinder_drawable_;
31
        ::osg::ShapeDrawableRefPtr cone_drawable_;
32
33
        osgVector4 color_;
34
35
        void init ();
36
37
        void resetGeodeContent ();
38
39
40
        /* Default constructor */
41
        LeafNodeArrow(const std::string& name, const osgVector4& color, float radiusCenter, float sizeAxis);
42
43
44
        /* Copy constructor */
45
        LeafNodeArrow(const LeafNodeArrow& other);
46
47
        /** Initialize weak_ptr */
48
        void initWeakPtr(LeafNodeArrowWeakPtr other_weak_ptr);
49
50
51
52
53
    protected:
54
    public:
55
        void addVertex (const osgVector3& vertex);
56
        /** Static method which create a new XYZ axis defined by the radius of the sphere (center) and size of the axis (0 by default)
57
         */
58
        static LeafNodeArrowPtr_t create(const std::string& name, const osgVector4& color, float radiusCenter, float sizeAxis);
59
        static LeafNodeArrowPtr_t create (const std::string& name, const osgVector4& color, float radiusCenter);
60
61
        /** Static method for creating a clone of box other with the copy constructor
62
         */
63
        static LeafNodeArrowPtr_t createCopy(LeafNodeArrowPtr_t other);
64
65
        /** Proceed to a clonage of the current object defined by the copy constructor
66
         */
67
        virtual LeafNodeArrowPtr_t clone(void) const;
68
69
        /** Copy
70
         \brief Proceed to a copy of the currend object as clone
71
         */
72
        virtual NodePtr_t copy() const { return clone(); }
73
74
        /** Return a shared pointer of the current object
75
         */
76
        LeafNodeArrowPtr_t self(void) const;
77
78
        // set color
79
        void setColor (const osgVector4& color);
80
        osgVector4 getColor () const
81
        {
82
          return color_;
83
        }
84
        float getRadius() const;
85
        void setRadius (const float& radius);
86
        void setSize(const float& size);
87
        float getSize() const;
88
        void resize(float radius,float length);
89
90
        SCENE_VIEWER_ACCEPT_VISITOR;
91
92
        /** Destructor */
93
        virtual ~LeafNodeArrow();
94
95
    };
96
} /* namespace viewer */
97
} /* namespace gepetto */
98
99
#endif /* GEPETTO_VIEWER_LeafNodeArrow_HH */