lpe-fillet-chamfer-properties.cpp revision afe3b94c9da473ea1e7632e7853dd7dee528d194
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6miklosh * From the code of Liam P.White from his Power Stroke Knot dialog
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6miklosh * Released under GNU GPL. Read the file 'COPYING' for more information
4b1c2be41ce8c1a88502c1b1885ad1468646fbfftheadib#if GLIBMM_DISABLE_DEPRECATED &&HAVE_GLIBMM_THREADS_H
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6mikloshFilletChamferPropertiesDialog::FilletChamferPropertiesDialog()
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6miklosh : _desktop(NULL), _knotpoint(NULL), _position_visible(false)
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6miklosh // Layer name widgets
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6miklosh _fillet_chamfer_position_numeric.set_increments(1,1);
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6miklosh //todo: get tha max aloable infinity freeze the widget
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6miklosh _fillet_chamfer_position_numeric.set_range(0., 999999999999999999.);
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6miklosh _fillet_chamfer_position_label.set_label(_("Radius (pixels):"));
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6miklosh _fillet_chamfer_position_label.set_alignment(1.0, 0.5);
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6miklosh _layout_table.attach(_fillet_chamfer_position_label, 0, 1, 0, 1, Gtk::FILL,
5c45c5153b0415f7573f69f4ee3e946b5872a8d1theadib _layout_table.attach(_fillet_chamfer_position_numeric, 1, 2, 0, 1,
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6miklosh _fillet_chamfer_chamfer_subdivisions.set_increments(1,1);
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6miklosh //todo: get tha max aloable infinity freeze the widget
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6miklosh _fillet_chamfer_chamfer_subdivisions.set_range(0, 999999999999999999.0);
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6miklosh _fillet_chamfer_chamfer_subdivisions_label.set_label(_("Chamfer subdivisions:"));
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6miklosh _fillet_chamfer_chamfer_subdivisions_label.set_alignment(1.0, 0.5);
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6miklosh _layout_table.attach(_fillet_chamfer_chamfer_subdivisions_label, 0, 1, 1, 2, Gtk::FILL,
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6miklosh _layout_table.attach(_fillet_chamfer_chamfer_subdivisions, 1, 2, 1, 2,
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6miklosh _fillet_chamfer_type_fillet.set_group(_fillet_chamfer_type_group);
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6miklosh _fillet_chamfer_type_inverse_fillet.set_label(_("Inverse fillet"));
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6miklosh _fillet_chamfer_type_inverse_fillet.set_group(_fillet_chamfer_type_group);
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6miklosh _fillet_chamfer_type_chamfer.set_label(_("Chamfer"));
d444ed610362dab3c3e727d1b110312318b84cb8miklosh _fillet_chamfer_type_chamfer.set_group(_fillet_chamfer_type_group);
63d6ddd517060979dd8b8fd41aad3faca7be3c5cTed Gould _fillet_chamfer_type_inverse_chamfer.set_label(_("Inverse chamfer"));
63d6ddd517060979dd8b8fd41aad3faca7be3c5cTed Gould _fillet_chamfer_type_inverse_chamfer.set_group(_fillet_chamfer_type_group);
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6miklosh mainVBox->pack_start(_fillet_chamfer_type_fillet, true, true, 4);
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6miklosh mainVBox->pack_start(_fillet_chamfer_type_inverse_fillet, true, true, 4);
d1bde559850436556ebee2e70e10f1cfc8aff636Krzysztof Kosiński mainVBox->pack_start(_fillet_chamfer_type_chamfer, true, true, 4);
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6miklosh mainVBox->pack_start(_fillet_chamfer_type_inverse_chamfer, true, true, 4);
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6miklosh .connect(sigc::mem_fun(*this, &FilletChamferPropertiesDialog::_close));
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6miklosh .connect(sigc::mem_fun(*this, &FilletChamferPropertiesDialog::_apply));
e66a49aa774c6770e99591a19873105bfeb5ce74Johan Engelen signal_delete_event().connect(sigc::bind_return(
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6miklosh sigc::hide(sigc::mem_fun(*this, &FilletChamferPropertiesDialog::_close)),
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6miklosh add_action_widget(_close_button, Gtk::RESPONSE_CLOSE);
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6miklosh add_action_widget(_apply_button, Gtk::RESPONSE_APPLY);
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6mikloshFilletChamferPropertiesDialog::~FilletChamferPropertiesDialog()
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6miklosh FilletChamferPropertiesDialog *dialog = new FilletChamferPropertiesDialog();
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6miklosh double d_pos = _fillet_chamfer_position_numeric.get_value();
05a66d0771cb563225b8690de04e9490b35453f2johanengelen if (_fillet_chamfer_type_fillet.get_active() == true) {
05a66d0771cb563225b8690de04e9490b35453f2johanengelen } else if (_fillet_chamfer_type_inverse_fillet.get_active() == true) {
05a66d0771cb563225b8690de04e9490b35453f2johanengelen } else if (_fillet_chamfer_type_inverse_chamfer.get_active() == true) {
05a66d0771cb563225b8690de04e9490b35453f2johanengelen d_width = _fillet_chamfer_chamfer_subdivisions.get_value() + 4000;
05a66d0771cb563225b8690de04e9490b35453f2johanengelen d_width = _fillet_chamfer_chamfer_subdivisions.get_value() + 3000;
4b883d02d308812fcf976f6292838c52a6230137Johan Engelen d_pos = Inkscape::Util::Quantity::convert(d_pos, unit, *document_unit);
4b883d02d308812fcf976f6292838c52a6230137Johan Engelen _knotpoint->knot_set_offset(Geom::Point(d_pos, d_width));
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6miklosh sigc::bind(sigc::ptr_fun(&::operator delete), this),
ca4d1d8972d64c1d1bfdd4b09d31f7b372074940Jon A. Cruzbool FilletChamferPropertiesDialog::_handleKeyEvent(GdkEventKey * /*event*/)
ca4d1d8972d64c1d1bfdd4b09d31f7b372074940Jon A. Cruz return false;
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6mikloshvoid FilletChamferPropertiesDialog::_handleButtonEvent(GdkEventButton *event)
68b9e386db1a231abaddbfed4d05f7539bdac786scislac if ((event->type == GDK_2BUTTON_PRESS) && (event->button == 1)) {
68b9e386db1a231abaddbfed4d05f7539bdac786scislacvoid FilletChamferPropertiesDialog::_set_knot_point(Geom::Point knotpoint)
68b9e386db1a231abaddbfed4d05f7539bdac786scislac std::string distance_or_radius = std::string(_("Radius "));
68b9e386db1a231abaddbfed4d05f7539bdac786scislac distance_or_radius = std::string(_("Radius approximated "));
68b9e386db1a231abaddbfed4d05f7539bdac786scislac distance_or_radius = std::string(_("Knot distance "));
68b9e386db1a231abaddbfed4d05f7539bdac786scislac if (knotpoint.x() > 0) {
68b9e386db1a231abaddbfed4d05f7539bdac786scislac position = modf(knotpoint[Geom::X], &intpart) * 100;
68b9e386db1a231abaddbfed4d05f7539bdac786scislac _fillet_chamfer_position_label.set_label(_("Position (%):"));
e9b6af083e34e2397a8ddbe9781920733d09d151Ted Gould std::string(_("(")) + std::string(unit) + std::string(")");
05a66d0771cb563225b8690de04e9490b35453f2johanengelen _fillet_chamfer_position_label.set_label(_(posConcat.c_str()));
05a66d0771cb563225b8690de04e9490b35453f2johanengelen position = Inkscape::Util::Quantity::convert(position, *document_unit, unit);
68b9e386db1a231abaddbfed4d05f7539bdac786scislac _fillet_chamfer_position_numeric.set_value(position);
05a66d0771cb563225b8690de04e9490b35453f2johanengelen _fillet_chamfer_type_inverse_fillet.set_active(true);
05a66d0771cb563225b8690de04e9490b35453f2johanengelen } else if (knotpoint.y() >= 3000 && knotpoint.y() < 4000) {
05a66d0771cb563225b8690de04e9490b35453f2johanengelen _fillet_chamfer_chamfer_subdivisions.set_value(knotpoint.y() - 3000);
d37634d73670180f99a3e0ea583621373d90ec4fJohan Engelen } else if (knotpoint.y() >= 4000 && knotpoint.y() < 5000) {
05a66d0771cb563225b8690de04e9490b35453f2johanengelen _fillet_chamfer_chamfer_subdivisions.set_value(knotpoint.y() - 4000);
05a66d0771cb563225b8690de04e9490b35453f2johanengelen _fillet_chamfer_type_inverse_chamfer.set_active(true);
54e660c4de9d37185e3953165d053526632ef4f0johanengelen FilletChamferPointArrayParamKnotHolderEntity *pt)
05a66d0771cb563225b8690de04e9490b35453f2johanengelen Inkscape::LivePathEffect::FilletChamferPointArrayParamKnotHolderEntity *>(
68b9e386db1a231abaddbfed4d05f7539bdac786scislacvoid FilletChamferPropertiesDialog::_set_unit(const gchar *abbr)
05a66d0771cb563225b8690de04e9490b35453f2johanengelenvoid FilletChamferPropertiesDialog::_set_document_unit(Glib::ustring const *abbr)
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6mikloshvoid FilletChamferPropertiesDialog::_set_use_distance(bool use_knot_distance)
68b9e386db1a231abaddbfed4d05f7539bdac786scislacvoid FilletChamferPropertiesDialog::_set_aprox(bool aprox_radius)
68b9e386db1a231abaddbfed4d05f7539bdac786scislacvoid FilletChamferPropertiesDialog::_set_desktop(SPDesktop *desktop)
68b9e386db1a231abaddbfed4d05f7539bdac786scislac} // namespace
68b9e386db1a231abaddbfed4d05f7539bdac786scislac} // namespace
68b9e386db1a231abaddbfed4d05f7539bdac786scislac} // namespace
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6miklosh Local Variables:
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6miklosh c-file-style:"stroustrup"
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6miklosh c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6miklosh indent-tabs-mode:nil
ca4d1d8972d64c1d1bfdd4b09d31f7b372074940Jon A. Cruz fill-column:99
b7f07692f95074fdcf74c7350fbf5f3099ffc1b6miklosh// filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99