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

Line Branch Exec Source
1
//
2
//  leaf-node-cylinder.h
3
//  gepetto-viewer
4
//
5
//  Created by Justin Carpentier, Mathieu Geisert November 2014.
6
//  Copyright (c) 2014 LAAS-CNRS. All rights reserved.
7
//
8
9
#ifndef GEPETTO_VIEWER_LEAFNODECYLINDER_HH
10
#define GEPETTO_VIEWER_LEAFNODECYLINDER_HH
11
12
#include <gepetto/viewer/node-drawable.h>
13
14
namespace gepetto {
15
namespace viewer {
16
    DEF_CLASS_SMART_PTR(LeafNodeCylinder)
17
18
    /** Implementation of the Cylinder GraphicalObject in OSG render */
19
    class LeafNodeCylinder : public NodeDrawable
20
    {
21
    private:
22
        /** Associated weak pointer */
23
        LeafNodeCylinderWeakPtr weak_ptr_;
24
25
        /** Associated Cylinder Shape */
26
        ::osg::CylinderRefPtr cylinder_ptr_;
27
28
        void init();
29
30
        /* Default constructor */
31
        LeafNodeCylinder(const std::string &name, const float &radius, const float &height);
32
        LeafNodeCylinder(const std::string &name, const float &radius, const float &height,const  osgVector4 &color);
33
34
        /* Copy constructor */
35
        LeafNodeCylinder(const LeafNodeCylinder& other);
36
37
        /** Initialize weak_ptr */
38
        void initWeakPtr (LeafNodeCylinderWeakPtr other_weak_ptr);
39
40
    protected:
41
    public:
42
        /** Static method which create a new box defined by the half_axis vector
43
         */
44
        static LeafNodeCylinderPtr_t create(const std::string &name, const float &radius, const float& height);
45
        static LeafNodeCylinderPtr_t create(const std::string &name, const float &radius, const float& height, const osgVector4 &color);
46
47
        /** Static method for creating a clone of box other with the copy constructor
48
         */
49
        static LeafNodeCylinderPtr_t createCopy(LeafNodeCylinderPtr_t other);
50
51
        /** Proceed to a clonage of the current object defined by the copy constructor
52
         */
53
        virtual LeafNodeCylinderPtr_t clone(void) const;
54
55
        /** Copy
56
         \brief Proceed to a copy of the currend object as clone
57
         */
58
        virtual NodePtr_t copy() const { return clone(); }
59
60
        /** Return a shared pointer of the current object
61
         */
62
        LeafNodeCylinderPtr_t self(void) const;
63
64
        /** Fix the new radius of the cylinder
65
         * Note : radius must be positive scalar
66
         */
67
        void setRadius (const float& radius);
68
69
        float getRadius () const
70
        {
71
            return cylinder_ptr_->getRadius();
72
        }
73
74
75
        /** Fix the new jeight of the cylinder
76
         * Note : radius must be positive scalar
77
         */
78
        void setHeight (const float& height);
79
80
        float getHeight () const
81
        {
82
            return cylinder_ptr_->getHeight();
83
        }
84
85
        SCENE_VIEWER_ACCEPT_VISITOR;
86
87
        /** Destructor */
88
        virtual ~LeafNodeCylinder();
89
90
    };
91
} /* namespace viewer */
92
} /* namespace gepetto */
93
94
#endif /* GEPETTO_VIEWER_LEAFNODECYLINDER_HH */