summaryrefslogtreecommitdiffstats
path: root/src/live_effects/lpe-fillet-chamfer.h
blob: 71f0f5e738aac7b050da1a367fe6f519c4865f81 (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// SPDX-License-Identifier: GPL-2.0-or-later
#ifndef INKSCAPE_LPE_FILLET_CHAMFER_H
#define INKSCAPE_LPE_FILLET_CHAMFER_H

/*
 * Author(s):
 *     Jabiertxo Arraiza Cenoz <jabier.arraiza@marker.es>
 *
 * Copyright (C) 2014 Author(s)
 *
 * Jabiertxof:Thanks to all people help me
 *
 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
 */

#include "live_effects/parameter/enum.h"
#include "live_effects/parameter/satellitesarray.h"
#include "live_effects/effect.h"
#include "live_effects/parameter/unit.h"
#include "live_effects/parameter/hidden.h"
#include "helper/geom-pathvectorsatellites.h"
#include "helper/geom-satellite.h"

namespace Inkscape {
namespace LivePathEffect {

enum Filletmethod {
    FM_AUTO,
    FM_ARC,
    FM_BEZIER,
    FM_END
};

class LPEFilletChamfer : public Effect {
public:
    LPEFilletChamfer(LivePathEffectObject *lpeobject);
    void doBeforeEffect(SPLPEItem const *lpeItem) override;
    Geom::PathVector doEffect_path(Geom::PathVector const &path_in) override;
    void doOnApply(SPLPEItem const *lpeItem) override;
    Gtk::Widget *newWidget() override;
    Geom::Ray getRay(Geom::Point start, Geom::Point end, Geom::Curve *curve, bool reverse);
    void addChamferSteps(Geom::Path &tmp_path, Geom::Path path_chamfer, Geom::Point end_arc_point, size_t steps);
    void addCanvasIndicators(SPLPEItem const */*lpeitem*/, std::vector<Geom::PathVector> &hp_vec) override;
    void updateSatelliteType(SatelliteType satellitetype);
    void setSelected(PathVectorSatellites *_pathvector_satellites);
    //void convertUnit();
    void updateChamferSteps();
    void updateAmount();
    void refreshKnots();
    bool helperpath;
    SatellitesArrayParam satellites_param;

private:
    UnitParam unit;
    EnumParam<Filletmethod> method;
    ScalarParam radius;
    ScalarParam chamfer_steps;
    BoolParam flexible;
    HiddenParam mode;
    BoolParam only_selected;
    BoolParam use_knot_distance;
    BoolParam hide_knots;
    BoolParam apply_no_radius;
    BoolParam apply_with_radius;
    bool _degenerate_hide;
    PathVectorSatellites *_pathvector_satellites;
    Geom::PathVector _hp;
    Glib::ustring previous_unit;
    LPEFilletChamfer(const LPEFilletChamfer &);
    LPEFilletChamfer &operator=(const LPEFilletChamfer &);

};

} //namespace LivePathEffect
} //namespace Inkscape

#endif

/*
  Local Variables:
  mode:c++
  c-file-style:"stroustrup"
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
  indent-tabs-mode:nil
  fill-column:99
  End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :