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

Line Branch Exec Source
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
12
#include <gepetto/viewer/node-drawable.h>
13
#include <osgDB/ReadFile>
14
15
namespace gepetto {
16
namespace viewer {
17
18
    DEF_CLASS_SMART_PTR(LeafNodeXYZAxis)
19
20
    /** Implementation of the XYZAxis GraphicalObject in OSG render */
21
    class LeafNodeXYZAxis: public NodeDrawable
22
    {
23
    private:
24
        /** Associated weak pointer */
25
        LeafNodeXYZAxisWeakPtr weak_ptr_;
26
27
        /** Sphere component */
28
        float radius_;
29
        ::osg::SphereRefPtr sphere_ptr_;
30
31
        /** axis components : */
32
        float sizeAxis_;
33
        /** Associated Geometry (drawable objects)*/
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
46
        /** Initialize weak_ptr */
47
        void initWeakPtr(LeafNodeXYZAxisWeakPtr other_weak_ptr);
48
49
    protected:
50
    public:
51
        void addVertex (const osgVector3& vertex);
52
        /** Static method which create a new XYZ axis defined by the radius of the sphere (center) and size of the axis (0 by default)
53
         */
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
57
        /** Static method for creating a clone of box other with the copy constructor
58
         */
59
        static LeafNodeXYZAxisPtr_t createCopy(LeafNodeXYZAxisPtr_t other);
60
61
        /** Proceed to a clonage of the current object defined by the copy constructor
62
         */
63
        virtual LeafNodeXYZAxisPtr_t clone(void) const;
64
65
        /** Copy
66
         \brief Proceed to a copy of the currend object as clone
67
         */
68
        virtual NodePtr_t copy() const { return clone(); }
69
70
        /** Return a shared pointer of the current object
71
         */
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
80
        SCENE_VIEWER_ACCEPT_VISITOR;
81
82
        /** Destructor */
83
        virtual ~LeafNodeXYZAxis();
84
85
    };
86
} /* namespace viewer */
87
} /* namespace gepetto */
88
89
#endif /* GEPETTO_VIEWER_LEAFNODEXYZAXIS_HH */