Welcome to mirror list, hosted at ThFree Co, Russian Federation.

CoordAxes.hpp « GUI « slic3r « src - github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d2e38e1847efdd467f580ed82361a12a13915678 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef slic3r_CoordAxes_hpp_
#define slic3r_CoordAxes_hpp_

#if ENABLE_WORLD_COORDINATE_SHOW_AXES
#include "GLModel.hpp"

namespace Slic3r {
namespace GUI {

class CoordAxes
{
public:
    static const float DefaultStemRadius;
    static const float DefaultStemLength;
    static const float DefaultTipRadius;
    static const float DefaultTipLength;

private:
    Vec3d m_origin{ Vec3d::Zero() };
    float m_stem_radius{ DefaultStemRadius };
    float m_stem_length{ DefaultStemLength };
    float m_tip_radius{ DefaultTipRadius };
    float m_tip_length{ DefaultTipLength };
    GLModel m_arrow;

public:
    const Vec3d& get_origin() const { return m_origin; }
    void set_origin(const Vec3d& origin) { m_origin = origin; }
    void set_stem_radius(float radius) {
        m_stem_radius = radius;
        m_arrow.reset();
    }
    void set_stem_length(float length) {
        m_stem_length = length;
        m_arrow.reset();
    }
    void set_tip_radius(float radius) {
        m_tip_radius = radius;
        m_arrow.reset();
    }
    void set_tip_length(float length) {
        m_tip_length = length;
        m_arrow.reset();
    }

    float get_stem_radius() const { return m_stem_radius; }
    float get_stem_length() const { return m_stem_length; }
    float get_tip_radius() const { return m_tip_radius; }
    float get_tip_length() const { return m_tip_length; }
    float get_total_length() const { return m_stem_length + m_tip_length; }

#if ENABLE_GL_SHADERS_ATTRIBUTES
    void render(const Transform3d& trafo, float emission_factor = 0.0f);
#else
    void render(float emission_factor = 0.0f);
#endif // ENABLE_GL_SHADERS_ATTRIBUTES
};

} // GUI
} // Slic3r

#endif // ENABLE_WORLD_COORDINATE_SHOW_AXES

#endif // slic3r_CoordAxes_hpp_